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

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

Issue 4132005: Kill Extension::RuntimeData and move its guts to ExtensionsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 10 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
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/extensions/extensions_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.h
diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h
index 213471c4e27a8f6088a72716c4c909726a5e7a4c..272b32509325b97444300042eb0c5d19d7eed90f 100644
--- a/chrome/browser/extensions/extensions_service.h
+++ b/chrome/browser/extensions/extensions_service.h
@@ -185,6 +185,17 @@ class ExtensionsService
bool AllowFileAccess(const Extension* extension);
void SetAllowFileAccess(const Extension* extension, bool allow);
+ // Whether the background page, if any, is ready. We don't load other
+ // components until then. If there is no background page, we consider it to
+ // be ready.
+ bool IsBackgroundPageReady(const Extension* extension);
+ void SetBackgroundPageReady(const Extension* extension);
+
+ // Getter and setter for the flag that specifies whether the extension is
+ // being upgraded.
+ bool IsBeingUpgraded(const Extension* extension);
+ void SetBeingUpgraded(const Extension* extension, bool value);
+
// Initialize and start all installed extensions.
void Init();
@@ -404,10 +415,25 @@ class ExtensionsService
ExtensionIdSet GetAppIds() const;
private:
- virtual ~ExtensionsService();
friend class BrowserThread;
friend class DeleteTask<ExtensionsService>;
+ // Contains Extension data that can change during the life of the process,
+ // but does not persist across restarts.
+ struct ExtensionRuntimeData {
+ // True if the background page is ready.
+ bool background_page_ready;
+
+ // True while the extension is being upgraded.
+ bool being_upgraded;
+
+ ExtensionRuntimeData();
+ ~ExtensionRuntimeData();
+ };
+ typedef std::map<std::string, ExtensionRuntimeData> ExtensionRuntimeDataMap;
+
+ virtual ~ExtensionsService();
+
// Clear all persistent data that may have been stored by the extension.
void ClearExtensionData(const GURL& extension_url);
@@ -459,6 +485,9 @@ class ExtensionsService
// The set of pending extensions.
PendingExtensionMap pending_extensions_;
+ // The map of extension IDs to their runtime data.
+ ExtensionRuntimeDataMap extension_runtime_data_;
+
// The full path to the directory where extensions are installed.
FilePath install_directory_;
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/extensions/extensions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698