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

Unified Diff: chrome/browser/plugin_process_host.cc

Issue 5874002: Create a ResourceMessageFilter to filter resource related IPCs. This gets ri... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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: chrome/browser/plugin_process_host.cc
===================================================================
--- chrome/browser/plugin_process_host.cc (revision 69229)
+++ chrome/browser/plugin_process_host.cc (working copy)
@@ -28,6 +28,7 @@
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
+#include "chrome/browser/renderer_host/resource_message_filter.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/common/chrome_switches.h"
@@ -55,6 +56,25 @@
static const char kDefaultPluginFinderURL[] =
"https://dl-ssl.google.com/edgedl/chrome/plugins/plugins2.xml";
+namespace {
+
+// Helper class that we pass to ResourceMessageFilter so that it can find the
+// right URLRequestContext for a request.
+class PluginURLRequestContextOverride
+ : public ResourceMessageFilter::URLRequestContextOverride {
+ public:
+ PluginURLRequestContextOverride() {
+ }
+
+ virtual URLRequestContext* GetRequestContext(
+ uint32 request_id, ResourceType::Type resource_type) {
+ return CPBrowsingContextManager::GetInstance()->ToURLRequestContext(
+ request_id);
brettw 2010/12/15 21:31:10 Indent 2 more spaces.
jam 2010/12/15 21:41:04 Done.
+ }
+};
+
+} // namespace
+
#if defined(OS_WIN)
void PluginProcessHost::OnPluginWindowDestroyed(HWND window, HWND parent) {
// The window is destroyed at this point, we just care about its parent, which
@@ -94,7 +114,8 @@
PluginProcessHost::PluginProcessHost()
: BrowserChildProcessHost(
PLUGIN_PROCESS,
- PluginService::GetInstance()->resource_dispatcher_host()),
+ PluginService::GetInstance()->resource_dispatcher_host(),
+ new PluginURLRequestContextOverride()),
ALLOW_THIS_IN_INITIALIZER_LIST(resolve_proxy_msg_helper_(this, NULL))
#if defined(OS_MACOSX)
, plugin_cursor_visible_(true)
@@ -399,13 +420,6 @@
Send(reply_msg);
}
-URLRequestContext* PluginProcessHost::GetRequestContext(
- uint32 request_id,
- const ViewHostMsg_Resource_Request& request_data) {
- return CPBrowsingContextManager::GetInstance()->ToURLRequestContext(
- request_id);
-}
-
void PluginProcessHost::RequestPluginChannel(Client* client) {
// We can't send any sync messages from the browser because it might lead to
// a hang. However this async messages must be answered right away by the

Powered by Google App Engine
This is Rietveld 408576698