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

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

Issue 8361021: Track all extension processes in ExtensionInfoMap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maybe fix dcheck Created 9 years, 2 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_info_map.h
diff --git a/chrome/browser/extensions/extension_info_map.h b/chrome/browser/extensions/extension_info_map.h
index abd50190f71fbc3f035fb8c22d39fa3c4d83b43a..e34482fc1000a2a5d768b896b0764cc2e0939ef3 100644
--- a/chrome/browser/extensions/extension_info_map.h
+++ b/chrome/browser/extensions/extension_info_map.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_INFO_MAP_H_
#pragma once
-#include <set>
+#include <map>
#include <string>
#include "base/basictypes.h"
@@ -50,15 +50,22 @@ class ExtensionInfoMap : public base::RefCountedThreadSafe<ExtensionInfoMap> {
// sub-profile (incognito to original profile, or vice versa).
bool CanCrossIncognito(const Extension* extension);
- // Registers a RenderProcessHost with |render_process_id| as hosting an
- // extension.
- void BindingsEnabledForProcess(int render_process_id);
+ // Record that |extension_id| is running in |process_id|. We normally have
+ // this information in ExtensionProcessManager on the UI thread, but we also
+ // sometimes need it on the IO thread. Note that this can be any of
+ // (extension, packaged app, hosted app).
+ void RegisterExtensionProcess(const std::string& extension_id,
+ int process_id);
- // Unregisters the RenderProcessHost with |render_process_id|.
- void BindingsDisabledForProcess(int render_process_id);
+ // Remove any record of |extension_id| created with RegisterExtensionProcess.
+ // If |extension_id| is unknown, we ignore it.
+ void UnregisterExtensionProcess(const std::string& extension_id,
+ int process_id);
- // True if this process host is hosting an extension with extension bindings.
- bool AreBindingsEnabledForProcess(int render_process_id) const;
+ // Returns the process id that |extension_id| is running in, or -1 if there is
+ // no such extension.
+ int IsExtensionInProcess(const std::string& extension_id,
Matt Perry 2011/10/21 18:28:51 return bool and update the comment
Aaron Boodman 2011/10/22 04:02:42 Done.
+ int process_id) const;
private:
// Extra dynamic data related to an extension.
@@ -72,8 +79,8 @@ class ExtensionInfoMap : public base::RefCountedThreadSafe<ExtensionInfoMap> {
// Extra data associated with enabled extensions.
ExtraDataMap extra_data_;
- // The set of process ids that have extension bindings enabled.
- std::set<int> extension_bindings_process_ids_;
+ typedef std::multimap<std::string, int> ExtensionProcessIDMap;
+ ExtensionProcessIDMap extension_process_ids_;
};
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFO_MAP_H_

Powered by Google App Engine
This is Rietveld 408576698