Title: [133892] trunk/Source/WebCore
Revision
133892
Author
commit-qu...@webkit.org
Date
2012-11-08 06:23:43 -0800 (Thu, 08 Nov 2012)

Log Message

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

Patch by Dan Carney <dcar...@google.com> on 2012-11-08
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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (133891 => 133892)


--- trunk/Source/WebCore/ChangeLog	2012-11-08 14:15:22 UTC (rev 133891)
+++ trunk/Source/WebCore/ChangeLog	2012-11-08 14:23:43 UTC (rev 133892)
@@ -1,3 +1,24 @@
+2012-11-08  Dan Carney  <dcar...@google.com>
+
+        [V8] Main world should have one DOMDataStore
+        https://bugs.webkit.org/show_bug.cgi?id=101470
+
+        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):
+
 2012-11-08  Laszlo Gombos  <l.gom...@samsung.com>
 
         [EFL] Remove non-variable options from the build system

Modified: trunk/Source/WebCore/bindings/v8/DOMDataStore.cpp (133891 => 133892)


--- trunk/Source/WebCore/bindings/v8/DOMDataStore.cpp	2012-11-08 14:15:22 UTC (rev 133891)
+++ trunk/Source/WebCore/bindings/v8/DOMDataStore.cpp	2012-11-08 14:23:43 UTC (rev 133892)
@@ -54,14 +54,14 @@
 
 DOMDataStore* DOMDataStore::current(v8::Isolate* isolate)
 {
-    DEFINE_STATIC_LOCAL(DOMDataStore, defaultStore, (MainWorld));
+    DEFINE_STATIC_LOCAL(DOMDataStore, mainWorldDOMDataStore, (MainWorld));
     V8PerIsolateData* data = "" ? V8PerIsolateData::from(isolate) : V8PerIsolateData::current();
     if (UNLIKELY(!!data->domDataStore()))
         return data->domDataStore();
     V8DOMWindowShell* context = V8DOMWindowShell::getEntered();
     if (UNLIKELY(!!context))
-        return context->world()->domDataStore();
-    return &defaultStore;
+        return context->world()->isolatedWorldDOMDataStore();
+    return &mainWorldDOMDataStore;
 }
 
 void DOMDataStore::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const

Modified: trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.h (133891 => 133892)


--- trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.h	2012-11-08 14:15:22 UTC (rev 133891)
+++ trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.h	2012-11-08 14:23:43 UTC (rev 133892)
@@ -78,9 +78,9 @@
     bool isIsolatedWorld() { return isIsolatedWorldId(m_worldId); }
     int worldId() const { return m_worldId; }
     int extensionGroup() const { return m_extensionGroup; }
-    DOMDataStore* domDataStore() const
+    DOMDataStore* isolatedWorldDOMDataStore() const
     {
-        ASSERT(m_worldId != uninitializedWorldId);
+        ASSERT(isIsolatedWorld());
         return m_domDataStore.get();
     }
     void deref()
@@ -98,7 +98,7 @@
         : m_worldId(worldId)
         , m_extensionGroup(extensionGroup)
     {
-        if (worldId != uninitializedWorldId)
+        if (isIsolatedWorld())
             m_domDataStore = adoptPtr(new DOMDataStore(DOMDataStore::IsolatedWorld));
     }
 

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h (133891 => 133892)


--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h	2012-11-08 14:15:22 UTC (rev 133891)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h	2012-11-08 14:23:43 UTC (rev 133892)
@@ -122,7 +122,7 @@
             if (LIKELY(!context))
                 return node->wrapper();
 
-            return context->world()->domDataStore()->get(node);
+            return context->world()->isolatedWorldDOMDataStore()->get(node);
         }
 
     private:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to