Changeset 48486 in webkit


Ignore:
Timestamp:
Sep 17, 2009 12:59:50 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-09-17 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

[V8] OwnHandle might get a weak callback after destruction
https://bugs.webkit.org/show_bug.cgi?id=29172

Be sure to clear out weak reference so we don't get a weak callback
after we've destructed ourselves. Also, removed some tricky methods
that had no clients.

  • bindings/v8/OwnHandle.h: (WebCore::OwnHandle::clear):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r48483 r48486  
     12009-09-17  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [V8] OwnHandle might get a weak callback after destruction
     6        https://bugs.webkit.org/show_bug.cgi?id=29172
     7
     8        Be sure to clear out weak reference so we don't get a weak callback
     9        after we've destructed ourselves.  Also, removed some tricky methods
     10        that had no clients.
     11
     12        * bindings/v8/OwnHandle.h:
     13        (WebCore::OwnHandle::clear):
     14
    1152009-09-17  Dimitri Glazkov  <dglazkov@chromium.org>
    216
  • trunk/WebCore/bindings/v8/OwnHandle.h

    r46839 r48486  
    4646        void set(v8::Handle<T> handle) { clear(); m_handle = v8::Persistent<T>::New(handle); }
    4747
    48         // FIXME: What if we release a weak handle?  Won't the callback do the wrong thing?
    49         v8::Persistent<T> release() { v8::Persistent<T> result = m_handle; m_handle.Clear(); return result; }
    50         void adopt(v8::Persistent<T> handle) { clear(); m_handle = handle; }
    51 
    5248        // Note: This is clear in the OwnPtr sense, not the v8::Handle sense.
    5349        void clear()
     
    5551            if (m_handle.IsEmpty())
    5652                return;
     53            if (m_handle.IsWeak())
     54                m_handle.ClearWeak();
    5755            m_handle.Dispose();
    5856            m_handle.Clear();
Note: See TracChangeset for help on using the changeset viewer.