summaryrefslogtreecommitdiffstats
path: root/content/browser/plugin_process_host.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-11 19:13:03 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-11 19:13:03 +0000
commit01cb1991150f05ffb77a43e98005661671a0aff0 (patch)
treec61b5e8446110c284eed4812ce511d5117853a9e /content/browser/plugin_process_host.h
parent35179be6fcd7cf9cb4db346e266621aab6941c14 (diff)
downloadchromium_src-01cb1991150f05ffb77a43e98005661671a0aff0.zip
chromium_src-01cb1991150f05ffb77a43e98005661671a0aff0.tar.gz
chromium_src-01cb1991150f05ffb77a43e98005661671a0aff0.tar.bz2
Load NPAPI plugin resources through the browser process directly instead of going through the renderer. This is needed because when we have site isolation enabled we won't trust the renderer to fetch urls from arbitrary origins, which is something that NPAPI plugins can do.
In a followup I'll implement range requests. For now this is behind the --direct-npapi-requests flag. BUG=286074 R=ananta@chromium.org, jschuh@chromium.org Review URL: https://codereview.chromium.org/23503043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/plugin_process_host.h')
-rw-r--r--content/browser/plugin_process_host.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/content/browser/plugin_process_host.h b/content/browser/plugin_process_host.h
index 61ce44d..75c667d 100644
--- a/content/browser/plugin_process_host.h
+++ b/content/browser/plugin_process_host.h
@@ -8,6 +8,7 @@
#include "build/build_config.h"
#include <list>
+#include <map>
#include <set>
#include <string>
#include <vector>
@@ -22,6 +23,9 @@
#include "content/public/common/webplugininfo.h"
#include "ipc/ipc_channel_proxy.h"
#include "ui/gfx/native_widget_types.h"
+#include "webkit/common/resource_type.h"
+
+struct ResourceHostMsg_Request;
namespace gfx {
class Rect;
@@ -31,6 +35,10 @@ namespace IPC {
struct ChannelHandle;
}
+namespace net {
+class URLRequestContext;
+}
+
namespace content {
class BrowserChildProcessHostImpl;
class ResourceContext;
@@ -87,9 +95,6 @@ class CONTENT_EXPORT PluginProcessHost : public BrowserChildProcessHostDelegate,
// OnChannelOpened in the client is called.
void OpenChannelToPlugin(Client* client);
- // Cancels all pending channel requests for the given resource context.
- static void CancelPendingRequestsForResourceContext(ResourceContext* context);
-
// This function is called to cancel pending requests to open new channels.
void CancelPendingRequest(Client* client);
@@ -125,6 +130,7 @@ class CONTENT_EXPORT PluginProcessHost : public BrowserChildProcessHostDelegate,
// Message handlers.
void OnChannelCreated(const IPC::ChannelHandle& channel_handle);
+ void OnChannelDestroyed(int renderer_id);
#if defined(OS_WIN)
void OnPluginWindowDestroyed(HWND window, HWND parent);
@@ -148,6 +154,11 @@ class CONTENT_EXPORT PluginProcessHost : public BrowserChildProcessHostDelegate,
void CancelRequests();
+ // Callback for ResourceMessageFilter.
+ void GetContexts(const ResourceHostMsg_Request& request,
+ ResourceContext** resource_context,
+ net::URLRequestContext** request_context);
+
// These are channel requests that we are waiting to send to the
// plugin process once the channel is opened.
std::vector<Client*> pending_requests_;
@@ -174,6 +185,10 @@ class CONTENT_EXPORT PluginProcessHost : public BrowserChildProcessHostDelegate,
bool plugin_cursor_visible_;
#endif
+ // Map from render_process_id to its ResourceContext
+ typedef std::map<int, ResourceContext*> ResourceContextMap;
+ ResourceContextMap resource_context_map_;
+
scoped_ptr<BrowserChildProcessHostImpl> process_;
DISALLOW_COPY_AND_ASSIGN(PluginProcessHost);