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

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

Issue 1236363002: ExtensionSyncService cleanup: process uninstalls in one step (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/extension_sync_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_sync_service.cc
diff --git a/chrome/browser/extensions/extension_sync_service.cc b/chrome/browser/extensions/extension_sync_service.cc
index 4b55a274842462b0c28d0f5b41721ca68cded36f..c01cd7a08f0228b385e4a677fd9ca5a6bc7fa8e9 100644
--- a/chrome/browser/extensions/extension_sync_service.cc
+++ b/chrome/browser/extensions/extension_sync_service.cc
@@ -112,33 +112,26 @@ ExtensionSyncService* ExtensionSyncService::Get(
return ExtensionSyncServiceFactory::GetForBrowserContext(context);
}
-syncer::SyncData ExtensionSyncService::PrepareToSyncUninstallExtension(
- const Extension& extension) {
- // Extract the data we need for sync now, but don't actually sync until we've
- // completed the uninstallation.
+void ExtensionSyncService::SyncUninstallExtension(
+ const extensions::Extension& extension) {
+ if (!extensions::util::ShouldSync(&extension, profile_))
+ return;
+
// TODO(tim): If we get here and IsSyncing is false, this will cause
// "back from the dead" style bugs, because sync will add-back the extension
// that was uninstalled here when MergeDataAndStartSyncing is called.
// See crbug.com/256795.
syncer::ModelType type =
extension.is_app() ? syncer::APPS : syncer::EXTENSIONS;
- const SyncBundle* bundle = GetSyncBundle(type);
- if (extensions::util::ShouldSync(&extension, profile_)) {
- if (bundle->IsSyncing())
- return CreateSyncData(extension).GetSyncData();
+ SyncBundle* bundle = GetSyncBundle(type);
+ if (!bundle->IsSyncing()) {
if (extension_service_->is_ready() && !flare_.is_null())
flare_.Run(type); // Tell sync to start ASAP.
+ return;
}
-
- return syncer::SyncData();
-}
-
-void ExtensionSyncService::ProcessSyncUninstallExtension(
- const std::string& extension_id,
- const syncer::SyncData& sync_data) {
- SyncBundle* bundle = GetSyncBundle(sync_data.GetDataType());
- if (bundle->HasExtensionId(extension_id))
- bundle->PushSyncDeletion(extension_id, sync_data);
+ const std::string& id = extension.id();
+ if (bundle->HasExtensionId(id))
+ bundle->PushSyncDeletion(id, CreateSyncData(extension).GetSyncData());
not at google - send to devlin 2015/07/15 17:49:13 Btw it would be nice if this function could mostly
Marc Treib 2015/07/16 08:12:29 Yup, the other CL does just that :) It's not (easi
}
void ExtensionSyncService::SyncEnableExtension(const Extension& extension) {
« no previous file with comments | « chrome/browser/extensions/extension_sync_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698