Changeset 48825 in webkit


Ignore:
Timestamp:
Sep 28, 2009 1:09:40 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-09-28 Yongjun Zhang <yongjun.zhang@nokia.com>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=28054

Use derefInNotNull() to work around winscw compiler forward declaration bug
regarding templated classes.

The compiler bug is reported at
https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812.

The change should be reverted when the above bug is fixed in winscw compiler.

Add parenthesis around (RefPtr::*UnspecifiedBoolType) to make winscw compiler
work with the default UnSpecifiedBoolType() operator, which removes the winscw hack.

  • wtf/RefPtr.h: (WTF::RefPtr::~RefPtr): (WTF::RefPtr::clear): (WTF::RefPtr::operator UnspecifiedBoolType):

2009-09-28 Yongjun Zhang <yongjun.zhang@nokia.com>

Reviewed by Eric Seidel.

Make JObjectWrapper::ref() and deref() public accessible to derefIfNull().

Will be reverted when the following winscw compiler bug is fixed.
https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812

  • bridge/jni/jni_instance.h:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r48824 r48825  
     12009-09-28  Yongjun Zhang  <yongjun.zhang@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=28054
     6       
     7        Use derefInNotNull() to work around winscw compiler forward declaration bug
     8        regarding templated classes.
     9
     10        The compiler bug is reported at
     11        https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812.
     12       
     13        The change should be reverted when the above bug is fixed in winscw compiler.
     14
     15        Add parenthesis around (RefPtr::*UnspecifiedBoolType) to make winscw compiler
     16        work with the default UnSpecifiedBoolType() operator, which removes the winscw hack.
     17
     18        * wtf/RefPtr.h:
     19        (WTF::RefPtr::~RefPtr):
     20        (WTF::RefPtr::clear):
     21        (WTF::RefPtr::operator UnspecifiedBoolType):
     22
    1232009-09-28  Gabor Loki  <loki@inf.u-szeged.hu>
    224
  • trunk/JavaScriptCore/wtf/RefPtr.h

    r45072 r48825  
    4949        bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
    5050
    51         ~RefPtr() { if (T* ptr = m_ptr) ptr->deref(); }
     51        ~RefPtr() { derefIfNotNull(m_ptr); }
    5252       
    5353        template <typename U> RefPtr(const RefPtr<U>& o) : m_ptr(o.get()) { if (T* ptr = m_ptr) ptr->ref(); }
     
    5555        T* get() const { return m_ptr; }
    5656       
    57         void clear() { if (T* ptr = m_ptr) ptr->deref(); m_ptr = 0; }
     57        void clear() { derefIfNotNull(m_ptr); m_ptr = 0; }
    5858        PassRefPtr<T> release() { PassRefPtr<T> tmp = adoptRef(m_ptr); m_ptr = 0; return tmp; }
    5959
     
    6464   
    6565        // This conversion operator allows implicit conversion to bool but not to other integer types.
    66 #if COMPILER(WINSCW)
    67         operator bool() const { return m_ptr; }
    68 #else
    69         typedef T* RefPtr::*UnspecifiedBoolType;
     66        typedef T* (RefPtr::*UnspecifiedBoolType);
    7067        operator UnspecifiedBoolType() const { return m_ptr ? &RefPtr::m_ptr : 0; }
    71 #endif
    7268       
    7369        RefPtr& operator=(const RefPtr&);
  • trunk/WebCore/ChangeLog

    r48822 r48825  
     12009-09-28  Yongjun Zhang  <yongjun.zhang@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Make JObjectWrapper::ref() and deref() public accessible to derefIfNull().
     6       
     7        Will be reverted when the following winscw compiler bug is fixed.
     8        https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812
     9
     10        * bridge/jni/jni_instance.h:
     11
    1122009-09-28  Andrew Scherkus  <scherkus@chromium.org>
    213
  • trunk/WebCore/bridge/jni/jni_instance.h

    r43122 r48825  
    4848friend class JavaMethod;
    4949
    50 protected:
    51     JObjectWrapper(jobject instance);   
    52     ~JObjectWrapper();
    53    
     50public:
    5451    void ref() { _refCount++; }
    5552    void deref()
     
    5956    }
    6057
     58protected:
     59    JObjectWrapper(jobject instance);   
     60    ~JObjectWrapper();
     61   
    6162    jobject _instance;
    6263
Note: See TracChangeset for help on using the changeset viewer.