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

Unified Diff: chrome/browser/sync/glue/frontend_data_type_controller.cc

Issue 8345026: Prevent crash on unrecoverable error method call on FrontendDataTypeControllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload before commit. Created 9 years, 2 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: chrome/browser/sync/glue/frontend_data_type_controller.cc
diff --git a/chrome/browser/sync/glue/frontend_data_type_controller.cc b/chrome/browser/sync/glue/frontend_data_type_controller.cc
index 770e5c31b4129e28e3ead78528aa14d9bf13138f..e686024334dfcfe872872725474a35493db8d0dc 100644
--- a/chrome/browser/sync/glue/frontend_data_type_controller.cc
+++ b/chrome/browser/sync/glue/frontend_data_type_controller.cc
@@ -195,7 +195,14 @@ void FrontendDataTypeController::OnUnrecoverableError(
const tracked_objects::Location& from_here, const std::string& message) {
// The ProfileSyncService will invoke our Stop() method in response to this.
RecordUnrecoverableError(from_here, message);
- sync_service_->OnUnrecoverableError(from_here, message);
+
+ // We dont know the current state of the caller. Posting a task will allow
+ // the caller to unwind the stack before we process unrecoverable error.
+ MessageLoop::current()->PostTask(from_here,
+ base::Bind(&ProfileSyncService::OnUnrecoverableError,
+ sync_service_->AsWeakPtr(),
+ from_here,
+ message));
}
AssociatorInterface* FrontendDataTypeController::model_associator() const {

Powered by Google App Engine
This is Rietveld 408576698