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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 7981002: Fix crash by preventing extensions from changing their IDs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add UMA action Created 9 years, 3 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 | « no previous file | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index d8b7f5f35c5ca7b80afc638c826921d1e09cfb5e..3391dca124f217d3ed8273876e7b3141da3064f1 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1428,6 +1428,16 @@ void ExtensionService::LoadInstalledExtension(const ExtensionInfo& info,
error = errors::kManifestUnreadable;
}
+ // Once installed, non-unpacked extensions cannot change their IDs (e.g., by
+ // updating the 'key' field in their manifest).
+ if (extension &&
+ extension->location() != Extension::LOAD &&
+ info.extension_id != extension->id()) {
+ error = errors::kCannotChangeExtensionID;
+ extension = NULL;
+ UserMetrics::RecordAction(UserMetricsAction("Extensions.IDChangedError"));
+ }
+
if (!extension) {
ReportExtensionLoadError(info.extension_path,
error,
« no previous file with comments | « no previous file | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698