Title: [129965] trunk/Source/WebCore
Revision
129965
Author
[email protected]
Date
2012-09-28 17:45:07 -0700 (Fri, 28 Sep 2012)

Log Message

Remove V8DOMWindowShell::getEntered
https://bugs.webkit.org/show_bug.cgi?id=96637

Patch by Dan Carney <[email protected]> on 2012-09-28
Reviewed by Adam Barth.

V8DOMWindowShell::getEntered was refactored so that the window shell
no longer has to be kept alive by a v8 context but rather a smaller
object.

No new tests. No change in functionality.

* bindings/v8/DOMData.cpp:
(WebCore::DOMData::getCurrentStore):
* bindings/v8/ScopedPersistent.h:
(WebCore::ScopedPersistent::leakHandle):
(ScopedPersistent):
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::resetIsolatedWorlds):
(WebCore::ScriptController::evaluateInIsolatedWorld):
(WebCore::ScriptController::currentWorldContext):
* bindings/v8/V8Binding.cpp:
(WebCore::perContextDataForCurrentWorld):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::setIsolatedWorldField):
(WebCore::V8DOMWindowShell::toIsolatedContextData):
(WebCore::isolatedContextWeakCallback):
(WebCore::V8DOMWindowShell::disposeContext):
(WebCore::V8DOMWindowShell::clearIsolatedShell):
(WebCore):
(WebCore::V8DOMWindowShell::initializeIfNeeded):
(WebCore::V8DOMWindowShell::setIsolatedWorldSecurityOrigin):
* bindings/v8/V8DOMWindowShell.h:
(V8DOMWindowShell):
(IsolatedContextData):
(WebCore::V8DOMWindowShell::IsolatedContextData::create):
(WebCore::V8DOMWindowShell::IsolatedContextData::world):
(WebCore::V8DOMWindowShell::IsolatedContextData::perContextData):
(WebCore::V8DOMWindowShell::IsolatedContextData::setSecurityOrigin):
(WebCore::V8DOMWindowShell::IsolatedContextData::securityOrigin):
(WebCore::V8DOMWindowShell::IsolatedContextData::IsolatedContextData):
(WebCore::V8DOMWindowShell::enteredIsolatedContext):
(WebCore::V8DOMWindowShell::enteredIsolatedContextData):
* bindings/v8/V8DOMWrapper.h:
(WebCore::V8DOMWrapper::getCachedWrapper):
* bindings/v8/WorldContextHandle.cpp:
(WebCore::WorldContextHandle::WorldContextHandle):
* bindings/v8/custom/V8DocumentCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8SVGDocumentCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:
(WebCore::V8XMLHttpRequest::constructorCallback):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (129964 => 129965)


--- trunk/Source/WebCore/ChangeLog	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/ChangeLog	2012-09-29 00:45:07 UTC (rev 129965)
@@ -1,3 +1,60 @@
+2012-09-28  Dan Carney  <[email protected]>
+
+        Remove V8DOMWindowShell::getEntered
+        https://bugs.webkit.org/show_bug.cgi?id=96637
+
+        Reviewed by Adam Barth.
+
+        V8DOMWindowShell::getEntered was refactored so that the window shell
+        no longer has to be kept alive by a v8 context but rather a smaller
+        object.
+
+        No new tests. No change in functionality.
+
+        * bindings/v8/DOMData.cpp:
+        (WebCore::DOMData::getCurrentStore):
+        * bindings/v8/ScopedPersistent.h:
+        (WebCore::ScopedPersistent::leakHandle):
+        (ScopedPersistent):
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::resetIsolatedWorlds):
+        (WebCore::ScriptController::evaluateInIsolatedWorld):
+        (WebCore::ScriptController::currentWorldContext):
+        * bindings/v8/V8Binding.cpp:
+        (WebCore::perContextDataForCurrentWorld):
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::setIsolatedWorldField):
+        (WebCore::V8DOMWindowShell::toIsolatedContextData):
+        (WebCore::isolatedContextWeakCallback):
+        (WebCore::V8DOMWindowShell::disposeContext):
+        (WebCore::V8DOMWindowShell::clearIsolatedShell):
+        (WebCore):
+        (WebCore::V8DOMWindowShell::initializeIfNeeded):
+        (WebCore::V8DOMWindowShell::setIsolatedWorldSecurityOrigin):
+        * bindings/v8/V8DOMWindowShell.h:
+        (V8DOMWindowShell):
+        (IsolatedContextData):
+        (WebCore::V8DOMWindowShell::IsolatedContextData::create):
+        (WebCore::V8DOMWindowShell::IsolatedContextData::world):
+        (WebCore::V8DOMWindowShell::IsolatedContextData::perContextData):
+        (WebCore::V8DOMWindowShell::IsolatedContextData::setSecurityOrigin):
+        (WebCore::V8DOMWindowShell::IsolatedContextData::securityOrigin):
+        (WebCore::V8DOMWindowShell::IsolatedContextData::IsolatedContextData):
+        (WebCore::V8DOMWindowShell::enteredIsolatedContext):
+        (WebCore::V8DOMWindowShell::enteredIsolatedContextData):
+        * bindings/v8/V8DOMWrapper.h:
+        (WebCore::V8DOMWrapper::getCachedWrapper):
+        * bindings/v8/WorldContextHandle.cpp:
+        (WebCore::WorldContextHandle::WorldContextHandle):
+        * bindings/v8/custom/V8DocumentCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8SVGDocumentCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:
+        (WebCore::V8XMLHttpRequest::constructorCallback):
+
 2012-09-28  Anders Carlsson  <[email protected]>
 
         Remove Java bridge

