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

Unified Diff: components/enhanced_bookmarks/enhanced_bookmark_model.cc

Issue 539173004: Bring up of the enhanced bookmarks cluster service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@intermediary2
Patch Set: micro-nit Created 6 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
« no previous file with comments | « components/enhanced_bookmarks/enhanced_bookmark_model.h ('k') | components/enhanced_bookmarks/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/enhanced_bookmarks/enhanced_bookmark_model.cc
diff --git a/components/enhanced_bookmarks/enhanced_bookmark_model.cc b/components/enhanced_bookmarks/enhanced_bookmark_model.cc
index 6ffcaf392035cd2101e9fbbf356985a9464c6630..7f89f8297eb6ca451377207e7e39fe0958063fb3 100644
--- a/components/enhanced_bookmarks/enhanced_bookmark_model.cc
+++ b/components/enhanced_bookmarks/enhanced_bookmark_model.cc
@@ -91,15 +91,18 @@ EnhancedBookmarkModel::EnhancedBookmarkModel(BookmarkModel* bookmark_model,
}
EnhancedBookmarkModel::~EnhancedBookmarkModel() {
+ Shutdown();
}
void EnhancedBookmarkModel::Shutdown() {
- FOR_EACH_OBSERVER(EnhancedBookmarkModelObserver,
- observers_,
- EnhancedBookmarkModelShuttingDown());
- weak_ptr_factory_.InvalidateWeakPtrs();
- bookmark_model_->RemoveObserver(this);
- bookmark_model_ = NULL;
+ if (bookmark_model_) {
+ FOR_EACH_OBSERVER(EnhancedBookmarkModelObserver,
+ observers_,
+ EnhancedBookmarkModelShuttingDown());
+ weak_ptr_factory_.InvalidateWeakPtrs();
+ bookmark_model_->RemoveObserver(this);
+ bookmark_model_ = NULL;
+ }
}
void EnhancedBookmarkModel::AddObserver(
« no previous file with comments | « components/enhanced_bookmarks/enhanced_bookmark_model.h ('k') | components/enhanced_bookmarks/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698