Title: [126086] trunk/Source
Revision
126086
Author
[email protected]
Date
2012-08-20 16:18:17 -0700 (Mon, 20 Aug 2012)

Log Message

[V8] Move clearForClose() and clearForNavigation() from V8Proxy to ScriptController
https://bugs.webkit.org/show_bug.cgi?id=94459

Reviewed by Adam Barth.

To kill V8Proxy, we can move clearForClose() and
clearForNavigation() from V8Proxy to ScriptController.

No tests. No change in behavior.

Source/WebCore:

* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::~ScriptController):
(WebCore::ScriptController::resetIsolatedWorlds):
(WebCore):
(WebCore::ScriptController::clearForClose):
(WebCore::ScriptController::clearForNavigation):
(WebCore::ScriptController::clearWindowShell):
* bindings/v8/ScriptController.h:
(ScriptController):
* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::~V8Proxy):
(WebCore::V8Proxy::handleOutOfMemory):
* bindings/v8/V8Proxy.h:
(V8Proxy):

Source/WebKit/chromium:

* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::detachedFromParent3):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126085 => 126086)


--- trunk/Source/WebCore/ChangeLog	2012-08-20 23:16:42 UTC (rev 126085)
+++ trunk/Source/WebCore/ChangeLog	2012-08-20 23:18:17 UTC (rev 126086)
@@ -1,3 +1,30 @@
+2012-08-20  Kentaro Hara  <[email protected]>
+
+        [V8] Move clearForClose() and clearForNavigation() from V8Proxy to ScriptController
+        https://bugs.webkit.org/show_bug.cgi?id=94459
+
+        Reviewed by Adam Barth.
+
+        To kill V8Proxy, we can move clearForClose() and
+        clearForNavigation() from V8Proxy to ScriptController.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::~ScriptController):
+        (WebCore::ScriptController::resetIsolatedWorlds):
+        (WebCore):
+        (WebCore::ScriptController::clearForClose):
+        (WebCore::ScriptController::clearForNavigation):
+        (WebCore::ScriptController::clearWindowShell):
+        * bindings/v8/ScriptController.h:
+        (ScriptController):
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::~V8Proxy):
+        (WebCore::V8Proxy::handleOutOfMemory):
+        * bindings/v8/V8Proxy.h:
+        (V8Proxy):
+
 2012-08-20  Dirk Schulze  <[email protected]>
 
         CSS Masking and CSS Filters applied in wrong order

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.cpp (126085 => 126086)


--- trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-08-20 23:16:42 UTC (rev 126085)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-08-20 23:18:17 UTC (rev 126086)
@@ -114,6 +114,7 @@
 
 ScriptController::~ScriptController()
 {
+    clearForClose();
 }
 
 void ScriptController::clearScriptObjects()
@@ -145,6 +146,30 @@
 #endif
 }
 
+void ScriptController::resetIsolatedWorlds()
+{
+    for (IsolatedWorldMap::iterator iter = m_proxy->isolatedWorlds().begin();
+         iter != m_proxy->isolatedWorlds().end(); ++iter) {
+        iter->second->destroy();
+    }
+    m_proxy->isolatedWorlds().clear();
+    m_proxy->isolatedWorldSecurityOrigins().clear();
+}
+
+void ScriptController::clearForClose()
+{
+    resetIsolatedWorlds();
+    V8GCController::collectGarbageIfNecessary();
+    windowShell()->clearForClose();
+}
+
+void ScriptController::clearForNavigation()
+{
+    resetIsolatedWorlds();
+    V8GCController::collectGarbageIfNecessary();
+    windowShell()->clearForNavigation();
+}
+
 void ScriptController::updateSecurityOrigin()
 {
     windowShell()->updateSecurityOrigin();
@@ -522,7 +547,7 @@
     // V8 binding expects ScriptController::clearWindowShell only be called
     // when a frame is loading a new page. V8Proxy::clearForNavigation
     // creates a new context for the new page.
-    m_proxy->clearForNavigation();
+    clearForNavigation();
 }
 
 #if ENABLE(INSPECTOR)

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.h (126085 => 126086)


