[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

abarth at webkit.org abarth at webkit.org
Thu Apr 8 00:55:32 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit d59070c3534f7ada51468af66edb0413a8a8c25a
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 6 03:09:24 2010 +0000

    2010-01-05  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Dimitri Glazkov.
    
            [v8] Move V8DOMWindowShell to ScriptController
            https://bugs.webkit.org/show_bug.cgi?id=33232
    
            This patch moves V8DOMWindow shell to ScriptController, where the
            window shells live in JSC land.  The next step will be to allow for
            more than one window shell per script controller.
    
            * bindings/v8/ScriptController.cpp:
            (WebCore::ScriptController::ScriptController):
            (WebCore::ScriptController::~ScriptController):
            (WebCore::ScriptController::updateSecurityOrigin):
            (WebCore::ScriptController::evaluateInIsolatedWorld):
            (WebCore::ScriptController::haveInterpreter):
            (WebCore::ScriptController::mainWorldWindowShell):
            (WebCore::ScriptController::clearWindowShell):
            (WebCore::ScriptController::clearForClose):
            (WebCore::ScriptController::destroyWindowShell):
            (WebCore::ScriptController::updateDocument):
            * bindings/v8/ScriptController.h:
            * bindings/v8/V8DOMWindowShell.cpp:
            (WebCore::V8DOMWindowShell::~V8DOMWindowShell):
            * bindings/v8/V8DOMWindowShell.h:
            (WebCore::V8DOMWindowShell::localHandleForContext):
            * bindings/v8/V8DOMWrapper.cpp:
            (WebCore::V8DOMWrapper::instantiateV8Object):
            (WebCore::V8DOMWrapper::convertDocumentToV8Object):
            (WebCore::V8DOMWrapper::convertNewNodeToV8Object):
            * bindings/v8/V8IsolatedContext.cpp:
            (WebCore::V8IsolatedContext::V8IsolatedContext):
            * bindings/v8/V8Proxy.cpp:
            (WebCore::V8Proxy::V8Proxy):
            (WebCore::V8Proxy::~V8Proxy):
            (WebCore::V8Proxy::handleOutOfMemory):
            (WebCore::V8Proxy::evaluateInIsolatedWorld):
            (WebCore::V8Proxy::setInjectedScriptContextDebugId):
            (WebCore::V8Proxy::context):
            (WebCore::V8Proxy::mainWorldContext):
            (WebCore::V8Proxy::currentContext):
            (WebCore::V8Proxy::setContextDebugId):
            * bindings/v8/V8Proxy.h:
            * bindings/v8/WorldContextHandle.cpp:
            (WebCore::WorldContextHandle::adjustedContext):
    2010-01-05  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Dimitri Glazkov.
    
            [v8] Move V8DOMWindowShell to ScriptController
            https://bugs.webkit.org/show_bug.cgi?id=33232
    
            Update FrameLoaderClientImpl.cpp to call clearForClose on
            ScriptController instead of on V8Proxy.
    
            * src/FrameLoaderClientImpl.cpp:
            (WebKit::FrameLoaderClientImpl::detachedFromParent3):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52847 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 29991bf..4d5a8c0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,50 @@
+2010-01-05  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [v8] Move V8DOMWindowShell to ScriptController
+        https://bugs.webkit.org/show_bug.cgi?id=33232
+
+        This patch moves V8DOMWindow shell to ScriptController, where the
+        window shells live in JSC land.  The next step will be to allow for
+        more than one window shell per script controller.
+
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::ScriptController):
+        (WebCore::ScriptController::~ScriptController):
+        (WebCore::ScriptController::updateSecurityOrigin):
+        (WebCore::ScriptController::evaluateInIsolatedWorld):
+        (WebCore::ScriptController::haveInterpreter):
+        (WebCore::ScriptController::mainWorldWindowShell):
+        (WebCore::ScriptController::clearWindowShell):
+        (WebCore::ScriptController::clearForClose):
+        (WebCore::ScriptController::destroyWindowShell):
+        (WebCore::ScriptController::updateDocument):
+        * bindings/v8/ScriptController.h:
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::~V8DOMWindowShell):
+        * bindings/v8/V8DOMWindowShell.h:
+        (WebCore::V8DOMWindowShell::localHandleForContext):
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::instantiateV8Object):
+        (WebCore::V8DOMWrapper::convertDocumentToV8Object):
+        (WebCore::V8DOMWrapper::convertNewNodeToV8Object):
+        * bindings/v8/V8IsolatedContext.cpp:
+        (WebCore::V8IsolatedContext::V8IsolatedContext):
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::V8Proxy):
+        (WebCore::V8Proxy::~V8Proxy):
+        (WebCore::V8Proxy::handleOutOfMemory):
+        (WebCore::V8Proxy::evaluateInIsolatedWorld):
+        (WebCore::V8Proxy::setInjectedScriptContextDebugId):
+        (WebCore::V8Proxy::context):
+        (WebCore::V8Proxy::mainWorldContext):
+        (WebCore::V8Proxy::currentContext):
+        (WebCore::V8Proxy::setContextDebugId):
+        * bindings/v8/V8Proxy.h:
+        * bindings/v8/WorldContextHandle.cpp:
+        (WebCore::WorldContextHandle::adjustedContext):
+
 2010-01-05  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 3298cad..456a038 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -106,6 +106,7 @@ ScriptController::ScriptController(Frame* frame)
     , m_processingTimerCallback(false)
     , m_paused(false)
     , m_proxy(new V8Proxy(frame))
