[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 02:07:27 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 09d0db514aaed0e4f49037f503b4092f4b92da96
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Mar 3 03:16:51 2010 +0000

    2010-03-02  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Fisher.
    
            Google Analytics triggers "blocked plugin" UI
            https://bugs.webkit.org/show_bug.cgi?id=35565
    
            Just like for running script, we need to distinguish between querying
            whether plug-ins are enabled and actually blocking a page from
            instantiating a plugin.  We need to issue different callbacks to the
            FrameLoaderClient so that the client can inform us that plug-ins are
            disabled in some cases without showing the "plug-in blocked" UI.
    
            * dom/DOMImplementation.cpp:
            (WebCore::DOMImplementation::createDocument):
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::requestObject):
            (WebCore::FrameLoader::allowPlugins):
            * loader/FrameLoader.h:
            (WebCore::):
            * loader/FrameLoaderClient.h:
            (WebCore::FrameLoaderClient::didNotAllowPlugins):
            * loader/MainResourceLoader.cpp:
            (WebCore::MainResourceLoader::substituteMIMETypeFromPluginDatabase):
            * loader/PluginDocument.cpp:
            (WebCore::PluginTokenizer::writeRawData):
            * page/Page.cpp:
            (WebCore::Page::pluginData):
            * plugins/MimeType.cpp:
            (WebCore::MimeType::enabledPlugin):
    2010-03-02  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Fisher.
    
            Google Analytics triggers "blocked plugin" UI
            https://bugs.webkit.org/show_bug.cgi?id=35565
    
            Plumb didNotAllowPlugins to the client.
    
            * public/WebFrameClient.h:
            (WebKit::WebFrameClient::didNotAllowPlugins):
            * src/FrameLoaderClientImpl.cpp:
            (WebKit::FrameLoaderClientImpl::didNotAllowPlugins):
            * src/FrameLoaderClientImpl.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55449 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0a7708c..b169699 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,34 @@
+2010-03-02  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        Google Analytics triggers "blocked plugin" UI
+        https://bugs.webkit.org/show_bug.cgi?id=35565
+
+        Just like for running script, we need to distinguish between querying
+        whether plug-ins are enabled and actually blocking a page from
+        instantiating a plugin.  We need to issue different callbacks to the
+        FrameLoaderClient so that the client can inform us that plug-ins are
+        disabled in some cases without showing the "plug-in blocked" UI.
+
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::requestObject):
+        (WebCore::FrameLoader::allowPlugins):
+        * loader/FrameLoader.h:
+        (WebCore::):
+        * loader/FrameLoaderClient.h:
+        (WebCore::FrameLoaderClient::didNotAllowPlugins):
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::substituteMIMETypeFromPluginDatabase):
+        * loader/PluginDocument.cpp:
+        (WebCore::PluginTokenizer::writeRawData):
+        * page/Page.cpp:
+        (WebCore::Page::pluginData):
+        * plugins/MimeType.cpp:
+        (WebCore::MimeType::enabledPlugin):
+
 2010-03-02  Andreas Kling  <andreas.kling at nokia.com>
 
         Reviewed by Simon Hausmann.
diff --git a/WebCore/dom/DOMImplementation.cpp b/WebCore/dom/DOMImplementation.cpp
index 4a0082d..3cdae9b 100644
--- a/WebCore/dom/DOMImplementation.cpp
+++ b/WebCore/dom/DOMImplementation.cpp
@@ -338,7 +338,7 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame
 #endif
 
     PluginData* pluginData = 0;