--- trunk/Source/WebCore/bindings/v8/ScriptController.h	2012-08-20 23:16:42 UTC (rev 126085)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.h	2012-08-20 23:18:17 UTC (rev 126086)
@@ -188,6 +188,9 @@
     void updatePlatformScriptObjects();
     void cleanupScriptObjectsForPlugin(Widget*);
 
+    void clearForNavigation();
+    void clearForClose();
+
     NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*);
     NPObject* windowScriptNPObject();
 
@@ -205,6 +208,8 @@
     static int contextDebugId(v8::Handle<v8::Context>);
 
 private:
+    void resetIsolatedWorlds();
+
     Frame* m_frame;
     const String* m_sourceURL;
 

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.cpp (126085 => 126086)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-20 23:16:42 UTC (rev 126085)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-20 23:18:17 UTC (rev 126086)
@@ -118,7 +118,6 @@
 
 V8Proxy::~V8Proxy()
 {
-    clearForClose();
     windowShell()->destroyGlobal();
 }
 
@@ -145,7 +144,7 @@
     if (!frame)
         return true;
 
-    frame->script()->proxy()->clearForClose();
+    frame->script()->clearForClose();
     frame->script()->windowShell()->destroyGlobal();
 
 #if PLATFORM(CHROMIUM)
@@ -348,30 +347,6 @@
     return frame->script()->windowShell()->perContextData();
 }
 
-void V8Proxy::resetIsolatedWorlds()
-{
-    for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin();
-         iter != m_isolatedWorlds.end(); ++iter) {
-        iter->second->destroy();
-    }
-    m_isolatedWorlds.clear();
-    m_isolatedWorldSecurityOrigins.clear();
-}
-
-void V8Proxy::clearForClose()
-{
-    resetIsolatedWorlds();
-    V8GCController::collectGarbageIfNecessary();
-    windowShell()->clearForClose();
-}
-
-void V8Proxy::clearForNavigation()
-{
-    resetIsolatedWorlds();
-    V8GCController::collectGarbageIfNecessary();
-    windowShell()->clearForNavigation();
-}
-
 v8::Local<v8::Context> V8Proxy::context(Frame* frame)
 {
     v8::Local<v8::Context> context = ScriptController::mainWorldContext(frame);

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.h (126085 => 126086)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-08-20 23:16:42 UTC (rev 126085)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-08-20 23:18:17 UTC (rev 126086)
@@ -87,9 +87,6 @@
 
         Frame* frame() const { return m_frame; }
 
-        void clearForNavigation();
-        void clearForClose();
-
         void finishedWithEvent(Event*) { }
 
         // Evaluate a script file in the current execution environment.
@@ -143,8 +140,6 @@
         IsolatedWorldSecurityOriginMap& isolatedWorldSecurityOrigins() { return m_isolatedWorldSecurityOrigins; }
 
     private:
-        void resetIsolatedWorlds();
-
         PassOwnPtr<v8::ScriptData> precompileScript(v8::Handle<v8::String>, CachedScript*);
 
         Frame* m_frame;

Modified: trunk/Source/WebKit/chromium/ChangeLog (126085 => 126086)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-20 23:16:42 UTC (rev 126085)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-20 23:18:17 UTC (rev 126086)
@@ -1,5 +1,20 @@
 2012-08-20  Kentaro Hara  <[email protected]>
 
+        [V8] Move clearForClose() and clearForNavigation() from V8Proxy to ScriptController
+        https://bugs.webkit.org/show_bug.cgi?id=94459
+
+        Reviewed by Adam Barth.
+
+        To kill V8Proxy, we can move clearForClose() and
+        clearForNavigation() from V8Proxy to ScriptController.
+
+        No tests. No change in behavior.
+
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::detachedFromParent3):
+
+2012-08-20  Kentaro Hara  <[email protected]>
+
         [V8] Move mainWorldContext() from V8Proxy to ScriptController
         https://bugs.webkit.org/show_bug.cgi?id=94453
 

Modified: trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp (126085 => 126086)


--- trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-08-20 23:16:42 UTC (rev 126085)
+++ trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-08-20 23:18:17 UTC (rev 126086)
@@ -304,7 +304,7 @@
     // 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();
 
     // Alert the client that the frame is being detached. This is the last
     // chance we have to communicate with the client.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to