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

andersca at apple.com andersca at apple.com
Wed Dec 22 13:39:33 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 56ae775cc574fbf389f9dad8e54fc1f65a2080d0
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 22 19:12:50 2010 +0000

    Move plug-in creation to WebPage::createPlugin
    https://bugs.webkit.org/show_bug.cgi?id=46289
    
    Reviewed by Adam Roben.
    
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
    (WebKit::WebFrameLoaderClient::createPlugin):
    Call WebPage::createPlugin.
    
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::createPlugin):
    Create the plug-in.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68065 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 769ac90..f3d2e5e 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,20 @@
 2010-09-22  Anders Carlsson  <andersca at apple.com>
 
+        Reviewed by Adam Roben.
+
+        Move plug-in creation to WebPage::createPlugin
+        https://bugs.webkit.org/show_bug.cgi?id=46289
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::createPlugin):
+        Call WebPage::createPlugin.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::createPlugin):
+        Create the plug-in.
+
+2010-09-22  Anders Carlsson  <andersca at apple.com>
+
         Reviewed by Darin Adler.
 
         Random plug-in cleanups
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index f2a1f17..ceedf47 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -29,7 +29,6 @@
 #include "NotImplemented.h"
 
 #include "InjectedBundleUserMessageCoders.h"
-#include "NetscapePlugin.h"
 #include "PlatformCertificateInfo.h"
 #include "PluginView.h"
 #include "WebCoreArgumentCoders.h"
@@ -962,30 +961,16 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugIn
 {
     ASSERT(paramNames.size() == paramValues.size());
     
-    String pluginPath;
-
-    // FIXME: In the future, this should return a real CoreIPC connection to the plug-in host, but for now we just
-    // return the path and load the plug-in in the web process.
-    if (!WebProcess::shared().connection()->sendSync(WebProcessProxyMessage::GetPluginHostConnection, 0, 
-                                                     CoreIPC::In(mimeType, url.string()), 
-                                                     CoreIPC::Out(pluginPath), 
-                                                     CoreIPC::Connection::NoTimeout))
-        return 0;
-
-    if (pluginPath.isNull())
-        return 0;
-
-    RefPtr<NetscapePluginModule> pluginModule = NetscapePluginModule::getOrCreate(pluginPath);
-    if (!pluginModule)
-        return 0;
-
+    WebPage* webPage = m_frame->page();
+    ASSERT(webPage);
+    
     Plugin::Parameters parameters;
     parameters.url = url;
     parameters.names = paramNames;
     parameters.values = paramValues;
     parameters.mimeType = mimeType;
     parameters.loadManually = loadManually;
-    
+
     // <rdar://problem/8440903>: AppleConnect has a bug where it does not
     // understand the parameter names specified in the <object> element that
     // embeds its plug-in. This hack works around the issue by converting the
@@ -998,7 +983,10 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugIn
             parameters.names[i] = paramNames[i].lower();
     }
 
-    RefPtr<Plugin> plugin = NetscapePlugin::create(pluginModule.release());
+    RefPtr<Plugin> plugin = webPage->createPlugin(parameters);
+    if (!plugin)
+        return 0;
+    
     return PluginView::create(pluginElement, plugin.release(), parameters);
 }
 
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 53fb967..286cdab 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -29,6 +29,7 @@
 #include "DrawingArea.h"
 #include "InjectedBundle.h"
 #include "MessageID.h"
+#include "NetscapePlugin.h"
 #include "PluginView.h"
 #include "WebBackForwardControllerClient.h"
 #include "WebBackForwardListProxy.h"
@@ -43,6 +44,7 @@
 #include "WebInspectorClient.h"
 #include "WebPageMessageKinds.h"
 #include "WebPageProxyMessageKinds.h"
+#include "WebProcessProxyMessageKinds.h"
 #include "WebPreferencesStore.h"
 #include "WebProcess.h"
 #include <WebCore/EventHandler.h>
@@ -168,6 +170,28 @@ void WebPage::initializeInjectedBundleUIClient(WKBundlePageUIClient* client)
     m_uiClient.initialize(client);
 }
 
+PassRefPtr<Plugin> WebPage::createPlugin(const Plugin::Parameters& parameters)
+{
+    String pluginPath;
+
+    // FIXME: In the future, this should return a real CoreIPC connection to the plug-in host, but for now we just
+    // return the path and load the plug-in in the web process.
+    if (!WebProcess::shared().connection()->sendSync(WebProcessProxyMessage::GetPluginHostConnection, 0, 
+                                                     CoreIPC::In(parameters.mimeType, parameters.url.string()), 
+                                                     CoreIPC::Out(pluginPath), 
+                                                     CoreIPC::Connection::NoTimeout))
+        return 0;
+
+    if (pluginPath.isNull())
+        return 0;
+
+    RefPtr<NetscapePluginModule> pluginModule = NetscapePluginModule::getOrCreate(pluginPath);
+    if (!pluginModule)
+        return 0;
+
+    return NetscapePlugin::create(pluginModule.release());
+}
+
 String WebPage::renderTreeExternalRepresentation() const
 {
     return externalRepresentation(m_mainFrame->coreFrame(), RenderAsTextBehaviorNormal);
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index b91b5dc..dd9308d 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -32,6 +32,7 @@
 #include "InjectedBundlePageFormClient.h"
 #include "InjectedBundlePageLoaderClient.h"
 #include "InjectedBundlePageUIClient.h"
+#include "Plugin.h"
 #include "WebEditCommand.h"
 #include <WebCore/FrameLoaderTypes.h>
 #include <WebCore/IntRect.h>
@@ -121,6 +122,7 @@ public:
     InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
 
     WebFrame* mainFrame() const { return m_mainFrame.get(); }
+    PassRefPtr<Plugin> createPlugin(const Plugin::Parameters&);
 
     String renderTreeExternalRepresentation() const;
     void executeEditingCommand(const String& commandName, const String& argument);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list