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

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

Issue 10807009: Include the processId in 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 e79f5400d53ff6ccd9dc9706f7a39c89abb70695..714de23297a6910d245057d0a76cabc34be959f5 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
@@ -15,6 +15,8 @@
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/event_filtering_info.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "net/base/net_errors.h"
@@ -64,6 +66,8 @@ 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::kFrameIdKey, GetFrameId(is_main_frame, frame_id));
dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
args.Append(dict);
@@ -86,6 +90,8 @@ void DispatchOnCommitted(const char* event_name,
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::kFrameIdKey, GetFrameId(is_main_frame, frame_id));
dict->SetString(
keys::kTransitionTypeKey,
@@ -116,6 +122,8 @@ void DispatchOnDOMContentLoaded(content::WebContents* web_contents,
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::kFrameIdKey, GetFrameId(is_main_frame, frame_id));
dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
args.Append(dict);
@@ -136,6 +144,8 @@ void DispatchOnCompleted(content::WebContents* web_contents,
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::kFrameIdKey, GetFrameId(is_main_frame, frame_id));
dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
args.Append(dict);
@@ -163,6 +173,8 @@ void DispatchOnCreatedNavigationTarget(
DictionaryValue* dict = new DictionaryValue();
dict->SetInteger(keys::kSourceTabIdKey,
ExtensionTabUtil::GetTabId(web_contents));
+ dict->SetInteger(keys::kSourceProcessIdKey,
+ web_contents->GetRenderViewHost()->GetProcess()->GetID());
dict->SetInteger(keys::kSourceFrameIdKey,
GetFrameId(source_frame_is_main_frame, source_frame_id));
dict->SetString(keys::kUrlKey, target_url.possibly_invalid_spec());
@@ -185,6 +197,8 @@ 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::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