Title: [132505] trunk/Source/WebCore
Revision
132505
Author
o...@chromium.org
Date
2012-10-25 11:16:28 -0700 (Thu, 25 Oct 2012)

Log Message

Get rid of ScriptController::clearForNavigation
https://bugs.webkit.org/show_bug.cgi?id=100390

Reviewed by Adam Barth.

Get rid of clearForNavigation and change resetIsolatedWorlds
to reset so that it can also do the hintForCollectGarbage call.
No new tests. No behavior change.

* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::reset):
(WebCore::ScriptController::clearForClose):
(WebCore::ScriptController::clearWindowShell):
* bindings/v8/ScriptController.h:
(ScriptController):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (132504 => 132505)


--- trunk/Source/WebCore/ChangeLog	2012-10-25 18:08:21 UTC (rev 132504)
+++ trunk/Source/WebCore/ChangeLog	2012-10-25 18:16:28 UTC (rev 132505)
@@ -1,3 +1,21 @@
+2012-10-25  Ojan Vafai  <o...@chromium.org>
+
+        Get rid of ScriptController::clearForNavigation
+        https://bugs.webkit.org/show_bug.cgi?id=100390
+
+        Reviewed by Adam Barth.
+
+        Get rid of clearForNavigation and change resetIsolatedWorlds
+        to reset so that it can also do the hintForCollectGarbage call.
+        No new tests. No behavior change.
+
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::reset):
+        (WebCore::ScriptController::clearForClose):
+        (WebCore::ScriptController::clearWindowShell):
+        * bindings/v8/ScriptController.h:
+        (ScriptController):
+
 2012-10-25  Simon Fraser  <simon.fra...@apple.com>
 
         r132427 changed the tiling behavior of tiled layer TileCaches as well as the page tile cache

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.cpp (132504 => 132505)


--- trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-10-25 18:08:21 UTC (rev 132504)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-10-25 18:16:28 UTC (rev 132505)
@@ -142,29 +142,22 @@
 #endif
 }
 
-void ScriptController::resetIsolatedWorlds()
+void ScriptController::reset()
 {
     for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin();
          iter != m_isolatedWorlds.end(); ++iter) {
         iter->value->destroyIsolatedShell();
     }
     m_isolatedWorlds.clear();
+    V8GCController::hintForCollectGarbage();
 }
 
 void ScriptController::clearForClose()
 {
-    resetIsolatedWorlds();
-    V8GCController::hintForCollectGarbage();
+    reset();
     windowShell()->clearForClose();
 }
 
-void ScriptController::clearForNavigation()
-{
-    resetIsolatedWorlds();
-    V8GCController::hintForCollectGarbage();
-    windowShell()->clearForNavigation();
-}
-
 void ScriptController::updateSecurityOrigin()
 {
     windowShell()->updateSecurityOrigin();
@@ -634,10 +627,10 @@
 
 void ScriptController::clearWindowShell(DOMWindow*, bool)
 {
+    reset();
     // V8 binding expects ScriptController::clearWindowShell only be called
-    // when a frame is loading a new page. ScriptController::clearForNavigation
-    // creates a new context for the new page.
-    clearForNavigation();
+    // when a frame is loading a new page. This creates a new context for the new page.
+    windowShell()->clearForNavigation();
 }
 
 #if ENABLE(INSPECTOR)

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.h (132504 => 132505)


--- trunk/Source/WebCore/bindings/v8/ScriptController.h	2012-10-25 18:08:21 UTC (rev 132504)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.h	2012-10-25 18:16:28 UTC (rev 132505)
@@ -167,7 +167,6 @@
     void updatePlatformScriptObjects();
     void cleanupScriptObjectsForPlugin(Widget*);
 
-    void clearForNavigation();
     void clearForClose();
 
     NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*);
@@ -192,7 +191,7 @@
     // call world->destroyIsolatedShell().
     typedef HashMap<int, V8DOMWindowShell*> IsolatedWorldMap;
 
-    void resetIsolatedWorlds();
+    void reset();
 
     Frame* m_frame;
     const String* m_sourceURL;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to