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

Unified Diff: trunk/src/chrome/browser/sync/glue/extension_backed_data_type_controller.cc

Issue 465113002: Revert 288557 "[Sync] Use OnSingleDataTypeUnrecoverableError for..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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
Index: trunk/src/chrome/browser/sync/glue/extension_backed_data_type_controller.cc
===================================================================
--- trunk/src/chrome/browser/sync/glue/extension_backed_data_type_controller.cc (revision 289111)
+++ trunk/src/chrome/browser/sync/glue/extension_backed_data_type_controller.cc (working copy)
@@ -30,6 +30,7 @@
} // namespace
ExtensionBackedDataTypeController::ExtensionBackedDataTypeController(
+ const DisableTypeCallback& disable_callback,
syncer::ModelType type,
const std::string& extension_hash,
sync_driver::SyncApiComponentFactory* sync_factory,
@@ -37,6 +38,7 @@
: UIDataTypeController(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
base::Bind(&ChromeReportUnrecoverableError),
+ disable_callback,
type,
sync_factory),
extension_hash_(extension_hash),
@@ -73,16 +75,20 @@
const extensions::Extension* extension,
extensions::UnloadedExtensionInfo::Reason reason) {
if (DoesExtensionMatch(*extension)) {
+ ProfileSyncService* sync_service =
+ ProfileSyncServiceFactory::GetForProfile(profile_);
+
// This will trigger purging the datatype from the sync directory. This
// may not always be the right choice, especially in the face of transient
// unloads (e.g. for permission changes). If that becomes a large enough
// issue, we should consider using the extension unload reason to just
// trigger a reconfiguration without disabling (type will be unready).
- syncer::SyncError error(FROM_HERE,
- syncer::SyncError::DATATYPE_POLICY_ERROR,
- "Extension unloaded",
- type());
- OnSingleDataTypeUnrecoverableError(error);
+ syncer::SyncError error(
+ FROM_HERE,
+ syncer::SyncError::DATATYPE_ERROR,
+ "Extension unloaded",
+ type());
+ sync_service->DisableDatatype(error);
}
}

Powered by Google App Engine
This is Rietveld 408576698