Title: [125993] trunk/Source/WebCore
Revision
125993
Author
[email protected]
Date
2012-08-19 21:32:15 -0700 (Sun, 19 Aug 2012)

Log Message

[V8] Move m_windowShell from V8Proxy to ScriptController
https://bugs.webkit.org/show_bug.cgi?id=94438

Reviewed by Adam Barth.

m_windowShell should be owned by ScriptController.
After this change, I can move a bunch of V8Proxy methods
that access windowShell() from V8Proxy to ScriptController.

No tests. No change in behavior.

* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::ScriptController):
* bindings/v8/ScriptController.h:
(WebCore):
(WebCore::ScriptController::windowShell):
(ScriptController):
* bindings/v8/V8Binding.h:
* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::V8Proxy):
(WebCore::V8Proxy::windowShell):
(WebCore):
* bindings/v8/V8Proxy.h:
(WebCore):
(WebCore::V8Proxy::frame):
(V8Proxy):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125992 => 125993)


--- trunk/Source/WebCore/ChangeLog	2012-08-20 04:03:24 UTC (rev 125992)
+++ trunk/Source/WebCore/ChangeLog	2012-08-20 04:32:15 UTC (rev 125993)
@@ -1,3 +1,32 @@
+2012-08-19  Kentaro Hara  <[email protected]>
+
+        [V8] Move m_windowShell from V8Proxy to ScriptController
+        https://bugs.webkit.org/show_bug.cgi?id=94438
+
+        Reviewed by Adam Barth.
+
+        m_windowShell should be owned by ScriptController.
+        After this change, I can move a bunch of V8Proxy methods
+        that access windowShell() from V8Proxy to ScriptController.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::ScriptController):
+        * bindings/v8/ScriptController.h:
+        (WebCore):
+        (WebCore::ScriptController::windowShell):
+        (ScriptController):
+        * bindings/v8/V8Binding.h:
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::V8Proxy):
+        (WebCore::V8Proxy::windowShell):
+        (WebCore):
+        * bindings/v8/V8Proxy.h:
+        (WebCore):
+        (WebCore::V8Proxy::frame):
+        (V8Proxy):
+
 2012-08-19  Benjamin Poulain  <[email protected]>
 
         Do not allocate SQLiteDatabase's m_openErrorMessage until its needed

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.cpp (125992 => 125993)


--- trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-08-20 04:03:24 UTC (rev 125992)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-08-20 04:32:15 UTC (rev 125993)
@@ -102,6 +102,7 @@
 ScriptController::ScriptController(Frame* frame)
     : m_frame(frame)
     , m_sourceURL(0)
+    , m_windowShell(V8DOMWindowShell::create(frame))
     , m_paused(false)
     , m_proxy(adoptPtr(new V8Proxy(frame)))
 #if ENABLE(NETSCAPE_PLUGIN_API)

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.h (125992 => 125993)


--- trunk/Source/WebCore/bindings/v8/ScriptController.h	2012-08-20 04:03:24 UTC (rev 125992)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.h	2012-08-20 04:32:15 UTC (rev 125993)
@@ -51,10 +51,12 @@
 class DOMWrapperWorld;
 class Event;
 class Frame;
+class HTMLDocument;
 class HTMLPlugInElement;
 class PagePopupClient;
 class ScriptSourceCode;
 class ScriptState;
+class V8DOMWindowShell;
 class Widget;
 
 class ScriptController {
@@ -65,7 +67,7 @@
     // FIXME: V8Proxy should either be folded into ScriptController
     // or this accessor should be made JSProxy*
     V8Proxy* proxy() { return m_proxy.get(); }
-    V8DOMWindowShell* windowShell() { return m_proxy->windowShell(); }
+    V8DOMWindowShell* windowShell() const { return m_windowShell.get(); }
 
     ScriptValue executeScript(const ScriptSourceCode&);
     ScriptValue executeScript(const String& script, bool forceUserGesture = false);
@@ -186,6 +188,9 @@
     Frame* m_frame;
     const String* m_sourceURL;
 
+    // For the moment, we have one of these. Soon we will have one per DOMWrapperWorld.
+    RefPtr<V8DOMWindowShell> m_windowShell;
+
     bool m_paused;
 
     OwnPtr<V8Proxy> m_proxy;

Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (125992 => 125993)


--- trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-08-20 04:03:24 UTC (rev 125992)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-08-20 04:32:15 UTC (rev 125993)
@@ -36,6 +36,7 @@
 #include "SafeAllocation.h"
 #include "V8BindingMacros.h"
 #include "V8DOMConfiguration.h"
+#include "V8DOMWindowShell.h"
 #include "V8DOMWrapper.h"
 #include "V8HiddenPropertyName.h"
 #include "V8PerIsolateData.h"

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.cpp (125992 => 125993)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-20 04:03:24 UTC (rev 125992)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-20 04:32:15 UTC (rev 125993)
@@ -120,7 +120,6 @@
 
 V8Proxy::V8Proxy(Frame* frame)
     : m_frame(frame)
-    , m_windowShell(V8DOMWindowShell::create(frame))
 {
 }
 
@@ -355,6 +354,11 @@
     return result;
 }
 
+V8DOMWindowShell* V8Proxy::windowShell() const
+{
+    return frame()->script()->windowShell();
+}
+
 DOMWindow* V8Proxy::retrieveWindow(v8::Handle<v8::Context> context)
 {
     v8::Handle<v8::Object> global = context->Global();

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.h (125992 => 125993)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-08-20 04:03:24 UTC (rev 125992)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-08-20 04:32:15 UTC (rev 125993)
@@ -35,7 +35,6 @@
 #include "SharedPersistent.h"
 #include "StatsCounter.h"
 #include "V8AbstractEventListener.h"
-#include "V8DOMWindowShell.h"
 #include "V8DOMWrapper.h"
 #include "V8GCController.h"
 #include "V8Utilities.h"
@@ -62,9 +61,10 @@
     class ScriptExecutionContext;
     class ScriptSourceCode;
     class SecurityOrigin;
-    class V8PerContextData;
+    class V8DOMWindowShell;
     class V8EventListener;
     class V8IsolatedContext;
+    class V8PerContextData;
     class WorldContextHandle;
 
     const int kMaxRecursionDepth = 22;
@@ -88,7 +88,7 @@
 
         ~V8Proxy();
 
-        Frame* frame() { return m_frame; }
+        Frame* frame() const { return m_frame; }
 
         void clearForNavigation();
         void clearForClose();
@@ -138,7 +138,9 @@
         bool matchesCurrentContext();
 
         // FIXME: This should eventually take DOMWrapperWorld argument!
-        V8DOMWindowShell* windowShell() const { return m_windowShell.get(); }
+        // FIXME: This method will be soon removed, as all methods that access windowShell()
+        // will be moved to ScriptController.
+        V8DOMWindowShell* windowShell() const;
 
         bool setContextDebugId(int id);
         static int contextDebugId(v8::Handle<v8::Context>);
@@ -164,9 +166,6 @@
 
         Frame* m_frame;
 
-        // For the moment, we have one of these.  Soon we will have one per DOMWrapperWorld.
-        RefPtr<V8DOMWindowShell> m_windowShell;
-
         // All of the extensions registered with the context.
         static V8Extensions m_extensions;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to