Changeset 134029 in webkit


Ignore:
Timestamp:
Nov 9, 2012 1:11:12 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[V8] Main world should have one DOMDataStore
https://bugs.webkit.org/show_bug.cgi?id=101470

Patch by Dan Carney <dcarney@google.com> on 2012-11-09
Reviewed by Kentaro Hara.

The main world DOMWrapperWorld held onto a DOMDataStore that should
never be used, as there is a static one optimized for speed in
DOMDataStore.

No new tests. No change in functionality.

  • bindings/v8/DOMDataStore.cpp:

(WebCore::DOMDataStore::current):

  • bindings/v8/DOMWrapperWorld.h:

(WebCore::DOMWrapperWorld::isolatedWorldDomDataStore):
(WebCore::DOMWrapperWorld::DOMWrapperWorld):

  • bindings/v8/V8DOMWrapper.h:

(WebCore::V8DOMWrapper::getCachedWrapper):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r134028 r134029  
     12012-11-09  Dan Carney  <dcarney@google.com>
     2
     3        [V8] Main world should have one DOMDataStore
     4        https://bugs.webkit.org/show_bug.cgi?id=101470
     5
     6        Reviewed by Kentaro Hara.
     7
     8        The main world DOMWrapperWorld held onto a DOMDataStore that should
     9        never be used, as there is a static one optimized for speed in
     10        DOMDataStore.
     11
     12        No new tests. No change in functionality.
     13
     14        * bindings/v8/DOMDataStore.cpp:
     15        (WebCore::DOMDataStore::current):
     16        * bindings/v8/DOMWrapperWorld.h:
     17        (WebCore::DOMWrapperWorld::isolatedWorldDomDataStore):
     18        (WebCore::DOMWrapperWorld::DOMWrapperWorld):
     19        * bindings/v8/V8DOMWrapper.h:
     20        (WebCore::V8DOMWrapper::getCachedWrapper):
     21
    1222012-11-09  Alexei Filippov  <alph@chromium.org>
    223
  • trunk/Source/WebCore/bindings/v8/DOMDataStore.cpp

    r133909 r134029  
    5555DOMDataStore* DOMDataStore::current(v8::Isolate* isolate)
    5656{
    57     DEFINE_STATIC_LOCAL(DOMDataStore, defaultStore, (MainWorld));
     57    DEFINE_STATIC_LOCAL(DOMDataStore, mainWorldDOMDataStore, (MainWorld));
    5858    V8PerIsolateData* data = isolate ? V8PerIsolateData::from(isolate) : V8PerIsolateData::current();
    5959    if (UNLIKELY(!!data->domDataStore()))
     
    6161    V8DOMWindowShell* context = V8DOMWindowShell::getEntered();
    6262    if (UNLIKELY(!!context))
    63         return context->world()->domDataStore();
    64     return &defaultStore;
     63        return context->world()->isolatedWorldDOMDataStore();
     64    return &mainWorldDOMDataStore;
    6565}
    6666
  • trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.h

    r133909 r134029  
    7575    static PassRefPtr<DOMWrapperWorld> createUninitializedWorld();
    7676
    77     bool isMainWorld() { return m_worldId == mainWorldId; }
    78     bool isIsolatedWorld() { return isIsolatedWorldId(m_worldId); }
     77    bool isMainWorld() const { return m_worldId == mainWorldId; }
     78    bool isIsolatedWorld() const { return isIsolatedWorldId(m_worldId); }
    7979    int worldId() const { return m_worldId; }
    8080    int extensionGroup() const { return m_extensionGroup; }
    81     DOMDataStore* domDataStore() const
     81    DOMDataStore* isolatedWorldDOMDataStore() const
    8282    {
    83         ASSERT(m_worldId != uninitializedWorldId);
     83        ASSERT(isIsolatedWorld());
    8484        return m_domDataStore.get();
    8585    }
     
    9999        , m_extensionGroup(extensionGroup)
    100100    {
    101         if (worldId != uninitializedWorldId)
     101        if (isIsolatedWorld())
    102102            m_domDataStore = adoptPtr(new DOMDataStore(DOMDataStore::IsolatedWorld));
    103103    }
  • trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h

    r133954 r134029  
    123123                return node->wrapper();
    124124
    125             return context->world()->domDataStore()->get(node);
     125            return context->world()->isolatedWorldDOMDataStore()->get(node);
    126126        }
    127127
Note: See TracChangeset for help on using the changeset viewer.