Changeset 37660 in webkit
- Timestamp:
- Oct 17, 2008 2:16:01 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37653 r37660 1 2008-10-17 Marco Barisione <marco.barisione@collabora.co.uk> 2 3 Reviewed by Sam Weinig. Landed by Jan Alonzo. 4 5 https://bugs.webkit.org/show_bug.cgi?id=21603 6 [GTK] Minor fixes to GOwnPtr 7 8 * wtf/GOwnPtr.cpp: 9 (WTF::GError): 10 (WTF::GList): 11 (WTF::GCond): 12 (WTF::GMutex): 13 (WTF::GPatternSpec): 14 (WTF::GDir): 15 * wtf/GOwnPtr.h: 16 (WTF::freeOwnedGPtr): 17 (WTF::GOwnPtr::~GOwnPtr): 18 (WTF::GOwnPtr::outPtr): 19 (WTF::GOwnPtr::set): 20 (WTF::GOwnPtr::clear): 21 * wtf/Threading.h: 22 1 23 2008-10-17 Maciej Stachowiak <mjs@apple.com> 2 24 -
trunk/JavaScriptCore/wtf/GOwnPtr.cpp
r37556 r37660 22 22 namespace WTF { 23 23 24 template <> void freeOwned Ptr<GError>(GError* ptr)24 template <> void freeOwnedGPtr<GError>(GError* ptr) 25 25 { 26 26 if (ptr) … … 28 28 } 29 29 30 template <> void freeOwned Ptr<GList>(GList* ptr)30 template <> void freeOwnedGPtr<GList>(GList* ptr) 31 31 { 32 32 g_list_free(ptr); 33 33 } 34 34 35 template <> void freeOwned Ptr<GCond>(GCond* ptr)35 template <> void freeOwnedGPtr<GCond>(GCond* ptr) 36 36 { 37 37 if (ptr) … … 39 39 } 40 40 41 template <> void freeOwned Ptr<GMutex>(GMutex* ptr)41 template <> void freeOwnedGPtr<GMutex>(GMutex* ptr) 42 42 { 43 43 if (ptr) … … 45 45 } 46 46 47 template <> void freeOwned Ptr<GPatternSpec>(GPatternSpec* ptr)47 template <> void freeOwnedGPtr<GPatternSpec>(GPatternSpec* ptr) 48 48 { 49 49 if (ptr) … … 51 51 } 52 52 53 template <> void freeOwned Ptr<GDir>(GDir* ptr)53 template <> void freeOwnedGPtr<GDir>(GDir* ptr) 54 54 { 55 55 if (ptr) -
trunk/JavaScriptCore/wtf/GOwnPtr.h
r37556 r37660 29 29 30 30 namespace WTF { 31 template <typename T> inline void freeOwned Ptr(T* ptr) { g_free(reinterpret_cast<void*>(ptr)); }32 template<> void freeOwned Ptr<GError>(GError*);33 template<> void freeOwned Ptr<GList>(GList*);34 template<> void freeOwned Ptr<GCond>(GCond*);35 template<> void freeOwned Ptr<GMutex>(GMutex*);36 template<> void freeOwned Ptr<GPatternSpec>(GPatternSpec*);37 template<> void freeOwned Ptr<GDir>(GDir*);31 template <typename T> inline void freeOwnedGPtr(T* ptr) { g_free(reinterpret_cast<void*>(ptr)); } 32 template<> void freeOwnedGPtr<GError>(GError*); 33 template<> void freeOwnedGPtr<GList>(GList*); 34 template<> void freeOwnedGPtr<GCond>(GCond*); 35 template<> void freeOwnedGPtr<GMutex>(GMutex*); 36 template<> void freeOwnedGPtr<GPatternSpec>(GPatternSpec*); 37 template<> void freeOwnedGPtr<GDir>(GDir*); 38 38 39 39 template <typename T> class GOwnPtr : Noncopyable { 40 40 public: 41 41 explicit GOwnPtr(T* ptr = 0) : m_ptr(ptr) { } 42 ~GOwnPtr() { freeOwned Ptr(m_ptr); }42 ~GOwnPtr() { freeOwnedGPtr(m_ptr); } 43 43 44 44 T* get() const { return m_ptr; } 45 45 T* release() { T* ptr = m_ptr; m_ptr = 0; return ptr; } 46 T*& rawPtr() {return m_ptr; }46 T*& outPtr() { ASSERT(!m_ptr); return m_ptr; } 47 47 48 void set(T* ptr) { ASSERT(!ptr || m_ptr != ptr); freeOwned Ptr(m_ptr); m_ptr = ptr; }49 void clear() { freeOwned Ptr(m_ptr); m_ptr = 0; }48 void set(T* ptr) { ASSERT(!ptr || m_ptr != ptr); freeOwnedGPtr(m_ptr); m_ptr = ptr; } 49 void clear() { freeOwnedGPtr(m_ptr); m_ptr = 0; } 50 50 51 51 T& operator*() const { ASSERT(m_ptr); return *m_ptr; } -
trunk/JavaScriptCore/wtf/Threading.h
r37556 r37660 63 63 #include <wtf/Locker.h> 64 64 #include <wtf/Noncopyable.h> 65 65 66 #if PLATFORM(GTK) 66 67 #include <wtf/GOwnPtr.h> -
trunk/WebCore/ChangeLog
r37659 r37660 1 2008-10-17 Marco Barisione <marco.barisione@collabora.co.uk> 2 3 Reviewed by Sam Weinig. Landed by Jan Alonzo. 4 5 https://bugs.webkit.org/show_bug.cgi?id=21603 6 [GTK] Minor fixes to GOwnPtr 7 8 * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: 9 (WebCore::mediaPlayerPrivateErrorCallback): 10 1 11 2008-10-17 Timothy Hatcher <timothy@apple.com> 2 12 -
trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
r37556 r37660 58 58 GOwnPtr<gchar> debug; 59 59 60 gst_message_parse_error(message, &err. rawPtr(), &debug.rawPtr());60 gst_message_parse_error(message, &err.outPtr(), &debug.outPtr()); 61 61 if (err->code == 3) { 62 62 LOG_VERBOSE(Media, "File not found");
Note: See TracChangeset
for help on using the changeset viewer.