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

Side by Side Diff: chrome/browser/jumplist_win.h

Issue 965503002: Filter out redundant jumplist updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup comments and delay amount. Created 5 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/jumplist_win.cc » ('j') | chrome/browser/jumplist_win.cc » ('J')
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_JUMPLIST_WIN_H_ 5 #ifndef CHROME_BROWSER_JUMPLIST_WIN_H_
6 #define CHROME_BROWSER_JUMPLIST_WIN_H_ 6 #define CHROME_BROWSER_JUMPLIST_WIN_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/synchronization/lock.h" 15 #include "base/synchronization/lock.h"
16 #include "base/task/cancelable_task_tracker.h" 16 #include "base/task/cancelable_task_tracker.h"
17 #include "base/time/time.h"
17 #include "chrome/browser/jumplist_updater_win.h" 18 #include "chrome/browser/jumplist_updater_win.h"
18 #include "chrome/browser/prefs/incognito_mode_prefs.h" 19 #include "chrome/browser/prefs/incognito_mode_prefs.h"
19 #include "chrome/browser/sessions/tab_restore_service.h" 20 #include "chrome/browser/sessions/tab_restore_service.h"
20 #include "chrome/browser/sessions/tab_restore_service_observer.h" 21 #include "chrome/browser/sessions/tab_restore_service_observer.h"
21 #include "components/history/core/browser/history_service.h" 22 #include "components/history/core/browser/history_service.h"
22 #include "components/history/core/browser/history_types.h" 23 #include "components/history/core/browser/history_types.h"
23 #include "components/history/core/browser/top_sites_observer.h" 24 #include "components/history/core/browser/top_sites_observer.h"
24 #include "content/public/browser/browser_thread.h" 25 #include "content/public/browser/browser_thread.h"
25 #include "content/public/browser/notification_observer.h" 26 #include "content/public/browser/notification_observer.h"
26 #include "content/public/browser/notification_registrar.h" 27 #include "content/public/browser/notification_registrar.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 base::FilePath icon_dir_; 156 base::FilePath icon_dir_;
156 157
157 // Items in the "Most Visited" category of the application JumpList, 158 // Items in the "Most Visited" category of the application JumpList,
158 // protected by the list_lock_. 159 // protected by the list_lock_.
159 ShellLinkItemList most_visited_pages_; 160 ShellLinkItemList most_visited_pages_;
160 161
161 // Items in the "Recently Closed" category of the application JumpList, 162 // Items in the "Recently Closed" category of the application JumpList,
162 // protected by the list_lock_. 163 // protected by the list_lock_.
163 ShellLinkItemList recently_closed_pages_; 164 ShellLinkItemList recently_closed_pages_;
164 165
166 // Track the last time a jumplist update was requested, and the last time
167 // such an update was requested. These are protected by list_lock_.
gab 2015/03/31 13:10:14 s/requested/started
gab 2015/03/31 13:10:14 s/list_lock_/|list_lock_|
168 base::TimeTicks lastUpdateRequested_;
jochen (gone - plz use gerrit) 2015/03/31 10:28:52 last_update_requested_
169 base::TimeTicks lastUpdateStarted_;
170
165 // A list of URLs we need to retrieve their favicons, 171 // A list of URLs we need to retrieve their favicons,
166 // protected by the list_lock_. 172 // protected by the list_lock_.
167 typedef std::pair<std::string, scoped_refptr<ShellLinkItem> > URLPair; 173 typedef std::pair<std::string, scoped_refptr<ShellLinkItem> > URLPair;
168 std::list<URLPair> icon_urls_; 174 std::list<URLPair> icon_urls_;
169 175
170 // Id of last favicon task. It's used to cancel current task if a new one 176 // Id of last favicon task. It's used to cancel current task if a new one
171 // comes in before it finishes. 177 // comes in before it finishes.
172 base::CancelableTaskTracker::TaskId task_id_; 178 base::CancelableTaskTracker::TaskId task_id_;
173 179
174 // Lock for most_visited_pages_, recently_closed_pages_, icon_urls_ 180 // Lock for most_visited_pages_, recently_closed_pages_, icon_urls_
175 // as they may be used by up to 3 threads. 181 // as they may be used by up to 3 threads.
176 base::Lock list_lock_; 182 base::Lock list_lock_;
177 183
178 // For callbacks may be run after destruction. 184 // For callbacks may be run after destruction.
179 base::WeakPtrFactory<JumpList> weak_ptr_factory_; 185 base::WeakPtrFactory<JumpList> weak_ptr_factory_;
180 186
181 DISALLOW_COPY_AND_ASSIGN(JumpList); 187 DISALLOW_COPY_AND_ASSIGN(JumpList);
182 }; 188 };
183 189
184 #endif // CHROME_BROWSER_JUMPLIST_WIN_H_ 190 #endif // CHROME_BROWSER_JUMPLIST_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/jumplist_win.cc » ('j') | chrome/browser/jumplist_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698