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

Unified Diff: chrome/browser/extensions/extension_renderer_state.cc

Issue 132233022: Fix chrome.webRequest.onBeforeRequest for requests coming from NPAPI plugin processes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 6 years, 11 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
« no previous file with comments | « chrome/browser/extensions/extension_renderer_state.h ('k') | content/browser/loader/resource_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_renderer_state.cc
===================================================================
--- chrome/browser/extensions/extension_renderer_state.cc (revision 245717)
+++ chrome/browser/extensions/extension_renderer_state.cc (working copy)
@@ -17,8 +17,10 @@
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/resource_request_info.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
+#include "content/public/common/process_type.h"
using content::BrowserThread;
using content::RenderProcessHost;
@@ -200,9 +202,16 @@
}
bool ExtensionRendererState::GetTabAndWindowId(
- int render_process_host_id, int routing_id, int* tab_id, int* window_id) {
+ const content::ResourceRequestInfo* info, int* tab_id, int* window_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- RenderId render_id(render_process_host_id, routing_id);
+ int render_process_id;
+ if (info->GetProcessType() == content::PROCESS_TYPE_PLUGIN) {
+ render_process_id = info->GetOriginPID();
+ } else {
+ render_process_id = info->GetChildID();
+ }
+ int render_view_id = info->GetRouteID();
+ RenderId render_id(render_process_id, render_view_id);
TabAndWindowIdMap::iterator iter = map_.find(render_id);
if (iter != map_.end()) {
*tab_id = iter->second.first;
« no previous file with comments | « chrome/browser/extensions/extension_renderer_state.h ('k') | content/browser/loader/resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698