Title: [126218] trunk/Source/WebCore
Revision
126218
Author
[email protected]
Date
2012-08-21 16:38:35 -0700 (Tue, 21 Aug 2012)

Log Message

[V8] Move toV8Context() from V8Proxy to V8Binding
https://bugs.webkit.org/show_bug.cgi?id=94597

Reviewed by Adam Barth.

To kill V8Proxy, we can move toV8Context() from V8Proxy to V8Binding.

No tests. No change in behavior.

* bindings/v8/V8Binding.cpp:
(WebCore::toV8Context):
(WebCore):
* bindings/v8/V8Binding.h:
(WebCore):
* bindings/v8/V8Proxy.cpp:
* bindings/v8/V8Proxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126217 => 126218)


--- trunk/Source/WebCore/ChangeLog	2012-08-21 23:37:43 UTC (rev 126217)
+++ trunk/Source/WebCore/ChangeLog	2012-08-21 23:38:35 UTC (rev 126218)
@@ -1,3 +1,22 @@
+2012-08-21  Kentaro Hara  <[email protected]>
+
+        [V8] Move toV8Context() from V8Proxy to V8Binding
+        https://bugs.webkit.org/show_bug.cgi?id=94597
+
+        Reviewed by Adam Barth.
+
+        To kill V8Proxy, we can move toV8Context() from V8Proxy to V8Binding.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/V8Binding.cpp:
+        (WebCore::toV8Context):
+        (WebCore):
+        * bindings/v8/V8Binding.h:
+        (WebCore):
+        * bindings/v8/V8Proxy.cpp:
+        * bindings/v8/V8Proxy.h:
+
 2012-08-21  Gabriel Peal  <[email protected]>
 
         Web Inspector: Embeddable Web Inspector

Modified: trunk/Source/WebCore/bindings/v8/V8Binding.cpp (126217 => 126218)


--- trunk/Source/WebCore/bindings/v8/V8Binding.cpp	2012-08-21 23:37:43 UTC (rev 126217)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.cpp	2012-08-21 23:38:35 UTC (rev 126218)
@@ -43,6 +43,8 @@
 #include "V8DOMWindow.h"
 #include "V8Element.h"
 #include "V8ObjectConstructor.h"
+#include "WorkerContext.h"
+#include "WorkerContextExecutionProxy.h"
 
 #include <wtf/MathExtras.h>
 #include <wtf/MainThread.h>
@@ -403,6 +405,20 @@
     return 0;
 }
 
+v8::Local<v8::Context> toV8Context(ScriptExecutionContext* context, const WorldContextHandle& worldContext)
+{
+    if (context->isDocument()) {
+        if (Frame* frame = static_cast<Document*>(context)->frame())
+            return worldContext.adjustedContext(frame->script());
+#if ENABLE(WORKERS)
+    } else if (context->isWorkerContext()) {
+        if (WorkerContextExecutionProxy* proxy = static_cast<WorkerContext*>(context)->script()->proxy())
+            return proxy->context();
+#endif
+    }
+    return v8::Local<v8::Context>();
+}
+
 V8PerContextData* perContextDataForCurrentWorld(Frame* frame)
 {
     V8IsolatedContext* isolatedContext;

Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (126217 => 126218)


--- trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-08-21 23:37:43 UTC (rev 126217)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-08-21 23:38:35 UTC (rev 126218)
@@ -371,6 +371,9 @@
     // Returns the window object associated with a context.
     DOMWindow* toDOMWindow(v8::Handle<v8::Context>);
 
+    // Returns the context associated with a ScriptExecutionContext.
+    v8::Local<v8::Context> toV8Context(ScriptExecutionContext*, const WorldContextHandle&);
+
     // Returns the frame object of the window object associated with
     // a context, if the window is currently being displayed in the Frame.
     Frame* toFrameIfNotDetached(v8::Handle<v8::Context>);

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.cpp (126217 => 126218)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-21 23:37:43 UTC (rev 126217)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-21 23:38:35 UTC (rev 126218)
@@ -286,18 +286,4 @@
     return context == context->GetCurrent();
 }
 
-v8::Local<v8::Context> toV8Context(ScriptExecutionContext* context, const WorldContextHandle& worldContext)
-{
-    if (context->isDocument()) {
-        if (Frame* frame = static_cast<Document*>(context)->frame())
-            return worldContext.adjustedContext(frame->script());
-#if ENABLE(WORKERS)
-    } else if (context->isWorkerContext()) {
-        if (WorkerContextExecutionProxy* proxy = static_cast<WorkerContext*>(context)->script()->proxy())
-            return proxy->context();
-#endif
-    }
-    return v8::Local<v8::Context>();
-}
-
 }  // namespace WebCore

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.h (126217 => 126218)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-08-21 23:37:43 UTC (rev 126217)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-08-21 23:38:35 UTC (rev 126218)
@@ -135,8 +135,6 @@
         
         IsolatedWorldSecurityOriginMap m_isolatedWorldSecurityOrigins;
     };
-
-    v8::Local<v8::Context> toV8Context(ScriptExecutionContext*, const WorldContextHandle& worldContext);
 }
 
 #endif // V8Proxy_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to