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

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

Issue 10071033: RefCounted types should not have public destructors, chrome/browser/ part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation ordering fixes as well Created 8 years, 8 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/bookmark_data_type_controller.cc
diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.cc b/chrome/browser/sync/glue/bookmark_data_type_controller.cc
index fc297d896801d4f07df214122f6db702cdc658a7..368368930b2f3fd714e4cda44f52dd218259026b 100644
--- a/chrome/browser/sync/glue/bookmark_data_type_controller.cc
+++ b/chrome/browser/sync/glue/bookmark_data_type_controller.cc
@@ -28,39 +28,8 @@ BookmarkDataTypeController::BookmarkDataTypeController(
sync_service) {
}
-BookmarkDataTypeController::~BookmarkDataTypeController() {
-}
-
-// Check that both the bookmark model and the history service (for favicons)
-// are loaded.
-bool BookmarkDataTypeController::DependentsLoaded() {
- BookmarkModel* bookmark_model = profile_->GetBookmarkModel();
- if (!bookmark_model || !bookmark_model->IsLoaded())
- return false;
-
- HistoryService* history =
- profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
- if (!history || !history->BackendLoaded())
- return false;
-
- // All necessary services are loaded.
- return true;
-}
-
-bool BookmarkDataTypeController::StartModels() {
- if (!DependentsLoaded()) {
- registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED,
- content::Source<Profile>(sync_service_->profile()));
- registrar_.Add(this, chrome::NOTIFICATION_HISTORY_LOADED,
- content::Source<Profile>(sync_service_->profile()));
- return false;
- }
- return true;
-}
-
-// Cleanup for our extra registrar usage.
-void BookmarkDataTypeController::CleanUpState() {
- registrar_.RemoveAll();
+syncable::ModelType BookmarkDataTypeController::type() const {
+ return syncable::BOOKMARKS;
}
void BookmarkDataTypeController::Observe(
@@ -80,8 +49,22 @@ void BookmarkDataTypeController::Observe(
Associate();
}
-syncable::ModelType BookmarkDataTypeController::type() const {
- return syncable::BOOKMARKS;
+BookmarkDataTypeController::~BookmarkDataTypeController() {}
+
+bool BookmarkDataTypeController::StartModels() {
+ if (!DependentsLoaded()) {
+ registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED,
+ content::Source<Profile>(sync_service_->profile()));
+ registrar_.Add(this, chrome::NOTIFICATION_HISTORY_LOADED,
+ content::Source<Profile>(sync_service_->profile()));
+ return false;
+ }
+ return true;
+}
+
+// Cleanup for our extra registrar usage.
+void BookmarkDataTypeController::CleanUpState() {
+ registrar_.RemoveAll();
}
void BookmarkDataTypeController::CreateSyncComponents() {
@@ -92,4 +75,20 @@ void BookmarkDataTypeController::CreateSyncComponents() {
set_change_processor(sync_components.change_processor);
}
+// Check that both the bookmark model and the history service (for favicons)
+// are loaded.
+bool BookmarkDataTypeController::DependentsLoaded() {
+ BookmarkModel* bookmark_model = profile_->GetBookmarkModel();
+ if (!bookmark_model || !bookmark_model->IsLoaded())
+ return false;
+
+ HistoryService* history =
+ profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
+ if (!history || !history->BackendLoaded())
+ return false;
+
+ // All necessary services are loaded.
+ return true;
+}
+
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698