Modified: trunk/Source/WebCore/bindings/v8/DOMData.cpp (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/DOMData.cpp	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/DOMData.cpp	2012-09-29 00:45:07 UTC (rev 129965)
@@ -43,9 +43,9 @@
     V8PerIsolateData* data = ""
     if (UNLIKELY(data->domDataStore() != 0))
         return *data->domDataStore();
-    V8DOMWindowShell* context = V8DOMWindowShell::getEntered();
-    if (UNLIKELY(context != 0))
-        return *context->world()->domDataStore();
+    V8DOMWindowShell::IsolatedContextData* isolatedData = V8DOMWindowShell::enteredIsolatedContextData();
+    if (UNLIKELY(!!isolatedData))
+        return *isolatedData->world()->domDataStore();
     return defaultStore;
 }
 

Modified: trunk/Source/WebCore/bindings/v8/ScopedPersistent.h (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/ScopedPersistent.h	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/ScopedPersistent.h	2012-09-29 00:45:07 UTC (rev 129965)
@@ -78,6 +78,13 @@
         m_handle.Clear();
     }
 
+    v8::Persistent<T> leakHandle()
+    {
+        v8::Persistent<T> handle = m_handle;
+        m_handle.Clear();
+        return handle;
+    }
+
 private:
     v8::Persistent<T> m_handle;
 };

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.cpp (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-09-29 00:45:07 UTC (rev 129965)
@@ -146,7 +146,8 @@
 {
     for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin();
          iter != m_isolatedWorlds.end(); ++iter) {
-        iter->second->destroyIsolatedShell();
+        iter->second->clearIsolatedShell();
+        delete iter->second;
     }
     m_isolatedWorlds.clear();
     m_isolatedWorldSecurityOrigins.clear();
@@ -390,11 +391,12 @@
             resultArray->Set(i, evaluationResult);
         }
 
-        // Mark temporary shell for weak destruction.
+        // Destroy temporary world.
         if (worldID == DOMWrapperWorld::uninitializedWorldId) {
             int actualWorldId = isolatedWorldShell->world()->worldId();
             m_isolatedWorlds.remove(actualWorldId);
-            isolatedWorldShell->destroyIsolatedShell();
+            isolatedWorldShell->clearIsolatedShell();
+            delete isolatedWorldShell;
         }
 
         v8Results = evaluateHandleScope.Close(resultArray);
