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

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

Issue 12226022: <webview>: Store <webview> embedder info in ExtensionRendererState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated comment on instance ID Created 7 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
Index: chrome/browser/extensions/extension_renderer_state.h
diff --git a/chrome/browser/extensions/extension_renderer_state.h b/chrome/browser/extensions/extension_renderer_state.h
index fc8722eca13b655744b0e8679b1c9a7369c712fb..a3291ab1ac5353dfee0875d20e9734e753f4689a 100644
--- a/chrome/browser/extensions/extension_renderer_state.h
+++ b/chrome/browser/extensions/extension_renderer_state.h
@@ -16,6 +16,12 @@
// methods should be called on the IO thread except for Init and Shutdown.
class ExtensionRendererState {
public:
+ struct WebViewInfo {
+ int embedder_process_id;
+ int embedder_routing_id;
+ int web_view_instance_id;
+ };
+
static ExtensionRendererState* GetInstance();
// These are called on the UI thread to start and stop listening to tab
@@ -23,9 +29,10 @@ class ExtensionRendererState {
void Init();
void Shutdown();
- // Looks up whether the given render process is a guest renderer hosted by a
- // <webview>.
- bool IsGuestProcess(int render_process_host_id);
+ // Looks up the information for the embedder <webview> for a given render
+ // view, if one exists. Called on the IO thread.
+ bool GetWebViewInfo(int guest_process_id, int guest_routing_id,
+ WebViewInfo* web_view_info);
// Looks up the tab and window ID for a given render view. Returns true
// if we have the IDs in our map. Called on the IO thread.
@@ -40,7 +47,7 @@ class ExtensionRendererState {
typedef std::pair<int, int> RenderId;
typedef std::pair<int, int> TabAndWindowId;
typedef std::map<RenderId, TabAndWindowId> TabAndWindowIdMap;
- typedef std::set<int> ProcessIdGuestRenderProcessSet;
+ typedef std::map<RenderId, WebViewInfo> WebViewInfoMap;
ExtensionRendererState();
~ExtensionRendererState();
@@ -52,12 +59,13 @@ class ExtensionRendererState {
int render_process_host_id, int routing_id);
// Adds or removes a <webview> guest render process from the set.
- void AddGuestProcess(int render_process_host_id);
- void RemoveGuestProcess(int render_process_host_id);
+ void AddWebView(int render_process_host_id, int routing_id,
+ const WebViewInfo& web_view_info);
+ void RemoveWebView(int render_process_host_id, int routing_id);
TabObserver* observer_;
TabAndWindowIdMap map_;
- ProcessIdGuestRenderProcessSet guest_set_;
+ WebViewInfoMap web_view_info_map_;
DISALLOW_COPY_AND_ASSIGN(ExtensionRendererState);
};
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api.cc ('k') | chrome/browser/extensions/extension_renderer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698