summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-07 15:39:55 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-07 15:39:55 +0000
commit2799c02a46d0d8d2726f19c8b100ff67504a7349 (patch)
tree184426e3ce12615457a274e62ab3abcdf2152d81 /chrome/plugin
parent2fa7c5c06d6fd30d23af3e71942d18d91eaf9b58 (diff)
downloadchromium_src-2799c02a46d0d8d2726f19c8b100ff67504a7349.zip
chromium_src-2799c02a46d0d8d2726f19c8b100ff67504a7349.tar.gz
chromium_src-2799c02a46d0d8d2726f19c8b100ff67504a7349.tar.bz2
Amit, please review everything.
jam, please review changes to the plugin create channel IPCs. mpcomplete, please review changes to chrome_plugin_host.cc ChromeFrame needs to intercept URL requests issued directly by plugins like gears to ensure that they get routed through the host browser network stack. We decide whether or not a request is to be handled based on the renderer process id and the render view id (routing id), which get passed in the ViewHostMsg_RequestResource IPC. If this request is issued by Gears then the routing id comes in as MSG_ROUTING_NONE, which causes the request to go through the chrome network stack. Fix is to pass the host render view id to the plugin in the PluginMsg_Init IPC. The plugin already receives the renderer process id. Both these ids now come back in the ViewHostMsg_RequestResource IPC. This fixes an issue with wave when rendered in full tab mode in ChromeFrame, where dropping a file into a wave would cause the renderer to hang. Fixes bug http://code.google.com/p/chromium/issues/detail?id=23992 Bug=23992 Review URL: http://codereview.chromium.org/370007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/chrome_plugin_host.cc24
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc3
-rw-r--r--chrome/plugin/webplugin_proxy.cc4
-rw-r--r--chrome/plugin/webplugin_proxy.h11
4 files changed, 36 insertions, 6 deletions
diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc
index f8b1b8f..6c3e71a 100644
--- a/chrome/plugin/chrome_plugin_host.cc
+++ b/chrome/plugin/chrome_plugin_host.cc
@@ -146,7 +146,7 @@ class PluginRequestHandlerProxy
upload_content_.back().SetToFilePathRange(filepath, offset, length);
}
- CPError Start() {
+ CPError Start(int renderer_id, int render_view_id) {
bridge_.reset(
PluginThread::current()->resource_dispatcher()->CreateBridge(
cprequest_->method,
@@ -161,7 +161,9 @@ class PluginRequestHandlerProxy
ResourceType::OBJECT,
cprequest_->context,
appcache::kNoHostId,
- MSG_ROUTING_CONTROL));
+ MSG_ROUTING_CONTROL,
+ renderer_id,
+ render_view_id));
if (!bridge_.get())
return CPERR_FAILURE;
@@ -493,7 +495,23 @@ CPError STDCALL CPR_StartRequest(CPRequest* request) {
PluginRequestHandlerProxy* handler =
PluginRequestHandlerProxy::FromCPRequest(request);
CHECK(handler);
- return handler->Start();
+
+ int renderer_id = -1;
+ int render_view_id = -1;
+
+ WebPluginProxy* webplugin = WebPluginProxy::FromCPBrowsingContext(
+ request->context);
+ if (webplugin) {
+ renderer_id = webplugin->GetRendererId();
+ if (renderer_id == -1)
+ return CPERR_FAILURE;
+
+ render_view_id = webplugin->host_render_view_routing_id();
+ if (render_view_id == -1)
+ return CPERR_FAILURE;
+ }
+
+ return handler->Start(renderer_id, render_view_id);
}
void STDCALL CPR_EndRequest(CPRequest* request, CPError reason) {
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index d2a583d..ac19f31 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -154,7 +154,8 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params,
#endif
webplugin_ = new WebPluginProxy(
- channel_, instance_id_, page_url_, params.containing_window);
+ channel_, instance_id_, page_url_, params.containing_window,
+ params.host_render_view_routing_id);
delegate_ = WebPluginDelegateImpl::Create(path, mime_type_, parent);
if (delegate_) {
webplugin_->set_delegate(delegate_);
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index df02104..ab5326f 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -43,7 +43,8 @@ WebPluginProxy::WebPluginProxy(
PluginChannel* channel,
int route_id,
const GURL& page_url,
- gfx::NativeViewId containing_window)
+ gfx::NativeViewId containing_window,
+ int host_render_view_routing_id)
: channel_(channel),
route_id_(route_id),
cp_browsing_context_(0),
@@ -53,6 +54,7 @@ WebPluginProxy::WebPluginProxy(
waiting_for_paint_(false),
containing_window_(containing_window),
page_url_(page_url),
+ host_render_view_routing_id_(host_render_view_routing_id),
ALLOW_THIS_IN_INITIALIZER_LIST(runnable_method_factory_(this)) {
}
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index f75bd20..fbf88f6 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -34,7 +34,8 @@ class WebPluginProxy : public webkit_glue::WebPlugin {
WebPluginProxy(PluginChannel* channel,
int route_id,
const GURL& page_url,
- gfx::NativeViewId containing_window);
+ gfx::NativeViewId containing_window,
+ int host_render_view_routing_id);
~WebPluginProxy();
void set_delegate(WebPluginDelegateImpl* d) { delegate_ = d; }
@@ -85,6 +86,11 @@ class WebPluginProxy : public webkit_glue::WebPlugin {
// Returns the id of the renderer that contains this plugin.
int GetRendererId();
+ // Returns the id of the associated render view.
+ int host_render_view_routing_id() const {
+ return host_render_view_routing_id_;
+ }
+
// For windowless plugins, paints the given rectangle into the local buffer.
void Paint(const gfx::Rect& rect);
@@ -168,6 +174,9 @@ class WebPluginProxy : public webkit_glue::WebPlugin {
#endif
+ // Contains the routing id of the host render view.
+ int host_render_view_routing_id_;
+
ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_;
};