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

Unified Diff: chrome/common/extensions/extension.h

Issue 256049: Generate IDs for --load-extension by hashing the path instead (Closed)
Patch Set: Removed support for default Extension constructor Created 11 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/sandboxed_extension_unpacker.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 d77e5e2730513f5bc95f854e3e376b6eb15aedde..c01d948634911c919333135784ae40eb0649e667 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -106,17 +106,9 @@ class Extension {
// The mimetype used for extensions.
static const char kMimeType[];
- Extension()
- : location_(INVALID), is_theme_(false),
- background_page_ready_(false) {}
explicit Extension(const FilePath& path);
virtual ~Extension();
- // Resets the id counter. This is only useful for unit tests.
- static void ResetGeneratedIdCounter() {
- id_counter_ = 0;
- }
-
// Checks to see if the extension has a valid ID.
static bool IdIsValid(const std::string& id);
@@ -160,10 +152,9 @@ class Extension {
// Does a simple base64 encoding of |input| into |output|.
static bool ProducePEM(const std::string& input, std::string* output);
- // Note: The result is coverted to lower-case because the browser enforces
- // hosts to be lower-case in omni-bar.
- static bool GenerateIdFromPublicKey(const std::string& input,
- std::string* output);
+ // Generates an extension ID from arbitrary input. The same input string will
+ // always generate the same output ID.
+ static bool GenerateId(const std::string& input, std::string* output);
// Expects base64 encoded |input| and formats into |output| including
// the appropriate header & footer.
@@ -281,14 +272,6 @@ class Extension {
void SetBackgroundPageReady();
private:
- // Counter used to assign ids to extensions that are loaded using
- // --load-extension.
- static int id_counter_;
-
- // Returns the next counter id. Intentionally post-incrementing so that first
- // value is 0.
- static int NextGeneratedId() { return id_counter_++; }
-
// Helper method that loads a UserScript object from a
// dictionary in the content_script list of the manifest.
bool LoadUserScriptHelper(const DictionaryValue* content_script,
« no previous file with comments | « chrome/browser/extensions/sandboxed_extension_unpacker.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698