+    , m_windowShell(V8DOMWindowShell::create(frame))
 #if ENABLE(NETSCAPE_PLUGIN_API)
     , m_windowScriptNPObject(0)
 #endif
@@ -116,6 +117,7 @@ ScriptController::ScriptController(Frame* frame)
 ScriptController::~ScriptController()
 {
     m_proxy->disconnectFrame();
+    m_windowShell.clear();
 }
 
 void ScriptController::clearScriptObjects()
@@ -140,7 +142,7 @@ void ScriptController::clearScriptObjects()
 
 void ScriptController::updateSecurityOrigin()
 {
-    m_proxy->windowShell()->updateSecurityOrigin();
+    m_windowShell->updateSecurityOrigin();
 }
 
 void ScriptController::updatePlatformScriptObjects()
@@ -205,6 +207,8 @@ bool ScriptController::anyPageIsProcessingUserGesture() const
 
 void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>& sources)
 {
+    // FIXME: This will need to get reorganized once we have a windowShell for the isolated world.
+    m_windowShell->initContextIfNeeded();
     m_proxy->evaluateInIsolatedWorld(worldID, sources, 0);
 }
 
@@ -291,7 +295,7 @@ void ScriptController::lowMemoryNotification()
 
 bool ScriptController::haveInterpreter() const
 {
-    return m_proxy->windowShell()->isContextInitialized();
+    return m_windowShell->isContextInitialized();
 }
 
 bool ScriptController::isEnabled() const
@@ -435,15 +439,32 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement
     return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(v8plugin), window);
 }
 
+V8DOMWindowShell* ScriptController::mainWorldWindowShell() const
+{
+    m_windowShell->initContextIfNeeded();
+    return m_windowShell.get();
+}
 
 void ScriptController::clearWindowShell()
 {
     m_mainWorldScriptState.clear();
+    m_proxy->resetIsolatedWorlds();
 
     // V8 binding expects ScriptController::clearWindowShell only be called
-    // when a frame is loading a new page. V8Proxy::clearForNavigation
+    // when a frame is loading a new page. V8DOMWindowShell::clearForNavigation
     // creates a new context for the new page.
-    m_proxy->clearForNavigation();
+    m_windowShell->clearForNavigation();
+}
+
+void ScriptController::clearForClose()
+{
+    m_windowShell->clearForClose();
+}
+
+void ScriptController::destroyWindowShell()
+{
+    m_windowShell->clearForClose();
+    m_windowShell->destroyGlobal();
 }
 
 void ScriptController::attachDebugger(void*)
