[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
mrobinson at webkit.org
mrobinson at webkit.org
Wed Dec 22 12:34:44 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit d7bdcd1a13cb0802d877706ff22d33d7d7ff246d
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 25 18:00:13 2010 +0000
2010-08-25 Martin Robinson <mrobinson at igalia.com>
Reviewed by Gustavo Noronha Silva.
Cairo and EFL port shouldn't depend on glib.
https://bugs.webkit.org/show_bug.cgi?id=44354
Replace GRefPtr with PlatformRefPtr. Keep GLib specific bits in
GRefPtr.h.
* GNUmakefile.am: Add PlatformRefPtr.h to the source list.
* wtf/PlatformRefPtr.h: Migrated from GRefPtr.h.
(WTF::PlatformRefPtr::PlatformRefPtr): Ditto.
(WTF::PlatformRefPtr::~PlatformRefPtr): Ditto.
(WTF::PlatformRefPtr::clear): Ditto.
(WTF::PlatformRefPtr::get): Ditto.
(WTF::PlatformRefPtr::operator*): Ditto.
(WTF::PlatformRefPtr::operator->): Ditto.
(WTF::PlatformRefPtr::operator!): Ditto.
(WTF::PlatformRefPtr::operator UnspecifiedBoolType): Ditto.
(WTF::PlatformRefPtr::hashTableDeletedValue): Ditto.
(WTF::::operator): Ditto.
(WTF::::swap): Ditto.
(WTF::swap): Ditto.
(WTF::operator==): Ditto.
(WTF::operator!=): Ditto.
(WTF::static_pointer_cast): Ditto.
(WTF::const_pointer_cast): Ditto.
(WTF::getPtr): Ditto.
(WTF::adoptPlatformRef): Ditto.
* wtf/gobject/GRefPtr.cpp: Changes to reflect new names.
(WTF::refPlatformPtr):
(WTF::derefPlatformPtr):
* wtf/gobject/GRefPtr.h: Ditto.
(WTF::refPlatformPtr):
(WTF::derefPlatformPtr):
2010-08-25 Martin Robinson <mrobinson at igalia.com>
Reviewed by Gustavo Noronha Silva.
Cairo and EFL port shouldn't depend on glib.
https://bugs.webkit.org/show_bug.cgi?id=44354
No new tests as functionality has not changed.
Replace occurrences of GRefPtr and adoptGRef with PlatformRefPtr and
adoptPlatformRef. Rename GRefPtrCairo to PlatformRefPtrCairo.
* GNUmakefile.am:
* platform/Cursor.h:
* platform/graphics/cairo/GRefPtrCairo.cpp: Removed.
* platform/graphics/cairo/GRefPtrCairo.h: Removed.
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/cairo/PlatformRefPtrCairo.cpp: Added.
(WTF::refPlatformPtr):
(WTF::derefPlatformPtr):
* platform/graphics/cairo/PlatformRefPtrCairo.h: Added.
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::ImageBuffer::toDataURL):
* platform/gtk/ClipboardGtk.cpp:
(WebCore::ClipboardGtk::declareAndWriteDragImage):
* platform/gtk/CursorGtk.cpp:
(WebCore::createNamedCursor):
(WebCore::createCustomCursor):
(WebCore::Cursor::ensurePlatformCursor):
* platform/gtk/DataObjectGtk.h:
* platform/gtk/GRefPtrGtk.cpp:
(WTF::refPlatformPtr):
(WTF::derefPlatformPtr):
* platform/gtk/GRefPtrGtk.h:
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeImage):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::dropAtomsForContext):
* platform/gtk/PopupMenuGtk.h:
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::RenderThemeGtk):
(WebCore::paintMozillaGtkWidget):
* platform/gtk/RenderThemeGtk.h:
2010-08-25 Martin Robinson <mrobinson at igalia.com>
Reviewed by Gustavo Noronha Silva.
Cairo and EFL port shouldn't depend on glib.
https://bugs.webkit.org/show_bug.cgi?id=44354
Replace occurrences of GRefPtr and adoptGRef with PlatformRefPtr and
adoptPlatformRef.
* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::ChromeClient::requestGeolocationPermissionForFrame):
* WebCoreSupport/DragClientGtk.cpp:
(WebKit::DragClient::startDrag):
* WebCoreSupport/EditorClientGtk.h:
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchWillSendRequest):
(WebKit::FrameLoaderClient::dispatchDecidePolicyForMIMEType):
(WebKit::FrameLoaderClient::createPlugin):
* WebCoreSupport/FullscreenVideoController.h:
* WebCoreSupport/InspectorClientGtk.cpp:
(WebKit::InspectorClient::populateSetting):
(WebKit::InspectorClient::storeSetting):
* webkit/webkitdownload.cpp:
(webkit_download_error):
* webkit/webkitnetworkrequest.cpp:
(webkit_network_request_new_with_core_request):
* webkit/webkitnetworkresponse.cpp:
(webkit_network_response_new_with_core_response):
2010-08-25 Martin Robinson <mrobinson at igalia.com>
Reviewed by Gustavo Noronha Silva.
Cairo and EFL port shouldn't depend on glib.
https://bugs.webkit.org/show_bug.cgi?id=44354
Replace occurrences of GRefPtr and adoptGRef with PlatformRefPtr and
adoptPlatformRef.
* DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
(AccessibilityUIElement::isSelected):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index bf4e1d8..ca80671 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,40 @@
+2010-08-25 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Cairo and EFL port shouldn't depend on glib.
+ https://bugs.webkit.org/show_bug.cgi?id=44354
+
+ Replace GRefPtr with PlatformRefPtr. Keep GLib specific bits in
+ GRefPtr.h.
+
+ * GNUmakefile.am: Add PlatformRefPtr.h to the source list.
+ * wtf/PlatformRefPtr.h: Migrated from GRefPtr.h.
+ (WTF::PlatformRefPtr::PlatformRefPtr): Ditto.
+ (WTF::PlatformRefPtr::~PlatformRefPtr): Ditto.
+ (WTF::PlatformRefPtr::clear): Ditto.
+ (WTF::PlatformRefPtr::get): Ditto.
+ (WTF::PlatformRefPtr::operator*): Ditto.
+ (WTF::PlatformRefPtr::operator->): Ditto.
+ (WTF::PlatformRefPtr::operator!): Ditto.
+ (WTF::PlatformRefPtr::operator UnspecifiedBoolType): Ditto.
+ (WTF::PlatformRefPtr::hashTableDeletedValue): Ditto.
+ (WTF::::operator): Ditto.
+ (WTF::::swap): Ditto.
+ (WTF::swap): Ditto.
+ (WTF::operator==): Ditto.
+ (WTF::operator!=): Ditto.
+ (WTF::static_pointer_cast): Ditto.
+ (WTF::const_pointer_cast): Ditto.
+ (WTF::getPtr): Ditto.
+ (WTF::adoptPlatformRef): Ditto.
+ * wtf/gobject/GRefPtr.cpp: Changes to reflect new names.
+ (WTF::refPlatformPtr):
+ (WTF::derefPlatformPtr):
+ * wtf/gobject/GRefPtr.h: Ditto.
+ (WTF::refPlatformPtr):
+ (WTF::derefPlatformPtr):
+
2010-08-25 Xan Lopez <xlopez at igalia.com>
Reviewed by Alexey Proskuryakov.
diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am
index fae85e1..ecd7ffe 100644
--- a/JavaScriptCore/GNUmakefile.am
+++ b/JavaScriptCore/GNUmakefile.am
@@ -469,6 +469,7 @@ javascriptcore_sources += \
JavaScriptCore/wtf/PassOwnPtr.h \
JavaScriptCore/wtf/PassRefPtr.h \
JavaScriptCore/wtf/Platform.h \
+ JavaScriptCore/wtf/PlatformRefPtr.h \
JavaScriptCore/wtf/PossiblyNull.h \
JavaScriptCore/wtf/RandomNumber.cpp \
JavaScriptCore/wtf/RandomNumber.h \
diff --git a/JavaScriptCore/wtf/PlatformRefPtr.h b/JavaScriptCore/wtf/PlatformRefPtr.h
new file mode 100644
index 0000000..2d05ac9
--- /dev/null
+++ b/JavaScriptCore/wtf/PlatformRefPtr.h
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2009 Martin Robinson
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef PlatformRefPtr_h
+#define PlatformRefPtr_h
+
+#include "AlwaysInline.h"
+#include <algorithm>
+
+namespace WTF {
+
+enum PlatformRefPtrAdoptType { PlatformRefPtrAdopt };
+template <typename T> inline T* refPlatformPtr(T*);
+template <typename T> inline void derefPlatformPtr(T*);
+template <typename T> class PlatformRefPtr;
+template <typename T> PlatformRefPtr<T> adoptPlatformRef(T*);
+
+template <typename T> class PlatformRefPtr {
+public:
+ PlatformRefPtr() : m_ptr(0) { }
+
+ PlatformRefPtr(T* ptr)
+ : m_ptr(ptr)
+ {
+ if (ptr)
+ refPlatformPtr(ptr);
+ }
+
+ PlatformRefPtr(const PlatformRefPtr& o)
+ : m_ptr(o.m_ptr)
+ {
+ if (T* ptr = m_ptr)
+ refPlatformPtr(ptr);
+ }
+
+ template <typename U> PlatformRefPtr(const PlatformRefPtr<U>& o)
+ : m_ptr(o.get())
+ {
+ if (T* ptr = m_ptr)
+ refPlatformPtr(ptr);
+ }
+
+ ~PlatformRefPtr()
+ {
+ if (T* ptr = m_ptr)
+ derefPlatformPtr(ptr);
+ }
+
+ void clear()
+ {
+ T* ptr = m_ptr;
+ m_ptr = 0;
+ if (ptr)
+ derefPlatformPtr(ptr);
+ }
+
+ T* get() const { return m_ptr; }
+ T& operator*() const { return *m_ptr; }
+ ALWAYS_INLINE T* operator->() const { return m_ptr; }
+
+ bool operator!() const { return !m_ptr; }
+
+ // This conversion operator allows implicit conversion to bool but not to other integer types.
+ typedef T* PlatformRefPtr::*UnspecifiedBoolType;
+ operator UnspecifiedBoolType() const { return m_ptr ? &PlatformRefPtr::m_ptr : 0; }
+
+ PlatformRefPtr& operator=(const PlatformRefPtr&);
+ PlatformRefPtr& operator=(T*);
+ template <typename U> PlatformRefPtr& operator=(const PlatformRefPtr<U>&);
+
+ void swap(PlatformRefPtr&);
+ friend PlatformRefPtr adoptPlatformRef<T>(T*);
+
+private:
+ static T* hashTableDeletedValue() { return reinterpret_cast<T*>(-1); }
+ // Adopting constructor.
+ PlatformRefPtr(T* ptr, PlatformRefPtrAdoptType) : m_ptr(ptr) {}
+
+ T* m_ptr;
+};
+
+template <typename T> inline PlatformRefPtr<T>& PlatformRefPtr<T>::operator=(const PlatformRefPtr<T>& o)
+{
+ T* optr = o.get();
+ if (optr)
+ refPlatformPtr(optr);
+ T* ptr = m_ptr;
+ m_ptr = optr;
+ if (ptr)
+ derefPlatformPtr(ptr);
+ return *this;
+}
+
+template <typename T> inline PlatformRefPtr<T>& PlatformRefPtr<T>::operator=(T* optr)
+{
+ T* ptr = m_ptr;
+ if (optr)
+ refPlatformPtr(optr);
+ m_ptr = optr;
+ if (ptr)
+ derefPlatformPtr(ptr);
+ return *this;
+}
+
+template <class T> inline void PlatformRefPtr<T>::swap(PlatformRefPtr<T>& o)
+{
+ std::swap(m_ptr, o.m_ptr);
+}
+
+template <class T> inline void swap(PlatformRefPtr<T>& a, PlatformRefPtr<T>& b)
+{
+ a.swap(b);
+}
+
+template <typename T, typename U> inline bool operator==(const PlatformRefPtr<T>& a, const PlatformRefPtr<U>& b)
+{
+ return a.get() == b.get();
+}
+
+template <typename T, typename U> inline bool operator==(const PlatformRefPtr<T>& a, U* b)
+{
+ return a.get() == b;
+}
+
+template <typename T, typename U> inline bool operator==(T* a, const PlatformRefPtr<U>& b)
+{
+ return a == b.get();
+}
+
+template <typename T, typename U> inline bool operator!=(const PlatformRefPtr<T>& a, const PlatformRefPtr<U>& b)
+{
+ return a.get() != b.get();
+}
+
+template <typename T, typename U> inline bool operator!=(const PlatformRefPtr<T>& a, U* b)
+{
+ return a.get() != b;
+}
+
+template <typename T, typename U> inline bool operator!=(T* a, const PlatformRefPtr<U>& b)
+{
+ return a != b.get();
+}
+
+template <typename T, typename U> inline PlatformRefPtr<T> static_pointer_cast(const PlatformRefPtr<U>& p)
+{
+ return PlatformRefPtr<T>(static_cast<T*>(p.get()));
+}
+
+template <typename T, typename U> inline PlatformRefPtr<T> const_pointer_cast(const PlatformRefPtr<U>& p)
+{
+ return PlatformRefPtr<T>(const_cast<T*>(p.get()));
+}
+
+template <typename T> inline T* getPtr(const PlatformRefPtr<T>& p)
+{
+ return p.get();
+}
+
+template <typename T> PlatformRefPtr<T> adoptPlatformRef(T* p)
+{
+ return PlatformRefPtr<T>(p, PlatformRefPtrAdopt);
+}
+
+} // namespace WTF
+
+using WTF::PlatformRefPtr;
+using WTF::refPlatformPtr;
+using WTF::derefPlatformPtr;
+using WTF::adoptPlatformRef;
+using WTF::static_pointer_cast;
+using WTF::const_pointer_cast;
+
+#endif // PlatformRefPtr_h
diff --git a/JavaScriptCore/wtf/gobject/GRefPtr.cpp b/JavaScriptCore/wtf/gobject/GRefPtr.cpp
index 9d16cb5..c16024c 100644
--- a/JavaScriptCore/wtf/gobject/GRefPtr.cpp
+++ b/JavaScriptCore/wtf/gobject/GRefPtr.cpp
@@ -23,30 +23,47 @@
namespace WTF {
-template <> GHashTable* refGPtr(GHashTable* ptr)
+template <> GHashTable* refPlatformPtr(GHashTable* ptr)
{
if (ptr)
g_hash_table_ref(ptr);
return ptr;
}
-template <> void derefGPtr(GHashTable* ptr)
+template <> void derefPlatformPtr(GHashTable* ptr)
{
g_hash_table_unref(ptr);
}
#if GLIB_CHECK_VERSION(2, 24, 0)
-template <> GVariant* refGPtr(GVariant* ptr)
+template <> GVariant* refPlatformPtr(GVariant* ptr)
{
if (ptr)
g_variant_ref(ptr);
return ptr;
}
-template <> void derefGPtr(GVariant* ptr)
+template <> void derefPlatformPtr(GVariant* ptr)
{
g_variant_unref(ptr);
}
+
+#else
+
+// We do this so that we can avoid including the glib.h header in GRefPtr.h.
+typedef struct _GVariant {
+ bool fake;
+} GVariant;
+
+template <> GVariant* refPlatformPtr(GVariant* ptr)
+{
+ return ptr;
+}
+
+template <> void derefPlatformPtr(GVariant* ptr)
+{
+}
+
#endif
} // namespace WTF
diff --git a/JavaScriptCore/wtf/gobject/GRefPtr.h b/JavaScriptCore/wtf/gobject/GRefPtr.h
index 9a07d93..064c87e 100644
--- a/JavaScriptCore/wtf/gobject/GRefPtr.h
+++ b/JavaScriptCore/wtf/gobject/GRefPtr.h
@@ -24,157 +24,30 @@
#define WTF_GRefPtr_h
#include "AlwaysInline.h"
+#include "PlatformRefPtr.h"
#include <algorithm>
-#include <glib.h>
-namespace WTF {
-
-enum GRefPtrAdoptType { GRefPtrAdopt };
-template <typename T> inline T* refGPtr(T*);
-template <typename T> inline void derefGPtr(T*);
-template <typename T> class GRefPtr;
-template <typename T> GRefPtr<T> adoptGRef(T*);
-template <> GHashTable* refGPtr(GHashTable* ptr);
-template <> void derefGPtr(GHashTable* ptr);
-
-#if GLIB_CHECK_VERSION(2, 24, 0)
-template <> GVariant* refGPtr(GVariant* ptr);
-template <> void derefGPtr(GVariant* ptr);
-#endif
-
-template <typename T> class GRefPtr {
-public:
- GRefPtr() : m_ptr(0) { }
- GRefPtr(T* ptr) : m_ptr(ptr) { if (ptr) refGPtr(ptr); }
- GRefPtr(const GRefPtr& o) : m_ptr(o.m_ptr) { if (T* ptr = m_ptr) refGPtr(ptr); }
- template <typename U> GRefPtr(const GRefPtr<U>& o) : m_ptr(o.get()) { if (T* ptr = m_ptr) refGPtr(ptr); }
-
- ~GRefPtr() { if (T* ptr = m_ptr) derefGPtr(ptr); }
-
- void clear()
- {
- T* ptr = m_ptr;
- m_ptr = 0;
- if (ptr)
- derefGPtr(ptr);
- }
-
- T* get() const { return m_ptr; }
- T& operator*() const { return *m_ptr; }
- ALWAYS_INLINE T* operator->() const { return m_ptr; }
-
- bool operator!() const { return !m_ptr; }
+typedef struct _GHashTable GHashTable;
+typedef struct _GVariant GVariant;
+typedef void* gpointer;
+extern "C" void g_object_unref(gpointer object);
+extern "C" gpointer g_object_ref_sink(gpointer object);
- // This conversion operator allows implicit conversion to bool but not to other integer types.
- typedef T* GRefPtr::*UnspecifiedBoolType;
- operator UnspecifiedBoolType() const { return m_ptr ? &GRefPtr::m_ptr : 0; }
-
- GRefPtr& operator=(const GRefPtr&);
- GRefPtr& operator=(T*);
- template <typename U> GRefPtr& operator=(const GRefPtr<U>&);
-
- void swap(GRefPtr&);
- friend GRefPtr adoptGRef<T>(T*);
-
-private:
- static T* hashTableDeletedValue() { return reinterpret_cast<T*>(-1); }
- // Adopting constructor.
- GRefPtr(T* ptr, GRefPtrAdoptType) : m_ptr(ptr) {}
-
- T* m_ptr;
-};
-
-template <typename T> inline GRefPtr<T>& GRefPtr<T>::operator=(const GRefPtr<T>& o)
-{
- T* optr = o.get();
- if (optr)
- refGPtr(optr);
- T* ptr = m_ptr;
- m_ptr = optr;
- if (ptr)
- derefGPtr(ptr);
- return *this;
-}
-
-template <typename T> inline GRefPtr<T>& GRefPtr<T>::operator=(T* optr)
-{
- T* ptr = m_ptr;
- if (optr)
- refGPtr(optr);
- m_ptr = optr;
- if (ptr)
- derefGPtr(ptr);
- return *this;
-}
-
-template <class T> inline void GRefPtr<T>::swap(GRefPtr<T>& o)
-{
- std::swap(m_ptr, o.m_ptr);
-}
-
-template <class T> inline void swap(GRefPtr<T>& a, GRefPtr<T>& b)
-{
- a.swap(b);
-}
-
-template <typename T, typename U> inline bool operator==(const GRefPtr<T>& a, const GRefPtr<U>& b)
-{
- return a.get() == b.get();
-}
-
-template <typename T, typename U> inline bool operator==(const GRefPtr<T>& a, U* b)
-{
- return a.get() == b;
-}
-
-template <typename T, typename U> inline bool operator==(T* a, const GRefPtr<U>& b)
-{
- return a == b.get();
-}
-
-template <typename T, typename U> inline bool operator!=(const GRefPtr<T>& a, const GRefPtr<U>& b)
-{
- return a.get() != b.get();
-}
-
-template <typename T, typename U> inline bool operator!=(const GRefPtr<T>& a, U* b)
-{
- return a.get() != b;
-}
-
-template <typename T, typename U> inline bool operator!=(T* a, const GRefPtr<U>& b)
-{
- return a != b.get();
-}
-
-template <typename T, typename U> inline GRefPtr<T> static_pointer_cast(const GRefPtr<U>& p)
-{
- return GRefPtr<T>(static_cast<T*>(p.get()));
-}
-
-template <typename T, typename U> inline GRefPtr<T> const_pointer_cast(const GRefPtr<U>& p)
-{
- return GRefPtr<T>(const_cast<T*>(p.get()));
-}
+namespace WTF {
-template <typename T> inline T* getPtr(const GRefPtr<T>& p)
-{
- return p.get();
-}
+template <> GHashTable* refPlatformPtr(GHashTable* ptr);
+template <> void derefPlatformPtr(GHashTable* ptr);
+template <> GVariant* refPlatformPtr(GVariant* ptr);
+template <> void derefPlatformPtr(GVariant* ptr);
-template <typename T> GRefPtr<T> adoptGRef(T* p)
-{
- return GRefPtr<T>(p, GRefPtrAdopt);
-}
-
-template <typename T> inline T* refGPtr(T* ptr)
+template <typename T> inline T* refPlatformPtr(T* ptr)
{
if (ptr)
g_object_ref_sink(ptr);
return ptr;
}
-template <typename T> inline void derefGPtr(T* ptr)
+template <typename T> inline void derefPlatformPtr(T* ptr)
{
if (ptr)
g_object_unref(ptr);
@@ -182,11 +55,4 @@ template <typename T> inline void derefGPtr(T* ptr)
} // namespace WTF
-using WTF::GRefPtr;
-using WTF::refGPtr;
-using WTF::derefGPtr;
-using WTF::adoptGRef;
-using WTF::static_pointer_cast;
-using WTF::const_pointer_cast;
-
#endif // WTF_GRefPtr_h
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 898dd98..7c06c27 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,48 @@
+2010-08-25 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Cairo and EFL port shouldn't depend on glib.
+ https://bugs.webkit.org/show_bug.cgi?id=44354
+
+ No new tests as functionality has not changed.
+
+ Replace occurrences of GRefPtr and adoptGRef with PlatformRefPtr and
+ adoptPlatformRef. Rename GRefPtrCairo to PlatformRefPtrCairo.
+
+ * GNUmakefile.am:
+ * platform/Cursor.h:
+ * platform/graphics/cairo/GRefPtrCairo.cpp: Removed.
+ * platform/graphics/cairo/GRefPtrCairo.h: Removed.
+ * platform/graphics/cairo/ImageCairo.cpp:
+ (WebCore::Image::drawPattern):
+ * platform/graphics/cairo/PlatformRefPtrCairo.cpp: Added.
+ (WTF::refPlatformPtr):
+ (WTF::derefPlatformPtr):
+ * platform/graphics/cairo/PlatformRefPtrCairo.h: Added.
+ * platform/graphics/gtk/ImageBufferGtk.cpp:
+ (WebCore::ImageBuffer::toDataURL):
+ * platform/gtk/ClipboardGtk.cpp:
+ (WebCore::ClipboardGtk::declareAndWriteDragImage):
+ * platform/gtk/CursorGtk.cpp:
+ (WebCore::createNamedCursor):
+ (WebCore::createCustomCursor):
+ (WebCore::Cursor::ensurePlatformCursor):
+ * platform/gtk/DataObjectGtk.h:
+ * platform/gtk/GRefPtrGtk.cpp:
+ (WTF::refPlatformPtr):
+ (WTF::derefPlatformPtr):
+ * platform/gtk/GRefPtrGtk.h:
+ * platform/gtk/PasteboardGtk.cpp:
+ (WebCore::Pasteboard::writeImage):
+ * platform/gtk/PasteboardHelper.cpp:
+ (WebCore::PasteboardHelper::dropAtomsForContext):
+ * platform/gtk/PopupMenuGtk.h:
+ * platform/gtk/RenderThemeGtk.cpp:
+ (WebCore::RenderThemeGtk::RenderThemeGtk):
+ (WebCore::paintMozillaGtkWidget):
+ * platform/gtk/RenderThemeGtk.h:
+
2010-08-25 Eric Carlson <eric.carlson at apple.com>
Reviewed by Alexey Proskuryakov.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 8f3b7cc..b47188e 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -2456,8 +2456,6 @@ webcoregtk_sources += \
WebCore/platform/graphics/cairo/FontPlatformData.h \
WebCore/platform/graphics/cairo/GOwnPtrCairo.cpp \
WebCore/platform/graphics/cairo/GOwnPtrCairo.h \
- WebCore/platform/graphics/cairo/GRefPtrCairo.cpp \
- WebCore/platform/graphics/cairo/GRefPtrCairo.h \
WebCore/platform/graphics/cairo/GradientCairo.cpp \
WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp \
WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h \
@@ -2466,6 +2464,8 @@ webcoregtk_sources += \
WebCore/platform/graphics/cairo/ImageCairo.cpp \
WebCore/platform/graphics/cairo/PathCairo.cpp \
WebCore/platform/graphics/cairo/PatternCairo.cpp \
+ WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp \
+ WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h \
WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp \
WebCore/platform/graphics/gtk/ColorGtk.cpp \
WebCore/platform/graphics/gtk/CairoUtilities.cpp \
diff --git a/WebCore/platform/Cursor.h b/WebCore/platform/Cursor.h
index 9b77d1c..92d3596 100644
--- a/WebCore/platform/Cursor.h
+++ b/WebCore/platform/Cursor.h
@@ -84,7 +84,7 @@ namespace WebCore {
#elif PLATFORM(MAC)
typedef NSCursor* PlatformCursor;
#elif PLATFORM(GTK)
- typedef GRefPtr<GdkCursor> PlatformCursor;
+ typedef PlatformRefPtr<GdkCursor> PlatformCursor;
#elif PLATFORM(EFL)
typedef const char* PlatformCursor;
#elif PLATFORM(QT) && !defined(QT_NO_CURSOR)
diff --git a/WebCore/platform/graphics/cairo/GRefPtrCairo.cpp b/WebCore/platform/graphics/cairo/GRefPtrCairo.cpp
deleted file mode 100644
index d244954..0000000
--- a/WebCore/platform/graphics/cairo/GRefPtrCairo.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2010 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "GRefPtrCairo.h"
-
-#include <cairo.h>
-
-namespace WTF {
-
-template <> cairo_t* refGPtr(cairo_t* ptr)
-{
- if (ptr)
- cairo_reference(ptr);
- return ptr;
-}
-
-template <> void derefGPtr(cairo_t* ptr)
-{
- if (ptr)
- cairo_destroy(ptr);
-}
-
-template <> cairo_surface_t* refGPtr(cairo_surface_t* ptr)
-{
- if (ptr)
- cairo_surface_reference(ptr);
- return ptr;
-}
-
-template <> void derefGPtr(cairo_surface_t* ptr)
-{
- if (ptr)
- cairo_surface_destroy(ptr);
-}
-
-}
diff --git a/WebCore/platform/graphics/cairo/GRefPtrCairo.h b/WebCore/platform/graphics/cairo/GRefPtrCairo.h
deleted file mode 100644
index aef51fe..0000000
--- a/WebCore/platform/graphics/cairo/GRefPtrCairo.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2010 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef GRefPtrCairo_h
-#define GRefPtrCairo_h
-
-#include "GRefPtr.h"
-
-typedef struct _cairo cairo_t;
-typedef struct _cairo_surface cairo_surface_t;
-
-namespace WTF {
-
-template <> cairo_t* refGPtr(cairo_t* ptr);
-template <> void derefGPtr(cairo_t* ptr);
-
-template <> cairo_surface_t* refGPtr(cairo_surface_t* ptr);
-template <> void derefGPtr(cairo_surface_t* ptr);
-
-}
-
-#endif
diff --git a/WebCore/platform/graphics/cairo/ImageCairo.cpp b/WebCore/platform/graphics/cairo/ImageCairo.cpp
index d5eb0e7..d9eb5e6 100644
--- a/WebCore/platform/graphics/cairo/ImageCairo.cpp
+++ b/WebCore/platform/graphics/cairo/ImageCairo.cpp
@@ -33,7 +33,7 @@
#include "AffineTransform.h"
#include "Color.h"
#include "FloatRect.h"
-#include "GRefPtrCairo.h"
+#include "PlatformRefPtrCairo.h"
#include "GraphicsContext.h"
#include "ImageBuffer.h"
#include "ImageObserver.h"
@@ -185,11 +185,11 @@ void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, con
cairo_t* cr = context->platformContext();
context->save();
- GRefPtr<cairo_surface_t> clippedImageSurface = 0;
+ PlatformRefPtr<cairo_surface_t> clippedImageSurface = 0;
if (tileRect.size() != size()) {
IntRect imageSize = enclosingIntRect(tileRect);
- clippedImageSurface = adoptGRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, imageSize.width(), imageSize.height()));
- GRefPtr<cairo_t> clippedImageContext(cairo_create(clippedImageSurface.get()));
+ clippedImageSurface = adoptPlatformRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, imageSize.width(), imageSize.height()));
+ PlatformRefPtr<cairo_t> clippedImageContext(cairo_create(clippedImageSurface.get()));
cairo_set_source_surface(clippedImageContext.get(), image, -tileRect.x(), -tileRect.y());
cairo_paint(clippedImageContext.get());
image = clippedImageSurface.get();
diff --git a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp
new file mode 100644
index 0000000..6870560
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "PlatformRefPtrCairo.h"
+
+#include <cairo.h>
+
+namespace WTF {
+
+template <> cairo_t* refPlatformPtr(cairo_t* ptr)
+{
+ if (ptr)
+ cairo_reference(ptr);
+ return ptr;
+}
+
+template <> void derefPlatformPtr(cairo_t* ptr)
+{
+ if (ptr)
+ cairo_destroy(ptr);
+}
+
+template <> cairo_surface_t* refPlatformPtr(cairo_surface_t* ptr)
+{
+ if (ptr)
+ cairo_surface_reference(ptr);
+ return ptr;
+}
+
+template <> void derefPlatformPtr(cairo_surface_t* ptr)
+{
+ if (ptr)
+ cairo_surface_destroy(ptr);
+}
+
+}
diff --git a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h
new file mode 100644
index 0000000..b064e58
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef GRefPtrCairo_h
+#define GRefPtrCairo_h
+
+#include "GRefPtr.h"
+
+typedef struct _cairo cairo_t;
+typedef struct _cairo_surface cairo_surface_t;
+
+namespace WTF {
+
+template <> cairo_t* refPlatformPtr(cairo_t* ptr);
+template <> void derefPlatformPtr(cairo_t* ptr);
+
+template <> cairo_surface_t* refPlatformPtr(cairo_surface_t* ptr);
+template <> void derefPlatformPtr(cairo_surface_t* ptr);
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp b/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
index d0b0274..821cc12 100644
--- a/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
+++ b/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
@@ -44,7 +44,7 @@ String ImageBuffer::toDataURL(const String& mimeType, const double* quality) con
if (type != "jpeg" && type != "png" && type != "tiff" && type != "ico" && type != "bmp")
return "data:,";
- GRefPtr<GdkPixbuf> pixbuf = cairoImageSurfaceToGdkPixbuf(m_data.m_surface);
+ PlatformRefPtr<GdkPixbuf> pixbuf = cairoImageSurfaceToGdkPixbuf(m_data.m_surface);
if (!pixbuf)
return "data:,";
diff --git a/WebCore/platform/gtk/ClipboardGtk.cpp b/WebCore/platform/gtk/ClipboardGtk.cpp
index 21ebe4c..b2c32a4 100644
--- a/WebCore/platform/gtk/ClipboardGtk.cpp
+++ b/WebCore/platform/gtk/ClipboardGtk.cpp
@@ -330,7 +330,7 @@ void ClipboardGtk::declareAndWriteDragImage(Element* element, const KURL& url, c
if (!image || !image->isLoaded())
return;
- GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->image()->getGdkPixbuf());
+ PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(image->image()->getGdkPixbuf());
if (!pixbuf)
return;
diff --git a/WebCore/platform/gtk/CursorGtk.cpp b/WebCore/platform/gtk/CursorGtk.cpp
index db6efa7..d1f1293 100644
--- a/WebCore/platform/gtk/CursorGtk.cpp
+++ b/WebCore/platform/gtk/CursorGtk.cpp
@@ -50,26 +50,26 @@ static GdkPixmap* createPixmapFromBits(const unsigned char* bits, const IntSize&
return pixmap;
}
-static GRefPtr<GdkCursor> createNamedCursor(CustomCursorType cursorType)
+static PlatformRefPtr<GdkCursor> createNamedCursor(CustomCursorType cursorType)
{
CustomCursor cursor = CustomCursors[cursorType];
- GRefPtr<GdkCursor> c = adoptGRef(gdk_cursor_new_from_name(gdk_display_get_default(), cursor.name));
+ PlatformRefPtr<GdkCursor> c = adoptPlatformRef(gdk_cursor_new_from_name(gdk_display_get_default(), cursor.name));
if (c)
return c;
const GdkColor fg = { 0, 0, 0, 0 };
const GdkColor bg = { 65535, 65535, 65535, 65535 };
IntSize cursorSize = IntSize(32, 32);
- GRefPtr<GdkPixmap> source = adoptGRef(createPixmapFromBits(cursor.bits, cursorSize));
- GRefPtr<GdkPixmap> mask = adoptGRef(createPixmapFromBits(cursor.mask_bits, cursorSize));
- return adoptGRef(gdk_cursor_new_from_pixmap(source.get(), mask.get(), &fg, &bg, cursor.hot_x, cursor.hot_y));
+ PlatformRefPtr<GdkPixmap> source = adoptPlatformRef(createPixmapFromBits(cursor.bits, cursorSize));
+ PlatformRefPtr<GdkPixmap> mask = adoptPlatformRef(createPixmapFromBits(cursor.mask_bits, cursorSize));
+ return adoptPlatformRef(gdk_cursor_new_from_pixmap(source.get(), mask.get(), &fg, &bg, cursor.hot_x, cursor.hot_y));
}
-static GRefPtr<GdkCursor> createCustomCursor(Image* image, const IntPoint& hotSpot)
+static PlatformRefPtr<GdkCursor> createCustomCursor(Image* image, const IntPoint& hotSpot)
{
IntPoint effectiveHotSpot = determineHotSpot(image, hotSpot);
- GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->getGdkPixbuf());
- return adoptGRef(gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf.get(), effectiveHotSpot.x(), effectiveHotSpot.y()));
+ PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(image->getGdkPixbuf());
+ return adoptPlatformRef(gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf.get(), effectiveHotSpot.x(), effectiveHotSpot.y()));
}
void Cursor::ensurePlatformCursor() const
@@ -83,77 +83,77 @@ void Cursor::ensurePlatformCursor() const
m_platformCursor = 0;
break;
case Cursor::Cross:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_CROSS));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_CROSS));
break;
case Cursor::Hand:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_HAND2));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_HAND2));
break;
case Cursor::IBeam:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_XTERM));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_XTERM));
break;
case Cursor::Wait:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_WATCH));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_WATCH));
break;
case Cursor::Help:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_QUESTION_ARROW));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_QUESTION_ARROW));
break;
case Cursor::Move:
case Cursor::MiddlePanning:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_FLEUR));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_FLEUR));
break;
case Cursor::EastResize:
case Cursor::EastPanning:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_RIGHT_SIDE));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_RIGHT_SIDE));
break;
case Cursor::NorthResize:
case Cursor::NorthPanning:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_TOP_SIDE));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_TOP_SIDE));
break;
case Cursor::NorthEastResize:
case Cursor::NorthEastPanning:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_LEFT_SIDE));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_LEFT_SIDE));
break;
case Cursor::NorthWestResize:
case Cursor::NorthWestPanning:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_TOP_LEFT_CORNER));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_TOP_LEFT_CORNER));
break;
case Cursor::SouthResize:
case Cursor::SouthPanning:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_BOTTOM_SIDE));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_BOTTOM_SIDE));
break;
case Cursor::SouthEastResize:
case Cursor::SouthEastPanning:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_BOTTOM_RIGHT_CORNER));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_BOTTOM_RIGHT_CORNER));
break;
case Cursor::SouthWestResize:
case Cursor::SouthWestPanning:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_BOTTOM_LEFT_CORNER));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_BOTTOM_LEFT_CORNER));
break;
case Cursor::WestResize:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_LEFT_SIDE));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_LEFT_SIDE));
break;
case Cursor::NorthSouthResize:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_TOP_TEE));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_TOP_TEE));
break;
case Cursor::EastWestResize:
case Cursor::WestPanning:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_LEFT_SIDE));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_LEFT_SIDE));
break;
case Cursor::NorthEastSouthWestResize:
case Cursor::NorthWestSouthEastResize:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_SIZING));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_SIZING));
break;
case Cursor::ColumnResize:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW));
break;
case Cursor::RowResize:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW));
break;
case Cursor::VerticalText:
m_platformCursor = createNamedCursor(CustomCursorVerticalText);
break;
case Cursor::Cell:
- m_platformCursor = adoptGRef(gdk_cursor_new(GDK_PLUS));
+ m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_PLUS));
break;
case Cursor::ContextMenu:
m_platformCursor = createNamedCursor(CustomCursorContextMenu);
diff --git a/WebCore/platform/gtk/DataObjectGtk.h b/WebCore/platform/gtk/DataObjectGtk.h
index a7d8baf..6f7149c 100644
--- a/WebCore/platform/gtk/DataObjectGtk.h
+++ b/WebCore/platform/gtk/DataObjectGtk.h
@@ -73,8 +73,8 @@ private:
String m_text;
String m_markup;
Vector<KURL> m_uriList;
- GRefPtr<GdkPixbuf> m_image;
- GRefPtr<GdkDragContext> m_dragContext;
+ PlatformRefPtr<GdkPixbuf> m_image;
+ PlatformRefPtr<GdkDragContext> m_dragContext;
RefPtr<Range> m_range;
};
diff --git a/WebCore/platform/gtk/GRefPtrGtk.cpp b/WebCore/platform/gtk/GRefPtrGtk.cpp
index 6647b99..83129cc 100644
--- a/WebCore/platform/gtk/GRefPtrGtk.cpp
+++ b/WebCore/platform/gtk/GRefPtrGtk.cpp
@@ -25,27 +25,27 @@
namespace WTF {
-template <> GtkTargetList* refGPtr(GtkTargetList* ptr)
+template <> GtkTargetList* refPlatformPtr(GtkTargetList* ptr)
{
if (ptr)
gtk_target_list_ref(ptr);
return ptr;
}
-template <> void derefGPtr(GtkTargetList* ptr)
+template <> void derefPlatformPtr(GtkTargetList* ptr)
{
if (ptr)
gtk_target_list_unref(ptr);
}
-template <> GdkCursor* refGPtr(GdkCursor* ptr)
+template <> GdkCursor* refPlatformPtr(GdkCursor* ptr)
{
if (ptr)
gdk_cursor_ref(ptr);
return ptr;
}
-template <> void derefGPtr(GdkCursor* ptr)
+template <> void derefPlatformPtr(GdkCursor* ptr)
{
if (ptr)
gdk_cursor_unref(ptr);
diff --git a/WebCore/platform/gtk/GRefPtrGtk.h b/WebCore/platform/gtk/GRefPtrGtk.h
index 77941f5..ea1b089 100644
--- a/WebCore/platform/gtk/GRefPtrGtk.h
+++ b/WebCore/platform/gtk/GRefPtrGtk.h
@@ -28,11 +28,11 @@ typedef struct _GdkCursor GdkCursor;
namespace WTF {
-template <> GtkTargetList* refGPtr(GtkTargetList* ptr);
-template <> void derefGPtr(GtkTargetList* ptr);
+template <> GtkTargetList* refPlatformPtr(GtkTargetList* ptr);
+template <> void derefPlatformPtr(GtkTargetList* ptr);
-template <> GdkCursor* refGPtr(GdkCursor* ptr);
-template <> void derefGPtr(GdkCursor* ptr);
+template <> GdkCursor* refPlatformPtr(GdkCursor* ptr);
+template <> void derefPlatformPtr(GdkCursor* ptr);
}
diff --git a/WebCore/platform/gtk/PasteboardGtk.cpp b/WebCore/platform/gtk/PasteboardGtk.cpp
index a0069cf..ddb9768 100644
--- a/WebCore/platform/gtk/PasteboardGtk.cpp
+++ b/WebCore/platform/gtk/PasteboardGtk.cpp
@@ -103,7 +103,7 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&)
Image* image = cachedImage->image();
ASSERT(image);
- GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->getGdkPixbuf());
+ PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(image->getGdkPixbuf());
DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
dataObject->setImage(pixbuf.get());
m_helper->writeClipboardContents(clipboard);
diff --git a/WebCore/platform/gtk/PasteboardHelper.cpp b/WebCore/platform/gtk/PasteboardHelper.cpp
index 2babe91..95df25f 100644
--- a/WebCore/platform/gtk/PasteboardHelper.cpp
+++ b/WebCore/platform/gtk/PasteboardHelper.cpp
@@ -245,7 +245,7 @@ Vector<GdkAtom> PasteboardHelper::dropAtomsForContext(GtkWidget* widget, GdkDrag
dropAtoms.append(netscapeURLAtom);
// For images, try to find the most applicable image type.
- GRefPtr<GtkTargetList> list(gtk_target_list_new(0, 0));
+ PlatformRefPtr<GtkTargetList> list(gtk_target_list_new(0, 0));
gtk_target_list_add_image_targets(list.get(), getIdForTargetType(TargetTypeImage), TRUE);
GdkAtom atom = gtk_drag_dest_find_target(widget, context, list.get());
if (atom != GDK_NONE)
diff --git a/WebCore/platform/gtk/PopupMenuGtk.h b/WebCore/platform/gtk/PopupMenuGtk.h
index fb4e7dd..d63e6d9 100644
--- a/WebCore/platform/gtk/PopupMenuGtk.h
+++ b/WebCore/platform/gtk/PopupMenuGtk.h
@@ -58,7 +58,7 @@ private:
PopupMenuClient* m_popupClient;
IntPoint m_menuPosition;
- GRefPtr<GtkMenu> m_popup;
+ PlatformRefPtr<GtkMenu> m_popup;
HashMap<GtkWidget*, int> m_indexMap;
};
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp
index 36fccf0..5019f35 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -148,7 +148,7 @@ RenderThemeGtk::RenderThemeGtk()
, m_pauseButton(0)
, m_seekBackButton(0)
, m_seekForwardButton(0)
- , m_partsTable(adoptGRef(g_hash_table_new_full(0, 0, 0, g_free)))
+ , m_partsTable(adoptPlatformRef(g_hash_table_new_full(0, 0, 0, g_free)))
{
if (!mozGtkRefCount) {
moz_gtk_init();
@@ -317,7 +317,7 @@ static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetTyp
else if (type == MOZ_GTK_CHECKBUTTON || type == MOZ_GTK_RADIOBUTTON)
flags = theme->isChecked(o);
- GRefPtr<GdkDrawable> drawable(i.context->gdkDrawable());
+ PlatformRefPtr<GdkDrawable> drawable(i.context->gdkDrawable());
GdkRectangle paintRect, clipRect;
if (drawable) {
AffineTransform ctm = i.context->getCTM();
@@ -342,7 +342,7 @@ static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetTyp
// In some situations, like during print previews, this GraphicsContext is not
// backed by a GdkDrawable. In those situations, we render onto a pixmap and then
// copy the rendered data back to the GraphicsContext via Cairo.
- drawable = adoptGRef(gdk_pixmap_new(0, rect.width(), rect.height(), gdk_visual_get_depth(gdk_visual_get_system())));
+ drawable = adoptPlatformRef(gdk_pixmap_new(0, rect.width(), rect.height(), gdk_visual_get_depth(gdk_visual_get_system())));
paintRect = clipRect = IntRect(0, 0, rect.width(), rect.height());
}
diff --git a/WebCore/platform/gtk/RenderThemeGtk.h b/WebCore/platform/gtk/RenderThemeGtk.h
index 71338d4..b9c076d 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.h
+++ b/WebCore/platform/gtk/RenderThemeGtk.h
@@ -190,7 +190,7 @@ private:
RefPtr<Image> m_seekBackButton;
RefPtr<Image> m_seekForwardButton;
Page* m_page;
- GRefPtr<GHashTable> m_partsTable;
+ PlatformRefPtr<GHashTable> m_partsTable;
};
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 3a4692d..aa810d7 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,33 @@
+2010-08-25 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Cairo and EFL port shouldn't depend on glib.
+ https://bugs.webkit.org/show_bug.cgi?id=44354
+
+ Replace occurrences of GRefPtr and adoptGRef with PlatformRefPtr and
+ adoptPlatformRef.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::requestGeolocationPermissionForFrame):
+ * WebCoreSupport/DragClientGtk.cpp:
+ (WebKit::DragClient::startDrag):
+ * WebCoreSupport/EditorClientGtk.h:
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::dispatchWillSendRequest):
+ (WebKit::FrameLoaderClient::dispatchDecidePolicyForMIMEType):
+ (WebKit::FrameLoaderClient::createPlugin):
+ * WebCoreSupport/FullscreenVideoController.h:
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorClient::populateSetting):
+ (WebKit::InspectorClient::storeSetting):
+ * webkit/webkitdownload.cpp:
+ (webkit_download_error):
+ * webkit/webkitnetworkrequest.cpp:
+ (webkit_network_request_new_with_core_request):
+ * webkit/webkitnetworkresponse.cpp:
+ (webkit_network_response_new_with_core_response):
+
2010-08-24 Xan Lopez <xlopez at igalia.com>
Reviewed by Martin Robinson.
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 077d9cb..7e4090b 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -612,7 +612,7 @@ void ChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocatio
WebKitWebFrame* webFrame = kit(frame);
WebKitWebView* webView = getViewFromFrame(webFrame);
- GRefPtr<WebKitGeolocationPolicyDecision> policyDecision(adoptGRef(webkit_geolocation_policy_decision_new(webFrame, geolocation)));
+ PlatformRefPtr<WebKitGeolocationPolicyDecision> policyDecision(adoptPlatformRef(webkit_geolocation_policy_decision_new(webFrame, geolocation)));
gboolean isHandled = FALSE;
g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision.get(), &isHandled);
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
index efce3dc..b6075b6 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
@@ -73,7 +73,7 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin,
WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame));
RefPtr<DataObjectGtk> dataObject = clipboardGtk->dataObject();
- GRefPtr<GtkTargetList> targetList(clipboardGtk->helper()->targetListForDataObject(dataObject.get()));
+ PlatformRefPtr<GtkTargetList> targetList(clipboardGtk->helper()->targetListForDataObject(dataObject.get()));
GOwnPtr<GdkEvent> currentEvent(gtk_get_current_event());
GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(m_webView), targetList.get(), dragOperationToGdkDragActions(clipboard->sourceOperation()), 1, currentEvent.get());
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
index 3e881fa..efb734f 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
@@ -141,7 +141,7 @@ namespace WebKit {
bool m_treatContextCommitAsKeyEvent;
GOwnPtr<gchar> m_pendingComposition;
Vector<const char*> m_pendingEditorCommands;
- GRefPtr<GtkWidget> m_nativeWidget;
+ PlatformRefPtr<GtkWidget> m_nativeWidget;
};
}
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 98ac4a1..2cf4f36 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -201,19 +201,19 @@ static char* toString(unsigned long identifier)
void FrameLoaderClient::dispatchWillSendRequest(WebCore::DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
{
- GRefPtr<WebKitNetworkResponse> networkResponse(0);
+ PlatformRefPtr<WebKitNetworkResponse> networkResponse(0);
// We are adding one more resource to the load, or maybe we are
// just redirecting a load.
if (redirectResponse.isNull())
static_cast<WebKit::DocumentLoader*>(loader)->increaseLoadCount(identifier);
else
- networkResponse = adoptGRef(webkit_network_response_new_with_core_response(redirectResponse));
+ networkResponse = adoptPlatformRef(webkit_network_response_new_with_core_response(redirectResponse));
WebKitWebView* webView = getViewFromFrame(m_frame);
GOwnPtr<gchar> identifierString(toString(identifier));
WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
- GRefPtr<WebKitNetworkRequest> networkRequest(adoptGRef(webkit_network_request_new_with_core_request(request)));
+ PlatformRefPtr<WebKitNetworkRequest> networkRequest(adoptPlatformRef(webkit_network_request_new_with_core_request(request)));
if (!redirectResponse.isNull()) {
// This is a redirect, so we need to update the WebResource's knowledge
@@ -314,7 +314,7 @@ void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction poli
if (isHandled)
return;
- GRefPtr<WebKitNetworkResponse> networkResponse(adoptGRef(webkit_web_frame_get_network_response(m_frame)));
+ PlatformRefPtr<WebKitNetworkResponse> networkResponse(adoptPlatformRef(webkit_web_frame_get_network_response(m_frame)));
if (networkResponse) {
ResourceResponse response = core(networkResponse.get());
if (response.isAttachment()) {
@@ -449,7 +449,7 @@ PassRefPtr<Widget> FrameLoaderClient::createPlugin(const IntSize& pluginSize, HT
CString mimeTypeString = mimeType.utf8();
ASSERT(paramNames.size() == paramValues.size());
- GRefPtr<GHashTable> hash = adoptGRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free));
+ PlatformRefPtr<GHashTable> hash = adoptPlatformRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free));
for (unsigned i = 0; i < paramNames.size(); ++i) {
g_hash_table_insert(hash.get(),
g_strdup(paramNames[i].utf8().data()),
diff --git a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h
index 31b7ff0..1567d9b 100644
--- a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h
+++ b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h
@@ -89,7 +89,7 @@ private:
guint m_volumeUpdateId;
bool m_seekLock;
GtkWidget* m_window;
- GRefPtr<GdkCursor> m_cursor;
+ PlatformRefPtr<GdkCursor> m_cursor;
GtkWidget* m_hudWindow;
GtkAction* m_playPauseAction;
GtkAction* m_exitFullscreenAction;
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index a2b167f..aedf21f 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -175,7 +175,7 @@ void InspectorClient::populateSetting(const String& key, String* value)
if (!settings)
return;
- GRefPtr<GVariant> variant = adoptGRef(g_settings_get_value(settings, toGSettingName(key).utf8().data()));
+ PlatformRefPtr<GVariant> variant = adoptPlatformRef(g_settings_get_value(settings, toGSettingName(key).utf8().data()));
if (key == "resourceTrackingEnabled" || key == "xhrMonitor"
|| key == "debuggerEnabled" || key == "profilerEnabled")
@@ -193,15 +193,15 @@ void InspectorClient::storeSetting(const String& key, const String& value)
if (!settings)
return;
- GRefPtr<GVariant> variant(0);
+ PlatformRefPtr<GVariant> variant(0);
// Set the key with the appropriate type, and also avoid setting
// unknown keys to avoid aborting the execution.
if (key == "resourceTrackingEnabled" || key == "xhrMonitor"
|| key == "debuggerEnabled" || key == "profilerEnabled")
- variant = adoptGRef(variantFromTruthString(value));
+ variant = adoptPlatformRef(variantFromTruthString(value));
else if (key == "frontendSettings")
- variant = adoptGRef(g_variant_new_string(value.utf8().data()));
+ variant = adoptPlatformRef(g_variant_new_string(value.utf8().data()));
if (!variant)
return;
diff --git a/WebKit/gtk/webkit/webkitdownload.cpp b/WebKit/gtk/webkit/webkitdownload.cpp
index 0717e7c..9bcb739 100644
--- a/WebKit/gtk/webkit/webkitdownload.cpp
+++ b/WebKit/gtk/webkit/webkitdownload.cpp
@@ -905,7 +905,7 @@ static void webkit_download_error(WebKitDownload* download, const ResourceError&
webkit_download_close_stream(download);
WebKitDownloadPrivate* priv = download->priv;
- GRefPtr<WebKitDownload> protect(download);
+ PlatformRefPtr<WebKitDownload> protect(download);
g_timer_stop(priv->timer);
webkit_download_set_status(download, WEBKIT_DOWNLOAD_STATUS_ERROR);
diff --git a/WebKit/gtk/webkit/webkitnetworkrequest.cpp b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
index c72abbd..8b50948 100644
--- a/WebKit/gtk/webkit/webkitnetworkrequest.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
@@ -164,7 +164,7 @@ static void webkit_network_request_init(WebKitNetworkRequest* request)
// for internal use only
WebKitNetworkRequest* webkit_network_request_new_with_core_request(const WebCore::ResourceRequest& resourceRequest)
{
- GRefPtr<SoupMessage> soupMessage(adoptGRef(resourceRequest.toSoupMessage()));
+ PlatformRefPtr<SoupMessage> soupMessage(adoptPlatformRef(resourceRequest.toSoupMessage()));
if (soupMessage)
return WEBKIT_NETWORK_REQUEST(g_object_new(WEBKIT_TYPE_NETWORK_REQUEST, "message", soupMessage.get(), NULL));
diff --git a/WebKit/gtk/webkit/webkitnetworkresponse.cpp b/WebKit/gtk/webkit/webkitnetworkresponse.cpp
index 6745b94..d4dd562 100644
--- a/WebKit/gtk/webkit/webkitnetworkresponse.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkresponse.cpp
@@ -161,7 +161,7 @@ static void webkit_network_response_init(WebKitNetworkResponse* response)
// for internal use only
WebKitNetworkResponse* webkit_network_response_new_with_core_response(const WebCore::ResourceResponse& resourceResponse)
{
- GRefPtr<SoupMessage> soupMessage(adoptGRef(resourceResponse.toSoupMessage()));
+ PlatformRefPtr<SoupMessage> soupMessage(adoptPlatformRef(resourceResponse.toSoupMessage()));
if (soupMessage)
return WEBKIT_NETWORK_RESPONSE(g_object_new(WEBKIT_TYPE_NETWORK_RESPONSE, "message", soupMessage.get(), NULL));
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index ea67c06..d4f8e14 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-25 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Cairo and EFL port shouldn't depend on glib.
+ https://bugs.webkit.org/show_bug.cgi?id=44354
+
+ Replace occurrences of GRefPtr and adoptGRef with PlatformRefPtr and
+ adoptPlatformRef.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isSelected):
+
2010-08-25 Ojan Vafai <ojan at chromium.org>
Fix order of Timothy's email address. The script, and
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index a09ad2a..a5c5e9f 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -394,7 +394,7 @@ bool AccessibilityUIElement::isSelected() const
if (!ATK_IS_OBJECT(m_element))
return false;
- GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
+ PlatformRefPtr<AtkStateSet> stateSet = adoptPlatformRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
gboolean isSelected = atk_state_set_contains_state(stateSet.get(), ATK_STATE_SELECTED);
return isSelected;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list