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

Unified Diff: extensions/browser/renderer_startup_helper.h

Issue 2766063003: Extensions: Keep track of loaded extensions in RendererStartupHelper. (Closed)
Patch Set: Address review Created 3 years, 8 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/BUILD.gn ('k') | extensions/browser/renderer_startup_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/renderer_startup_helper.h
diff --git a/extensions/browser/renderer_startup_helper.h b/extensions/browser/renderer_startup_helper.h
index 94ec3833b955795135c84650f0b857268d8be0d4..cf490f50e57e425577ec12934435ec97ec4bb82e 100644
--- a/extensions/browser/renderer_startup_helper.h
+++ b/extensions/browser/renderer_startup_helper.h
@@ -47,7 +47,8 @@ class RendererStartupHelper : public KeyedService,
const content::NotificationDetails& details) override;
// Sends a message to the specified |process| activating the given extension
- // once the process is initialized.
+ // once the process is initialized. OnExtensionLoaded should have already been
+ // called for the extension.
void ActivateExtensionInProcess(const Extension& extension,
content::RenderProcessHost* process);
@@ -59,6 +60,8 @@ class RendererStartupHelper : public KeyedService,
void OnExtensionLoaded(const Extension& extension);
private:
+ friend class RendererStartupHelperTest;
+
// Initializes the specified process, informing it of system state and loaded
// extensions.
void InitializeProcess(content::RenderProcessHost* process);
@@ -68,6 +71,10 @@ class RendererStartupHelper : public KeyedService,
content::BrowserContext* browser_context_; // Not owned.
+ // Tracks the set of loaded extensions and the processes they are loaded in.
+ std::map<ExtensionId, std::set<content::RenderProcessHost*>>
+ extension_process_map_;
+
// The set of render processes that have had the initial batch of IPC messages
// sent, including the set of loaded extensions. Further messages that
// activate, load, or unload extensions should not be sent until after this
« no previous file with comments | « extensions/browser/BUILD.gn ('k') | extensions/browser/renderer_startup_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698