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

Unified Diff: chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.cc

Issue 665133004: Skip enhanced bookmarks cluster requests if it's not being used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.cc
diff --git a/chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.cc b/chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.cc
index 8f1540deadcc474b0fe9f89a4bfa0c63d57720c8..fa09f07dd07671838b6834d71230bdb2ea620f6d 100644
--- a/chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.cc
+++ b/chrome/browser/enhanced_bookmarks/chrome_bookmark_server_cluster_service.cc
@@ -33,6 +33,15 @@ ChromeBookmarkServerClusterService::~ChromeBookmarkServerClusterService() {
sync_service_->RemoveObserver(this);
}
+void ChromeBookmarkServerClusterService::AddObserver(
+ BookmarkServerServiceObserver* observer) {
+ BookmarkServerClusterService::AddObserver(observer);
+ if (sync_refresh_skipped_) {
+ sync_refresh_skipped_ = false;
+ TriggerTokenRequest(false);
+ }
+}
+
void ChromeBookmarkServerClusterService::OnStateChanged() {
// Do nothing.
}
@@ -42,10 +51,14 @@ void ChromeBookmarkServerClusterService::OnSyncCycleCompleted() {
// cluster request immediately after a bookmark is changed from the bookmark
// observer notification will yield the wrong results. The request must be
// delayed until the sync cycle has completed.
- // TODO(noyau): This might happen too often, need a way to coalesce and delay
- // the notifications.
- if (model_->loaded())
- TriggerTokenRequest(false);
+ if (model_->loaded()) {
danduong 2014/10/20 18:45:38 Did we want to move this to the end of Extensive C
Kibeom Kim (inactive) 2014/10/20 20:05:47 noyau@: do you have any comment about this?
noyau (Ping after 24h) 2014/10/20 22:19:54 How would you know that an extensive change was ac
+ if (MightHaveObservers()) {
+ TriggerTokenRequest(false);
+ sync_refresh_skipped_ = false;
+ } else {
+ sync_refresh_skipped_ = true;
+ }
+ }
}
} // namespace enhanced_bookmarks

Powered by Google App Engine
This is Rietveld 408576698