Changeset 37660 in webkit


Ignore:
Timestamp:
Oct 17, 2008 2:16:01 PM (16 years ago)
Author:
jmalonzo@webkit.org
Message:

2008-10-17 Marco Barisione <marco.barisione@collabora.co.uk>

Reviewed by Sam Weinig. Landed by Jan Alonzo.

https://bugs.webkit.org/show_bug.cgi?id=21603
[GTK] Minor fixes to GOwnPtr

  • wtf/GOwnPtr.cpp: (WTF::GError): (WTF::GList): (WTF::GCond): (WTF::GMutex): (WTF::GPatternSpec): (WTF::GDir):
  • wtf/GOwnPtr.h: (WTF::freeOwnedGPtr): (WTF::GOwnPtr::~GOwnPtr): (WTF::GOwnPtr::outPtr): (WTF::GOwnPtr::set): (WTF::GOwnPtr::clear):
  • wtf/Threading.h:

2008-10-17 Marco Barisione <marco.barisione@collabora.co.uk>

Reviewed by Sam Weinig. Landed by Jan Alonzo.

https://bugs.webkit.org/show_bug.cgi?id=21603
[GTK] Minor fixes to GOwnPtr

  • platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: (WebCore::mediaPlayerPrivateErrorCallback):
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r37653 r37660  
     12008-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
    1232008-10-17  Maciej Stachowiak  <mjs@apple.com>
    224
  • trunk/JavaScriptCore/wtf/GOwnPtr.cpp

    r37556 r37660  
    2222namespace WTF {
    2323
    24 template <> void freeOwnedPtr<GError>(GError* ptr)
     24template <> void freeOwnedGPtr<GError>(GError* ptr)
    2525{
    2626    if (ptr)
     
    2828}
    2929
    30 template <> void freeOwnedPtr<GList>(GList* ptr)
     30template <> void freeOwnedGPtr<GList>(GList* ptr)
    3131{
    3232    g_list_free(ptr);
    3333}
    3434
    35 template <> void freeOwnedPtr<GCond>(GCond* ptr)
     35template <> void freeOwnedGPtr<GCond>(GCond* ptr)
    3636{
    3737    if (ptr)
     
    3939}
    4040
    41 template <> void freeOwnedPtr<GMutex>(GMutex* ptr)
     41template <> void freeOwnedGPtr<GMutex>(GMutex* ptr)
    4242{
    4343    if (ptr)
     
    4545}
    4646
    47 template <> void freeOwnedPtr<GPatternSpec>(GPatternSpec* ptr)
     47template <> void freeOwnedGPtr<GPatternSpec>(GPatternSpec* ptr)
    4848{
    4949    if (ptr)
     
    5151}
    5252
    53 template <> void freeOwnedPtr<GDir>(GDir* ptr)
     53template <> void freeOwnedGPtr<GDir>(GDir* ptr)
    5454{
    5555    if (ptr)
  • trunk/JavaScriptCore/wtf/GOwnPtr.h

    r37556 r37660  
    2929
    3030namespace WTF {
    31     template <typename T> inline void freeOwnedPtr(T* ptr) { g_free(reinterpret_cast<void*>(ptr)); }
    32     template<> void freeOwnedPtr<GError>(GError*);
    33     template<> void freeOwnedPtr<GList>(GList*);
    34     template<> void freeOwnedPtr<GCond>(GCond*);
    35     template<> void freeOwnedPtr<GMutex>(GMutex*);
    36     template<> void freeOwnedPtr<GPatternSpec>(GPatternSpec*);
    37     template<> void freeOwnedPtr<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*);
    3838
    3939    template <typename T> class GOwnPtr : Noncopyable {
    4040    public:
    4141        explicit GOwnPtr(T* ptr = 0) : m_ptr(ptr) { }
    42         ~GOwnPtr() { freeOwnedPtr(m_ptr); }
     42        ~GOwnPtr() { freeOwnedGPtr(m_ptr); }
    4343
    4444        T* get() const { return m_ptr; }
    4545        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; }
    4747
    48         void set(T* ptr) { ASSERT(!ptr || m_ptr != ptr); freeOwnedPtr(m_ptr); m_ptr = ptr; }
    49         void clear() { freeOwnedPtr(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; }
    5050
    5151        T& operator*() const { ASSERT(m_ptr); return *m_ptr; }
  • trunk/JavaScriptCore/wtf/Threading.h

    r37556 r37660  
    6363#include <wtf/Locker.h>
    6464#include <wtf/Noncopyable.h>
     65
    6566#if PLATFORM(GTK)
    6667#include <wtf/GOwnPtr.h>
  • trunk/WebCore/ChangeLog

    r37659 r37660  
     12008-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
    1112008-10-17  Timothy Hatcher  <timothy@apple.com>
    212
  • trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp

    r37556 r37660  
    5858        GOwnPtr<gchar> debug;
    5959
    60         gst_message_parse_error(message, &err.rawPtr(), &debug.rawPtr());
     60        gst_message_parse_error(message, &err.outPtr(), &debug.outPtr());
    6161        if (err->code == 3) {
    6262            LOG_VERBOSE(Media, "File not found");
Note: See TracChangeset for help on using the changeset viewer.