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

Unified Diff: extensions/browser/extension_api_frame_id_map.cc

Issue 1628423002: Add frameId to chrome.tabs.executeScript/insertCSS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissiondata-remove-process_id
Patch Set: Remove unused include from rebase Created 4 years, 10 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 | « extensions/browser/extension_api_frame_id_map.h ('k') | extensions/browser/script_executor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_api_frame_id_map.cc
diff --git a/extensions/browser/extension_api_frame_id_map.cc b/extensions/browser/extension_api_frame_id_map.cc
index 72949bea094e87dcfb49b0f7b97efab3738e7321..e844fac40d525869938c0fe794669153b040107e 100644
--- a/extensions/browser/extension_api_frame_id_map.cc
+++ b/extensions/browser/extension_api_frame_id_map.cc
@@ -24,6 +24,7 @@ base::LazyInstance<ExtensionApiFrameIdMap>::Leaky g_map_instance =
} // namespace
const int ExtensionApiFrameIdMap::kInvalidFrameId = -1;
+const int ExtensionApiFrameIdMap::kTopFrameId = 0;
ExtensionApiFrameIdMap::CachedFrameIdPair::CachedFrameIdPair()
: frame_id(kInvalidFrameId), parent_frame_id(kInvalidFrameId) {}
@@ -75,7 +76,7 @@ int ExtensionApiFrameIdMap::GetFrameId(content::RenderFrameHost* rfh) {
return kInvalidFrameId;
if (rfh->GetParent())
return rfh->GetFrameTreeNodeId();
- return 0; // Main frame.
+ return kTopFrameId;
}
int ExtensionApiFrameIdMap::GetParentFrameId(content::RenderFrameHost* rfh) {
@@ -96,7 +97,7 @@ content::RenderFrameHost* ExtensionApiFrameIdMap::GetRenderFrameHostById(
if (frame_id == kInvalidFrameId)
return nullptr;
- if (frame_id == 0)
+ if (frame_id == kTopFrameId)
return web_contents->GetMainFrame();
DCHECK_GE(frame_id, 1);
« no previous file with comments | « extensions/browser/extension_api_frame_id_map.h ('k') | extensions/browser/script_executor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698