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

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

Issue 294023017: sync: Fix crash on backend initialize failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/sync/glue/sync_backend_host_core.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/sync_backend_host_core.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host_core.cc b/chrome/browser/sync/glue/sync_backend_host_core.cc
index 32b7da2d08f7dcdbde2e195a76d9039e76c1e4cf..b2d56f2ae30e05c8340bff980f27de79fc1a49ef 100644
--- a/chrome/browser/sync/glue/sync_backend_host_core.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_core.cc
@@ -109,6 +109,7 @@ SyncBackendHostCore::SyncBackendHostCore(
registrar_(NULL),
has_sync_setup_completed_(has_sync_setup_completed),
forward_protocol_events_(false),
+ forward_type_info_(false),
weak_ptr_factory_(this) {
DCHECK(backend.get());
}
@@ -577,8 +578,8 @@ void SyncBackendHostCore::DoShutdown(bool sync_disabled) {
void SyncBackendHostCore::DoDestroySyncManager() {
DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
if (sync_manager_) {
- save_changes_timer_.reset();
DisableDirectoryTypeDebugInfoForwarding();
+ save_changes_timer_.reset();
sync_manager_->RemoveObserver(this);
sync_manager_->ShutdownOnSyncThread();
sync_manager_.reset();
@@ -669,6 +670,9 @@ void SyncBackendHostCore::DisableProtocolEventForwarding() {
void SyncBackendHostCore::EnableDirectoryTypeDebugInfoForwarding() {
DCHECK(sync_manager_);
+
+ forward_type_info_ = true;
+
if (!sync_manager_->HasDirectoryTypeDebugInfoObserver(this))
sync_manager_->RegisterDirectoryTypeDebugInfoObserver(this);
sync_manager_->RequestEmitDebugInfo();
@@ -676,6 +680,12 @@ void SyncBackendHostCore::EnableDirectoryTypeDebugInfoForwarding() {
void SyncBackendHostCore::DisableDirectoryTypeDebugInfoForwarding() {
DCHECK(sync_manager_);
+
+ if (!forward_type_info_)
+ return;
+
+ forward_type_info_ = false;
+
if (sync_manager_->HasDirectoryTypeDebugInfoObserver(this))
sync_manager_->UnregisterDirectoryTypeDebugInfoObserver(this);
}
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_core.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698