Title: [126796] trunk/Source/WebCore
Revision
126796
Author
[email protected]
Date
2012-08-27 14:24:36 -0700 (Mon, 27 Aug 2012)

Log Message

[V8] initContextIfNeeded is overly specific
https://bugs.webkit.org/show_bug.cgi?id=95120

Reviewed by Eric Seidel.

This patch is part of a series to clean up V8DOMWindowShell.  This
patch renames initContextIfNeeded to initializeIfNeeded because callers
shouldn't need to worry about what V8DOMWindow needs to initialize.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateToV8Converters):
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore::V8TestActiveDOMObject::wrapSlow):
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::evaluateInIsolatedWorld):
(WebCore::ScriptController::mainWorldContext):
(WebCore::ScriptController::matchesCurrentContext):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::initializeIfNeeded):
(WebCore::V8DOMWindowShell::updateDocument):
(WebCore::V8DOMWindowShell::namedItemAdded):
(WebCore::V8DOMWindowShell::namedItemRemoved):
* bindings/v8/V8DOMWindowShell.h:
(V8DOMWindowShell):
* bindings/v8/WorkerContextExecutionProxy.cpp:
(WebCore::WorkerContextExecutionProxy::initializeIfNeeded):
(WebCore::WorkerContextExecutionProxy::evaluate):
* bindings/v8/WorkerContextExecutionProxy.h:
(WorkerContextExecutionProxy):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126795 => 126796)


--- trunk/Source/WebCore/ChangeLog	2012-08-27 21:22:29 UTC (rev 126795)
+++ trunk/Source/WebCore/ChangeLog	2012-08-27 21:24:36 UTC (rev 126796)
@@ -1,3 +1,35 @@
+2012-08-27  Adam Barth  <[email protected]>
+
+        [V8] initContextIfNeeded is overly specific
+        https://bugs.webkit.org/show_bug.cgi?id=95120
+
+        Reviewed by Eric Seidel.
+
+        This patch is part of a series to clean up V8DOMWindowShell.  This
+        patch renames initContextIfNeeded to initializeIfNeeded because callers
+        shouldn't need to worry about what V8DOMWindow needs to initialize.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateToV8Converters):
+        * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
+        (WebCore::V8TestActiveDOMObject::wrapSlow):
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::evaluateInIsolatedWorld):
+        (WebCore::ScriptController::mainWorldContext):
+        (WebCore::ScriptController::matchesCurrentContext):
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::initializeIfNeeded):
+        (WebCore::V8DOMWindowShell::updateDocument):
+        (WebCore::V8DOMWindowShell::namedItemAdded):
+        (WebCore::V8DOMWindowShell::namedItemRemoved):
+        * bindings/v8/V8DOMWindowShell.h:
+        (V8DOMWindowShell):
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::WorkerContextExecutionProxy::initializeIfNeeded):
+        (WebCore::WorkerContextExecutionProxy::evaluate):
+        * bindings/v8/WorkerContextExecutionProxy.h:
+        (WorkerContextExecutionProxy):
+
 2012-08-27  Brian Salomon  <[email protected]>
 
         [Skia/Chromium] Remove use of deprecated Skia names

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (126795 => 126796)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-08-27 21:22:29 UTC (rev 126795)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-08-27 21:24:36 UTC (rev 126796)
@@ -3374,8 +3374,8 @@
 
     if (IsSubType($dataNode, "Document")) {
         push(@implContent, <<END);
-    if (frame && frame->script()->windowShell()->context().IsEmpty() && frame->script()->windowShell()->initContextIfNeeded()) {
-        // initContextIfNeeded may have created a wrapper for the object, retry from the start.
+    if (frame && frame->script()->windowShell()->context().IsEmpty() && frame->script()->windowShell()->initializeIfNeeded()) {
+        // initializeIfNeeded may have created a wrapper for the object, retry from the start.
         return ${className}::wrap(impl.get(), isolate);
     }
 END
@@ -3389,7 +3389,7 @@
         push(@implContent, <<END);
     if (impl->frame()) {
         frame = impl->frame();
-        frame->script()->windowShell()->initContextIfNeeded();
+        frame->script()->windowShell()->initializeIfNeeded();
     }
 END
     }

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp (126795 => 126796)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp	2012-08-27 21:22:29 UTC (rev 126795)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp	2012-08-27 21:24:36 UTC (rev 126796)
@@ -182,7 +182,7 @@
     Frame* frame = 0;
     if (impl->frame()) {
         frame = impl->frame();
-        frame->script()->windowShell()->initContextIfNeeded();
+        frame->script()->windowShell()->initializeIfNeeded();
     }
 
     // Enter the node's context and create the wrapper in that context.

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.cpp (126795 => 126796)


--- trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-08-27 21:22:29 UTC (rev 126795)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-08-27 21:24:36 UTC (rev 126796)
@@ -334,7 +334,7 @@
     v8::HandleScope handleScope;
 
     // FIXME: This will need to get reorganized once we have a windowShell for the isolated world.
-    if (!windowShell()->initContextIfNeeded())
+    if (!windowShell()->initializeIfNeeded())
         return;
 
     v8::Local<v8::Array> v8Results;
@@ -424,7 +424,7 @@
 
 v8::Local<v8::Context> ScriptController::mainWorldContext()
 {
-    windowShell()->initContextIfNeeded();
+    windowShell()->initializeIfNeeded();
     return v8::Local<v8::Context>::New(windowShell()->context());
 }
 
@@ -448,7 +448,7 @@
         if (m_frame != toFrameIfNotDetached(context))
             return false;
     } else {
-        windowShell()->initContextIfNeeded();
+        windowShell()->initializeIfNeeded();
         context = windowShell()->context();
     }
     return context == v8::Context::GetCurrent();

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (126795 => 126796)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-08-27 21:22:29 UTC (rev 126795)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-08-27 21:24:36 UTC (rev 126796)
@@ -291,7 +291,7 @@
 // the frame. However, a new inner window is created for the new page.
 // If there are JS code holds a closure to the old inner window,
 // it won't be able to reach the outer window via its global object.
