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

Unified Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc

Issue 10815051: Send the correct process ID with webNavigation events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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: chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
index 714de23297a6910d245057d0a76cabc34be959f5..4614d753f749f9ef713d0e8bc111bf3b647bd190 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
@@ -59,6 +59,7 @@ int GetFrameId(bool is_main_frame, int64 frame_id) {
// Constructs and dispatches an onBeforeNavigate event.
void DispatchOnBeforeNavigate(content::WebContents* web_contents,
+ int render_process_id,
int64 frame_id,
bool is_main_frame,
const GURL& validated_url) {
@@ -66,8 +67,7 @@ void DispatchOnBeforeNavigate(content::WebContents* web_contents,
DictionaryValue* dict = new DictionaryValue();
dict->SetInteger(keys::kTabIdKey, ExtensionTabUtil::GetTabId(web_contents));
dict->SetString(keys::kUrlKey, validated_url.spec());
- dict->SetInteger(keys::kProcessIdKey,
- web_contents->GetRenderViewHost()->GetProcess()->GetID());
+ dict->SetInteger(keys::kProcessIdKey, render_process_id);
dict->SetInteger(keys::kFrameIdKey, GetFrameId(is_main_frame, frame_id));
dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
args.Append(dict);
@@ -189,6 +189,7 @@ void DispatchOnCreatedNavigationTarget(
// Constructs and dispatches an onErrorOccurred event.
void DispatchOnErrorOccurred(content::WebContents* web_contents,
+ int render_process_id,
const GURL& url,
int64 frame_id,
bool is_main_frame,
@@ -197,8 +198,7 @@ void DispatchOnErrorOccurred(content::WebContents* web_contents,
DictionaryValue* dict = new DictionaryValue();
dict->SetInteger(keys::kTabIdKey, ExtensionTabUtil::GetTabId(web_contents));
dict->SetString(keys::kUrlKey, url.spec());
- dict->SetInteger(keys::kProcessIdKey,
- web_contents->GetRenderViewHost()->GetProcess()->GetID());
+ dict->SetInteger(keys::kProcessIdKey, render_process_id);
dict->SetInteger(keys::kFrameIdKey, GetFrameId(is_main_frame, frame_id));
dict->SetString(keys::kErrorKey, net::ErrorToString(error_code));
dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));

Powered by Google App Engine
This is Rietveld 408576698