@@ -429,11 +431,20 @@
 
 v8::Local<v8::Context> ScriptController::currentWorldContext()
 {
-    if (V8DOMWindowShell* isolatedShell = V8DOMWindowShell::getEntered()) {
-        v8::Persistent<v8::Context> context = isolatedShell->context();
-        if (context.IsEmpty() || m_frame != toFrameIfNotDetached(context))
+    V8DOMWindowShell::IsolatedContextData* isolatedContextData = V8DOMWindowShell::enteredIsolatedContextData();
+    if (UNLIKELY(!!isolatedContextData)) {
+        V8DOMWindowShell* isolatedShell = existingWindowShellInternal(isolatedContextData->world());
+        // A temporary isolated world has been deleted, so use the current context.
+        if (UNLIKELY(!isolatedShell)) {
+            v8::Handle<v8::Context> context = v8::Context::GetEntered();
+            if (m_frame != toFrameIfNotDetached(context))
+                return v8::Local<v8::Context>();
+            return v8::Local<v8::Context>::New(context);
+        }
+        // The shell exists, but potentially it has a new context, so use it.
+        if (isolatedShell->context().IsEmpty() || m_frame != toFrameIfNotDetached(isolatedShell->context()))
             return v8::Local<v8::Context>();
-        return v8::Local<v8::Context>::New(context);
+        return v8::Local<v8::Context>::New(isolatedShell->context());
     }
     windowShell()->initializeIfNeeded();
     return v8::Local<v8::Context>::New(windowShell()->context());

Modified: trunk/Source/WebCore/bindings/v8/V8Binding.cpp (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/V8Binding.cpp	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.cpp	2012-09-29 00:45:07 UTC (rev 129965)
@@ -311,9 +311,9 @@
 
 V8PerContextData* perContextDataForCurrentWorld(Frame* frame)
 {
-    V8DOMWindowShell* isolatedShell;
-    if (UNLIKELY(!!(isolatedShell = V8DOMWindowShell::getEntered())))
-        return isolatedShell->perContextData();
+    V8DOMWindowShell::IsolatedContextData* isolatedShellData = 0;
+    if (UNLIKELY(!!(isolatedShellData = V8DOMWindowShell::enteredIsolatedContextData())))
+        return isolatedShellData->perContextData();
     return frame->script()->windowShell()->perContextData();
 }
 

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-09-29 00:45:07 UTC (rev 129965)
@@ -170,14 +170,15 @@
     ASSERT(!document->isHTMLDocument() || (V8Document::toNative(v8::Handle<v8::Object>::Cast(wrapper->GetPrototype())) == document));
 }
 
-static void setIsolatedWorldField(V8DOMWindowShell* shell, v8::Local<v8::Context> context)
+static void setIsolatedWorldField(V8DOMWindowShell::IsolatedContextData* data, v8::Handle<v8::Context> context)
 {
-    toInnerGlobalObject(context)->SetPointerInInternalField(V8DOMWindow::enteredIsolatedWorldIndex, shell);
+    toInnerGlobalObject(context)->SetPointerInInternalField(V8DOMWindow::enteredIsolatedWorldIndex, data);
 }
 
-V8DOMWindowShell* V8DOMWindowShell::enteredIsolatedWorldContext()
+V8DOMWindowShell::IsolatedContextData* V8DOMWindowShell::toIsolatedContextData(v8::Handle<v8::Object> innerGlobal)
 {
-    return static_cast<V8DOMWindowShell*>(toInnerGlobalObject(v8::Context::GetEntered())->GetPointerFromInternalField(V8DOMWindow::enteredIsolatedWorldIndex));
+    ASSERT(innerGlobal->InternalFieldCount() >= V8DOMWindow::enteredIsolatedWorldIndex);
+    return static_cast<IsolatedContextData*>(innerGlobal->GetPointerFromInternalField(V8DOMWindow::enteredIsolatedWorldIndex));
 }
 
 static void setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContext, int debugId)
@@ -207,20 +208,14 @@
     return !m_context.isEmpty();
 }
 
-void V8DOMWindowShell::destroyIsolatedShell()
-{
-    disposeContext(true);
-}
-
 static void isolatedContextWeakCallback(v8::Persistent<v8::Value> object, void* parameter)
 {
-    // Handle will be disposed in delete.
-    delete static_cast<V8DOMWindowShell*>(parameter);
+    object.Dispose();
+    delete static_cast<V8DOMWindowShell::IsolatedContextData*>(parameter);
 }
 
