Changeset 62824 in webkit


Ignore:
Timestamp:
Jul 8, 2010 1:14:46 PM (14 years ago)
Author:
andersca@apple.com
Message:

Add a GetPluginHostConnection WebProcessProxy message
https://bugs.webkit.org/show_bug.cgi?id=41893

Reviewed by Sam Weinig.

  • Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h:

(WebProcessProxyMessage::):

  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::getPluginHostConnection):
(WebKit::WebProcessProxy::didReceiveMessage):
(WebKit::WebProcessProxy::didReceiveSyncMessage):

  • UIProcess/WebProcessProxy.h:
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::createPlugin):

Location:
trunk/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r62823 r62824  
     12010-07-08  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Add a GetPluginHostConnection WebProcessProxy message
     6        https://bugs.webkit.org/show_bug.cgi?id=41893
     7       
     8        * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h:
     9        (WebProcessProxyMessage::):
     10        * UIProcess/WebProcessProxy.cpp:
     11        (WebKit::WebProcessProxy::getPluginHostConnection):
     12        (WebKit::WebProcessProxy::didReceiveMessage):
     13        (WebKit::WebProcessProxy::didReceiveSyncMessage):
     14        * UIProcess/WebProcessProxy.h:
     15        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     16        (WebKit::WebFrameLoaderClient::createPlugin):
     17
    1182010-07-08  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/WebKit2/Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h

    r61725 r62824  
    3535enum Kind {
    3636    PostMessage,
    37     GetPlugins
     37    GetPlugins,
     38    GetPluginHostConnection
    3839};
    3940
  • trunk/WebKit2/UIProcess/WebProcessProxy.cpp

    r62320 r62824  
    3434#include "WebProcessMessageKinds.h"
    3535#include "WebProcessProxyMessageKinds.h"
     36#include <WebCore/KURL.h>
    3637#include <WebCore/PlatformString.h>
    3738
     
    166167        PluginInfoStore::shared().refresh();
    167168    PluginInfoStore::shared().getPlugins(plugins);
     169}
     170
     171void WebProcessProxy::getPluginHostConnection(const String& mimeType, const KURL& url, WebCore::String& pluginPath)
     172{
     173    String newMimeType = mimeType.lower();
     174
     175    PluginInfoStore::Plugin plugin = PluginInfoStore::shared().findPlugin(newMimeType, url);
     176    if (!plugin.path)
     177        return;
     178
     179    pluginPath = plugin.path;
    168180}
    169181
     
    183195            // These are synchronous messages and should never be handled here.
    184196            case WebProcessProxyMessage::GetPlugins:
     197            case WebProcessProxyMessage::GetPluginHostConnection:
    185198                ASSERT_NOT_REACHED();
    186199                break;
     
    216229            }
    217230
     231            case WebProcessProxyMessage::GetPluginHostConnection: {
     232#if PLATFORM(MAC)
     233                String mimeType;
     234                String urlString;
     235               
     236                if (!arguments->decode(CoreIPC::Out(mimeType, urlString)))
     237                    return;
     238               
     239                String pluginPath;
     240                getPluginHostConnection(mimeType, KURL(ParsedURLString, urlString), pluginPath);
     241                reply->encode(CoreIPC::In(pluginPath));
     242#endif
     243                break;
     244            }
     245
    218246            // These are asynchronous messages and should never be handled here.
    219247            case WebProcessProxyMessage::PostMessage:
  • trunk/WebKit2/UIProcess/WebProcessProxy.h

    r62320 r62824  
    3838
    3939namespace WebCore {
     40    class KURL;
    4041    class String;
    4142};
     
    9394    void forwardMessageToWebContext(const WebCore::String&);
    9495    void getPlugins(bool refresh, Vector<WebCore::PluginInfo>&);
    95    
     96    void getPluginHostConnection(const WebCore::String& mimeType, const WebCore::KURL& url, WebCore::String& pluginPath);
     97
    9698    // CoreIPC::Connection::Client
    9799    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r62823 r62824  
    3535#include "WebPage.h"
    3636#include "WebPageProxyMessageKinds.h"
     37#include "WebProcessProxyMessageKinds.h"
    3738#include "WebProcess.h"
    3839#include <JavaScriptCore/APICast.h>
     
    767768PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement*, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
    768769{
    769     notImplemented();
    770    
     770    String pluginPath;
     771
     772    // FIXME: In the future, this should return a real CoreIPC connection to the plug-in host, but for now we just
     773    // return the path and load the plug-in in the web process.
     774    if (!WebProcess::shared().connection()->sendSync(WebProcessProxyMessage::GetPluginHostConnection, 0,
     775                                                     CoreIPC::In(mimeType, url.string()),
     776                                                     CoreIPC::Out(pluginPath),
     777                                                     CoreIPC::Connection::NoTimeout))
     778        return 0;
     779
     780    if (pluginPath.isNull())
     781        return 0;
     782
     783    // FIXME: Use the plug-in path.
     784
    771785    RefPtr<Plugin> plugin = DummyPlugin::create();
    772786    if (!plugin->initialize(url, paramNames, paramValues, mimeType, loadManually))
Note: See TracChangeset for help on using the changeset viewer.