[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
mrobinson at webkit.org
mrobinson at webkit.org
Fri Jan 21 14:55:35 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit 5031ca1bd7b8e2a80f67b4a77d1ab585cbb7cc3b
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 4 22:29:48 2011 +0000
2011-01-03 Martin Robinson <mrobinson at igalia.com>
Reviewed by Darin Adler.
Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr
https://bugs.webkit.org/show_bug.cgi?id=51846
* GNUmakefile.am: Remove PlatformRefPtr.h from the sources list.
* JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
* jit/ExecutableAllocator.h: Change references to PlatformRefPtr to RefPtr.
(JSC::ExecutableAllocator::cacheFlush): Ditto.
* wtf/PlatformRefPtr.h: Removed.
* wtf/RandomNumber.cpp: Change references to PlatformRefPtr to RefPtr.
(WTF::randomNumber): Ditto.
* wtf/brew/RefPtrBrew.h: Ditto.
(WTF::refIfNotNull): Added.
(WTF::derefIfNotNull): Added.
* wtf/brew/ShellBrew.h: Change references to PlatformRefPtr to RefPtr.
(WTF::createRefPtrInstance): Modified to return a RefPtr.
* wtf/gobject/GRefPtr.cpp:
(WTF::refGPtr): Moved from PlatformRefPtr here.
(WTF::derefGPtr): Ditto.
* wtf/gobject/GRefPtr.h: Ditto.
(WTF::GRefPtr::GRefPtr): Ditto.
(WTF::GRefPtr::~GRefPtr): Ditto.
(WTF::GRefPtr::clear): Ditto.
(WTF::GRefPtr::isHashTableDeletedValue): Ditto.
(WTF::GRefPtr::get): Ditto.
(WTF::GRefPtr::operator*): Ditto.
(WTF::GRefPtr::operator->): Ditto.
(WTF::GRefPtr::operator!): Ditto.
(WTF::GRefPtr::operator UnspecifiedBoolType): Ditto.
(WTF::GRefPtr::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::adoptGRef): Ditto.
(WTF::refGPtr): Ditto.
(WTF::derefGPtr): Ditto.
2011-01-03 Martin Robinson <mrobinson at igalia.com>
Reviewed by Darin Adler.
Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr
https://bugs.webkit.org/show_bug.cgi?id=51846
* DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp: Change usage of PlatformRefPtr
back to GRefPtr.
2011-01-03 Martin Robinson <mrobinson at igalia.com>
Reviewed by Darin Adler.
Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr
https://bugs.webkit.org/show_bug.cgi?id=51846
No new tests. This should not introduce any functional changes.
Changed all references to PlatformRefPtr in GTK+ code to GRefPtr. Changed
all references to PlatformRefPtr in Brew code to RefPtr.
2011-01-03 Martin Robinson <mrobinson at igalia.com>
Reviewed by Darin Adler.
Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr
https://bugs.webkit.org/show_bug.cgi?id=51846
Changed all references to PlatformRefPtr in GTK+ code to GRefPtr.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index b0ca278..73084ff 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,48 @@
+2011-01-03 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Darin Adler.
+
+ Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr
+ https://bugs.webkit.org/show_bug.cgi?id=51846
+
+ * GNUmakefile.am: Remove PlatformRefPtr.h from the sources list.
+ * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
+ * jit/ExecutableAllocator.h: Change references to PlatformRefPtr to RefPtr.
+ (JSC::ExecutableAllocator::cacheFlush): Ditto.
+ * wtf/PlatformRefPtr.h: Removed.
+ * wtf/RandomNumber.cpp: Change references to PlatformRefPtr to RefPtr.
+ (WTF::randomNumber): Ditto.
+ * wtf/brew/RefPtrBrew.h: Ditto.
+ (WTF::refIfNotNull): Added.
+ (WTF::derefIfNotNull): Added.
+ * wtf/brew/ShellBrew.h: Change references to PlatformRefPtr to RefPtr.
+ (WTF::createRefPtrInstance): Modified to return a RefPtr.
+ * wtf/gobject/GRefPtr.cpp:
+ (WTF::refGPtr): Moved from PlatformRefPtr here.
+ (WTF::derefGPtr): Ditto.
+ * wtf/gobject/GRefPtr.h: Ditto.
+ (WTF::GRefPtr::GRefPtr): Ditto.
+ (WTF::GRefPtr::~GRefPtr): Ditto.
+ (WTF::GRefPtr::clear): Ditto.
+ (WTF::GRefPtr::isHashTableDeletedValue): Ditto.
+ (WTF::GRefPtr::get): Ditto.
+ (WTF::GRefPtr::operator*): Ditto.
+ (WTF::GRefPtr::operator->): Ditto.
+ (WTF::GRefPtr::operator!): Ditto.
+ (WTF::GRefPtr::operator UnspecifiedBoolType): Ditto.
+ (WTF::GRefPtr::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::adoptGRef): Ditto.
+ (WTF::refGPtr): Ditto.
+ (WTF::derefGPtr): Ditto.
+
2011-01-04 Daniel Bates <dbates at rim.com>
Reviewed by Adam Roben.
diff --git a/Source/JavaScriptCore/GNUmakefile.am b/Source/JavaScriptCore/GNUmakefile.am
index 7e9882f..93f10ee 100644
--- a/Source/JavaScriptCore/GNUmakefile.am
+++ b/Source/JavaScriptCore/GNUmakefile.am
@@ -488,7 +488,6 @@ javascriptcore_sources += \
Source/JavaScriptCore/wtf/PassOwnPtr.h \
Source/JavaScriptCore/wtf/PassRefPtr.h \
Source/JavaScriptCore/wtf/Platform.h \
- Source/JavaScriptCore/wtf/PlatformRefPtr.h \
Source/JavaScriptCore/wtf/PossiblyNull.h \
Source/JavaScriptCore/wtf/RandomNumber.cpp \
Source/JavaScriptCore/wtf/RandomNumber.h \
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
index 8989559..554e5e1 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
@@ -745,10 +745,6 @@
>
</File>
<File
- RelativePath="..\..\wtf\PlatformRefPtr.h"
- >
- </File>
- <File
RelativePath="..\..\wtf\PossiblyNull.h"
>
</File>
diff --git a/Source/JavaScriptCore/jit/ExecutableAllocator.h b/Source/JavaScriptCore/jit/ExecutableAllocator.h
index 4580a67..d45f294 100644
--- a/Source/JavaScriptCore/jit/ExecutableAllocator.h
+++ b/Source/JavaScriptCore/jit/ExecutableAllocator.h
@@ -306,7 +306,7 @@ public:
#elif PLATFORM(BREWMP)
static void cacheFlush(void* code, size_t size)
{
- PlatformRefPtr<IMemCache1> memCache = createRefPtrInstance<IMemCache1>(AEECLSID_MemCache1);
+ RefPtr<IMemCache1> memCache = createRefPtrInstance<IMemCache1>(AEECLSID_MemCache1);
IMemCache1_ClearCache(memCache.get(), reinterpret_cast<uint32>(code), size, MEMSPACE_CACHE_FLUSH, MEMSPACE_DATACACHE);
IMemCache1_ClearCache(memCache.get(), reinterpret_cast<uint32>(code), size, MEMSPACE_CACHE_INVALIDATE, MEMSPACE_INSTCACHE);
}
diff --git a/Source/JavaScriptCore/wtf/PlatformRefPtr.h b/Source/JavaScriptCore/wtf/PlatformRefPtr.h
deleted file mode 100644
index e4f1314..0000000
--- a/Source/JavaScriptCore/wtf/PlatformRefPtr.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * 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 "RefPtr.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* leakRef() WARN_UNUSED_RETURN
- {
- T* ptr = m_ptr;
- m_ptr = 0;
- return ptr;
- }
-
- // Hash table deleted values, which are only constructed and never copied or destroyed.
- PlatformRefPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { }
- bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
-
- 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/Source/JavaScriptCore/wtf/RandomNumber.cpp b/Source/JavaScriptCore/wtf/RandomNumber.cpp
index 7a9b6a8..0c45416 100644
--- a/Source/JavaScriptCore/wtf/RandomNumber.cpp
+++ b/Source/JavaScriptCore/wtf/RandomNumber.cpp
@@ -99,7 +99,7 @@ double randomNumber()
return static_cast<double>(fullRandom)/static_cast<double>(1LL << 53);
#elif PLATFORM(BREWMP)
uint32_t bits;
- PlatformRefPtr<ISource> randomSource = createRefPtrInstance<ISource>(AEECLSID_RANDOM);
+ RefPtr<ISource> randomSource = createRefPtrInstance<ISource>(AEECLSID_RANDOM);
ISOURCE_Read(randomSource.get(), reinterpret_cast<char*>(&bits), 4);
return static_cast<double>(bits) / (static_cast<double>(std::numeric_limits<uint32_t>::max()) + 1.0);
diff --git a/Source/JavaScriptCore/wtf/brew/RefPtrBrew.h b/Source/JavaScriptCore/wtf/brew/RefPtrBrew.h
index 7fb0b7c..40e257b 100644
--- a/Source/JavaScriptCore/wtf/brew/RefPtrBrew.h
+++ b/Source/JavaScriptCore/wtf/brew/RefPtrBrew.h
@@ -24,28 +24,34 @@
#ifndef RefPtrBrew_h
#define RefPtrBrew_h
-#include "AlwaysInline.h"
-#include "PlatformRefPtr.h"
+#include "RefPtr.h"
#include <AEEIBase.h>
-#include <algorithm>
namespace WTF {
// All Brew MP classes are derived from either IBase or IQI.
-// Technically, IBase and IQI are different types. However, it is
-// okay to cast both types to IBase because they have AddRef and Release
-// in the same method vtable slots.
-template <typename T> inline T* refPlatformPtr(T* ptr)
+template<> void refIfNotNull(IBase* ptr)
{
- if (ptr)
- IBase_AddRef(reinterpret_cast<IBase*>(ptr));
- return ptr;
+ if (LIKELY(ptr != 0))
+ IBase_AddRef(ptr);
}
-template <typename T> inline void derefPlatformPtr(T* ptr)
+template<> void derefIfNotNull(IBase* ptr)
{
- if (ptr)
- IBase_Release(reinterpret_cast<IBase*>(ptr));
+ if (LIKELY(ptr != 0))
+ IBase_Release(ptr);
+}
+
+template<> void refIfNotNull(IQI* ptr)
+{
+ if (LIKELY(ptr != 0))
+ IQI_AddRef(ptr);
+}
+
+template<> void derefIfNotNull(IQI* ptr)
+{
+ if (LIKELY(ptr != 0))
+ IQI_Release(ptr);
}
} // namespace WTF
diff --git a/Source/JavaScriptCore/wtf/brew/ShellBrew.h b/Source/JavaScriptCore/wtf/brew/ShellBrew.h
index faccc75..8047631 100644
--- a/Source/JavaScriptCore/wtf/brew/ShellBrew.h
+++ b/Source/JavaScriptCore/wtf/brew/ShellBrew.h
@@ -34,7 +34,7 @@
#include <wtf/Assertions.h>
#include <wtf/PassOwnPtr.h>
-#include <wtf/PlatformRefPtr.h>
+#include <wtf/RefPtr.h>
namespace WTF {
@@ -51,7 +51,7 @@ static inline PassOwnPtr<T> createInstance(AEECLSID cls)
}
template <typename T>
-static inline PlatformRefPtr<T> createRefPtrInstance(AEECLSID cls)
+static inline RefPtr<T> createRefPtrInstance(AEECLSID cls)
{
T* instance = 0;
@@ -59,7 +59,7 @@ static inline PlatformRefPtr<T> createRefPtrInstance(AEECLSID cls)
ISHELL_CreateInstance(shell, cls, reinterpret_cast<void**>(&instance));
ASSERT(instance);
- return adoptPlatformRef(instance);
+ return adoptRef(instance);
}
} // namespace WTF
diff --git a/Source/JavaScriptCore/wtf/gobject/GRefPtr.cpp b/Source/JavaScriptCore/wtf/gobject/GRefPtr.cpp
index 085684e..1cd22c5 100644
--- a/Source/JavaScriptCore/wtf/gobject/GRefPtr.cpp
+++ b/Source/JavaScriptCore/wtf/gobject/GRefPtr.cpp
@@ -25,27 +25,27 @@
namespace WTF {
-template <> GHashTable* refPlatformPtr(GHashTable* ptr)
+template <> GHashTable* refGPtr(GHashTable* ptr)
{
if (ptr)
g_hash_table_ref(ptr);
return ptr;
}
-template <> void derefPlatformPtr(GHashTable* ptr)
+template <> void derefGPtr(GHashTable* ptr)
{
g_hash_table_unref(ptr);
}
#if GLIB_CHECK_VERSION(2, 24, 0)
-template <> GVariant* refPlatformPtr(GVariant* ptr)
+template <> GVariant* refGPtr(GVariant* ptr)
{
if (ptr)
g_variant_ref(ptr);
return ptr;
}
-template <> void derefPlatformPtr(GVariant* ptr)
+template <> void derefGPtr(GVariant* ptr)
{
g_variant_unref(ptr);
}
@@ -57,25 +57,25 @@ typedef struct _GVariant {
bool fake;
} GVariant;
-template <> GVariant* refPlatformPtr(GVariant* ptr)
+template <> GVariant* refGPtr(GVariant* ptr)
{
return ptr;
}
-template <> void derefPlatformPtr(GVariant* ptr)
+template <> void derefGPtr(GVariant* ptr)
{
}
#endif
-template <> GSource* refPlatformPtr(GSource* ptr)
+template <> GSource* refGPtr(GSource* ptr)
{
if (ptr)
g_source_ref(ptr);
return ptr;
}
-template <> void derefPlatformPtr(GSource* ptr)
+template <> void derefGPtr(GSource* ptr)
{
if (ptr)
g_source_unref(ptr);
diff --git a/Source/JavaScriptCore/wtf/gobject/GRefPtr.h b/Source/JavaScriptCore/wtf/gobject/GRefPtr.h
index 4efd9be..10ebf07 100644
--- a/Source/JavaScriptCore/wtf/gobject/GRefPtr.h
+++ b/Source/JavaScriptCore/wtf/gobject/GRefPtr.h
@@ -26,7 +26,8 @@
#if ENABLE(GLIB_SUPPORT)
#include "AlwaysInline.h"
-#include "PlatformRefPtr.h"
+#include "GRefPtr.h"
+#include "RefPtr.h"
#include <algorithm>
extern "C" void g_object_unref(gpointer);
@@ -34,21 +35,185 @@ extern "C" gpointer g_object_ref_sink(gpointer);
namespace WTF {
-template <> GHashTable* refPlatformPtr(GHashTable* ptr);
-template <> void derefPlatformPtr(GHashTable* ptr);
-template <> GVariant* refPlatformPtr(GVariant* ptr);
-template <> void derefPlatformPtr(GVariant* ptr);
-template <> GSource* refPlatformPtr(GSource* ptr);
-template <> void derefPlatformPtr(GSource* ptr);
+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 <typename T> inline T* refPlatformPtr(T* ptr)
+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* leakRef() WARN_UNUSED_RETURN
+ {
+ T* ptr = m_ptr;
+ m_ptr = 0;
+ return ptr;
+ }
+
+ // Hash table deleted values, which are only constructed and never copied or destroyed.
+ GRefPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { }
+ bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
+
+ 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* 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()));
+}
+
+template <typename T> inline T* getPtr(const GRefPtr<T>& p)
+{
+ return p.get();
+}
+
+template <typename T> GRefPtr<T> adoptGRef(T* p)
+{
+ return GRefPtr<T>(p, GRefPtrAdopt);
+}
+
+template <> GHashTable* refGPtr(GHashTable* ptr);
+template <> void derefGPtr(GHashTable* ptr);
+template <> GVariant* refGPtr(GVariant* ptr);
+template <> void derefGPtr(GVariant* ptr);
+template <> GSource* refGPtr(GSource* ptr);
+template <> void derefGPtr(GSource* ptr);
+
+template <typename T> inline T* refGPtr(T* ptr)
{
if (ptr)
g_object_ref_sink(ptr);
return ptr;
}
-template <typename T> inline void derefPlatformPtr(T* ptr)
+template <typename T> inline void derefGPtr(T* ptr)
{
if (ptr)
g_object_unref(ptr);
@@ -56,6 +221,9 @@ template <typename T> inline void derefPlatformPtr(T* ptr)
} // namespace WTF
+using WTF::GRefPtr;
+using WTF::adoptGRef;
+
#endif // ENABLE(GLIB_SUPPORT)
#endif // WTF_GRefPtr_h
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index f5e71e0..d43838e 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-03 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Darin Adler.
+
+ Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr
+ https://bugs.webkit.org/show_bug.cgi?id=51846
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp: Change usage of PlatformRefPtr
+ back to GRefPtr.
+
2011-01-04 Zhe Su <suzhe at chromium.org>
Reviewed by Kenneth Russell.
diff --git a/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index 7e1a9c2..ff76e4b 100644
--- a/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -376,7 +376,7 @@ static bool checkElementState(PlatformUIElement element, AtkStateType stateType)
if (!ATK_IS_OBJECT(element))
return false;
- PlatformRefPtr<AtkStateSet> stateSet = adoptPlatformRef(atk_object_ref_state_set(ATK_OBJECT(element)));
+ GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(element)));
return atk_state_set_contains_state(stateSet.get(), stateType);
}
@@ -408,7 +408,7 @@ bool AccessibilityUIElement::isFocused() const
if (!ATK_IS_OBJECT(m_element))
return false;
- PlatformRefPtr<AtkStateSet> stateSet = adoptPlatformRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
+ GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
gboolean isFocused = atk_state_set_contains_state(stateSet.get(), ATK_STATE_FOCUSED);
return isFocused;
@@ -670,7 +670,7 @@ bool AccessibilityUIElement::isFocusable() const
if (!ATK_IS_OBJECT(m_element))
return false;
- PlatformRefPtr<AtkStateSet> stateSet = adoptPlatformRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
+ GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
gboolean isFocusable = atk_state_set_contains_state(stateSet.get(), ATK_STATE_FOCUSABLE);
return isFocusable;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1a18a94..853ca88 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-03 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Darin Adler.
+
+ Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr
+ https://bugs.webkit.org/show_bug.cgi?id=51846
+
+ No new tests. This should not introduce any functional changes.
+
+ Changed all references to PlatformRefPtr in GTK+ code to GRefPtr. Changed
+ all references to PlatformRefPtr in Brew code to RefPtr.
+
2011-01-04 David Kilzer <ddkilzer at apple.com>
<http://webkit.org/b/51890> Move ResourceLoadPriority.h into WebCore/platform/network
diff --git a/WebCore/platform/ContextMenuItem.h b/WebCore/platform/ContextMenuItem.h
index 255750e..441829f 100644
--- a/WebCore/platform/ContextMenuItem.h
+++ b/WebCore/platform/ContextMenuItem.h
@@ -289,7 +289,7 @@ namespace WebCore {
#if PLATFORM(MAC)
RetainPtr<NSMenuItem> m_platformDescription;
#elif PLATFORM(GTK)
- PlatformRefPtr<GtkMenuItem> m_platformDescription;
+ GRefPtr<GtkMenuItem> m_platformDescription;
#else
PlatformMenuItemDescription m_platformDescription;
#endif
diff --git a/WebCore/platform/Cursor.h b/WebCore/platform/Cursor.h
index a962bbb..2d16a9b 100644
--- a/WebCore/platform/Cursor.h
+++ b/WebCore/platform/Cursor.h
@@ -86,7 +86,7 @@ namespace WebCore {
#elif PLATFORM(MAC)
typedef NSCursor *PlatformCursor;
#elif PLATFORM(GTK)
- typedef PlatformRefPtr<GdkCursor> PlatformCursor;
+ typedef GRefPtr<GdkCursor> PlatformCursor;
#elif PLATFORM(EFL)
typedef const char* PlatformCursor;
#elif PLATFORM(QT) && !defined(QT_NO_CURSOR)
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index 66b4c09..2477f49 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -392,8 +392,8 @@ public:
void setScrollOffset(const IntSize& offset) { m_scrollOffset = offset; }
private:
- PlatformRefPtr<GtkAdjustment> m_horizontalAdjustment;
- PlatformRefPtr<GtkAdjustment> m_verticalAdjustment;
+ GRefPtr<GtkAdjustment> m_horizontalAdjustment;
+ GRefPtr<GtkAdjustment> m_verticalAdjustment;
#endif
#if PLATFORM(WX)
diff --git a/WebCore/platform/brew/FileSystemBrew.cpp b/WebCore/platform/brew/FileSystemBrew.cpp
index e207b55..61d568d 100644
--- a/WebCore/platform/brew/FileSystemBrew.cpp
+++ b/WebCore/platform/brew/FileSystemBrew.cpp
@@ -46,7 +46,7 @@ namespace WebCore {
bool getFileSize(const String& path, long long& result)
{
- PlatformRefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
+ RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
FileInfo info;
if (IFILEMGR_GetInfo(fileMgr.get(), path.utf8().data(), &info) == SUCCESS) {
@@ -66,21 +66,21 @@ bool getFileModificationTime(const String& path, time_t& result)
bool fileExists(const String& path)
{
- PlatformRefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
+ RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
return (IFILEMGR_Test(fileMgr.get(), path.utf8().data()) == SUCCESS);
}
bool deleteFile(const String& path)
{
- PlatformRefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
+ RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
return (IFILEMGR_Remove(fileMgr.get(), path.utf8().data()) == SUCCESS);
}
bool deleteEmptyDirectory(const String& path)
{
- PlatformRefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
+ RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
return (IFILEMGR_RmDir(fileMgr.get(), path.utf8().data()) == SUCCESS);
}
@@ -109,7 +109,7 @@ CString fileSystemRepresentation(const String& path)
static String canonicalPath(const String& path)
{
- PlatformRefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
+ RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
// Get the buffer size required to resolve the path.
int canonPathLen;
@@ -162,7 +162,7 @@ static bool makeAllDirectories(IFileMgr* fileManager, const String& path)
bool makeAllDirectories(const String& path)
{
- PlatformRefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
+ RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
return makeAllDirectories(fileMgr.get(), canonicalPath(path));
}
@@ -192,7 +192,7 @@ CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
// use "fs:/~/tmp" as our temporary directory.
String tempPath("fs:/~/tmp");
- PlatformRefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
+ RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR);
// Create the temporary directory if it does not exist.
IFILEMGR_MkDir(fileMgr.get(), tempPath.utf8().data());
diff --git a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
index fc6a753..bd41c9a 100644
--- a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
+++ b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
@@ -221,7 +221,7 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(AEEEvent event, uint16 code, uint32
, m_windowsVirtualKeyCode((type == RawKeyDown || type == KeyUp) ? windowsKeyCodeForKeyEvent(code) : 0)
{
if ((m_type == Char) && modifiers) {
- PlatformRefPtr<IKeysMapping> keysMapping = createRefPtrInstance<IKeysMapping>(AEECLSID_KeysMapping);
+ RefPtr<IKeysMapping> keysMapping = createRefPtrInstance<IKeysMapping>(AEECLSID_KeysMapping);
int result = IKeysMapping_GetMapping(keysMapping.get(), code, modifiers, reinterpret_cast<AECHAR*>(&code));
if (result == AEE_SUCCESS) // Reset the modifier when key code is successfully mapped.
modifiers = 0;
diff --git a/WebCore/platform/brew/ScreenBrew.cpp b/WebCore/platform/brew/ScreenBrew.cpp
index 53e53d0..6316ee0 100644
--- a/WebCore/platform/brew/ScreenBrew.cpp
+++ b/WebCore/platform/brew/ScreenBrew.cpp
@@ -49,7 +49,7 @@ struct DisplayInfo {
static void getDisplayInfo(DisplayInfo& info)
{
IDisplay* display = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIDisplay;
- PlatformRefPtr<IBitmap> bitmap = adoptPlatformRef(IDisplay_GetDestination(display));
+ RefPtr<IBitmap> bitmap = adoptRef(IDisplay_GetDestination(display));
AEEBitmapInfo bitmapInfo;
IBitmap_GetInfo(bitmap.get(), &bitmapInfo, sizeof(AEEBitmapInfo));
diff --git a/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp b/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
index cf0470f..2aa016e 100644
--- a/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
+++ b/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
@@ -45,7 +45,7 @@ String ImageBuffer::toDataURL(const String& mimeType, const double* quality) con
if (type != "jpeg" && type != "png" && type != "tiff" && type != "ico" && type != "bmp")
return "data:,";
- PlatformRefPtr<GdkPixbuf> pixbuf = cairoImageSurfaceToGdkPixbuf(m_data.m_surface);
+ GRefPtr<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 49bcb7d..eb7248b 100644
--- a/WebCore/platform/gtk/ClipboardGtk.cpp
+++ b/WebCore/platform/gtk/ClipboardGtk.cpp
@@ -290,7 +290,7 @@ void ClipboardGtk::declareAndWriteDragImage(Element* element, const KURL& url, c
if (!image || !image->isLoaded())
return;
- PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(image->image()->getGdkPixbuf());
+ GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->image()->getGdkPixbuf());
if (!pixbuf)
return;
diff --git a/WebCore/platform/gtk/CursorGtk.cpp b/WebCore/platform/gtk/CursorGtk.cpp
index 39073ae..9c5c16c 100644
--- a/WebCore/platform/gtk/CursorGtk.cpp
+++ b/WebCore/platform/gtk/CursorGtk.cpp
@@ -39,10 +39,10 @@
namespace WebCore {
-static PlatformRefPtr<GdkCursor> createNamedCursor(CustomCursorType cursorType)
+static GRefPtr<GdkCursor> createNamedCursor(CustomCursorType cursorType)
{
CustomCursor cursor = CustomCursors[cursorType];
- PlatformRefPtr<GdkCursor> c = adoptPlatformRef(gdk_cursor_new_from_name(gdk_display_get_default(), cursor.name));
+ GRefPtr<GdkCursor> c = adoptGRef(gdk_cursor_new_from_name(gdk_display_get_default(), cursor.name));
if (c)
return c;
@@ -55,15 +55,15 @@ static PlatformRefPtr<GdkCursor> createNamedCursor(CustomCursorType cursorType)
cairo_set_source_surface(cr.get(), source.get(), cursor.hot_x, cursor.hot_y);
cairo_mask_surface(cr.get(), mask.get(), cursor.hot_x, cursor.hot_y);
- PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(gdk_pixbuf_get_from_surface(surface.get(), 0, 0, 32, 32));
- return adoptPlatformRef(gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf.get(), 0, 0));
+ GRefPtr<GdkPixbuf> pixbuf = adoptGRef(gdk_pixbuf_get_from_surface(surface.get(), 0, 0, 32, 32));
+ return adoptGRef(gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf.get(), 0, 0));
}
-static PlatformRefPtr<GdkCursor> createCustomCursor(Image* image, const IntPoint& hotSpot)
+static GRefPtr<GdkCursor> createCustomCursor(Image* image, const IntPoint& hotSpot)
{
IntPoint effectiveHotSpot = determineHotSpot(image, hotSpot);
- PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(image->getGdkPixbuf());
- return adoptPlatformRef(gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf.get(), effectiveHotSpot.x(), effectiveHotSpot.y()));
+ GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->getGdkPixbuf());
+ return adoptGRef(gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf.get(), effectiveHotSpot.x(), effectiveHotSpot.y()));
}
void Cursor::ensurePlatformCursor() const
@@ -77,77 +77,77 @@ void Cursor::ensurePlatformCursor() const
m_platformCursor = 0;
break;
case Cursor::Cross:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_CROSS));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_CROSS));
break;
case Cursor::Hand:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_HAND2));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_HAND2));
break;
case Cursor::IBeam:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_XTERM));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_XTERM));
break;
case Cursor::Wait:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_WATCH));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_WATCH));
break;
case Cursor::Help:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_QUESTION_ARROW));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_QUESTION_ARROW));
break;
case Cursor::Move:
case Cursor::MiddlePanning:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_FLEUR));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_FLEUR));
break;
case Cursor::EastResize:
case Cursor::EastPanning:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_RIGHT_SIDE));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_RIGHT_SIDE));
break;
case Cursor::NorthResize:
case Cursor::NorthPanning:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_TOP_SIDE));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_TOP_SIDE));
break;
case Cursor::NorthEastResize:
case Cursor::NorthEastPanning:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_LEFT_SIDE));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_LEFT_SIDE));
break;
case Cursor::NorthWestResize:
case Cursor::NorthWestPanning:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_TOP_LEFT_CORNER));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_TOP_LEFT_CORNER));
break;
case Cursor::SouthResize:
case Cursor::SouthPanning:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_BOTTOM_SIDE));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_BOTTOM_SIDE));
break;
case Cursor::SouthEastResize:
case Cursor::SouthEastPanning:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_BOTTOM_RIGHT_CORNER));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_BOTTOM_RIGHT_CORNER));
break;
case Cursor::SouthWestResize:
case Cursor::SouthWestPanning:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_BOTTOM_LEFT_CORNER));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_BOTTOM_LEFT_CORNER));
break;
case Cursor::WestResize:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_LEFT_SIDE));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_LEFT_SIDE));
break;
case Cursor::NorthSouthResize:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_TOP_TEE));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_TOP_TEE));
break;
case Cursor::EastWestResize:
case Cursor::WestPanning:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_LEFT_SIDE));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_LEFT_SIDE));
break;
case Cursor::NorthEastSouthWestResize:
case Cursor::NorthWestSouthEastResize:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_SIZING));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_SIZING));
break;
case Cursor::ColumnResize:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW));
break;
case Cursor::RowResize:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW));
+ m_platformCursor = adoptGRef(gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW));
break;
case Cursor::VerticalText:
m_platformCursor = createNamedCursor(CustomCursorVerticalText);
break;
case Cursor::Cell:
- m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_PLUS));
+ m_platformCursor = adoptGRef(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 f6b13fd..5423f81 100644
--- a/WebCore/platform/gtk/DataObjectGtk.h
+++ b/WebCore/platform/gtk/DataObjectGtk.h
@@ -73,8 +73,8 @@ private:
KURL m_url;
String m_uriList;
Vector<String> m_filenames;
- PlatformRefPtr<GdkPixbuf> m_image;
- PlatformRefPtr<GdkDragContext> m_dragContext;
+ GRefPtr<GdkPixbuf> m_image;
+ GRefPtr<GdkDragContext> m_dragContext;
RefPtr<Range> m_range;
};
diff --git a/WebCore/platform/gtk/FileSystemGtk.cpp b/WebCore/platform/gtk/FileSystemGtk.cpp
index 1f6c953..b8aa102 100644
--- a/WebCore/platform/gtk/FileSystemGtk.cpp
+++ b/WebCore/platform/gtk/FileSystemGtk.cpp
@@ -217,7 +217,7 @@ CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
{
GOwnPtr<gchar> filename(g_strdup_printf("%s%s", prefix, createCanonicalUUIDString().utf8().data()));
GOwnPtr<gchar> tempPath(g_build_filename(g_get_tmp_dir(), filename.get(), NULL));
- PlatformRefPtr<GFile> file = adoptPlatformRef(g_file_new_for_path(tempPath.get()));
+ GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(tempPath.get()));
handle = g_file_create_readwrite(file.get(), G_FILE_CREATE_NONE, 0, 0);
if (!isHandleValid(handle))
@@ -231,7 +231,7 @@ PlatformFileHandle openFile(const String& path, FileOpenMode mode)
if (fsRep.isNull())
return invalidPlatformFileHandle;
- PlatformRefPtr<GFile> file = adoptPlatformRef(g_file_new_for_path(fsRep.data()));
+ GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(fsRep.data()));
GFileIOStream* ioStream = 0;
if (mode == OpenForRead)
ioStream = g_file_open_readwrite(file.get(), 0, 0);
diff --git a/WebCore/platform/gtk/GRefPtrGtk.cpp b/WebCore/platform/gtk/GRefPtrGtk.cpp
index 83129cc..6647b99 100644
--- a/WebCore/platform/gtk/GRefPtrGtk.cpp
+++ b/WebCore/platform/gtk/GRefPtrGtk.cpp
@@ -25,27 +25,27 @@
namespace WTF {
-template <> GtkTargetList* refPlatformPtr(GtkTargetList* ptr)
+template <> GtkTargetList* refGPtr(GtkTargetList* ptr)
{
if (ptr)
gtk_target_list_ref(ptr);
return ptr;
}
-template <> void derefPlatformPtr(GtkTargetList* ptr)
+template <> void derefGPtr(GtkTargetList* ptr)
{
if (ptr)
gtk_target_list_unref(ptr);
}
-template <> GdkCursor* refPlatformPtr(GdkCursor* ptr)
+template <> GdkCursor* refGPtr(GdkCursor* ptr)
{
if (ptr)
gdk_cursor_ref(ptr);
return ptr;
}
-template <> void derefPlatformPtr(GdkCursor* ptr)
+template <> void derefGPtr(GdkCursor* ptr)
{
if (ptr)
gdk_cursor_unref(ptr);
diff --git a/WebCore/platform/gtk/GRefPtrGtk.h b/WebCore/platform/gtk/GRefPtrGtk.h
index 5e6ab78..1fb9772 100644
--- a/WebCore/platform/gtk/GRefPtrGtk.h
+++ b/WebCore/platform/gtk/GRefPtrGtk.h
@@ -21,15 +21,15 @@
#ifndef GRefPtrGtk_h
#define GRefPtrGtk_h
-#include "GRefPtr.h"
+#include <wtf/gobject/GRefPtr.h>
namespace WTF {
-template <> GtkTargetList* refPlatformPtr(GtkTargetList* ptr);
-template <> void derefPlatformPtr(GtkTargetList* ptr);
+template <> GtkTargetList* refGPtr(GtkTargetList* ptr);
+template <> void derefGPtr(GtkTargetList* ptr);
-template <> GdkCursor* refPlatformPtr(GdkCursor* ptr);
-template <> void derefPlatformPtr(GdkCursor* ptr);
+template <> GdkCursor* refGPtr(GdkCursor* ptr);
+template <> void derefGPtr(GdkCursor* ptr);
}
diff --git a/WebCore/platform/gtk/MainFrameScrollbarGtk.h b/WebCore/platform/gtk/MainFrameScrollbarGtk.h
index 8271ef5..f184425 100644
--- a/WebCore/platform/gtk/MainFrameScrollbarGtk.h
+++ b/WebCore/platform/gtk/MainFrameScrollbarGtk.h
@@ -44,7 +44,7 @@ private:
MainFrameScrollbarGtk(ScrollbarClient*, ScrollbarOrientation, GtkAdjustment*);
static void gtkValueChanged(GtkAdjustment*, MainFrameScrollbarGtk*);
- PlatformRefPtr<GtkAdjustment> m_adjustment;
+ GRefPtr<GtkAdjustment> m_adjustment;
};
}
diff --git a/WebCore/platform/gtk/PasteboardGtk.cpp b/WebCore/platform/gtk/PasteboardGtk.cpp
index 76b7bb0..4cd5dc0 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);
- PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(image->getGdkPixbuf());
+ GRefPtr<GdkPixbuf> pixbuf = adoptGRef(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 4428be0..013789f 100644
--- a/WebCore/platform/gtk/PasteboardHelper.cpp
+++ b/WebCore/platform/gtk/PasteboardHelper.cpp
@@ -248,7 +248,7 @@ Vector<GdkAtom> PasteboardHelper::dropAtomsForContext(GtkWidget* widget, GdkDrag
dropAtoms.append(netscapeURLAtom);
// For images, try to find the most applicable image type.
- PlatformRefPtr<GtkTargetList> list(gtk_target_list_new(0, 0));
+ GRefPtr<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 e47fda6..7f2fc36 100644
--- a/WebCore/platform/gtk/PopupMenuGtk.h
+++ b/WebCore/platform/gtk/PopupMenuGtk.h
@@ -59,7 +59,7 @@ private:
PopupMenuClient* m_popupClient;
IntPoint m_menuPosition;
- PlatformRefPtr<GtkMenu> m_popup;
+ GRefPtr<GtkMenu> m_popup;
HashMap<GtkWidget*, int> m_indexMap;
String m_currentSearchString;
uint32_t m_previousKeyEventTimestamp;
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp
index 8fca711..061028b 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -70,7 +70,7 @@ void RenderThemeGtk::initMediaButtons()
if (iconsInitialized)
return;
- PlatformRefPtr<GtkIconFactory> iconFactory = adoptPlatformRef(gtk_icon_factory_new());
+ GRefPtr<GtkIconFactory> iconFactory = adoptGRef(gtk_icon_factory_new());
GtkIconSource* iconSource = gtk_icon_source_new();
const char* icons[] = { "audio-volume-high", "audio-volume-muted" };
@@ -326,9 +326,9 @@ static IntPoint centerRectVerticallyInParentInputElement(RenderObject* object, c
bool RenderThemeGtk::paintSearchFieldResultsDecoration(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
{
- PlatformRefPtr<GdkPixbuf> icon = getStockIcon(GTK_TYPE_ENTRY, GTK_STOCK_FIND,
- gtkTextDirection(renderObject->style()->direction()),
- gtkIconState(renderObject), GTK_ICON_SIZE_MENU);
+ GRefPtr<GdkPixbuf> icon = getStockIcon(GTK_TYPE_ENTRY, GTK_STOCK_FIND,
+ gtkTextDirection(renderObject->style()->direction()),
+ gtkIconState(renderObject), GTK_ICON_SIZE_MENU);
paintGdkPixbuf(paintInfo.context, icon.get(), centerRectVerticallyInParentInputElement(renderObject, rect));
return false;
}
@@ -346,9 +346,9 @@ void RenderThemeGtk::adjustSearchFieldCancelButtonStyle(CSSStyleSelector* select
bool RenderThemeGtk::paintSearchFieldCancelButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
{
- PlatformRefPtr<GdkPixbuf> icon = getStockIcon(GTK_TYPE_ENTRY, GTK_STOCK_CLEAR,
- gtkTextDirection(renderObject->style()->direction()),
- gtkIconState(renderObject), GTK_ICON_SIZE_MENU);
+ GRefPtr<GdkPixbuf> icon = getStockIcon(GTK_TYPE_ENTRY, GTK_STOCK_CLEAR,
+ gtkTextDirection(renderObject->style()->direction()),
+ gtkIconState(renderObject), GTK_ICON_SIZE_MENU);
paintGdkPixbuf(paintInfo.context, icon.get(), centerRectVerticallyInParentInputElement(renderObject, rect));
return false;
}
@@ -447,10 +447,10 @@ String RenderThemeGtk::extraMediaControlsStyleSheet()
bool RenderThemeGtk::paintMediaButton(RenderObject* renderObject, GraphicsContext* context, const IntRect& rect, const char* iconName)
{
- PlatformRefPtr<GdkPixbuf> icon = getStockIcon(GTK_TYPE_CONTAINER, iconName,
- gtkTextDirection(renderObject->style()->direction()),
- gtkIconState(renderObject),
- getMediaButtonIconSize(m_mediaIconSize));
+ GRefPtr<GdkPixbuf> icon = getStockIcon(GTK_TYPE_CONTAINER, iconName,
+ gtkTextDirection(renderObject->style()->direction()),
+ gtkIconState(renderObject),
+ getMediaButtonIconSize(m_mediaIconSize));
IntPoint iconPoint(rect.x() + (rect.width() - m_mediaIconSize) / 2,
rect.y() + (rect.height() - m_mediaIconSize) / 2);
context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB);
diff --git a/WebCore/platform/gtk/RenderThemeGtk.h b/WebCore/platform/gtk/RenderThemeGtk.h
index 29bf66a..b7c3b79 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.h
+++ b/WebCore/platform/gtk/RenderThemeGtk.h
@@ -174,7 +174,7 @@ private:
#endif
GtkStateType gtkIconState(RenderObject*);
static void setTextInputBorders(RenderStyle*);
- PlatformRefPtr<GdkPixbuf> getStockIcon(GType, const char* iconName, gint direction, gint state, gint iconSize);
+ GRefPtr<GdkPixbuf> getStockIcon(GType, const char* iconName, gint direction, gint state, gint iconSize);
mutable GtkWidget* m_gtkWindow;
mutable GtkWidget* m_gtkContainer;
diff --git a/WebCore/platform/gtk/RenderThemeGtk2.cpp b/WebCore/platform/gtk/RenderThemeGtk2.cpp
index e37f924..7e98f08 100644
--- a/WebCore/platform/gtk/RenderThemeGtk2.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk2.cpp
@@ -375,16 +375,16 @@ bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInf
}
#endif
-PlatformRefPtr<GdkPixbuf> RenderThemeGtk::getStockIcon(GType widgetType, const char* iconName, gint direction, gint state, gint iconSize)
+GRefPtr<GdkPixbuf> RenderThemeGtk::getStockIcon(GType widgetType, const char* iconName, gint direction, gint state, gint iconSize)
{
ASSERT(widgetType == GTK_TYPE_CONTAINER || widgetType == GTK_TYPE_ENTRY);
GtkWidget* widget = widgetType == GTK_TYPE_CONTAINER ? GTK_WIDGET(gtkContainer()) : gtkEntry();
GtkStyle* style = gtk_widget_get_style(widget);
GtkIconSet* iconSet = gtk_style_lookup_icon_set(style, iconName);
- return adoptPlatformRef(gtk_icon_set_render_icon(iconSet, style,
- static_cast<GtkTextDirection>(direction),
- static_cast<GtkStateType>(state),
- static_cast<GtkIconSize>(iconSize), 0, 0));
+ return adoptGRef(gtk_icon_set_render_icon(iconSet, style,
+ static_cast<GtkTextDirection>(direction),
+ static_cast<GtkStateType>(state),
+ static_cast<GtkIconSize>(iconSize), 0, 0));
}
diff --git a/WebCore/platform/gtk/RenderThemeGtk3.cpp b/WebCore/platform/gtk/RenderThemeGtk3.cpp
index ee33c3b..afd2eb2 100644
--- a/WebCore/platform/gtk/RenderThemeGtk3.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk3.cpp
@@ -47,7 +47,7 @@
namespace WebCore {
-typedef HashMap<GType, PlatformRefPtr<GtkStyleContext> > StyleContextMap;
+typedef HashMap<GType, GRefPtr<GtkStyleContext> > StyleContextMap;
static StyleContextMap& styleContextMap();
static void gtkStyleChangedCallback(GObject*, GParamSpec*)
@@ -82,7 +82,7 @@ static GtkStyleContext* getStyleContext(GType widgetType)
GtkWidgetPath* path = gtk_widget_path_new();
gtk_widget_path_append_type(path, widgetType);
- PlatformRefPtr<GtkStyleContext> context = adoptPlatformRef(gtk_style_context_new());
+ GRefPtr<GtkStyleContext> context = adoptGRef(gtk_style_context_new());
gtk_style_context_set_path(context.get(), path);
gtk_widget_path_free(path);
@@ -410,7 +410,7 @@ bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInf
}
#endif
-PlatformRefPtr<GdkPixbuf> RenderThemeGtk::getStockIcon(GType widgetType, const char* iconName, gint direction, gint state, gint iconSize)
+GRefPtr<GdkPixbuf> RenderThemeGtk::getStockIcon(GType widgetType, const char* iconName, gint direction, gint state, gint iconSize)
{
GtkStyleContext* context = getStyleContext(widgetType);
GtkIconSet* iconSet = gtk_style_context_lookup_icon_set(context, iconName);
@@ -429,7 +429,7 @@ PlatformRefPtr<GdkPixbuf> RenderThemeGtk::getStockIcon(GType widgetType, const c
gtk_style_context_restore(context);
- return adoptPlatformRef(icon);
+ return adoptGRefPtr(icon);
}
Color RenderThemeGtk::platformActiveSelectionBackgroundColor() const
diff --git a/WebCore/platform/network/ResourceHandleInternal.h b/WebCore/platform/network/ResourceHandleInternal.h
index 9cccecd..d833e32 100644
--- a/WebCore/platform/network/ResourceHandleInternal.h
+++ b/WebCore/platform/network/ResourceHandleInternal.h
@@ -132,7 +132,7 @@ namespace WebCore {
m_pass = url.pass();
m_firstRequest.removeCredentials();
#if USE(SOUP)
- m_requester = adoptPlatformRef(webkit_soup_requester_new());
+ m_requester = adoptGRef(webkit_soup_requester_new());
#endif
}
@@ -186,13 +186,13 @@ namespace WebCore {
Vector<char> m_postBytes;
#endif
#if USE(SOUP)
- PlatformRefPtr<SoupMessage> m_soupMessage;
+ GRefPtr<SoupMessage> m_soupMessage;
ResourceResponse m_response;
bool m_cancelled;
- PlatformRefPtr<WebKitSoupRequest> m_soupRequest;
- PlatformRefPtr<WebKitSoupRequester> m_requester;
- PlatformRefPtr<GInputStream> m_inputStream;
- PlatformRefPtr<GCancellable> m_cancellable;
+ GRefPtr<WebKitSoupRequest> m_soupRequest;
+ GRefPtr<WebKitSoupRequester> m_requester;
+ GRefPtr<GInputStream> m_inputStream;
+ GRefPtr<GCancellable> m_cancellable;
char* m_buffer;
gsize m_total;
guint m_idleHandler;
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index a2440d3..8900b18 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -353,14 +353,14 @@ static gboolean parseDataUrl(gpointer callbackData)
SoupSession* session = handle->defaultSession();
GOwnPtr<GError> error;
- d->m_soupRequest = adoptPlatformRef(webkit_soup_requester_request(d->m_requester.get(), handle->firstRequest().url().string().utf8().data(), session, &error.outPtr()));
+ d->m_soupRequest = adoptGRef(webkit_soup_requester_request(d->m_requester.get(), handle->firstRequest().url().string().utf8().data(), session, &error.outPtr()));
if (error) {
d->m_soupRequest = 0;
client->didFinishLoading(handle, 0);
return false;
}
- d->m_inputStream = adoptPlatformRef(webkit_soup_request_send(d->m_soupRequest.get(), 0, &error.outPtr()));
+ d->m_inputStream = adoptGRef(webkit_soup_request_send(d->m_soupRequest.get(), 0, &error.outPtr()));
if (error) {
d->m_inputStream = 0;
client->didFinishLoading(handle, 0);
@@ -374,7 +374,7 @@ static gboolean parseDataUrl(gpointer callbackData)
// balanced by a deref() in cleanupSoupRequestOperation, which should always run
handle->ref();
- d->m_cancellable = adoptPlatformRef(g_cancellable_new());
+ d->m_cancellable = adoptGRef(g_cancellable_new());
g_input_stream_read_async(d->m_inputStream.get(), d->m_buffer, READ_BUFFER_SIZE, G_PRIORITY_DEFAULT,
d->m_cancellable.get(), readCallback, GINT_TO_POINTER(!isBase64));
@@ -531,7 +531,7 @@ static void sendRequestCallback(GObject* source, GAsyncResult* res, gpointer use
return;
}
- d->m_inputStream = adoptPlatformRef(in);
+ d->m_inputStream = adoptGRef(in);
d->m_buffer = static_cast<char*>(g_slice_alloc0(READ_BUFFER_SIZE));
d->m_total = 0;
@@ -575,7 +575,7 @@ static bool startHttp(ResourceHandle* handle)
request.setURL(url);
GOwnPtr<GError> error;
- d->m_soupRequest = adoptPlatformRef(webkit_soup_requester_request(d->m_requester.get(), url.string().utf8().data(), session, &error.outPtr()));
+ d->m_soupRequest = adoptGRef(webkit_soup_requester_request(d->m_requester.get(), url.string().utf8().data(), session, &error.outPtr()));
if (error) {
d->m_soupRequest = 0;
return false;
@@ -583,7 +583,7 @@ static bool startHttp(ResourceHandle* handle)
g_object_set_data(G_OBJECT(d->m_soupRequest.get()), "webkit-resource", handle);
- d->m_soupMessage = adoptPlatformRef(webkit_soup_request_http_get_message(WEBKIT_SOUP_REQUEST_HTTP(d->m_soupRequest.get())));
+ d->m_soupMessage = adoptGRef(webkit_soup_request_http_get_message(WEBKIT_SOUP_REQUEST_HTTP(d->m_soupRequest.get())));
if (!d->m_soupMessage)
return false;
@@ -668,7 +668,7 @@ static bool startHttp(ResourceHandle* handle)
// Send the request only if it's not been explicitely deferred.
if (!d->m_defersLoading) {
- d->m_cancellable = adoptPlatformRef(g_cancellable_new());
+ d->m_cancellable = adoptGRef(g_cancellable_new());
webkit_soup_request_send_async(d->m_soupRequest.get(), d->m_cancellable.get(), sendRequestCallback, 0);
}
@@ -751,7 +751,7 @@ void ResourceHandle::platformSetDefersLoading(bool defersLoading)
return;
if (!defersLoading && !d->m_cancellable && d->m_soupRequest.get()) {
- d->m_cancellable = adoptPlatformRef(g_cancellable_new());
+ d->m_cancellable = adoptGRef(g_cancellable_new());
webkit_soup_request_send_async(d->m_soupRequest.get(), d->m_cancellable.get(), sendRequestCallback, 0);
return;
}
@@ -888,7 +888,7 @@ static bool startGio(ResourceHandle* handle, KURL url)
CString urlStr = url.string().utf8();
GOwnPtr<GError> error;
- d->m_soupRequest = adoptPlatformRef(webkit_soup_requester_request(d->m_requester.get(), urlStr.data(), session, &error.outPtr()));
+ d->m_soupRequest = adoptGRef(webkit_soup_requester_request(d->m_requester.get(), urlStr.data(), session, &error.outPtr()));
if (error) {
d->m_soupRequest = 0;
return false;
@@ -899,7 +899,7 @@ static bool startGio(ResourceHandle* handle, KURL url)
// balanced by a deref() in cleanupSoupRequestOperation, which should always run
handle->ref();
- d->m_cancellable = adoptPlatformRef(g_cancellable_new());
+ d->m_cancellable = adoptGRef(g_cancellable_new());
webkit_soup_request_send_async(d->m_soupRequest.get(), d->m_cancellable.get(), sendRequestCallback, 0);
return true;
diff --git a/WebCore/platform/network/soup/SocketStreamHandle.h b/WebCore/platform/network/soup/SocketStreamHandle.h
index 08d2d94..3168fae 100644
--- a/WebCore/platform/network/soup/SocketStreamHandle.h
+++ b/WebCore/platform/network/soup/SocketStreamHandle.h
@@ -58,10 +58,10 @@ namespace WebCore {
virtual void platformClose();
private:
- PlatformRefPtr<GSocketConnection> m_socketConnection;
- PlatformRefPtr<GInputStream> m_inputStream;
- PlatformRefPtr<GOutputStream> m_outputStream;
- PlatformRefPtr<GSource> m_writeReadySource;
+ GRefPtr<GSocketConnection> m_socketConnection;
+ GRefPtr<GInputStream> m_inputStream;
+ GRefPtr<GOutputStream> m_outputStream;
+ GRefPtr<GSource> m_writeReadySource;
char* m_readBuffer;
void* m_id;
diff --git a/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp b/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp
index 7f62d5a..841e209 100644
--- a/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp
+++ b/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp
@@ -88,7 +88,7 @@ SocketStreamHandle::SocketStreamHandle(const KURL& url, SocketStreamHandleClient
unsigned int port = url.hasPort() ? url.port() : 80;
m_id = activateHandle(this);
- PlatformRefPtr<GSocketClient> socketClient = adoptPlatformRef(g_socket_client_new());
+ GRefPtr<GSocketClient> socketClient = adoptGRef(g_socket_client_new());
g_socket_client_connect_to_host_async(socketClient.get(), url.host().utf8().data(), port, 0,
reinterpret_cast<GAsyncReadyCallback>(connectedCallback), m_id);
}
@@ -107,7 +107,7 @@ void SocketStreamHandle::connected(GSocketConnection* socketConnection, GError*
return;
}
- m_socketConnection = adoptPlatformRef(socketConnection);
+ m_socketConnection = adoptGRef(socketConnection);
m_outputStream = g_io_stream_get_output_stream(G_IO_STREAM(m_socketConnection.get()));
m_inputStream = g_io_stream_get_input_stream(G_IO_STREAM(m_socketConnection.get()));
@@ -222,7 +222,7 @@ void SocketStreamHandle::beginWaitingForSocketWritability()
if (m_writeReadySource) // Already waiting.
return;
- m_writeReadySource = adoptPlatformRef(g_socket_create_source(
+ m_writeReadySource = adoptGRef(g_socket_create_source(
g_socket_connection_get_socket(m_socketConnection.get()), static_cast<GIOCondition>(G_IO_OUT), 0));
g_source_set_callback(m_writeReadySource.get(), reinterpret_cast<GSourceFunc>(writeReadyCallback), m_id, 0);
g_source_attach(m_writeReadySource.get(), 0);
diff --git a/WebCore/platform/text/gtk/TextCodecGtk.cpp b/WebCore/platform/text/gtk/TextCodecGtk.cpp
index 9308b33..c5bd7e8 100644
--- a/WebCore/platform/text/gtk/TextCodecGtk.cpp
+++ b/WebCore/platform/text/gtk/TextCodecGtk.cpp
@@ -422,14 +422,14 @@ void TextCodecGtk::createIConvDecoder() const
{
ASSERT(!m_iconvDecoder);
- m_iconvDecoder = adoptPlatformRef(g_charset_converter_new(internalEncodingName, m_encoding.name(), 0));
+ m_iconvDecoder = adoptGRef(g_charset_converter_new(internalEncodingName, m_encoding.name(), 0));
}
void TextCodecGtk::createIConvEncoder() const
{
ASSERT(!m_iconvEncoder);
- m_iconvEncoder = adoptPlatformRef(g_charset_converter_new(m_encoding.name(), internalEncodingName, 0));
+ m_iconvEncoder = adoptGRef(g_charset_converter_new(m_encoding.name(), internalEncodingName, 0));
}
String TextCodecGtk::decode(const char* bytes, size_t length, bool flush, bool stopOnError, bool& sawError)
diff --git a/WebCore/platform/text/gtk/TextCodecGtk.h b/WebCore/platform/text/gtk/TextCodecGtk.h
index 1fb8df9..bb3a445 100644
--- a/WebCore/platform/text/gtk/TextCodecGtk.h
+++ b/WebCore/platform/text/gtk/TextCodecGtk.h
@@ -57,8 +57,8 @@ namespace WebCore {
TextEncoding m_encoding;
size_t m_numBufferedBytes;
unsigned char m_bufferedBytes[16]; // bigger than any single multi-byte character
- mutable PlatformRefPtr<GCharsetConverter> m_iconvDecoder;
- mutable PlatformRefPtr<GCharsetConverter> m_iconvEncoder;
+ mutable GRefPtr<GCharsetConverter> m_iconvDecoder;
+ mutable GRefPtr<GCharsetConverter> m_iconvEncoder;
};
} // namespace WebCore
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index e943c6e..ce79fda 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,12 @@
+2011-01-03 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Darin Adler.
+
+ Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr
+ https://bugs.webkit.org/show_bug.cgi?id=51846
+
+ Changed all references to PlatformRefPtr in GTK+ code to GRefPtr.
+
2011-01-03 Gustavo Noronha Silva <gustavo.noronha at collabora.co.uk>
Reviewed by Martin Robinson.
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 6df5980..7f39d37 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -157,7 +157,7 @@ Page* ChromeClient::createWindow(Frame* frame, const FrameLoadRequest& frameLoad
if (!webView)
return 0;
- PlatformRefPtr<WebKitWebWindowFeatures> webWindowFeatures(adoptPlatformRef(kitNew(coreFeatures)));
+ GRefPtr<WebKitWebWindowFeatures> webWindowFeatures(adoptGRef(kitNew(coreFeatures)));
g_object_set(webView, "window-features", webWindowFeatures.get(), NULL);
if (!frameLoadRequest.isEmpty())
@@ -657,7 +657,7 @@ void ChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocatio
WebKitWebFrame* webFrame = kit(frame);
WebKitWebView* webView = getViewFromFrame(webFrame);
- PlatformRefPtr<WebKitGeolocationPolicyDecision> policyDecision(adoptPlatformRef(webkit_geolocation_policy_decision_new(webFrame, geolocation)));
+ GRefPtr<WebKitGeolocationPolicyDecision> policyDecision(adoptGRef(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/DocumentLoaderGtk.cpp b/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp
index bedb129..6031b62 100644
--- a/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp
@@ -69,7 +69,7 @@ void DocumentLoader::attachToFrame()
// We may get to here without having a datasource, when the data
// is coming from the page cache.
- PlatformRefPtr<WebKitWebDataSource> dataSource(adoptPlatformRef(kitNew(this)));
+ GRefPtr<WebKitWebDataSource> dataSource(adoptGRef(kitNew(this)));
setDataSource(dataSource.get());
}
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
index dbe7ddd..c92c083 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
@@ -103,7 +103,7 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin,
WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame));
RefPtr<DataObjectGtk> dataObject = clipboardGtk->dataObject();
- PlatformRefPtr<GtkTargetList> targetList(clipboardGtk->helper()->targetListForDataObject(dataObject.get()));
+ GRefPtr<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/DragClientGtk.h b/WebKit/gtk/WebCoreSupport/DragClientGtk.h
index 086ec69..9c6d948 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.h
@@ -59,7 +59,7 @@ namespace WebKit {
private:
WebKitWebView* m_webView;
WebCore::IntPoint m_startPos;
- PlatformRefPtr<GtkWidget> m_dragIconWindow;
+ GRefPtr<GtkWidget> m_dragIconWindow;
RefPtr<cairo_surface_t> m_dragImage;
};
}
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index 1d80cbe..ee9bf9a 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -270,7 +270,7 @@ void EditorClient::setInputMethodState(bool active)
bool EditorClient::shouldDeleteRange(Range* range)
{
gboolean accept = TRUE;
- PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range)));
+ GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range)));
g_signal_emit_by_name(m_webView, "should-delete-range", kitRange.get(), &accept);
return accept;
}
@@ -278,7 +278,7 @@ bool EditorClient::shouldDeleteRange(Range* range)
bool EditorClient::shouldShowDeleteInterface(HTMLElement* element)
{
gboolean accept = TRUE;
- PlatformRefPtr<WebKitDOMHTMLElement> kitElement(adoptPlatformRef(kit(element)));
+ GRefPtr<WebKitDOMHTMLElement> kitElement(adoptGRef(kit(element)));
g_signal_emit_by_name(m_webView, "should-show-delete-interface-for-element", kitElement.get(), &accept);
return accept;
}
@@ -310,7 +310,7 @@ bool EditorClient::shouldBeginEditing(WebCore::Range* range)
clearPendingComposition();
gboolean accept = TRUE;
- PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range)));
+ GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range)));
g_signal_emit_by_name(m_webView, "should-begin-editing", kitRange.get(), &accept);
return accept;
}
@@ -320,7 +320,7 @@ bool EditorClient::shouldEndEditing(WebCore::Range* range)
clearPendingComposition();
gboolean accept = TRUE;
- PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range)));
+ GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range)));
g_signal_emit_by_name(m_webView, "should-end-editing", kitRange.get(), &accept);
return accept;
}
@@ -342,7 +342,7 @@ static WebKitInsertAction kit(EditorInsertAction action)
bool EditorClient::shouldInsertText(const String& string, Range* range, EditorInsertAction action)
{
gboolean accept = TRUE;
- PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range)));
+ GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range)));
g_signal_emit_by_name(m_webView, "should-insert-text", string.utf8().data(), kitRange.get(), kit(action), &accept);
return accept;
}
@@ -362,8 +362,8 @@ static WebKitSelectionAffinity kit(EAffinity affinity)
bool EditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity affinity, bool stillSelecting)
{
gboolean accept = TRUE;
- PlatformRefPtr<WebKitDOMRange> kitFromRange(fromRange ? adoptPlatformRef(kit(fromRange)) : 0);
- PlatformRefPtr<WebKitDOMRange> kitToRange(toRange ? adoptPlatformRef(kit(toRange)) : 0);
+ GRefPtr<WebKitDOMRange> kitFromRange(fromRange ? adoptGRef(kit(fromRange)) : 0);
+ GRefPtr<WebKitDOMRange> kitToRange(toRange ? adoptGRef(kit(toRange)) : 0);
g_signal_emit_by_name(m_webView, "should-change-selected-range", kitFromRange.get(), kitToRange.get(),
kit(affinity), stillSelecting, &accept);
return accept;
@@ -372,8 +372,8 @@ bool EditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange, E
bool EditorClient::shouldApplyStyle(WebCore::CSSStyleDeclaration* declaration, WebCore::Range* range)
{
gboolean accept = TRUE;
- PlatformRefPtr<WebKitDOMCSSStyleDeclaration> kitDeclaration(kit(declaration));
- PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range)));
+ GRefPtr<WebKitDOMCSSStyleDeclaration> kitDeclaration(kit(declaration));
+ GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range)));
g_signal_emit_by_name(m_webView, "should-apply-style", kitDeclaration.get(), kitRange.get(), &accept);
return accept;
}
@@ -543,8 +543,8 @@ void EditorClient::redo()
bool EditorClient::shouldInsertNode(Node* node, Range* range, EditorInsertAction action)
{
gboolean accept = TRUE;
- PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range)));
- PlatformRefPtr<WebKitDOMNode> kitNode(adoptPlatformRef(kit(node)));
+ GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range)));
+ GRefPtr<WebKitDOMNode> kitNode(adoptGRef(kit(node)));
g_signal_emit_by_name(m_webView, "should-insert-node", kitNode.get(), kitRange.get(), kit(action), &accept);
return accept;
}
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
index f2db1d9..214dbd6 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
@@ -140,7 +140,7 @@ namespace WebKit {
bool m_treatContextCommitAsKeyEvent;
GOwnPtr<gchar> m_pendingComposition;
Vector<const char*> m_pendingEditorCommands;
- PlatformRefPtr<GtkWidget> m_nativeWidget;
+ GRefPtr<GtkWidget> m_nativeWidget;
};
}
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 5302257..13cbc59 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -244,7 +244,7 @@ WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClient::createDocumentLoader
{
RefPtr<WebKit::DocumentLoader> loader = WebKit::DocumentLoader::create(request, substituteData);
- PlatformRefPtr<WebKitWebDataSource> webDataSource(adoptPlatformRef(kitNew(loader.get())));
+ GRefPtr<WebKitWebDataSource> webDataSource(adoptGRef(kitNew(loader.get())));
loader->setDataSource(webDataSource.get());
return loader.release();
@@ -312,19 +312,19 @@ static char* toString(unsigned long identifier)
void FrameLoaderClient::dispatchWillSendRequest(WebCore::DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
{
- PlatformRefPtr<WebKitNetworkResponse> networkResponse(0);
+ GRefPtr<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 = adoptPlatformRef(kitNew(redirectResponse));
+ networkResponse = adoptGRef(kitNew(redirectResponse));
WebKitWebView* webView = getViewFromFrame(m_frame);
GOwnPtr<gchar> identifierString(toString(identifier));
WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
- PlatformRefPtr<WebKitNetworkRequest> networkRequest(adoptPlatformRef(kitNew(request)));
+ GRefPtr<WebKitNetworkRequest> networkRequest(adoptGRef(kitNew(request)));
if (!redirectResponse.isNull()) {
// This is a redirect, so we need to update the WebResource's knowledge
@@ -418,7 +418,7 @@ void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction poli
}
WebKitWebView* page = getViewFromFrame(m_frame);
- PlatformRefPtr<WebKitNetworkRequest> request(adoptPlatformRef(kitNew(resourceRequest)));
+ GRefPtr<WebKitNetworkRequest> request(adoptGRef(kitNew(resourceRequest)));
WebKitWebPolicyDecision* policyDecision = webkit_web_policy_decision_new(m_frame, policyFunction);
if (m_policyDecision)
@@ -431,7 +431,7 @@ void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction poli
if (isHandled)
return;
- PlatformRefPtr<WebKitNetworkResponse> networkResponse(adoptPlatformRef(webkit_web_frame_get_network_response(m_frame)));
+ GRefPtr<WebKitNetworkResponse> networkResponse(adoptGRef(webkit_web_frame_get_network_response(m_frame)));
if (networkResponse) {
ResourceResponse response = core(networkResponse.get());
if (response.isAttachment()) {
@@ -498,8 +498,8 @@ void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFuncti
m_policyDecision = policyDecision;
WebKitWebView* webView = getViewFromFrame(m_frame);
- PlatformRefPtr<WebKitNetworkRequest> request(adoptPlatformRef(webkit_network_request_new(resourceRequest.url().string().utf8().data())));
- PlatformRefPtr<WebKitWebNavigationAction> navigationAction(adoptPlatformRef(getNavigationAction(action, frameName.utf8().data())));
+ GRefPtr<WebKitNetworkRequest> request(adoptGRef(webkit_network_request_new(resourceRequest.url().string().utf8().data())));
+ GRefPtr<WebKitWebNavigationAction> navigationAction(adoptGRef(getNavigationAction(action, frameName.utf8().data())));
gboolean isHandled = false;
g_signal_emit_by_name(webView, "new-window-policy-decision-requested", m_frame, request.get(), navigationAction.get(), policyDecision, &isHandled);
@@ -522,7 +522,7 @@ void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunct
}
WebKitWebView* webView = getViewFromFrame(m_frame);
- PlatformRefPtr<WebKitNetworkRequest> request(adoptPlatformRef(kitNew(resourceRequest)));
+ GRefPtr<WebKitNetworkRequest> request(adoptGRef(kitNew(resourceRequest)));
WebKitNavigationResponse response;
/*
* We still support the deprecated navigation-requested signal, if the
@@ -543,7 +543,7 @@ void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunct
g_object_unref(m_policyDecision);
m_policyDecision = policyDecision;
- PlatformRefPtr<WebKitWebNavigationAction> navigationAction(adoptPlatformRef(getNavigationAction(action, 0)));
+ GRefPtr<WebKitWebNavigationAction> navigationAction(adoptGRef(getNavigationAction(action, 0)));
gboolean isHandled = false;
g_signal_emit_by_name(webView, "navigation-policy-decision-requested", m_frame, request.get(), navigationAction.get(), policyDecision, &isHandled);
@@ -559,7 +559,7 @@ PassRefPtr<Widget> FrameLoaderClient::createPlugin(const IntSize& pluginSize, HT
CString mimeTypeString = mimeType.utf8();
ASSERT(paramNames.size() == paramValues.size());
- PlatformRefPtr<GHashTable> hash = adoptPlatformRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free));
+ GRefPtr<GHashTable> hash = adoptGRef(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()),
@@ -1171,7 +1171,7 @@ void FrameLoaderClient::dispatchDidFailLoad(const ResourceError& error)
void FrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRequest&, const ResourceResponse& response)
{
- PlatformRefPtr<WebKitNetworkRequest> networkRequest(adoptPlatformRef(kitNew(request)));
+ GRefPtr<WebKitNetworkRequest> networkRequest(adoptGRef(kitNew(request)));
WebKitWebView* view = getViewFromFrame(m_frame);
webkit_web_view_request_download(view, networkRequest.get(), response, handle);
@@ -1259,7 +1259,7 @@ void FrameLoaderClient::setMainDocumentError(WebCore::DocumentLoader*, const Res
void FrameLoaderClient::startDownload(const ResourceRequest& request)
{
- PlatformRefPtr<WebKitNetworkRequest> networkRequest(adoptPlatformRef(kitNew(request)));
+ GRefPtr<WebKitNetworkRequest> networkRequest(adoptGRef(kitNew(request)));
WebKitWebView* view = getViewFromFrame(m_frame);
webkit_web_view_request_download(view, networkRequest.get());
@@ -1300,7 +1300,7 @@ static void postCommitFrameViewSetup(WebKitWebFrame *frame, FrameView *view, boo
g_object_notify(G_OBJECT(containingWindow->priv->viewportAttributes.get()), "valid");
if (priv->currentMenu) {
- PlatformRefPtr<GtkMenu> menu(priv->currentMenu);
+ GRefPtr<GtkMenu> menu(priv->currentMenu);
priv->currentMenu.clear();
gtk_menu_popdown(menu.get());
}
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index d39302f..31af243 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -179,7 +179,7 @@ void InspectorClient::populateSetting(const String& key, String* value)
if (!settings)
return;
- PlatformRefPtr<GVariant> variant = adoptPlatformRef(g_settings_get_value(settings, toGSettingName(key).utf8().data()));
+ GRefPtr<GVariant> variant = adoptGRef(g_settings_get_value(settings, toGSettingName(key).utf8().data()));
if (key == "resourceTrackingEnabled" || key == "xhrMonitor"
|| key == "debuggerEnabled" || key == "profilerEnabled")
@@ -197,15 +197,15 @@ void InspectorClient::storeSetting(const String& key, const String& value)
if (!settings)
return;
- PlatformRefPtr<GVariant> variant(0);
+ GRefPtr<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 = adoptPlatformRef(variantFromTruthString(value));
+ variant = adoptGRef(variantFromTruthString(value));
else if (key == "frontendSettings")
- variant = adoptPlatformRef(g_variant_new_string(value.utf8().data()));
+ variant = adoptGRef(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 61e9380..60b8e6d 100644
--- a/WebKit/gtk/webkit/webkitdownload.cpp
+++ b/WebKit/gtk/webkit/webkitdownload.cpp
@@ -907,7 +907,7 @@ static void webkit_download_error(WebKitDownload* download, const ResourceError&
webkit_download_close_stream(download);
WebKitDownloadPrivate* priv = download->priv;
- PlatformRefPtr<WebKitDownload> protect(download);
+ GRefPtr<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 8dffe77..7005637 100644
--- a/WebKit/gtk/webkit/webkitnetworkrequest.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
@@ -253,7 +253,7 @@ namespace WebKit {
WebKitNetworkRequest* kitNew(const WebCore::ResourceRequest& resourceRequest)
{
- PlatformRefPtr<SoupMessage> soupMessage(adoptPlatformRef(resourceRequest.toSoupMessage()));
+ GRefPtr<SoupMessage> soupMessage(adoptGRef(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 23cf9d2..4b8661b 100644
--- a/WebKit/gtk/webkit/webkitnetworkresponse.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkresponse.cpp
@@ -263,7 +263,7 @@ WebCore::ResourceResponse core(WebKitNetworkResponse* response)
WebKitNetworkResponse* kitNew(const WebCore::ResourceResponse& resourceResponse)
{
- PlatformRefPtr<SoupMessage> soupMessage(adoptPlatformRef(resourceResponse.toSoupMessage()));
+ GRefPtr<SoupMessage> soupMessage(adoptGRef(resourceResponse.toSoupMessage()));
if (soupMessage)
return WEBKIT_NETWORK_RESPONSE(g_object_new(WEBKIT_TYPE_NETWORK_RESPONSE, "message", soupMessage.get(), NULL));
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index b7ea21e..cd7eed3 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -3473,7 +3473,7 @@ static void webkit_web_view_init(WebKitWebView* webView)
// members, which ensures they are initialized properly.
new (priv) WebKitWebViewPrivate();
- priv->imContext = adoptPlatformRef(gtk_im_multicontext_new());
+ priv->imContext = adoptGRef(gtk_im_multicontext_new());
Page::PageClients pageClients;
pageClients.chromeClient = new WebKit::ChromeClient(webView);
@@ -3491,11 +3491,11 @@ static void webkit_web_view_init(WebKitWebView* webView)
// We also add a simple wrapper class to provide the public
// interface for the Web Inspector.
- priv->webInspector = adoptPlatformRef(WEBKIT_WEB_INSPECTOR(g_object_new(WEBKIT_TYPE_WEB_INSPECTOR, NULL)));
+ priv->webInspector = adoptGRef(WEBKIT_WEB_INSPECTOR(g_object_new(WEBKIT_TYPE_WEB_INSPECTOR, NULL)));
webkit_web_inspector_set_inspector_client(priv->webInspector.get(), priv->corePage);
// And our ViewportAttributes friend.
- priv->viewportAttributes = adoptPlatformRef(WEBKIT_VIEWPORT_ATTRIBUTES(g_object_new(WEBKIT_TYPE_VIEWPORT_ATTRIBUTES, NULL)));
+ priv->viewportAttributes = adoptGRef(WEBKIT_VIEWPORT_ATTRIBUTES(g_object_new(WEBKIT_TYPE_VIEWPORT_ATTRIBUTES, NULL)));
priv->viewportAttributes->priv->webView = webView;
// The smart pointer will call g_object_ref_sink on these adjustments.
@@ -3507,17 +3507,17 @@ static void webkit_web_view_init(WebKitWebView* webView)
priv->lastPopupXPosition = priv->lastPopupYPosition = -1;
priv->editable = false;
- priv->backForwardList = adoptPlatformRef(webkit_web_back_forward_list_new_with_web_view(webView));
+ priv->backForwardList = adoptGRef(webkit_web_back_forward_list_new_with_web_view(webView));
priv->zoomFullContent = FALSE;
- priv->webSettings = adoptPlatformRef(webkit_web_settings_new());
+ priv->webSettings = adoptGRef(webkit_web_settings_new());
webkit_web_view_update_settings(webView);
g_signal_connect(priv->webSettings.get(), "notify", G_CALLBACK(webkit_web_view_settings_notify), webView);
- priv->webWindowFeatures = adoptPlatformRef(webkit_web_window_features_new());
+ priv->webWindowFeatures = adoptGRef(webkit_web_window_features_new());
- priv->subResources = adoptPlatformRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref));
+ priv->subResources = adoptGRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref));
priv->currentClickCount = 0;
priv->previousClickButton = 0;
@@ -4894,7 +4894,7 @@ void webkit_web_view_add_main_resource(WebKitWebView* webView, const char* ident
{
WebKitWebViewPrivate* priv = webView->priv;
- priv->mainResource = adoptPlatformRef(webResource);
+ priv->mainResource = adoptGRef(webResource);
priv->mainResourceIdentifier = identifier;
}
diff --git a/WebKit/gtk/webkit/webkitwebviewprivate.h b/WebKit/gtk/webkit/webkitwebviewprivate.h
index dec6dad..29da1fe 100644
--- a/WebKit/gtk/webkit/webkitwebviewprivate.h
+++ b/WebKit/gtk/webkit/webkitwebviewprivate.h
@@ -52,26 +52,26 @@ extern "C" {
typedef struct _WebKitWebViewPrivate WebKitWebViewPrivate;
struct _WebKitWebViewPrivate {
WebCore::Page* corePage;
- PlatformRefPtr<WebKitWebSettings> webSettings;
- PlatformRefPtr<WebKitWebInspector> webInspector;
- PlatformRefPtr<WebKitViewportAttributes> viewportAttributes;
- PlatformRefPtr<WebKitWebWindowFeatures> webWindowFeatures;
+ GRefPtr<WebKitWebSettings> webSettings;
+ GRefPtr<WebKitWebInspector> webInspector;
+ GRefPtr<WebKitViewportAttributes> viewportAttributes;
+ GRefPtr<WebKitWebWindowFeatures> webWindowFeatures;
WebKitWebFrame* mainFrame;
- PlatformRefPtr<WebKitWebBackForwardList> backForwardList;
+ GRefPtr<WebKitWebBackForwardList> backForwardList;
- PlatformRefPtr<GtkMenu> currentMenu;
+ GRefPtr<GtkMenu> currentMenu;
gint lastPopupXPosition;
gint lastPopupYPosition;
HashSet<GtkWidget*> children;
bool editable;
- PlatformRefPtr<GtkIMContext> imContext;
+ GRefPtr<GtkIMContext> imContext;
gboolean transparent;
- PlatformRefPtr<GtkAdjustment> horizontalAdjustment;
- PlatformRefPtr<GtkAdjustment> verticalAdjustment;
+ GRefPtr<GtkAdjustment> horizontalAdjustment;
+ GRefPtr<GtkAdjustment> verticalAdjustment;
#ifndef GTK_API_VERSION_2
// GtkScrollablePolicy needs to be checked when
@@ -96,9 +96,9 @@ struct _WebKitWebViewPrivate {
// These are hosted here because the DataSource object is
// created too late in the frame loading process.
- PlatformRefPtr<WebKitWebResource> mainResource;
+ GRefPtr<WebKitWebResource> mainResource;
CString mainResourceIdentifier;
- PlatformRefPtr<GHashTable> subResources;
+ GRefPtr<GHashTable> subResources;
CString tooltipText;
WebCore::IntRect tooltipArea;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list