-void V8DOMWindowShell::disposeContext(bool weak)
+void V8DOMWindowShell::disposeContext()
 {
-    ASSERT(!m_context.get().IsWeak());
     m_perContextData.clear();
 
     if (m_context.isEmpty())
@@ -228,14 +223,14 @@
 
     m_frame->loader()->client()->willReleaseScriptContext(m_context.get(), m_world->worldId());
 
-    if (!weak)
+    if (m_isolatedContextData) {
+        ASSERT(!m_world->isMainWorld());
+        // Here we must intentionally leak the per context data pointer as it gets deleted in isolatedContextWeakCallback.
+        m_context.leakHandle().MakeWeak(m_isolatedContextData.leakPtr(), isolatedContextWeakCallback);
+        // The global handle keeps a reference to the context, so it must be removed.
+        m_global.clear();
+    } else
         m_context.clear();
-    else {
-        ASSERT(!m_world->isMainWorld());
-        destroyGlobal();
-        m_frame = 0;
-        m_context.get().MakeWeak(this, isolatedContextWeakCallback);
-    }
 
     // It's likely that disposing the context has created a lot of
     // garbage. Notify V8 about this so it'll have a chance of cleaning
@@ -251,6 +246,11 @@
     m_global.clear();
 }
 
+void V8DOMWindowShell::clearIsolatedShell()
+{
+    disposeContext();
+}
+
 void V8DOMWindowShell::clearForClose()
 {
     if (m_context.isEmpty())
@@ -345,21 +345,22 @@
         }
     }
 
+    m_perContextData = V8PerContextData::create(m_context.get());
+    if (!m_perContextData->init()) {
+        disposeContext();
+        return false;
+    }
+
     // Flag context as isolated.
     if (!isMainWorld) {
         V8DOMWindowShell* mainWindow = m_frame->script()->windowShell();
         mainWindow->initializeIfNeeded();
         if (!mainWindow->context().IsEmpty())
             setInjectedScriptContextDebugId(m_context.get(), m_frame->script()->contextDebugId(mainWindow->context()));
-        setIsolatedWorldField(this, context);
+        m_isolatedContextData = IsolatedContextData::create(m_world, m_perContextData.release(), m_isolatedWorldShellSecurityOrigin);
+        setIsolatedWorldField(m_isolatedContextData.get(), context);
     }
 
-    m_perContextData = V8PerContextData::create(m_context.get());
-    if (!m_perContextData->init()) {
-        disposeContext();
-        return false;
-    }
-
     if (!installDOMWindow()) {
         disposeContext();
         return false;
@@ -617,6 +618,8 @@
         InspectorInstrumentation::didCreateIsolatedContext(m_frame, scriptState, securityOrigin.get());
     }
     m_isolatedWorldShellSecurityOrigin = securityOrigin;
+    if (m_isolatedContextData)
+        m_isolatedContextData->setSecurityOrigin(m_isolatedWorldShellSecurityOrigin);
 }
 
 } // WebCore

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h	2012-09-29 00:45:07 UTC (rev 129965)
@@ -53,6 +53,34 @@
 // persist between navigations.
 class V8DOMWindowShell {
 public:
+
+    // This class holds all the data that is accessible from a context for an isolated shell.
+    // It survives until the context is deleted.
+    class IsolatedContextData {
+        WTF_MAKE_NONCOPYABLE(IsolatedContextData);
+    public:
+        static PassOwnPtr<IsolatedContextData> create(PassRefPtr<DOMWrapperWorld> world, PassOwnPtr<V8PerContextData> perContextData, PassRefPtr<SecurityOrigin> securityOrigin)
+        {
+            return adoptPtr(new IsolatedContextData(world, perContextData, securityOrigin));
+        }
+        DOMWrapperWorld* world() { return m_world.get(); }
+        V8PerContextData* perContextData() { return m_perContextData.get(); }
+        void setSecurityOrigin(PassRefPtr<SecurityOrigin> origin) { m_securityOrigin = origin; }
+        SecurityOrigin* securityOrigin() { return m_securityOrigin.get(); }
+
+    private:
+        IsolatedContextData(PassRefPtr<DOMWrapperWorld> world, PassOwnPtr<V8PerContextData> perContextData, PassRefPtr<SecurityOrigin> securityOrigin)
+            : m_world(world)
+            , m_perContextData(perContextData)
+            , m_securityOrigin(securityOrigin)
+        {
+        }
+
+        RefPtr<DOMWrapperWorld> m_world;
+        OwnPtr<V8PerContextData> m_perContextData;
+        RefPtr<SecurityOrigin> m_securityOrigin;
+    };
+
     static PassOwnPtr<V8DOMWindowShell> create(Frame*, PassRefPtr<DOMWrapperWorld>);
 
     v8::Persistent<v8::Context> context() const { return m_context.get(); }
@@ -76,6 +104,7 @@
 
     void clearForNavigation();
     void clearForClose();
+    void clearIsolatedShell();
 
     void destroyGlobal();
 
@@ -90,29 +119,25 @@
         return m_isolatedWorldShellSecurityOrigin.get();
     };
 
