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

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

Issue 7744057: Do not attempt to apply app sync updates to extensions with matching ID, or vice versa. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/835/src
Patch Set: Created 9 years, 4 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/browser/extensions/extension_service_unittest.cc » ('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 2f1874f40832b29c697f7e00e569cbc35d81c02c..8712e6fc5d42235a7596a81d681b34aa15bcacb2 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1638,6 +1638,17 @@ void ExtensionService::ProcessSyncData(
ExtensionFilter filter) {
const std::string& id = extension_sync_data.id;
+ // If we have an app update for an extension, or vice versa, ignore it.
+ //
+ // This can happen if an app author publishes an update that is actually an
+ // extension, for example.
+ const Extension* extension_if_installed =
+ GetExtensionByIdInternal(id, true, true, true);
+ if (extension_if_installed && !filter(*extension_if_installed)) {
+ LOG(WARNING) << "Attempt to sync wrong type of extension for " << id;
+ return;
+ }
+
// Handle uninstalls first.
if (extension_sync_data.uninstalled) {
std::string error;
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698