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

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

Issue 1413543005: Use FrameTreeNode ID as frameId in extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/:/ / Created 4 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
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 a8b027acf75d224d62a4517012347b67297041d1..14612edb9c2888683a751333efb7b3235f3fa096 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
@@ -21,6 +21,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/event_router.h"
+#include "extensions/browser/extension_api_frame_id_map.h"
#include "extensions/common/event_filtering_info.h"
#include "net/base/net_errors.h"
#include "ui/base/page_transition_types.h"
@@ -62,15 +63,10 @@ void DispatchEvent(content::BrowserContext* browser_context,
} // namespace
int GetFrameId(content::RenderFrameHost* frame_host) {
- if (!frame_host)
- return -1;
- return !frame_host->GetParent() ? 0 : frame_host->GetRoutingID();
+ return ExtensionApiFrameIdMap::GetFrameId(frame_host);
}
// Constructs and dispatches an onBeforeNavigate event.
-// TODO(dcheng): Is the parent process ID needed here? http://crbug.com/393640
-// Collisions are probably possible... but maybe this won't ever happen because
-// of the SiteInstance grouping policies.
void DispatchOnBeforeNavigate(content::WebContents* web_contents,
content::RenderFrameHost* frame_host,
const GURL& validated_url) {

Powered by Google App Engine
This is Rietveld 408576698