[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:12:31 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 9e67cecba21cbf76f69a06d17750476aede21273
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue May 14 02:57:28 2002 +0000
Fixed bug 2922884 (JavaScript object leak creating Image object from JavaScript).
There was a reference loop created when a document contained a variable that
referenced an image, because images held references to the document; the C++
kind that do not participate in the JavaScript garbage collection.
* khtml/ecma/kjs_html.h: Use a QGuardedPtr to the DocumentImpl instead of using
a Document object.
* khtml/ecma/kjs_html.cpp:
(Image::tryPut): Change because the "doc" pointer is now a pointer to the
DocumentImpl, not the Document. Also check for 0, since it's now a QGuardedPtr
that can become 0.
(Image::Image): Newly out of line. Changed because the "doc" pointer is now a
pointer to the DocumentImpl, not the Document.
Since the solution used QGuardedPtr, I had to implement it.
* kwq/qt/qguardedptr.h: Put the implementation in a new KWQGuardedPtrBase class,
with only the bare minimum in a template. This new implementation uses iterators
on a QPtrList, which means there's not much code needed.
* kwq/KWQGuardedPtr.mm: (KWQGuardedPtrBase::KWQGuardedPtrBase): Rewrite to use
a QPtrListIterator to a dummy list in the QObject. This reuses code nicely, but
a custom-coded solution would be a bit more efficient.
* kwq/qt/qobject.h:
* kwq/KWQObject.mm: (QObject::QObject): Create the one-element list that's used
by the QGuardedPtr instances.
Since the above code needed to copy a QPtrListIterator, I needed to support that.
* kwq/qt/qlist.h: Move the iterator's copy constructor out of the private part,
and implement it. This class was strange in that it has a public assignment
operator, but a private unimplemented copy constructor. Implementing it was trivial,
though, so this was no obstacle.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index fd8ad8d..05b9826 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,39 @@
+2002-05-13 Darin Adler <darin at apple.com>
+
+ Fixed bug 2922884 (JavaScript object leak creating Image object from JavaScript).
+ There was a reference loop created when a document contained a variable that
+ referenced an image, because images held references to the document; the C++
+ kind that do not participate in the JavaScript garbage collection.
+
+ * khtml/ecma/kjs_html.h: Use a QGuardedPtr to the DocumentImpl instead of using
+ a Document object.
+ * khtml/ecma/kjs_html.cpp:
+ (Image::tryPut): Change because the "doc" pointer is now a pointer to the
+ DocumentImpl, not the Document. Also check for 0, since it's now a QGuardedPtr
+ that can become 0.
+ (Image::Image): Newly out of line. Changed because the "doc" pointer is now a
+ pointer to the DocumentImpl, not the Document.
+
+ Since the solution used QGuardedPtr, I had to implement it.
+
+ * kwq/qt/qguardedptr.h: Put the implementation in a new KWQGuardedPtrBase class,
+ with only the bare minimum in a template. This new implementation uses iterators
+ on a QPtrList, which means there's not much code needed.
+ * kwq/KWQGuardedPtr.mm: (KWQGuardedPtrBase::KWQGuardedPtrBase): Rewrite to use
+ a QPtrListIterator to a dummy list in the QObject. This reuses code nicely, but
+ a custom-coded solution would be a bit more efficient.
+
+ * kwq/qt/qobject.h:
+ * kwq/KWQObject.mm: (QObject::QObject): Create the one-element list that's used
+ by the QGuardedPtr instances.
+
+ Since the above code needed to copy a QPtrListIterator, I needed to support that.
+
+ * kwq/qt/qlist.h: Move the iterator's copy constructor out of the private part,
+ and implement it. This class was strange in that it has a public assignment
+ operator, but a private unimplemented copy constructor. Implementing it was trivial,
+ though, so this was no obstacle.
+
2002-05-13 Maciej Stachowiak <mjs at apple.com>
Removed libjpeg dependency. Turns out we don't need it.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index fd8ad8d..05b9826 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,39 @@
+2002-05-13 Darin Adler <darin at apple.com>
+
+ Fixed bug 2922884 (JavaScript object leak creating Image object from JavaScript).
+ There was a reference loop created when a document contained a variable that
+ referenced an image, because images held references to the document; the C++
+ kind that do not participate in the JavaScript garbage collection.
+
+ * khtml/ecma/kjs_html.h: Use a QGuardedPtr to the DocumentImpl instead of using
+ a Document object.
+ * khtml/ecma/kjs_html.cpp:
+ (Image::tryPut): Change because the "doc" pointer is now a pointer to the
+ DocumentImpl, not the Document. Also check for 0, since it's now a QGuardedPtr
+ that can become 0.
+ (Image::Image): Newly out of line. Changed because the "doc" pointer is now a
+ pointer to the DocumentImpl, not the Document.
+
+ Since the solution used QGuardedPtr, I had to implement it.
+
+ * kwq/qt/qguardedptr.h: Put the implementation in a new KWQGuardedPtrBase class,
+ with only the bare minimum in a template. This new implementation uses iterators
+ on a QPtrList, which means there's not much code needed.
+ * kwq/KWQGuardedPtr.mm: (KWQGuardedPtrBase::KWQGuardedPtrBase): Rewrite to use
+ a QPtrListIterator to a dummy list in the QObject. This reuses code nicely, but
+ a custom-coded solution would be a bit more efficient.
+
+ * kwq/qt/qobject.h:
+ * kwq/KWQObject.mm: (QObject::QObject): Create the one-element list that's used
+ by the QGuardedPtr instances.
+
+ Since the above code needed to copy a QPtrListIterator, I needed to support that.
+
+ * kwq/qt/qlist.h: Move the iterator's copy constructor out of the private part,
+ and implement it. This class was strange in that it has a public assignment
+ operator, but a private unimplemented copy constructor. Implementing it was trivial,
+ though, so this was no obstacle.
+
2002-05-13 Maciej Stachowiak <mjs at apple.com>
Removed libjpeg dependency. Turns out we don't need it.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index fd8ad8d..05b9826 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,39 @@
+2002-05-13 Darin Adler <darin at apple.com>
+
+ Fixed bug 2922884 (JavaScript object leak creating Image object from JavaScript).
+ There was a reference loop created when a document contained a variable that
+ referenced an image, because images held references to the document; the C++
+ kind that do not participate in the JavaScript garbage collection.
+
+ * khtml/ecma/kjs_html.h: Use a QGuardedPtr to the DocumentImpl instead of using
+ a Document object.
+ * khtml/ecma/kjs_html.cpp:
+ (Image::tryPut): Change because the "doc" pointer is now a pointer to the
+ DocumentImpl, not the Document. Also check for 0, since it's now a QGuardedPtr
+ that can become 0.
+ (Image::Image): Newly out of line. Changed because the "doc" pointer is now a
+ pointer to the DocumentImpl, not the Document.
+
+ Since the solution used QGuardedPtr, I had to implement it.
+
+ * kwq/qt/qguardedptr.h: Put the implementation in a new KWQGuardedPtrBase class,
+ with only the bare minimum in a template. This new implementation uses iterators
+ on a QPtrList, which means there's not much code needed.
+ * kwq/KWQGuardedPtr.mm: (KWQGuardedPtrBase::KWQGuardedPtrBase): Rewrite to use
+ a QPtrListIterator to a dummy list in the QObject. This reuses code nicely, but
+ a custom-coded solution would be a bit more efficient.
+
+ * kwq/qt/qobject.h:
+ * kwq/KWQObject.mm: (QObject::QObject): Create the one-element list that's used
+ by the QGuardedPtr instances.
+
+ Since the above code needed to copy a QPtrListIterator, I needed to support that.
+
+ * kwq/qt/qlist.h: Move the iterator's copy constructor out of the private part,
+ and implement it. This class was strange in that it has a public assignment
+ operator, but a private unimplemented copy constructor. Implementing it was trivial,
+ though, so this was no obstacle.
+
2002-05-13 Maciej Stachowiak <mjs at apple.com>
Removed libjpeg dependency. Turns out we don't need it.
diff --git a/WebCore/khtml/ecma/kjs_html.cpp b/WebCore/khtml/ecma/kjs_html.cpp
index dc8afd0..7da51af 100644
--- a/WebCore/khtml/ecma/kjs_html.cpp
+++ b/WebCore/khtml/ecma/kjs_html.cpp
@@ -2975,13 +2975,26 @@ void Image::tryPut(ExecState *exec, const UString &propertyName, const Value& va
String str = value.toString(exec);
src = str.value();
if ( img ) img->deref(this);
+#ifndef APPLE_CHANGES
img = static_cast<DOM::DocumentImpl*>( doc.handle() )->docLoader()->requestImage( src.string() );
+#else
+ img = doc ? doc->docLoader()->requestImage( src.string() ) : 0;
+#endif
if ( img ) img->ref(this);
} else {
DOMObject::tryPut(exec, propertyName, value, attr);
}
}
+#ifdef APPLE_CHANGES
+
+Image::Image(const DOM::Document &d)
+ : doc(static_cast<DOM::DocumentImpl*>(d.handle())), img(0)
+{
+}
+
+#endif
+
Image::~Image()
{
if ( img ) img->deref(this);
diff --git a/WebCore/khtml/ecma/kjs_html.h b/WebCore/khtml/ecma/kjs_html.h
index 10267f4..81306d3 100644
--- a/WebCore/khtml/ecma/kjs_html.h
+++ b/WebCore/khtml/ecma/kjs_html.h
@@ -30,6 +30,10 @@
#include "ecma/kjs_binding.h"
#include "ecma/kjs_dom.h"
+#ifdef APPLE_CHANGES
+#include <qguardedptr.h>
+#endif
+
class HTMLElement;
namespace KJS {
@@ -210,7 +214,11 @@ namespace KJS {
class Image : public DOMObject, public khtml::CachedObjectClient {
public:
+#ifndef APPLE_CHANGES
Image(const DOM::Document &d) : doc(d), img(0) { }
+#else
+ Image(const DOM::Document &d);
+#endif
~Image();
virtual Value tryGet(ExecState *exec, const UString &propertyName) const;
Value getValueProperty(ExecState *exec, int token) const;
@@ -221,7 +229,11 @@ namespace KJS {
enum { Src, Complete };
private:
UString src;
+#ifndef APPLE_CHANGES
DOM::Document doc;
+#else
+ QGuardedPtr<DOM::DocumentImpl> doc;
+#endif
khtml::CachedImage* img;
};
diff --git a/WebCore/kwq/KWQGuardedPtr.h b/WebCore/kwq/KWQGuardedPtr.h
index df6fec7..a3cab39 100644
--- a/WebCore/kwq/KWQGuardedPtr.h
+++ b/WebCore/kwq/KWQGuardedPtr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,92 +26,27 @@
#ifndef QGUARDEDPTR_H_
#define QGUARDEDPTR_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "KWQRefPtr.h"
-
#include "qobject.h"
-// class QGuardedPtrPrivate ====================================================
-
-// class QGuardedPtr ===========================================================
-
-class QGuardedPtrPrivate;
-
-template <class T> class QGuardedPtr {
+class KWQGuardedPtrBase {
public:
-
- // typedefs ----------------------------------------------------------------
- // enums -------------------------------------------------------------------
- // constants ---------------------------------------------------------------
- // static member functions -------------------------------------------------
-
- // constructors, copy constructors, and destructors ------------------------
-
- QGuardedPtr() : d(new QGuardedPtrPrivate(0))
- {
- }
- QGuardedPtr(T *o) : d(new QGuardedPtrPrivate(o))
- {
- }
+ KWQGuardedPtrBase(QObject* = 0);
- QGuardedPtr(const QGuardedPtr<T> &p) {
- d = p.d;
- }
-
- ~QGuardedPtr() {
- }
-
- // member functions --------------------------------------------------------
-
- bool isNull() const {
- return d->object() == 0;
- }
-
- // operators ---------------------------------------------------------------
-
- QGuardedPtr &operator=(const QGuardedPtr &p) {
- d = p.d;
- return *this;
- }
-
- T &operator*() const {
- return *(T*)d->object();
- }
-
- operator T *() const {
- return (T*)d->object();
- }
+ QObject* pointer() const { return iterator.current(); }
+ bool isNull() const { return pointer() != 0; }
- T *operator->() const {
- return (T*)d->object();
- }
-
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
private:
+ QPtrListIterator<QObject> iterator;
+};
- KWQRefPtr<QGuardedPtrPrivate> d;
-}; // class QGuardedPtr ========================================================
-
-class QGuardedPtrPrivate {
- public:
- QGuardedPtrPrivate(QObject *o);
- ~QGuardedPtrPrivate();
-
- QObject *object()
- {
- return p;
- }
-
- private:
- QObject *p;
- int refCount;
+template <class T> class QGuardedPtr : public KWQGuardedPtrBase {
+public:
+ QGuardedPtr() { }
+ QGuardedPtr(T* p) : KWQGuardedPtrBase(p) { }
- friend class KWQRefPtr<QGuardedPtrPrivate>;
+ T& operator*() const { return *(T*)pointer(); }
+ operator T*() const { return (T*)pointer(); }
+ T* operator->() const { return (T*)pointer(); }
};
#endif
-
diff --git a/WebCore/kwq/KWQGuardedPtr.mm b/WebCore/kwq/KWQGuardedPtr.mm
index 14c5d15..fb7c75f 100644
--- a/WebCore/kwq/KWQGuardedPtr.mm
+++ b/WebCore/kwq/KWQGuardedPtr.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,16 +25,10 @@
#include <qguardedptr.h>
-QGuardedPtrPrivate::QGuardedPtrPrivate(QObject* o)
- : p(o)
+KWQGuardedPtrBase::KWQGuardedPtrBase(QObject *o)
{
- // FIXME: must connect
+ if (o) {
+ iterator = QPtrListIterator<QObject>(o->guardedPtrDummyList);
+ iterator.toFirst();
+ }
}
-
-
-QGuardedPtrPrivate::~QGuardedPtrPrivate()
-{
-}
-
-
-
diff --git a/WebCore/kwq/KWQObject.h b/WebCore/kwq/KWQObject.h
index 7c6d418..d7ea4c4 100644
--- a/WebCore/kwq/KWQObject.h
+++ b/WebCore/kwq/KWQObject.h
@@ -26,16 +26,13 @@
#ifndef QOBJECT_H_
#define QOBJECT_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <KWQDef.h>
#include "qnamespace.h"
#include "qstring.h"
#include "qevent.h"
#include "qstringlist.h"
+#include "qptrlist.h"
// FIXME: should these macros be in "kwq.h" or other header file?
#define slots
@@ -67,12 +64,13 @@ class QTimer;
class QImage;
class QVariant;
+class KWQGuardedPtrBase;
+
// class QObject ===============================================================
class QObject : public Qt {
public:
-#ifdef _KWQ_
enum Actions {
// Standard button action, maps to RenderFormElement::slotClicked
ACTION_BUTTON_CLICKED = 1,
@@ -91,27 +89,13 @@ public:
ACTION_COMBOBOX_CLICKED = 7
};
-#endif
-
- // typedefs ----------------------------------------------------------------
- // enums -------------------------------------------------------------------
- // constants ---------------------------------------------------------------
-
- // static member functions -------------------------------------------------
- static bool connect(const QObject *, const char *, const QObject *,
- const char *);
-
- static bool disconnect( const QObject *, const char *, const QObject *,
- const char *);
-
- // constructors, copy constructors, and destructors ------------------------
+ static bool connect(const QObject *, const char *, const QObject *, const char *);
+ static bool disconnect( const QObject *, const char *, const QObject *, const char *);
QObject(QObject *parent=0, const char *name=0);
virtual ~QObject();
- // member functions --------------------------------------------------------
-
const char *name() const;
virtual void setName(const char *);
@@ -130,24 +114,19 @@ public:
void blockSignals(bool);
-#ifdef _KWQ_
virtual void performAction(QObject::Actions action);
void emitAction(QObject::Actions action);
void setTarget (QObject *obj);
-#endif
- // operators ---------------------------------------------------------------
-
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
-
private:
// no copying or assignment
- // note that these are "standard" (no pendantic stuff needed)
QObject(const QObject &);
QObject &operator=(const QObject &);
QObject *target;
-}; // class QObject ============================================================
+ QPtrList<QObject> guardedPtrDummyList;
+
+ friend class KWQGuardedPtrBase;
+};
#endif
diff --git a/WebCore/kwq/KWQObject.mm b/WebCore/kwq/KWQObject.mm
index b6af841..fab197f 100644
--- a/WebCore/kwq/KWQObject.mm
+++ b/WebCore/kwq/KWQObject.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,6 +25,7 @@
#include <qobject.h>
#include <qvariant.h>
+#include <qguardedptr.h>
#include <kwqdebug.h>
@@ -76,6 +77,7 @@ void QObject::setTarget (QObject *t)
QObject::QObject(QObject *parent=0, const char *name=0)
{
+ guardedPtrDummyList.append(this);
}
diff --git a/WebCore/kwq/KWQPtrList.h b/WebCore/kwq/KWQPtrList.h
index d50ee00..cc6502a 100644
--- a/WebCore/kwq/KWQPtrList.h
+++ b/WebCore/kwq/KWQPtrList.h
@@ -120,6 +120,7 @@ public:
// constructors, copy constructors, and destructors ------------------------
QPtrListIterator() {}
+ QPtrListIterator(const QPtrListIterator &li) : impl(li.impl) {}
QPtrListIterator(const QPtrList<T> &l) : impl(l.impl) {}
~QPtrListIterator() {}
@@ -135,11 +136,9 @@ public:
operator T *() const { return (T *)impl.current(); }
T *operator--() { return (T *)(--impl); }
T *operator++() { return (T *)(++impl); }
- QPtrListIterator<T> &operator=(const QPtrListIterator<T> &li) { impl = li.impl; return *this; }
+ QPtrListIterator &operator=(const QPtrListIterator &li) { impl = li.impl; return *this; }
private:
- QPtrListIterator<T>(const QPtrListIterator<T> &li) {}
-
KWQListIteratorImpl impl;
}; // class QPtrListIterator ======================================================
diff --git a/WebCore/kwq/qt/qguardedptr.h b/WebCore/kwq/qt/qguardedptr.h
index df6fec7..a3cab39 100644
--- a/WebCore/kwq/qt/qguardedptr.h
+++ b/WebCore/kwq/qt/qguardedptr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,92 +26,27 @@
#ifndef QGUARDEDPTR_H_
#define QGUARDEDPTR_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "KWQRefPtr.h"
-
#include "qobject.h"
-// class QGuardedPtrPrivate ====================================================
-
-// class QGuardedPtr ===========================================================
-
-class QGuardedPtrPrivate;
-
-template <class T> class QGuardedPtr {
+class KWQGuardedPtrBase {
public:
-
- // typedefs ----------------------------------------------------------------
- // enums -------------------------------------------------------------------
- // constants ---------------------------------------------------------------
- // static member functions -------------------------------------------------
-
- // constructors, copy constructors, and destructors ------------------------
-
- QGuardedPtr() : d(new QGuardedPtrPrivate(0))
- {
- }
- QGuardedPtr(T *o) : d(new QGuardedPtrPrivate(o))
- {
- }
+ KWQGuardedPtrBase(QObject* = 0);
- QGuardedPtr(const QGuardedPtr<T> &p) {
- d = p.d;
- }
-
- ~QGuardedPtr() {
- }
-
- // member functions --------------------------------------------------------
-
- bool isNull() const {
- return d->object() == 0;
- }
-
- // operators ---------------------------------------------------------------
-
- QGuardedPtr &operator=(const QGuardedPtr &p) {
- d = p.d;
- return *this;
- }
-
- T &operator*() const {
- return *(T*)d->object();
- }
-
- operator T *() const {
- return (T*)d->object();
- }
+ QObject* pointer() const { return iterator.current(); }
+ bool isNull() const { return pointer() != 0; }
- T *operator->() const {
- return (T*)d->object();
- }
-
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
private:
+ QPtrListIterator<QObject> iterator;
+};
- KWQRefPtr<QGuardedPtrPrivate> d;
-}; // class QGuardedPtr ========================================================
-
-class QGuardedPtrPrivate {
- public:
- QGuardedPtrPrivate(QObject *o);
- ~QGuardedPtrPrivate();
-
- QObject *object()
- {
- return p;
- }
-
- private:
- QObject *p;
- int refCount;
+template <class T> class QGuardedPtr : public KWQGuardedPtrBase {
+public:
+ QGuardedPtr() { }
+ QGuardedPtr(T* p) : KWQGuardedPtrBase(p) { }
- friend class KWQRefPtr<QGuardedPtrPrivate>;
+ T& operator*() const { return *(T*)pointer(); }
+ operator T*() const { return (T*)pointer(); }
+ T* operator->() const { return (T*)pointer(); }
};
#endif
-
diff --git a/WebCore/kwq/qt/qlist.h b/WebCore/kwq/qt/qlist.h
index d50ee00..cc6502a 100644
--- a/WebCore/kwq/qt/qlist.h
+++ b/WebCore/kwq/qt/qlist.h
@@ -120,6 +120,7 @@ public:
// constructors, copy constructors, and destructors ------------------------
QPtrListIterator() {}
+ QPtrListIterator(const QPtrListIterator &li) : impl(li.impl) {}
QPtrListIterator(const QPtrList<T> &l) : impl(l.impl) {}
~QPtrListIterator() {}
@@ -135,11 +136,9 @@ public:
operator T *() const { return (T *)impl.current(); }
T *operator--() { return (T *)(--impl); }
T *operator++() { return (T *)(++impl); }
- QPtrListIterator<T> &operator=(const QPtrListIterator<T> &li) { impl = li.impl; return *this; }
+ QPtrListIterator &operator=(const QPtrListIterator &li) { impl = li.impl; return *this; }
private:
- QPtrListIterator<T>(const QPtrListIterator<T> &li) {}
-
KWQListIteratorImpl impl;
}; // class QPtrListIterator ======================================================
diff --git a/WebCore/kwq/qt/qobject.h b/WebCore/kwq/qt/qobject.h
index 7c6d418..d7ea4c4 100644
--- a/WebCore/kwq/qt/qobject.h
+++ b/WebCore/kwq/qt/qobject.h
@@ -26,16 +26,13 @@
#ifndef QOBJECT_H_
#define QOBJECT_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <KWQDef.h>
#include "qnamespace.h"
#include "qstring.h"
#include "qevent.h"
#include "qstringlist.h"
+#include "qptrlist.h"
// FIXME: should these macros be in "kwq.h" or other header file?
#define slots
@@ -67,12 +64,13 @@ class QTimer;
class QImage;
class QVariant;
+class KWQGuardedPtrBase;
+
// class QObject ===============================================================
class QObject : public Qt {
public:
-#ifdef _KWQ_
enum Actions {
// Standard button action, maps to RenderFormElement::slotClicked
ACTION_BUTTON_CLICKED = 1,
@@ -91,27 +89,13 @@ public:
ACTION_COMBOBOX_CLICKED = 7
};
-#endif
-
- // typedefs ----------------------------------------------------------------
- // enums -------------------------------------------------------------------
- // constants ---------------------------------------------------------------
-
- // static member functions -------------------------------------------------
- static bool connect(const QObject *, const char *, const QObject *,
- const char *);
-
- static bool disconnect( const QObject *, const char *, const QObject *,
- const char *);
-
- // constructors, copy constructors, and destructors ------------------------
+ static bool connect(const QObject *, const char *, const QObject *, const char *);
+ static bool disconnect( const QObject *, const char *, const QObject *, const char *);
QObject(QObject *parent=0, const char *name=0);
virtual ~QObject();
- // member functions --------------------------------------------------------
-
const char *name() const;
virtual void setName(const char *);
@@ -130,24 +114,19 @@ public:
void blockSignals(bool);
-#ifdef _KWQ_
virtual void performAction(QObject::Actions action);
void emitAction(QObject::Actions action);
void setTarget (QObject *obj);
-#endif
- // operators ---------------------------------------------------------------
-
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
-
private:
// no copying or assignment
- // note that these are "standard" (no pendantic stuff needed)
QObject(const QObject &);
QObject &operator=(const QObject &);
QObject *target;
-}; // class QObject ============================================================
+ QPtrList<QObject> guardedPtrDummyList;
+
+ friend class KWQGuardedPtrBase;
+};
#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list