Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: content/renderer/npapi/webplugin_delegate_proxy.cc

Issue 23503043: Load NPAPI plugin resources through the browser process directly instead of going through the render (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/npapi/webplugin_delegate_proxy.cc
===================================================================
--- content/renderer/npapi/webplugin_delegate_proxy.cc (revision 222566)
+++ content/renderer/npapi/webplugin_delegate_proxy.cc (working copy)
@@ -28,13 +28,13 @@
#include "content/child/npapi/npobject_proxy.h"
#include "content/child/npapi/npobject_stub.h"
#include "content/child/npapi/npobject_util.h"
-#include "content/child/npapi/webplugin.h"
#include "content/child/npapi/webplugin_resource_client.h"
#include "content/child/plugin_messages.h"
#include "content/common/content_constants_internal.h"
#include "content/common/view_messages.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/npapi/plugin_channel_host.h"
+#include "content/renderer/npapi/webplugin_impl.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"
#include "content/renderer/sad_plugin.h"
@@ -201,10 +201,11 @@
} // namespace
WebPluginDelegateProxy::WebPluginDelegateProxy(
+ WebPluginImpl* plugin,
const std::string& mime_type,
const base::WeakPtr<RenderViewImpl>& render_view)
: render_view_(render_view),
- plugin_(NULL),
+ plugin_(plugin),
uses_shared_bitmaps_(false),
#if defined(OS_MACOSX)
uses_compositor_(false),
@@ -284,7 +285,6 @@
const GURL& url,
const std::vector<std::string>& arg_names,
const std::vector<std::string>& arg_values,
- WebPlugin* plugin,
bool load_manually) {
// TODO(shess): Attempt to work around http://crbug.com/97285 and
// http://crbug.com/141055 by retrying the connection. Reports seem
@@ -373,8 +373,6 @@
params.host_render_view_routing_id = render_view_->routing_id();
params.load_manually = load_manually;
- plugin_ = plugin;
-
result = false;
Send(new PluginMsg_Init(instance_id_, params, &transparent_, &result));
@@ -440,10 +438,6 @@
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg)
IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow)
-#if defined(OS_WIN)
- IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessData, OnSetWindowlessData)
- IPC_MESSAGE_HANDLER(PluginHostMsg_NotifyIMEStatus, OnNotifyIMEStatus)
-#endif
IPC_MESSAGE_HANDLER(PluginHostMsg_CancelResource, OnCancelResource)
IPC_MESSAGE_HANDLER(PluginHostMsg_InvalidateRect, OnInvalidateRect)
IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject,
@@ -458,7 +452,14 @@
OnInitiateHTTPRangeRequest)
IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading,
OnDeferResourceLoading)
-
+ IPC_MESSAGE_HANDLER(PluginHostMsg_URLRedirectResponse,
+ OnURLRedirectResponse)
+ IPC_MESSAGE_HANDLER(PluginHostMsg_CheckIfRunInsecureContent,
+ OnCheckIfRunInsecureContent)
+#if defined(OS_WIN)
+ IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessData, OnSetWindowlessData)
+ IPC_MESSAGE_HANDLER(PluginHostMsg_NotifyIMEStatus, OnNotifyIMEStatus)
+#endif
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(PluginHostMsg_FocusChanged,
OnFocusChanged);
@@ -471,8 +472,6 @@
IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedPluginSwappedIOSurface,
OnAcceleratedPluginSwappedIOSurface)
#endif
- IPC_MESSAGE_HANDLER(PluginHostMsg_URLRedirectResponse,
- OnURLRedirectResponse)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
DCHECK(handled);
@@ -1119,6 +1118,31 @@
return proxy;
}
+void WebPluginDelegateProxy::FetchURL(unsigned long resource_id,
+ int notify_id,
+ const GURL& url,
+ const GURL& first_party_for_cookies,
+ const std::string& method,
+ const std::string& post_data,
+ const GURL& referrer,
+ bool notify_redirects,
+ bool is_plugin_src_load,
+ int origin_pid,
+ int render_view_id) {
+ PluginMsg_FetchURL_Params params;
+ params.resource_id = resource_id;
+ params.notify_id = notify_id;
+ params.url = url;
+ params.first_party_for_cookies = first_party_for_cookies;
+ params.method = method;
+ params.post_data = post_data;
+ params.referrer = referrer;
+ params.notify_redirect = notify_redirects;
+ params.is_plugin_src_load = is_plugin_src_load;
+ params.render_view_id = render_view_id;
+ Send(new PluginMsg_FetchURL(instance_id_, params));
+}
+
#if defined(OS_MACOSX)
void WebPluginDelegateProxy::OnFocusChanged(bool focused) {
if (render_view_)
@@ -1204,4 +1228,9 @@
plugin_->URLRedirectResponse(allow, resource_id);
}
+void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url,
+ bool* result) {
+ *result = plugin_->CheckIfRunInsecureContent(url);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698