-    if (frame && frame->page() && frame->loader()->client()->allowPlugins(frame->page()->settings()->arePluginsEnabled()))
+    if (frame && frame->page() && frame->loader()->allowPlugins(NotAboutToInstantiatePlugin))
         pluginData = frame->page()->pluginData();
 
     // PDF is one image type for which a plugin can override built-in support.
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 1cff1b3..d1aae7e 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -1277,7 +1277,7 @@ bool FrameLoader::requestObject(RenderPart* renderer, const String& url, const A
     bool useFallback;
     if (shouldUsePlugin(completedURL, mimeType, renderer->hasFallbackContent(), useFallback)) {
         Settings* settings = m_frame->settings();
-        if (!m_client->allowPlugins(settings && settings->arePluginsEnabled())
+        if (!allowPlugins(AboutToInstantiatePlugin)
             || (!settings->isJavaEnabled() && MIMETypeRegistry::isJavaAppletMIMEType(mimeType)))
             return false;
         if (isDocumentSandboxed(SandboxPlugins))
@@ -1812,6 +1812,15 @@ void FrameLoader::started()
         frame->loader()->m_isComplete = false;
 }
 
+bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason)
+{
+    Settings* settings = m_frame->settings();
+    bool allowed = m_client->allowPlugins(settings && settings->arePluginsEnabled());
+    if (!allowed && reason == AboutToInstantiatePlugin)
+        m_frame->loader()->client()->didNotAllowPlugins();
+    return allowed;
+}
+
 bool FrameLoader::containsPlugins() const 
 { 
     return m_containsPlugIns;
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index 6533445..675a2c3 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -280,6 +280,7 @@ public:
     void setResponseMIMEType(const String&);
     const String& responseMIMEType() const;
 
+    bool allowPlugins(ReasonForCallingAllowPlugins);
     bool containsPlugins() const;
 
     void loadDone();
diff --git a/WebCore/loader/FrameLoaderClient.h b/WebCore/loader/FrameLoaderClient.h
index 7556bbc..e29c882 100644
--- a/WebCore/loader/FrameLoaderClient.h
+++ b/WebCore/loader/FrameLoaderClient.h
@@ -267,6 +267,8 @@ namespace WebCore {
         // that need to know if JavaScript is enabled but are not necessarily
         // preparing to execute script.
         virtual void didNotAllowScript() { }
+        // This callback is similar, but for plugins.
+        virtual void didNotAllowPlugins() { }
     };
 
 } // namespace WebCore
diff --git a/WebCore/loader/FrameLoaderTypes.h b/WebCore/loader/FrameLoaderTypes.h
index 8288bce..678ab65 100644
--- a/WebCore/loader/FrameLoaderTypes.h
+++ b/WebCore/loader/FrameLoaderTypes.h
@@ -108,6 +108,11 @@ namespace WebCore {
         DoSecurityCheck
     };
 
+    enum ReasonForCallingAllowPlugins {
+        AboutToInstantiatePlugin,
+        NotAboutToInstantiatePlugin
+    };
+
     typedef int SandboxFlags;
 }
 
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index d7467d1..1992347 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -285,7 +285,7 @@ void MainResourceLoader::continueAfterContentPolicy(PolicyAction policy)
 #if PLATFORM(QT)
 void MainResourceLoader::substituteMIMETypeFromPluginDatabase(const ResourceResponse& r)
 {
-    if (!m_frame->loader()->client()->allowPlugins(m_frame->settings()->arePluginsEnabled()))
+    if (!m_frame->loader()->allowPlugins(NotAboutToInstantiatePlugin))
         return;
 
     String filename = r.url().lastPathComponent();
diff --git a/WebCore/loader/PluginDocument.cpp b/WebCore/loader/PluginDocument.cpp
index d710746..604defc 100644
--- a/WebCore/loader/PluginDocument.cpp
+++ b/WebCore/loader/PluginDocument.cpp
@@ -104,7 +104,7 @@ bool PluginTokenizer::writeRawData(const char*, int)
 
     if (Frame* frame = m_doc->frame()) {
         Settings* settings = frame->settings();
-        if (settings && frame->loader()->client()->allowPlugins(settings->arePluginsEnabled())) {
+        if (settings && frame->loader()->allowPlugins(NotAboutToInstantiatePlugin)) {
             m_doc->updateLayout();
 
             if (RenderWidget* renderer = toRenderWidget(m_embedElement->renderer())) {
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index b5e1a06..b9ca18c 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -390,7 +390,7 @@ void Page::refreshPlugins(bool reload)
 
 PluginData* Page::pluginData() const
 {
-    if (!mainFrame()->loader()->client()->allowPlugins(settings()->arePluginsEnabled()))
+    if (!mainFrame()->loader()->allowPlugins(NotAboutToInstantiatePlugin))
         return 0;
     if (!m_pluginData)
         m_pluginData = PluginData::create(this);
diff --git a/WebCore/plugins/MimeType.cpp b/WebCore/plugins/MimeType.cpp
index ac9181c..954715a 100644
--- a/WebCore/plugins/MimeType.cpp
+++ b/WebCore/plugins/MimeType.cpp
@@ -56,7 +56,7 @@ const String &MimeType::description() const
 PassRefPtr<Plugin> MimeType::enabledPlugin() const
 {
     const Page* p = m_pluginData->page();
-    if (!p || !p->mainFrame()->loader()->client()->allowPlugins(p->settings()->arePluginsEnabled()))
+    if (!p || !p->mainFrame()->loader()->allowPlugins(NotAboutToInstantiatePlugin))
         return 0;
 
     const PluginInfo *info = m_pluginData->mimes()[m_index]->plugin;
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 3e69e87..168e066 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,18 @@
+2010-03-02  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        Google Analytics triggers "blocked plugin" UI
+        https://bugs.webkit.org/show_bug.cgi?id=35565
+
+        Plumb didNotAllowPlugins to the client.
+
+        * public/WebFrameClient.h:
+        (WebKit::WebFrameClient::didNotAllowPlugins):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::didNotAllowPlugins):
+        * src/FrameLoaderClientImpl.h:
+
 2010-03-02  Chris Fleizach  <cfleizach at apple.com>
 
         Reviewed by Beth Dakin.
diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h
index 9076386..136b158 100644
--- a/WebKit/chromium/public/WebFrameClient.h
+++ b/WebKit/chromium/public/WebFrameClient.h
@@ -91,6 +91,9 @@ public:
     // Controls whether plugins are allowed for this frame.
     virtual bool allowPlugins(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; }
 
+    // Notifies the client that the frame would have instantiated a plug-in if plug-ins were enabled.
+    virtual void didNotAllowPlugins(WebFrame*) { }
+
     // Controls whether images are allowed for this frame.
     virtual bool allowImages(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; }
 
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 3585339..c84f11a 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -186,6 +186,12 @@ void FrameLoaderClientImpl::didNotAllowScript()
         m_webFrame->client()->didNotAllowScript(m_webFrame);
 }
 
+void FrameLoaderClientImpl::didNotAllowPlugins()
+{
+    if (m_webFrame->client())
+        m_webFrame->client()->didNotAllowPlugins(m_webFrame);
+}
+
 bool FrameLoaderClientImpl::hasWebView() const
 {
     return m_webFrame->viewImpl();
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h
index 75112a6..e0ee98c 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -196,6 +196,7 @@ public:
     virtual bool allowPlugins(bool enabledPerSettings);
     virtual bool allowImages(bool enabledPerSettings);
     virtual void didNotAllowScript();
+    virtual void didNotAllowPlugins();
 
 private:
     void makeDocumentView();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list