[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:52:55 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 6f2321005e052d9009b55bd5eda12751b696404c
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 4 02:24:53 2010 +0000

    2010-01-03  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            [Chromium] Remove evaluateInNewContext (it's useless)
            https://bugs.webkit.org/show_bug.cgi?id=33068
    
            This function has no clients and makes life complicated.  Isolated
            worlds won out over NewContext and there's not really any going back
            now.
    
            No new tests because this is all minus lines.
    
            * bindings/v8/ScriptController.cpp:
            * bindings/v8/ScriptController.h:
            * bindings/v8/V8DOMWrapper.cpp:
            (WebCore::V8DOMWrapper::convertWindowToV8Object):
            * bindings/v8/V8Proxy.cpp:
            * bindings/v8/V8Proxy.h:
    2010-01-03  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            [Chromium] Remove evaluateInNewContext (it's useless)
            https://bugs.webkit.org/show_bug.cgi?id=33068
    
            This function has no clients and makes life complicated.  Isolated
            worlds won out over NewContext and there's not really any going back
            now.
    
            * public/WebFrame.h:
            * src/FrameLoaderClientImpl.h:
            * src/WebFrameImpl.cpp:
            * src/WebFrameImpl.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52698 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b32e98b..7b73014 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-01-03  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        [Chromium] Remove evaluateInNewContext (it's useless)
+        https://bugs.webkit.org/show_bug.cgi?id=33068
+
+        This function has no clients and makes life complicated.  Isolated
+        worlds won out over NewContext and there's not really any going back
+        now.
+
+        No new tests because this is all minus lines.
+
+        * bindings/v8/ScriptController.cpp:
+        * bindings/v8/ScriptController.h:
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::convertWindowToV8Object):
+        * bindings/v8/V8Proxy.cpp:
+        * bindings/v8/V8Proxy.h:
+
 2010-01-03  Sam Weinig  <sam at webkit.org>
 
         Rubber-stamped by Dan Bernstein.
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index e5487ce..9df1722 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -213,11 +213,6 @@ void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<Sc
     m_proxy->evaluateInIsolatedWorld(worldID, sources, extensionGroup);
 }
 
-void ScriptController::evaluateInNewContext(const Vector<ScriptSourceCode>& sources, int extensionGroup)
-{
-    m_proxy->evaluateInNewContext(sources, extensionGroup);
-}
-
 // Evaluate a script file in the environment of this proxy.
 ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode)
 {
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index 58f19bc..8afafa4 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -90,12 +90,6 @@ namespace WebCore {
         // FIXME: Get rid of extensionGroup here.
         void evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>&, int extensionGroup);
 
-        // Executes JavaScript in a new context associated with the web frame. The
-        // script gets its own global scope and its own prototypes for intrinsic
-        // JavaScript objects (String, Array, and so-on). It shares the wrappers for
-        // all DOM nodes and DOM constructors.
-        void evaluateInNewContext(const Vector<ScriptSourceCode>&, int extensionGroup);
-
         // Masquerade 'this' as the windowShell.
         // This is a bit of a hack, but provides reasonable compatibility
         // with what JSC does as well.
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index 6b0f818..9c08611 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -1606,7 +1606,7 @@ v8::Handle<v8::Value> V8DOMWrapper::convertWindowToV8Object(DOMWindow* window)
     if (!frame)
         return v8::Handle<v8::Object>();
 
-    // Special case: Because of evaluateInNewContext() one DOMWindow can have
+    // Special case: Because of evaluateInIsolatedWorld() one DOMWindow can have
     // multiple contexts and multiple global objects associated with it. When
     // code running in one of those contexts accesses the window object, we
     // want to return the global object associated with that context, not
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index 32a7e25..7223435 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -309,56 +309,6 @@ void V8Proxy::evaluateInIsolatedWorld(int worldID, const Vector<ScriptSourceCode
       world->destroy();
 }
 
-// FIXME: We should remove this function!
-void V8Proxy::evaluateInNewContext(const Vector<ScriptSourceCode>& sources, int extensionGroup)
-{
-    windowShell()->initContextIfNeeded();
-
-    v8::HandleScope handleScope;
-
-    // Set up the DOM window as the prototype of the new global object.
-    v8::Handle<v8::Context> windowContext = windowShell()->context();
-    v8::Handle<v8::Object> windowGlobal = windowContext->Global();
-    v8::Handle<v8::Object> windowWrapper = V8DOMWrapper::lookupDOMWrapper(V8ClassIndex::DOMWINDOW, windowGlobal);
-
-    ASSERT(V8DOMWrapper::convertDOMWrapperToNative<DOMWindow>(windowWrapper) == m_frame->domWindow());
-
-    v8::Persistent<v8::Context> context = windowShell()->createNewContext(v8::Handle<v8::Object>(), extensionGroup);
-    if (context.IsEmpty())
-        return;
-
-    v8::Context::Scope contextScope(context);
-
-    // Setup context id for JS debugger.
-    if (!setInjectedScriptContextDebugId(context)) {
-        context.Dispose();
-        return;
-    }
-
-    v8::Handle<v8::Object> global = context->Global();
-
-    v8::Handle<v8::String> implicitProtoString = v8::String::New("__proto__");
-    global->Set(implicitProtoString, windowWrapper);
-
-    // Give the code running in the new context a way to get access to the
-    // original context.
-    global->Set(v8::String::New("contentWindow"), windowGlobal);
-
-    m_frame->loader()->client()->didCreateIsolatedScriptContext();
-
-    // Run code in the new context.
-    for (size_t i = 0; i < sources.size(); ++i)
-        evaluate(sources[i], 0);
-
-    // Using the default security token means that the canAccess is always
-    // called, which is slow.
-    // FIXME: Use tokens where possible. This will mean keeping track of all
-    // created contexts so that they can all be updated when the document domain
-    // changes.
-    context->UseDefaultSecurityToken();
-    context.Dispose();
-}
-
 bool V8Proxy::setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContext)
 {
     // Setup context id for JS debugger.
diff --git a/WebCore/bindings/v8/V8Proxy.h b/WebCore/bindings/v8/V8Proxy.h
index 80ecaff..3d53846 100644
--- a/WebCore/bindings/v8/V8Proxy.h
+++ b/WebCore/bindings/v8/V8Proxy.h
@@ -207,11 +207,6 @@ namespace WebCore {
         // constructors.
         void evaluateInIsolatedWorld(int worldId, const Vector<ScriptSourceCode>& sources, int extensionGroup);
 
-        // Evaluate JavaScript in a new context. The script gets its own global scope
-        // and its own prototypes for intrinsic JavaScript objects (String, Array,
-        // and so-on). It shares the wrappers for all DOM nodes and DOM constructors.
-        void evaluateInNewContext(const Vector<ScriptSourceCode>&, int extensionGroup);
-
         // Evaluate a script file in the current execution environment.
         // The caller must hold an execution context.
         // If cannot evalute the script, it returns an error.
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 9d10403..ac870f1 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-03  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        [Chromium] Remove evaluateInNewContext (it's useless)
+        https://bugs.webkit.org/show_bug.cgi?id=33068
+
+        This function has no clients and makes life complicated.  Isolated
+        worlds won out over NewContext and there's not really any going back
+        now.
+
+        * public/WebFrame.h:
+        * src/FrameLoaderClientImpl.h:
+        * src/WebFrameImpl.cpp:
+        * src/WebFrameImpl.h:
+
 2009-12-30  Darin Fisher  <darin at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index db6cfaf..2601598 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -195,17 +195,6 @@ public:
     // Executes script in the context of the current page.
     virtual void executeScript(const WebScriptSource&) = 0;
 
-    // Executes script in a new context associated with the frame. The
-    // script gets its own global scope and its own prototypes for
-    // intrinsic JS objects (String, Array, and so-on). It shares the
-    // wrappers for all DOM nodes and DOM constructors.  extensionGroup is
-    // an embedder-provided specifier that controls which v8 extensions are
-    // loaded into the new context - see WebKit::registerExtension for the
-    // corresponding specifier.
-    virtual void executeScriptInNewContext(const WebScriptSource* sources,
-                                           unsigned numSources,
-                                           int extensionGroup) = 0;
-
     // Executes JavaScript in a new world associated with the web frame.
     // The script gets its own global scope and its own prototypes for
     // intrinsic JavaScript objects (String, Array, and so-on). It also
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h
index 4ddfe5f..cbf084e 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -66,7 +66,7 @@ public:
     virtual void didCreateScriptContextForFrame();
     virtual void didDestroyScriptContextForFrame();
 
-    // A context untied to a frame was created (through evaluateInNewContext).
+    // A context untied to a frame was created (through evaluateInIsolatedWorld).
     // This context is not tied to the lifetime of its frame, and is destroyed
     // in garbage collection.
     virtual void didCreateIsolatedScriptContext();
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index f6ccc24..241cfe8 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -595,19 +595,6 @@ void WebFrameImpl::executeScript(const WebScriptSource& source)
         ScriptSourceCode(source.code, source.url, source.startLine));
 }
 
-void WebFrameImpl::executeScriptInNewContext(
-    const WebScriptSource* sourcesIn, unsigned numSources, int extensionGroup)
-{
-    Vector<ScriptSourceCode> sources;
-
-    for (unsigned i = 0; i < numSources; ++i) {
-        sources.append(ScriptSourceCode(
-            sourcesIn[i].code, sourcesIn[i].url, sourcesIn[i].startLine));
-    }
-
-    m_frame->script()->evaluateInNewContext(sources, extensionGroup);
-}
-
 void WebFrameImpl::executeScriptInIsolatedWorld(
     int worldId, const WebScriptSource* sourcesIn, unsigned numSources,
     int extensionGroup)
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index 6123fa5..fbd0e2e 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -90,8 +90,6 @@ public:
     virtual NPObject* windowObject() const;
     virtual void bindToWindowObject(const WebString& name, NPObject*);
     virtual void executeScript(const WebScriptSource&);
-    virtual void executeScriptInNewContext(
-        const WebScriptSource* sources, unsigned numSources, int extensionGroup);
     virtual void executeScriptInIsolatedWorld(
         int worldId, const WebScriptSource* sources, unsigned numSources,
         int extensionGroup);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list