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

Unified Diff: chrome/common/extensions/extension.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/views/browser_actions_container.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.h
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index b96eaecb099271ea52d394965d9fbda4f9abd636..ffc110347c9cf6740b71aa112191afc56442acc8 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -100,28 +100,6 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
bool is_public; // False if only this extension can load this plugin.
};
- // Contains the subset of the extension's (private) data that can be modified
- // after initialization. This class should only be accessed on the UI thread.
- struct RuntimeData {
- // We keep a cache of images loaded from extension resources based on their
- // path and a string representation of a size that may have been used to
- // scale it (or the empty string if the image is at its original size).
- typedef std::pair<FilePath, std::string> ImageCacheKey;
- typedef std::map<ImageCacheKey, SkBitmap> ImageCache;
-
- RuntimeData();
- ~RuntimeData();
-
- // True if the background page is ready.
- bool background_page_ready;
-
- // True while the extension is being upgraded.
- bool being_upgraded;
-
- // Cached images for this extension.
- ImageCache image_cache_;
- };
-
// A permission is defined by its |name| (what is used in the manifest),
// and the |message_id| that's used by install/update UI.
struct Permission {
@@ -440,22 +418,15 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
return theme_display_properties_.get();
}
- // 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 GetBackgroundPageReady() const;
- void SetBackgroundPageReady() const;
-
- // Getter and setter for the flag that specifies whether the extension is
- // being upgraded.
- bool being_upgraded() const { return GetRuntimeData()->being_upgraded; }
- void set_being_upgraded(bool value) const {
- GetRuntimeData()->being_upgraded = value;
- }
-
private:
friend class base::RefCountedThreadSafe<Extension>;
+ // We keep a cache of images loaded from extension resources based on their
+ // path and a string representation of a size that may have been used to
+ // scale it (or the empty string if the image is at its original size).
+ typedef std::pair<FilePath, std::string> ImageCacheKey;
+ typedef std::map<ImageCacheKey, SkBitmap> ImageCache;
+
// Normalize the path for use by the extension. On Windows, this will make
// sure the drive letter is uppercase.
static FilePath MaybeNormalizePath(const FilePath& path);
@@ -532,12 +503,9 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// this extension.
string16 GetHostPermissionMessage() const;
- // Returns a mutable pointer to our runtime data. Can only be called on
- // the UI thread.
- RuntimeData* GetRuntimeData() const;
-
- // Runtime data.
- const RuntimeData runtime_data_;
+ // Cached images for this extension. This should only be touched on the UI
+ // thread.
+ mutable ImageCache image_cache_;
// A persistent, globally unique ID. An extension's ID is used in things
// like directory structures and URLs, and is expected to not change across
« no previous file with comments | « chrome/browser/views/browser_actions_container.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698