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

Unified Diff: chrome/browser/win/jumplist.h

Issue 2868303003: Cancel the next 10 updates if there's a timeout in jumplist updater (Closed)
Patch Set: Created 3 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 | « no previous file | chrome/browser/win/jumplist.cc » ('j') | chrome/browser/win/jumplist.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/jumplist.h
diff --git a/chrome/browser/win/jumplist.h b/chrome/browser/win/jumplist.h
index 95479cc8d5a2daddbefd7bfb2a02ad1a3c909549..e35050e3026ebe20737c8e7e420d03ca0f3da9af 100644
--- a/chrome/browser/win/jumplist.h
+++ b/chrome/browser/win/jumplist.h
@@ -170,6 +170,12 @@ class JumpList : public sessions::TabRestoreServiceObserver,
void TopSitesChanged(history::TopSites* top_sites,
ChangeReason change_reason) override;
+ // Checks if the timeout flag |jumplist_updater_timeout_| is true and updates
+ // the flag and |cancelled_update_count_| accordingly.
+ // Returns true if |jumplist_updater_timeout_| is still true after being
+ // updated.
+ bool CheckAndUpdateTimeoutInfo();
+
// Called on a timer to update the most visited URLs after requests storms
// have subsided.
void DeferredTopSitesChanged();
@@ -232,6 +238,15 @@ class JumpList : public sessions::TabRestoreServiceObserver,
// jumplist.
base::OneShotTimer timer_recently_closed_;
+ // The number of jumplist updates cancelled intentionally due to jumplist
+ // updater timeout.
+ int cancelled_update_count_;
gab 2017/05/12 17:58:47 Initialize member inline here instead of in constr
chengx 2017/05/12 18:53:38 Done.
+
+ // A boolean flag indicating if there's a timeout in jumplist updater. This
+ // flag will be cleared after the following |kCancelledUpdates| jumplist
+ // updates are cancelled intentionally.
+ bool jumplist_updater_timeout_;
gab 2017/05/12 17:58:47 Actually you don't need the bool, you can do this
chengx 2017/05/12 18:53:38 Agreed. I've updated the logic in the new patch se
+
// Holds data that can be accessed from multiple threads.
scoped_refptr<base::RefCountedData<JumpListData>> jumplist_data_;
« no previous file with comments | « no previous file | chrome/browser/win/jumplist.cc » ('j') | chrome/browser/win/jumplist.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698