@@ -453,7 +474,7 @@ void ScriptController::attachDebugger(void*)
 
 void ScriptController::updateDocument()
 {
-    m_proxy->windowShell()->updateDocument();
+    m_windowShell->updateDocument();
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index 9ba7d38..958ebfb 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -63,6 +63,8 @@ public:
     // or this accessor should be made JSProxy*
     V8Proxy* proxy() { return m_proxy.get(); }
 
+    V8DOMWindowShell* mainWorldWindowShell() const;
+
     ScriptValue executeScript(const ScriptSourceCode&);
     ScriptValue executeScript(const String& script, bool forceUserGesture = false);
 
@@ -153,6 +155,11 @@ public:
     void clearWindowShell();
     void updateDocument();
 
+    void clearForClose();
+
+    // This is very destructive (e.g., out of memory).
+    void destroyWindowShell();
+
     void updateSecurityOrigin();
     void clearScriptObjects();
     void updatePlatformScriptObjects();
@@ -182,7 +189,12 @@ private:
     bool m_processingTimerCallback;
     bool m_paused;
 
+    // FIXME: V8Proxy should eventually be removed.
     OwnPtr<V8Proxy> m_proxy;
+
+    // For the moment, we have one of these.  Soon we will have one per DOMWrapperWorld.
+    RefPtr<V8DOMWindowShell> m_windowShell;
+
     typedef HashMap<Widget*, NPObject*> PluginObjectMap;
 
     // A mapping between Widgets and their corresponding script object.
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.cpp b/WebCore/bindings/v8/V8DOMWindowShell.cpp
index 968ab05..088329a 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -100,6 +100,12 @@ V8DOMWindowShell::V8DOMWindowShell(Frame* frame)
 {
 }
 
+V8DOMWindowShell::~V8DOMWindowShell()
+{
+    clearForClose();
+    destroyGlobal();
+}
+
 bool V8DOMWindowShell::isContextInitialized()
 {
     // m_context, m_global, and m_wrapperBoilerplates should
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.h b/WebCore/bindings/v8/V8DOMWindowShell.h
index de149be..9535da5 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.h
+++ b/WebCore/bindings/v8/V8DOMWindowShell.h
@@ -46,8 +46,13 @@ class V8DOMWindowShell : public RefCounted<V8DOMWindowShell> {
 public:
     static PassRefPtr<V8DOMWindowShell> create(Frame*);
 
+    virtual ~V8DOMWindowShell();
+
     v8::Handle<v8::Context> context() const { return m_context; }
 
+    // This method is slower than |context()|, but sometimes we need local handles.
+    v8::Local<v8::Context> localHandleForContext() const { return v8::Local<v8::Context>::New(m_context); }
+
     // Update document object of the frame.
     void updateDocument();
 
@@ -65,7 +70,6 @@ public:
 
     void clearForNavigation();
     void clearForClose();
-
     void destroyGlobal();
 
     static v8::Handle<v8::Value> getHiddenObjectPrototype(v8::Handle<v8::Context>);
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index 6b212c0..a637536 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -802,7 +802,7 @@ v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, V8ClassI
     v8::Local<v8::Object> instance;
     if (proxy)
         // FIXME: Fix this to work properly with isolated worlds (see above).
-        instance = proxy->windowShell()->createWrapperFromCache(descriptorType);
+        instance = proxy->frame()->script()->mainWorldWindowShell()->createWrapperFromCache(descriptorType);
     else {
         v8::Local<v8::Function> function = getTemplate(descriptorType)->GetFunction();
         instance = SafeAllocation::newInstance(function);
@@ -1204,8 +1204,15 @@ v8::Handle<v8::Value> V8DOMWrapper::convertDocumentToV8Object(Document* document
     // instantiate a document wrapper.  Therefore, we get the proxy before
     // checking if the node already has a wrapper.
     V8Proxy* proxy = V8Proxy::retrieve(document->frame());
-    if (proxy)
-        proxy->windowShell()->initContextIfNeeded();
+    if (proxy) {
+        // This code looks wacky:
+        // 1) The test for |proxy| above is really a test whether JavaScript
+        //    is enabled in this frame.  I have no idea if that's needed.
+        // 2) Calling initContextIfNeeded here is redundant becase just
+        //    grabbing mainWorldWindowShell() already calls initContextIfNeeded.
+        // FIXME: I bet we can clean this up a bit!
+        proxy->frame()->script()->mainWorldWindowShell()->initContextIfNeeded();
+    }
 
     DOMWrapperMap<Node>& domNodeMap = getDOMNodeMap();
     v8::Handle<v8::Object> wrapper = domNodeMap.get(document);
@@ -1294,8 +1301,10 @@ v8::Handle<v8::Value> V8DOMWrapper::convertNewNodeToV8Object(Node* node, V8Proxy
     domNodeMap.set(node, v8::Persistent<v8::Object>::New(result));
 
     if (isDocument) {
-        if (proxy)
-            proxy->windowShell()->updateDocumentWrapper(result);
+        if (proxy) {
+            // FIXME: Don't we need to do this for every world?
+            proxy->frame()->script()->mainWorldWindowShell()->updateDocumentWrapper(result);
+        }
 
         if (type == V8ClassIndex::HTMLDOCUMENT) {
             // Create marker object and insert it in two internal fields.
diff --git a/WebCore/bindings/v8/V8IsolatedContext.cpp b/WebCore/bindings/v8/V8IsolatedContext.cpp
index e8a51cb..663c6f2 100644
--- a/WebCore/bindings/v8/V8IsolatedContext.cpp
+++ b/WebCore/bindings/v8/V8IsolatedContext.cpp
@@ -53,9 +53,15 @@ void V8IsolatedContext::contextWeakReferenceCallback(v8::Persistent<v8::Value> o
 V8IsolatedContext::V8IsolatedContext(V8Proxy* proxy, int extensionGroup)
     : m_world(IsolatedWorld::create())
 {
+    // FIXME: None of this code belongs here! Basically, ScriptController
+    // should create a new DOMWrapperWorld and a new windowShell and then
+    // evaluate the script.
+
+    V8DOMWindowShell* mainWorldWindowShell = proxy->frame()->script()->mainWorldWindowShell();
+
     v8::HandleScope scope;
     // FIXME: We should be creating a new V8DOMWindowShell here instead of riping out the context.
-    m_context = SharedPersistent<v8::Context>::create(proxy->windowShell()->createNewContext(v8::Handle<v8::Object>(), extensionGroup));
+    m_context = SharedPersistent<v8::Context>::create(mainWorldWindowShell->createNewContext(v8::Handle<v8::Object>(), extensionGroup));
     if (m_context->get().IsEmpty())
         return;
 
@@ -66,7 +72,7 @@ V8IsolatedContext::V8IsolatedContext(V8Proxy* proxy, int extensionGroup)
 
     V8DOMWindowShell::installHiddenObjectPrototype(m_context->get());
     // FIXME: This will go away once we have a windowShell for the isolated world.
-    proxy->windowShell()->installDOMWindow(m_context->get(), proxy->frame()->domWindow());
+    mainWorldWindowShell->installDOMWindow(m_context->get(), proxy->frame()->domWindow());
 
     // Using the default security token means that the canAccess is always
     // called, which is slow.
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index e6e7f89..44b7c52 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -213,7 +213,6 @@ static void handleFatalErrorInV8()
 
 V8Proxy::V8Proxy(Frame* frame)
     : m_frame(frame)
-    , m_windowShell(V8DOMWindowShell::create(frame))
     , m_inlineCode(false)
     , m_timerCallback(false)
     , m_recursion(0)
@@ -222,8 +221,7 @@ V8Proxy::V8Proxy(Frame* frame)
 
 V8Proxy::~V8Proxy()
 {
-    clearForClose();
-    windowShell()->destroyGlobal();
+    resetIsolatedWorlds();
 }
 
 v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine)
@@ -246,13 +244,7 @@ bool V8Proxy::handleOutOfMemory()
     // Warning, error, disable JS for this frame?
     Frame* frame = V8Proxy::retrieveFrame(context);
 
-    V8Proxy* proxy = V8Proxy::retrieve(frame);
-    if (proxy) {
-        // Clean m_context, and event handlers.
-        proxy->clearForClose();
-
-        proxy->windowShell()->destroyGlobal();
-    }
+    frame->script()->destroyWindowShell();
 
     ChromiumBridge::notifyJSOutOfMemory(frame);
 
@@ -266,9 +258,6 @@ bool V8Proxy::handleOutOfMemory()
 
 void V8Proxy::evaluateInIsolatedWorld(int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup)
 {
-    // FIXME: This will need to get reorganized once we have a windowShell for the isolated world.
-    windowShell()->initContextIfNeeded();
-
     v8::HandleScope handleScope;
     V8IsolatedContext* isolatedContext = 0;
 
@@ -314,7 +303,7 @@ bool V8Proxy::setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetCont
 {
     // Setup context id for JS debugger.
     v8::Context::Scope contextScope(targetContext);
-    v8::Handle<v8::Context> context = windowShell()->context();
+    v8::Handle<v8::Context> context = m_frame->script()->mainWorldWindowShell()->localHandleForContext();
     if (context.IsEmpty())
         return false;
     int debugId = contextDebugId(context);
@@ -584,18 +573,6 @@ void V8Proxy::resetIsolatedWorlds()
     m_isolatedWorlds.clear();
 }
 
-void V8Proxy::clearForClose()
-{
-    resetIsolatedWorlds();
-    windowShell()->clearForClose();
-}
-
-void V8Proxy::clearForNavigation()
-{
-    resetIsolatedWorlds();
-    windowShell()->clearForNavigation();
-}
-
 void V8Proxy::setDOMException(int exceptionCode)
 {
     if (exceptionCode <= 0)
@@ -655,6 +632,7 @@ v8::Handle<v8::Value> V8Proxy::throwError(ErrorType type, const char* message)
 
 v8::Local<v8::Context> V8Proxy::context(Frame* frame)
 {
+    // FIXME: Move this function to ScriptController.
     v8::Local<v8::Context> context = V8Proxy::mainWorldContext(frame);
     if (context.IsEmpty())
         return v8::Local<v8::Context>();
@@ -670,32 +648,28 @@ v8::Local<v8::Context> V8Proxy::context(Frame* frame)
 
 v8::Local<v8::Context> V8Proxy::context()
 {
+    // FIXME: Move this function to ScriptController.
     if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) {
         RefPtr<SharedPersistent<v8::Context> > context = isolatedContext->sharedContext();
         if (m_frame != V8Proxy::retrieveFrame(context->get()))
             return v8::Local<v8::Context>();
         return v8::Local<v8::Context>::New(context->get());
     }
-    return mainWorldContext();
-}
-
-v8::Local<v8::Context> V8Proxy::mainWorldContext()
-{
-    windowShell()->initContextIfNeeded();
-    return v8::Local<v8::Context>::New(windowShell()->context());
+    return m_frame->script()->mainWorldWindowShell()->localHandleForContext();
 }
 
 v8::Local<v8::Context> V8Proxy::mainWorldContext(Frame* frame)
 {
-    V8Proxy* proxy = retrieve(frame);
-    if (!proxy)
+    // FIXME: Move this function to ScriptController.
+    if (!frame->script()->isEnabled())
         return v8::Local<v8::Context>();
 
-    return proxy->mainWorldContext();
+    return frame->script()->mainWorldWindowShell()->localHandleForContext();
 }
 
 v8::Local<v8::Context> V8Proxy::currentContext()
 {
+    // FIXME: Why does this function exist?
     return v8::Context::GetCurrent();
 }
 
@@ -830,7 +804,7 @@ void V8Proxy::registerExtension(v8::Extension* extension, int extensionGroup)
 bool V8Proxy::setContextDebugId(int debugId)
 {
     ASSERT(debugId > 0);
-    v8::Handle<v8::Context> context = windowShell()->context();
+    v8::Local<v8::Context> context = m_frame->script()->mainWorldWindowShell()->localHandleForContext();
     if (context.IsEmpty())
         return false;
     v8::HandleScope scope;
diff --git a/WebCore/bindings/v8/V8Proxy.h b/WebCore/bindings/v8/V8Proxy.h
index 598340d..d07bd0e 100644
--- a/WebCore/bindings/v8/V8Proxy.h
+++ b/WebCore/bindings/v8/V8Proxy.h
@@ -152,9 +152,6 @@ namespace WebCore {
 
         Frame* frame() { return m_frame; }
 
-        void clearForNavigation();
-        void clearForClose();
-
         // FIXME: Need comment. User Gesture related.
         bool inlineCode() const { return m_inlineCode; }
         void setInlineCode(bool value) { m_inlineCode = value; }
@@ -309,10 +306,6 @@ namespace WebCore {
         static bool sourceName(String& result);
 
         v8::Local<v8::Context> context();
-        v8::Local<v8::Context> mainWorldContext();
-
-        // FIXME: This should eventually take DOMWrapperWorld argument!
-        V8DOMWindowShell* windowShell() const { return m_windowShell.get(); }
 
         bool setContextDebugId(int id);
         static int contextDebugId(v8::Handle<v8::Context>);
@@ -335,13 +328,14 @@ namespace WebCore {
         // Report an unsafe attempt to access the given frame on the console.
         static void reportUnsafeAccessTo(Frame* target, DelayReporting delay);
 
+        // FIXME: This should move to ScriptController.
+        void resetIsolatedWorlds();
+
     private:
         // If m_recursionCount is 0, let LocalStorage know so we can release
         // the storage mutex.
         void releaseStorageMutex();
 
-        void resetIsolatedWorlds();
-
         // Returns false when we're out of memory in V8.
         bool setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContext);
 
@@ -370,9 +364,6 @@ namespace WebCore {
 
         Frame* m_frame;
 
-        // For the moment, we have one of these.  Soon we will have one per DOMWrapperWorld.
-        RefPtr<V8DOMWindowShell> m_windowShell;
-        
         // Utility context holding JavaScript functions used internally.
         static v8::Persistent<v8::Context> m_utilityContext;
 
diff --git a/WebCore/bindings/v8/WorldContextHandle.cpp b/WebCore/bindings/v8/WorldContextHandle.cpp
index 7ba76d3..04879b4 100644
--- a/WebCore/bindings/v8/WorldContextHandle.cpp
+++ b/WebCore/bindings/v8/WorldContextHandle.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "WorldContextHandle.h"
 
+#include "Frame.h"
 #include "V8IsolatedContext.h"
 
 namespace WebCore {
@@ -48,7 +49,7 @@ WorldContextHandle::WorldContextHandle(WorldToUse worldToUse)
 v8::Local<v8::Context> WorldContextHandle::adjustedContext(V8Proxy* proxy) const
 {
     if (m_worldToUse == UseMainWorld)
-        return proxy->mainWorldContext();
+        return proxy->frame()->script()->mainWorldWindowShell()->localHandleForContext();
     if (!m_context || m_context->get().IsEmpty())
         return proxy->context();
     return v8::Local<v8::Context>::New(m_context->get());
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index ce19dbd..fd977e3 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-05  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [v8] Move V8DOMWindowShell to ScriptController
+        https://bugs.webkit.org/show_bug.cgi?id=33232
+
+        Update FrameLoaderClientImpl.cpp to call clearForClose on
+        ScriptController instead of on V8Proxy.
+
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::detachedFromParent3):
+
 2010-01-05  Rachel Petterson  <rlp at google.com>
 
         Reviewed by Adam Barth.
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index cdeebed..cdc949d 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -215,8 +215,8 @@ void FrameLoaderClientImpl::detachedFromParent3()
     // will cause a crash.  If you remove/modify this, just ensure that you can
     // go to a page and then navigate to a new page without getting any asserts
     // or crashes.
-    m_webFrame->frame()->script()->proxy()->clearForClose();
-    
+    m_webFrame->frame()->script()->clearForClose();
+
     // Stop communicating with the WebFrameClient at this point since we are no
     // longer associated with the Page.
     m_webFrame->dropClient();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list