[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

abarth at webkit.org abarth at webkit.org
Wed Dec 22 13:32:57 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b4b32f2ac71031a5118cb0f85bd9ea76944ef93d
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 20 02:27:15 2010 +0000

    2010-09-19  Sheriff Bot  <webkit.review.bot at gmail.com>
    
            Unreviewed, rolling out r67749.
            http://trac.webkit.org/changeset/67749
            https://bugs.webkit.org/show_bug.cgi?id=46068
    
            breaking ToT chromium canary build (Requested by shans on
            #webkit).
    
            * bindings/v8/V8DOMWindowShell.cpp:
            (WebCore::V8DOMWindowShell::createNewContext):
            * bindings/v8/V8Proxy.cpp:
            (WebCore::V8Proxy::registeredExtensionWithV8):
            (WebCore::V8Proxy::registerExtension):
            * bindings/v8/V8Proxy.h:
            * loader/EmptyClients.h:
            * loader/FrameLoaderClient.h:
    2010-09-19  Sheriff Bot  <webkit.review.bot at gmail.com>
    
            Unreviewed, rolling out r67749.
            http://trac.webkit.org/changeset/67749
            https://bugs.webkit.org/show_bug.cgi?id=46068
    
            breaking ToT chromium canary build (Requested by shans on
            #webkit).
    
            * public/WebFrameClient.h:
            * public/WebScriptController.h:
            * src/FrameLoaderClientImpl.cpp:
            * src/FrameLoaderClientImpl.h:
            * src/WebScriptController.cpp:
            (WebKit::WebScriptController::registerExtension):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67831 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index da02dae..acff675 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-19  Sheriff Bot  <webkit.review.bot at gmail.com>
+
+        Unreviewed, rolling out r67749.
+        http://trac.webkit.org/changeset/67749
+        https://bugs.webkit.org/show_bug.cgi?id=46068
+
+        breaking ToT chromium canary build (Requested by shans on
+        #webkit).
+
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::createNewContext):
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::registeredExtensionWithV8):
+        (WebCore::V8Proxy::registerExtension):
+        * bindings/v8/V8Proxy.h:
+        * loader/EmptyClients.h:
+        * loader/FrameLoaderClient.h:
+
 2010-09-19  Gavin Barraclough  <barraclough at apple.com>
 
         Reviewed by Oliver Hunt.
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.cpp b/WebCore/bindings/v8/V8DOMWindowShell.cpp
index 76498cd..b07f6fc 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -330,15 +330,23 @@ v8::Persistent<v8::Context> V8DOMWindowShell::createNewContext(v8::Handle<v8::Ob
 
     // Used to avoid sleep calls in unload handlers.
     if (!V8Proxy::registeredExtensionWithV8(DateExtension::get()))
-        V8Proxy::registerExtension(DateExtension::get());
+        V8Proxy::registerExtension(DateExtension::get(), String());
 
     // Dynamically tell v8 about our extensions now.
     const V8Extensions& extensions = V8Proxy::extensions();
     OwnArrayPtr<const char*> extensionNames(new const char*[extensions.size()]);
     int index = 0;
     for (size_t i = 0; i < extensions.size(); ++i) {
-        if (m_frame->loader()->client()->allowScriptExtension(extensions[i]->name(), extensionGroup))
-            extensionNames[index++] = extensions[i]->name();
+        if (extensions[i].group && extensions[i].group != extensionGroup)
+            continue;
+
+        // Note: we check the loader URL here instead of the document URL
+        // because we might be currently loading an URL into a blank page.
+        // See http://code.google.com/p/chromium/issues/detail?id=10924
+        if (extensions[i].scheme.length() > 0 && (extensions[i].scheme != m_frame->loader()->activeDocumentLoader()->url().protocol()))
+            continue;
+
+        extensionNames[index++] = extensions[i].extension->name();
     }
     v8::ExtensionConfiguration extensionConfiguration(index, extensionNames.get());
     result = v8::Context::New(&extensionConfiguration, globalTemplate, global);
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index e731772..a776ee7 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -832,17 +832,25 @@ void V8Proxy::registerExtensionWithV8(v8::Extension* extension)
 bool V8Proxy::registeredExtensionWithV8(v8::Extension* extension)
 {
     for (size_t i = 0; i < m_extensions.size(); ++i) {
-        if (m_extensions[i] == extension)
+        if (m_extensions[i].extension == extension)
             return true;
     }
 
     return false;
 }
 
-void V8Proxy::registerExtension(v8::Extension* extension)
+void V8Proxy::registerExtension(v8::Extension* extension, const String& schemeRestriction)
 {
     registerExtensionWithV8(extension);
-    m_extensions.append(extension);
+    V8ExtensionInfo info = {schemeRestriction, 0, extension};
+    m_extensions.append(info);
+}
+
+void V8Proxy::registerExtension(v8::Extension* extension, int extensionGroup)
+{
+    registerExtensionWithV8(extension);
+    V8ExtensionInfo info = {String(), extensionGroup, extension};
+    m_extensions.append(info);
 }
 
 bool V8Proxy::setContextDebugId(int debugId)
diff --git a/WebCore/bindings/v8/V8Proxy.h b/WebCore/bindings/v8/V8Proxy.h
index 4d00d57..7b4d6f6 100644
--- a/WebCore/bindings/v8/V8Proxy.h
+++ b/WebCore/bindings/v8/V8Proxy.h
@@ -119,7 +119,17 @@ namespace WebCore {
 
     const int kMaxRecursionDepth = 20;
 
-    typedef WTF::Vector<v8::Extension*> V8Extensions;
+    // Information about an extension that is registered for use with V8. If
+    // scheme is non-empty, it contains the URL scheme the extension should be
+    // used with. If group is non-zero, the extension will only be loaded into
+    // script contexts that belong to that group. Otherwise, the extension is
+    // used with all schemes and contexts.
+    struct V8ExtensionInfo {
+        String scheme;
+        int group;
+        v8::Extension* extension;
+    };
+    typedef WTF::Vector<V8ExtensionInfo> V8Extensions;
 
     class V8Proxy {
     public:
@@ -309,10 +319,15 @@ namespace WebCore {
         bool setContextDebugId(int id);
         static int contextDebugId(v8::Handle<v8::Context>);
 
-        // Registers a v8 extension to be available on webpages. Will only
-        // affect v8 contexts initialized after this call. Takes ownership of
-        // the v8::Extension object passed.
-        static void registerExtension(v8::Extension*);
+        // Registers a v8 extension to be available on webpages. The two forms
+        // offer various restrictions on what types of contexts the extension is
+        // loaded into. If a scheme is provided, only pages whose URL has the given
+        // scheme will match. If extensionGroup is provided, the extension will
+        // only be loaded into scripts run via evaluateInNewWorld with the
+        // matching group.  Will only affect v8 contexts initialized after this
+        // call. Takes ownership of the v8::Extension object passed.
+        static void registerExtension(v8::Extension*, const String& schemeRestriction);
+        static void registerExtension(v8::Extension*, int extensionGroup);
 
         static void registerExtensionWithV8(v8::Extension*);
         static bool registeredExtensionWithV8(v8::Extension*);
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index d032f98..b3a196d 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -359,7 +359,6 @@ public:
     virtual void didCreateScriptContextForFrame() { }
     virtual void didDestroyScriptContextForFrame() { }
     virtual void didCreateIsolatedScriptContext() { }
-    virtual bool allowScriptExtension(const String& extensionName, int extensionGroup) { return false; }
 #endif
 
 #if PLATFORM(MAC)
diff --git a/WebCore/loader/FrameLoaderClient.h b/WebCore/loader/FrameLoaderClient.h
index a736b58..1b7e9c0 100644
--- a/WebCore/loader/FrameLoaderClient.h
+++ b/WebCore/loader/FrameLoaderClient.h
@@ -253,7 +253,6 @@ namespace WebCore {
         virtual void didCreateScriptContextForFrame() = 0;
         virtual void didDestroyScriptContextForFrame() = 0;
         virtual void didCreateIsolatedScriptContext() = 0;
-        virtual bool allowScriptExtension(const String& extensionName, int extensionGroup) = 0;
 #endif
 
         virtual void registerForIconNotification(bool listen = true) = 0;
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 147c60f..47b0e63 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-19  Sheriff Bot  <webkit.review.bot at gmail.com>
+
+        Unreviewed, rolling out r67749.
+        http://trac.webkit.org/changeset/67749
+        https://bugs.webkit.org/show_bug.cgi?id=46068
+
+        breaking ToT chromium canary build (Requested by shans on
+        #webkit).
+
+        * public/WebFrameClient.h:
+        * public/WebScriptController.h:
+        * src/FrameLoaderClientImpl.cpp:
+        * src/FrameLoaderClientImpl.h:
+        * src/WebScriptController.cpp:
+        (WebKit::WebScriptController::registerExtension):
+
 2010-09-19  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h
index 9944da1..699325d 100644
--- a/WebKit/chromium/public/WebFrameClient.h
+++ b/WebKit/chromium/public/WebFrameClient.h
@@ -301,9 +301,6 @@ public:
     // scripts.
     virtual void didCreateIsolatedScriptContext(WebFrame*) { }
 
-    // Controls whether the given script extension should run in this frame.
-    virtual bool allowScriptExtension(WebFrame*, const WebString& extensionName, int extensionGroup) { return false; }
-
 
     // Geometry notifications ----------------------------------------------
 
diff --git a/WebKit/chromium/public/WebScriptController.h b/WebKit/chromium/public/WebScriptController.h
index 12d691d..54bb08a 100644
--- a/WebKit/chromium/public/WebScriptController.h
+++ b/WebKit/chromium/public/WebScriptController.h
@@ -43,10 +43,18 @@ class WebString;
 
 class WebScriptController {
 public:
-    // Registers a v8 extension to be available on webpages.
+    // Registers a v8 extension to be available on webpages. The three forms
+    // offer various restrictions on what types of contexts the extension is
+    // loaded into. If a scheme is provided, only pages whose URL has the given
+    // scheme will match. If extensionGroup is provided, the extension will only
+    // be loaded into scripts run via WebFrame::ExecuteInNewWorld with the
+    // matching group.
     // Will only affect v8 contexts initialized after this call. Takes ownership
     // of the v8::Extension object passed.
     WEBKIT_API static void registerExtension(v8::Extension*);
+    WEBKIT_API static void registerExtension(v8::Extension*,
+                                             const WebString& schemeRestriction);
+    WEBKIT_API static void registerExtension(v8::Extension*, int extensionGroup);
 
     // Enables special settings which are only applicable if V8 is executed
     // in the single thread which must be the main thread.
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 68c0178..61d43df 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -147,14 +147,6 @@ void FrameLoaderClientImpl::didCreateIsolatedScriptContext()
         m_webFrame->client()->didCreateIsolatedScriptContext(m_webFrame);
 }
 
-bool FrameLoaderClientImpl::allowScriptExtension(const String& extensionName,
-                                                 int extensionGroup)
-{
-    if (m_webFrame->client())
-        return m_webFrame->client()->allowScriptExtension(m_webFrame, extensionName, extensionGroup);
-    return false;
-}
-
 void FrameLoaderClientImpl::didPerformFirstNavigation() const
 {
 }
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h
index 64ca830..57105de 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -69,10 +69,6 @@ public:
     // in garbage collection.
     virtual void didCreateIsolatedScriptContext();
 
-    // Returns true if we should allow the given V8 extension to be added to
-    // the script context at the currently loading page and given extension group.
-    virtual bool allowScriptExtension(const String& extensionName, int extensionGroup);
-
     virtual bool hasWebView() const;
     virtual bool hasFrameView() const;
     virtual void makeRepresentation(WebCore::DocumentLoader*);
diff --git a/WebKit/chromium/src/WebScriptController.cpp b/WebKit/chromium/src/WebScriptController.cpp
index 0aa11a6..d2c168d 100644
--- a/WebKit/chromium/src/WebScriptController.cpp
+++ b/WebKit/chromium/src/WebScriptController.cpp
@@ -43,7 +43,19 @@ namespace WebKit {
 
 void WebScriptController::registerExtension(v8::Extension* extension)
 {
-    V8Proxy::registerExtension(extension);
+    V8Proxy::registerExtension(extension, WebString());
+}
+
+void WebScriptController::registerExtension(v8::Extension* extension,
+                                            const WebString& schemeRestriction)
+{
+    V8Proxy::registerExtension(extension, schemeRestriction);
+}
+
+void WebScriptController::registerExtension(v8::Extension* extension,
+                                            int extensionGroup)
+{
+    V8Proxy::registerExtension(extension, extensionGroup);
 }
 
 void WebScriptController::enableV8SingleThreadMode()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list