summaryrefslogtreecommitdiffstats
path: root/content/plugin
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-31 22:35:13 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-31 22:35:13 +0000
commit208d3b7d52b46f9a641d432433dc59894878880d (patch)
treedb72721b64e095787c06631ba468f71b158e1649 /content/plugin
parent32d2669f5b705998451d1106f6072aaf7b38d30e (diff)
downloadchromium_src-208d3b7d52b46f9a641d432433dc59894878880d.zip
chromium_src-208d3b7d52b46f9a641d432433dc59894878880d.tar.gz
chromium_src-208d3b7d52b46f9a641d432433dc59894878880d.tar.bz2
Moved the following IPC messages used by the chrome NPAPI plugin installer out of content
into Chrome. 1. PluginProcessHostMsg_GetPluginFinderUrl 2. PluginProcessHostMsg_MissingPluginStatus 3. PluginProcessHostMsg_DownloadUrl These messages are prefixed with Chrome. Removed the InstallMissingPlugin and OnInstallMissingPlugin handlers from the NPAPI plugin sources and from our webkit plugin implementation. The plugin infobar no longer sends over an IPC message to initiate installation of the third party plugin. It sends over a windows message which is handled in the plugin installer for Windows. This functionality is not implemented for the mac and linux as before. To display the plugin installation infobar the PluginProcessHostMsg_MissingPluginStatus message sent by the plugin needs the routing id and the renderer process id. This information is now passed along with the plugin instantiation parameters in NPP_New. These parameters are only read by the default plugin. This is a continuation of the fixes to ensure that IPC's don't span across content and chrome. BUG=87335 Review URL: http://codereview.chromium.org/7812020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/plugin')
-rw-r--r--content/plugin/webplugin_delegate_stub.cc24
-rw-r--r--content/plugin/webplugin_delegate_stub.h1
-rw-r--r--content/plugin/webplugin_proxy.cc4
-rw-r--r--content/plugin/webplugin_proxy.h1
4 files changed, 17 insertions, 13 deletions
diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc
index 87e8fda..824cd47 100644
--- a/content/plugin/webplugin_delegate_stub.cc
+++ b/content/plugin/webplugin_delegate_stub.cc
@@ -7,7 +7,9 @@
#include "build/build_config.h"
#include "base/command_line.h"
+#include "base/string_number_conversions.h"
#include "content/common/content_client.h"
+#include "content/common/content_constants.h"
#include "content/common/content_switches.h"
#include "content/common/plugin_messages.h"
#include "content/plugin/npobject_stub.h"
@@ -122,7 +124,6 @@ bool WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(PluginMsg_DidFinishManualLoading,
OnDidFinishManualLoading)
IPC_MESSAGE_HANDLER(PluginMsg_DidManualLoadFail, OnDidManualLoadFail)
- IPC_MESSAGE_HANDLER(PluginMsg_InstallMissingPlugin, OnInstallMissingPlugin)
IPC_MESSAGE_HANDLER(PluginMsg_HandleURLRequestReply,
OnHandleURLRequestReply)
IPC_MESSAGE_HANDLER(PluginMsg_HTTPRangeRequestReply,
@@ -179,9 +180,22 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params,
path, mime_type_, parent);
if (delegate_) {
webplugin_->set_delegate(delegate_);
+ std::vector<std::string> arg_names = params.arg_names;
+ std::vector<std::string> arg_values = params.arg_values;
+
+ if (path.value() == webkit::npapi::kDefaultPluginLibraryName) {
+ // Add the renderer process id and Render view routing id to the list of
+ // parameters passed to the plugin.
+ arg_names.push_back(content::kDefaultPluginRenderViewId);
+ arg_values.push_back(base::IntToString(
+ params.host_render_view_routing_id));
+
+ arg_names.push_back(content::kDefaultPluginRenderProcessId);
+ arg_values.push_back(base::IntToString(channel_->renderer_id()));
+ }
*result = delegate_->Initialize(params.url,
- params.arg_names,
- params.arg_values,
+ arg_names,
+ arg_values,
webplugin_,
params.load_manually);
}
@@ -363,10 +377,6 @@ void WebPluginDelegateStub::OnDidManualLoadFail() {
delegate_->DidManualLoadFail();
}
-void WebPluginDelegateStub::OnInstallMissingPlugin() {
- delegate_->InstallMissingPlugin();
-}
-
void WebPluginDelegateStub::OnHandleURLRequestReply(
unsigned long resource_id, const GURL& url, int notify_id) {
WebPluginResourceClient* resource_client =
diff --git a/content/plugin/webplugin_delegate_stub.h b/content/plugin/webplugin_delegate_stub.h
index 3c4610a..4a12b9a 100644
--- a/content/plugin/webplugin_delegate_stub.h
+++ b/content/plugin/webplugin_delegate_stub.h
@@ -97,7 +97,6 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,
void OnDidReceiveManualData(const std::vector<char>& buffer);
void OnDidFinishManualLoading();
void OnDidManualLoadFail();
- void OnInstallMissingPlugin();
void OnHandleURLRequestReply(unsigned long resource_id,
const GURL& url,
int notify_id);
diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc
index df76e8e..c01bc55 100644
--- a/content/plugin/webplugin_proxy.cc
+++ b/content/plugin/webplugin_proxy.cc
@@ -260,10 +260,6 @@ std::string WebPluginProxy::GetCookies(const GURL& url,
return cookies;
}
-void WebPluginProxy::OnMissingPluginStatus(int status) {
- Send(new PluginHostMsg_MissingPluginStatus(route_id_, status));
-}
-
WebPluginResourceClient* WebPluginProxy::GetResourceClient(int id) {
ResourceClientMap::iterator iterator = resource_clients_.find(id);
// The IPC messages which deal with streams are now asynchronous. It is
diff --git a/content/plugin/webplugin_proxy.h b/content/plugin/webplugin_proxy.h
index df1b880..b6e3175 100644
--- a/content/plugin/webplugin_proxy.h
+++ b/content/plugin/webplugin_proxy.h
@@ -80,7 +80,6 @@ class WebPluginProxy : public webkit::npapi::WebPlugin {
virtual std::string GetCookies(const GURL& url,
const GURL& first_party_for_cookies);
- virtual void OnMissingPluginStatus(int status);
// class-specific methods
// Returns a WebPluginResourceClient object given its id, or NULL if no