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

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

Issue 2779403002: Migrate jumplist update task from FILE thread to base/task_scheduler (Closed)
Patch Set: Fix nits. Created 3 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 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 13 matching lines...) Expand all
24 #include "components/history/core/browser/history_types.h" 24 #include "components/history/core/browser/history_types.h"
25 #include "components/history/core/browser/top_sites_observer.h" 25 #include "components/history/core/browser/top_sites_observer.h"
26 #include "components/keyed_service/core/refcounted_keyed_service.h" 26 #include "components/keyed_service/core/refcounted_keyed_service.h"
27 #include "components/sessions/core/tab_restore_service.h" 27 #include "components/sessions/core/tab_restore_service.h"
28 #include "components/sessions/core/tab_restore_service_observer.h" 28 #include "components/sessions/core/tab_restore_service_observer.h"
29 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
30 #include "content/public/browser/notification_observer.h" 30 #include "content/public/browser/notification_observer.h"
31 #include "content/public/browser/notification_registrar.h" 31 #include "content/public/browser/notification_registrar.h"
32 32
33 namespace base { 33 namespace base {
34 class SequencedTaskRunner; 34 class SingleThreadTaskRunner;
35 } 35 }
36 36
37 namespace chrome { 37 namespace chrome {
38 struct FaviconImageResult; 38 struct FaviconImageResult;
39 } 39 }
40 40
41 class JumpListFactory; 41 class JumpListFactory;
42 class PrefChangeRegistrar; 42 class PrefChangeRegistrar;
43 class Profile; 43 class Profile;
44 44
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // the list. 144 // the list.
145 void OnMostVisitedURLsAvailable( 145 void OnMostVisitedURLsAvailable(
146 const history::MostVisitedURLList& data); 146 const history::MostVisitedURLList& data);
147 147
148 // Callback for changes to the incognito mode availability pref. 148 // Callback for changes to the incognito mode availability pref.
149 void OnIncognitoAvailabilityChanged(); 149 void OnIncognitoAvailabilityChanged();
150 150
151 // Helper for RunUpdate() that determines its parameters. 151 // Helper for RunUpdate() that determines its parameters.
152 void PostRunUpdate(); 152 void PostRunUpdate();
153 153
154 // Called on a timer to invoke RunUpdateOnFileThread() after requests storms 154 // Called on a timer to invoke RunUpdateJumpList() after requests storms
155 // have subsided. 155 // have subsided.
156 void DeferredRunUpdate(); 156 void DeferredRunUpdate();
157 157
158 // history::TopSitesObserver implementation. 158 // history::TopSitesObserver implementation.
159 void TopSitesLoaded(history::TopSites* top_sites) override; 159 void TopSitesLoaded(history::TopSites* top_sites) override;
160 void TopSitesChanged(history::TopSites* top_sites, 160 void TopSitesChanged(history::TopSites* top_sites,
161 ChangeReason change_reason) override; 161 ChangeReason change_reason) override;
162 162
163 // Tracks FaviconService tasks. 163 // Tracks FaviconService tasks.
164 base::CancelableTaskTracker cancelable_task_tracker_; 164 base::CancelableTaskTracker cancelable_task_tracker_;
(...skipping 13 matching lines...) Expand all
178 // Timer for requesting delayed updates of the jumplist. 178 // Timer for requesting delayed updates of the jumplist.
179 base::OneShotTimer timer_; 179 base::OneShotTimer timer_;
180 180
181 // Holds data that can be accessed from multiple threads. 181 // Holds data that can be accessed from multiple threads.
182 scoped_refptr<base::RefCountedData<JumpListData>> jumplist_data_; 182 scoped_refptr<base::RefCountedData<JumpListData>> jumplist_data_;
183 183
184 // Id of last favicon task. It's used to cancel current task if a new one 184 // Id of last favicon task. It's used to cancel current task if a new one
185 // comes in before it finishes. 185 // comes in before it finishes.
186 base::CancelableTaskTracker::TaskId task_id_; 186 base::CancelableTaskTracker::TaskId task_id_;
187 187
188 // A task runner which runs the background file deletion tasks sequentially. 188 // A task runner running tasks to update the jumplist in JumpListIcons and to
189 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; 189 // delete JumpListIconsOld sequentially.
190 scoped_refptr<base::SingleThreadTaskRunner> single_thread_task_runner_;
190 191
191 // For callbacks may be run after destruction. 192 // For callbacks may be run after destruction.
192 base::WeakPtrFactory<JumpList> weak_ptr_factory_; 193 base::WeakPtrFactory<JumpList> weak_ptr_factory_;
193 194
194 DISALLOW_COPY_AND_ASSIGN(JumpList); 195 DISALLOW_COPY_AND_ASSIGN(JumpList);
195 }; 196 };
196 197
197 #endif // CHROME_BROWSER_WIN_JUMPLIST_H_ 198 #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