-bool V8DOMWindowShell::initContextIfNeeded()
+bool V8DOMWindowShell::initializeIfNeeded()
 {
     if (!m_context.isEmpty())
         return true;
@@ -527,7 +527,7 @@
     // reference to this wrapper. We eagerly initialize the _javascript_
     // context for the new document to make property access on the
     // global object wrapper succeed.
-    if (!initContextIfNeeded())
+    if (!initializeIfNeeded())
         return;
 
     // We have a new document and we need to update the cache.
@@ -553,7 +553,7 @@
 
 void V8DOMWindowShell::namedItemAdded(HTMLDocument* document, const AtomicString& name)
 {
-    if (!initContextIfNeeded())
+    if (!initializeIfNeeded())
         return;
 
     v8::HandleScope handleScope;
@@ -569,7 +569,7 @@
     if (document->hasNamedItem(name.impl()) || document->hasExtraNamedItem(name.impl()))
         return;
 
-    if (!initContextIfNeeded())
+    if (!initializeIfNeeded())
         return;
 
     v8::HandleScope handleScope;

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h (126795 => 126796)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h	2012-08-27 21:22:29 UTC (rev 126795)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h	2012-08-27 21:24:36 UTC (rev 126796)
@@ -71,7 +71,7 @@
     void setContext(v8::Handle<v8::Context>);
     static bool installDOMWindow(v8::Handle<v8::Context> context, DOMWindow*);
 
-    bool initContextIfNeeded();
+    bool initializeIfNeeded();
     void updateDocumentWrapper(v8::Handle<v8::Object> wrapper);
 
     void clearForNavigation();

Modified: trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp (126795 => 126796)


--- trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp	2012-08-27 21:22:29 UTC (rev 126795)
+++ trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp	2012-08-27 21:24:36 UTC (rev 126796)
@@ -135,7 +135,7 @@
     V8PerIsolateData::ensureInitialized(v8::Isolate::GetCurrent());
 }
 
-bool WorkerContextExecutionProxy::initContextIfNeeded()
+bool WorkerContextExecutionProxy::initializeIfNeeded()
 {
     // Bail out if the context has already been initialized.
     if (!m_context.IsEmpty())
@@ -206,7 +206,7 @@
 {
     v8::HandleScope hs;
 
-    if (!initContextIfNeeded())
+    if (!initializeIfNeeded())
         return ScriptValue();
 
     v8::Context::Scope scope(m_context);

Modified: trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h (126795 => 126796)


--- trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h	2012-08-27 21:22:29 UTC (rev 126795)
+++ trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h	2012-08-27 21:24:36 UTC (rev 126796)
@@ -78,7 +78,7 @@
 
     private:
         void initIsolate();
-        bool initContextIfNeeded();
+        bool initializeIfNeeded();
         void dispose();
 
         // Run an already compiled script.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to