-    // Returns the isolated world associated with
-    // v8::Context::GetEntered(). Because worlds are isolated, the entire
-    // _javascript_ call stack should be from the same isolated world.
-    // Returns 0 if the entered context is from the main world.
-    //
-    // FIXME: Consider edge cases with DOM mutation events that might
-    // violate this invariant.
-    //
-    // FIXME: This is poorly named after the deletion of isolated contexts.
-    static V8DOMWindowShell* getEntered()
+    inline static IsolatedContextData* enteredIsolatedContextData()
     {
-        if (!DOMWrapperWorld::isolatedWorldsExist())
+        if (LIKELY(!DOMWrapperWorld::isolatedWorldsExist()))
             return 0;
         if (!v8::Context::InContext())
             return 0;
-        return enteredIsolatedWorldContext();
+        v8::Handle<v8::Object> innerGlobal = v8::Handle<v8::Object>::Cast(v8::Context::GetEntered()->Global()->GetPrototype());
+        IsolatedContextData* isolatedContextData = toIsolatedContextData(innerGlobal);
+        if (LIKELY(!isolatedContextData))
+            return 0;
+        return isolatedContextData;
     }
 
-    void destroyIsolatedShell();
+    static IsolatedContextData* toIsolatedContextData(v8::Handle<v8::Object> innerGlobal);
+
 private:
     V8DOMWindowShell(Frame*, PassRefPtr<DOMWrapperWorld>);
 
-    void disposeContext(bool weak = false);
+    void disposeContext();
 
     void setSecurityToken();
 
@@ -126,12 +151,11 @@
     void createContext();
     bool installDOMWindow();
 
-    static V8DOMWindowShell* enteredIsolatedWorldContext();
-
     Frame* m_frame;
     RefPtr<DOMWrapperWorld> m_world;
 
     OwnPtr<V8PerContextData> m_perContextData;
+    OwnPtr<IsolatedContextData> m_isolatedContextData;
 
     ScopedPersistent<v8::Context> m_context;
     ScopedPersistent<v8::Object> m_global;

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h	2012-09-29 00:45:07 UTC (rev 129965)
@@ -118,14 +118,14 @@
                     return *wrapper;
             }
 
-            V8DOMWindowShell* context = V8DOMWindowShell::getEntered();
-            if (LIKELY(!context)) {
+            V8DOMWindowShell::IsolatedContextData* isolatedData = V8DOMWindowShell::enteredIsolatedContextData();
+            if (LIKELY(!isolatedData)) {
                 v8::Persistent<v8::Object>* wrapper = node->wrapper();
                 if (!wrapper)
                     return v8::Handle<v8::Object>();
                 return *wrapper;
             }
-            DOMDataStore* store = context->world()->domDataStore();
+            DOMDataStore* store = isolatedData->world()->domDataStore();
             DOMNodeMapping& domNodeMap = node->isActiveNode() ? store->activeDomNodeMap() : store->domNodeMap();
             return domNodeMap.get(node);
         }

