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

Side by Side Diff: chrome/browser/win/jumplist.h

Issue 2965973002: Remove delay for the first JumpList top site sync in one session (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/win/jumplist.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_WIN_JUMPLIST_H_ 5 #ifndef CHROME_BROWSER_WIN_JUMPLIST_H_
6 #define CHROME_BROWSER_WIN_JUMPLIST_H_ 6 #define CHROME_BROWSER_WIN_JUMPLIST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 // Callback for changes to the incognito mode availability pref. 118 // Callback for changes to the incognito mode availability pref.
119 void OnIncognitoAvailabilityChanged(); 119 void OnIncognitoAvailabilityChanged();
120 120
121 // Initializes the one-shot timer to update the JumpList in a while. If there 121 // Initializes the one-shot timer to update the JumpList in a while. If there
122 // is already a request queued then cancel it and post the new request. This 122 // is already a request queued then cancel it and post the new request. This
123 // ensures that JumpList update won't happen until there has been a brief 123 // ensures that JumpList update won't happen until there has been a brief
124 // quiet period, thus avoiding update storms. 124 // quiet period, thus avoiding update storms.
125 void InitializeTimerForUpdate(); 125 void InitializeTimerForUpdate();
126 126
127 // Called on a timer after requests storms have subsided. Calls APIs 127 // Processes update notifications. Calls APIs ProcessTopSitesNotification and
128 // ProcessTopSitesNotification and ProcessTabRestoreNotification on 128 // ProcessTabRestoreNotification on demand to do the actual work.
129 // demand to do the actual work. 129 void ProcessNotifications();
130 void OnDelayTimer();
131 130
132 // Processes notifications from TopSites service. 131 // Processes notifications from TopSites service.
133 void ProcessTopSitesNotification(); 132 void ProcessTopSitesNotification();
134 133
135 // Processes notifications from TabRestore service. 134 // Processes notifications from TabRestore service.
136 void ProcessTabRestoreServiceNotification(); 135 void ProcessTabRestoreServiceNotification();
137 136
138 // Callback for TopSites that notifies when |data|, the "Most Visited" list, 137 // Callback for TopSites that notifies when |data|, the "Most Visited" list,
139 // is available. This function updates the ShellLinkItemList objects and 138 // is available. This function updates the ShellLinkItemList objects and
140 // begins the process of fetching favicons for the URLs. 139 // begins the process of fetching favicons for the URLs.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // A flag indicating if "Recently Closed" category should be updated. 274 // A flag indicating if "Recently Closed" category should be updated.
276 bool recently_closed_should_update_ = false; 275 bool recently_closed_should_update_ = false;
277 276
278 // A flag indicating if there's a JumpList update task already posted or 277 // A flag indicating if there's a JumpList update task already posted or
279 // currently running. 278 // currently running.
280 bool update_in_progress_ = false; 279 bool update_in_progress_ = false;
281 280
282 // A flag indicating if a session has at least one tab closed. 281 // A flag indicating if a session has at least one tab closed.
283 bool has_tab_closed_ = false; 282 bool has_tab_closed_ = false;
284 283
284 // A flag indicating if a session has at least one top sites sync.
285 bool has_topsites_sync = false;
286
285 // Number of updates to skip to alleviate the machine when a previous update 287 // Number of updates to skip to alleviate the machine when a previous update
286 // was too slow. Updates will be resumed when this reaches 0 again. 288 // was too slow. Updates will be resumed when this reaches 0 again.
287 int updates_to_skip_ = 0; 289 int updates_to_skip_ = 0;
288 290
289 // Id of last favicon task. It's used to cancel current task if a new one 291 // Id of last favicon task. It's used to cancel current task if a new one
290 // comes in before it finishes. 292 // comes in before it finishes.
291 base::CancelableTaskTracker::TaskId task_id_ = 293 base::CancelableTaskTracker::TaskId task_id_ =
292 base::CancelableTaskTracker::kBadTaskId; 294 base::CancelableTaskTracker::kBadTaskId;
293 295
294 // A task runner running tasks to update the JumpList. 296 // A task runner running tasks to update the JumpList.
295 scoped_refptr<base::SingleThreadTaskRunner> update_jumplist_task_runner_; 297 scoped_refptr<base::SingleThreadTaskRunner> update_jumplist_task_runner_;
296 298
297 // A task runner running tasks to delete the JumpListIcons and 299 // A task runner running tasks to delete the JumpListIcons and
298 // JumpListIconsOld folders. 300 // JumpListIconsOld folders.
299 scoped_refptr<base::SequencedTaskRunner> delete_jumplisticons_task_runner_; 301 scoped_refptr<base::SequencedTaskRunner> delete_jumplisticons_task_runner_;
300 302
301 SEQUENCE_CHECKER(sequence_checker_); 303 SEQUENCE_CHECKER(sequence_checker_);
302 304
303 // For callbacks may run after destruction. 305 // For callbacks may run after destruction.
304 base::WeakPtrFactory<JumpList> weak_ptr_factory_; 306 base::WeakPtrFactory<JumpList> weak_ptr_factory_;
305 307
306 DISALLOW_COPY_AND_ASSIGN(JumpList); 308 DISALLOW_COPY_AND_ASSIGN(JumpList);
307 }; 309 };
308 310
309 #endif // CHROME_BROWSER_WIN_JUMPLIST_H_ 311 #endif // CHROME_BROWSER_WIN_JUMPLIST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/win/jumplist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698