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

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

Issue 4147007: Don't stomp on non-sync pending updates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for commit Created 10 years, 1 month 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/extensions_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 4b5b2c115bf916e925174a8136d8418bc78d79ee..1591eb25ff056e07866e063ef92298a1ed4e1e56 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -753,6 +753,25 @@ void ExtensionsService::AddPendingExtensionInternal(
Extension::Location install_source) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ // If a non-sync update is pending, a sync request should not
+ // overwrite it. This is important for external extensions.
+ // If an external extension download is pending, and the user has
+ // the extension in their sync profile, the install should set the
+ // type to be external. An external extension should not be
+ // rejected if it fails the safty checks for a syncable extension.
+ // TODO(skerner): Work out other potential overlapping conditions.
+ // (crbug/61000)
+ PendingExtensionMap::iterator it = pending_extensions_.find(id);
+ if (it != pending_extensions_.end()) {
+ VLOG(1) << "Extension id " << id
+ << " was entered for update more than once."
+ << " old is_from_sync = " << it->second.is_from_sync
+ << " new is_from_sync = " << is_from_sync;
+ if (!it->second.is_from_sync && is_from_sync)
+ return;
+ }
+
+
pending_extensions_[id] =
PendingExtensionInfo(update_url, expected_crx_type, is_from_sync,
install_silently, enable_on_install,
« no previous file with comments | « no previous file | chrome/browser/extensions/extensions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698