Modified: trunk/Source/WebCore/bindings/v8/WorldContextHandle.cpp (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/WorldContextHandle.cpp	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/WorldContextHandle.cpp	2012-09-29 00:45:07 UTC (rev 129965)
@@ -44,27 +44,28 @@
     if (worldToUse == UseMainWorld || worldToUse == UseWorkerWorld)
         return;
 
+    if (!v8::Context::InContext()) {
+        m_worldToUse = UseMainWorld;
+        return;
+    }
+
+    v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+    ASSERT(!context.IsEmpty());
+    v8::Handle<v8::Object> innerGlobal = toInnerGlobalObject(context);
 #if ENABLE(WORKERS)
-    // FIXME We are duplicating a lot of effort here checking the context for the worker and for the isolated world.
-    if (v8::Context::InContext()) {
-        v8::Handle<v8::Context> context = v8::Context::GetCurrent();
-        if (!context.IsEmpty()) {
-            if (UNLIKELY(!V8DOMWrapper::isWrapperOfType(toInnerGlobalObject(context), &V8DOMWindow::info))) {
-                m_worldToUse = UseWorkerWorld;
-                return;
-            }
-        }
+    if (UNLIKELY(!V8DOMWrapper::isWrapperOfType(innerGlobal, &V8DOMWindow::info))) {
+        m_worldToUse = UseWorkerWorld;
+        return;
     }
 #endif
 
-    V8DOMWindowShell* shell = V8DOMWindowShell::getEntered();
-    if (LIKELY(!shell)) {
+    V8DOMWindowShell::IsolatedContextData* data = ""
+    if (LIKELY(!data)) {
         m_worldToUse = UseMainWorld;
         return;
     }
 
-    ASSERT(!shell->context().IsEmpty());
-    m_context = SharedPersistent<v8::Context>::create(shell->context());
+    m_context = SharedPersistent<v8::Context>::create(context);
 }
 
 v8::Local<v8::Context> WorldContextHandle::adjustedContext(ScriptController* script) const

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp	2012-09-29 00:45:07 UTC (rev 129965)
@@ -108,7 +108,7 @@
     v8::Handle<v8::Object> wrapper = V8Document::wrap(impl, creationContext, isolate, forceNewObject);
     if (wrapper.IsEmpty())
         return wrapper;
-    if (!V8DOMWindowShell::getEntered()) {
+    if (!V8DOMWindowShell::enteredIsolatedContextData()) {
         if (Frame* frame = impl->frame())
             frame->script()->windowShell()->updateDocumentWrapper(wrapper);
     }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp	2012-09-29 00:45:07 UTC (rev 129965)
@@ -183,7 +183,7 @@
     v8::Handle<v8::Object> wrapper = V8HTMLDocument::wrap(impl, creationContext, isolate, forceNewObject);
     if (wrapper.IsEmpty())
         return wrapper;
-    if (!V8DOMWindowShell::getEntered()) {
+    if (!V8DOMWindowShell::enteredIsolatedContextData()) {
         if (Frame* frame = impl->frame())
             frame->script()->windowShell()->updateDocumentWrapper(wrapper);
     }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp	2012-09-29 00:45:07 UTC (rev 129965)
@@ -45,7 +45,7 @@
     v8::Handle<v8::Object> wrapper = V8SVGDocument::wrap(impl, creationContext, isolate, forceNewObject);
     if (wrapper.IsEmpty())
         return wrapper;
-    if (!V8DOMWindowShell::getEntered()) {
+    if (!V8DOMWindowShell::enteredIsolatedContextData()) {
         if (Frame* frame = impl->frame())
             frame->script()->windowShell()->updateDocumentWrapper(wrapper);
     }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp (129964 => 129965)


--- trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp	2012-09-29 00:36:58 UTC (rev 129964)
+++ trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp	2012-09-29 00:45:07 UTC (rev 129965)
@@ -55,8 +55,8 @@
     ScriptExecutionContext* context = getScriptExecutionContext();
 
     RefPtr<SecurityOrigin> securityOrigin;
-    if (V8DOMWindowShell* isolatedWorldShell = V8DOMWindowShell::getEntered())
-        securityOrigin = isolatedWorldShell->isolatedWorldSecurityOrigin();
+    if (V8DOMWindowShell::IsolatedContextData* isolatedContextData = V8DOMWindowShell::enteredIsolatedContextData())
+        securityOrigin = isolatedContextData->securityOrigin();
 
     RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, securityOrigin);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to