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

Side by Side Diff: net/disk_cache/simple/simple_index.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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 | « net/disk_cache/disk_cache_test_util.h ('k') | net/dns/dns_config_service.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
7 7
8 #include <list> 8 #include <list>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 // All nonstatic SimpleEntryImpl methods should always be called on the IO 181 // All nonstatic SimpleEntryImpl methods should always be called on the IO
182 // thread, in all cases. |io_thread_checker_| documents and enforces this. 182 // thread, in all cases. |io_thread_checker_| documents and enforces this.
183 base::ThreadChecker io_thread_checker_; 183 base::ThreadChecker io_thread_checker_;
184 184
185 // Timestamp of the last time we wrote the index to disk. 185 // Timestamp of the last time we wrote the index to disk.
186 // PostponeWritingToDisk() may give up postponing and allow the write if it 186 // PostponeWritingToDisk() may give up postponing and allow the write if it
187 // has been a while since last time we wrote. 187 // has been a while since last time we wrote.
188 base::TimeTicks last_write_to_disk_; 188 base::TimeTicks last_write_to_disk_;
189 189
190 base::OneShotTimer<SimpleIndex> write_to_disk_timer_; 190 base::OneShotTimer write_to_disk_timer_;
191 base::Closure write_to_disk_cb_; 191 base::Closure write_to_disk_cb_;
192 192
193 typedef std::list<net::CompletionCallback> CallbackList; 193 typedef std::list<net::CompletionCallback> CallbackList;
194 CallbackList to_run_when_initialized_; 194 CallbackList to_run_when_initialized_;
195 195
196 // Set to true when the app is on the background. When the app is in the 196 // Set to true when the app is on the background. When the app is in the
197 // background we can write the index much more frequently, to insure fresh 197 // background we can write the index much more frequently, to insure fresh
198 // index on next startup. 198 // index on next startup.
199 bool app_on_background_; 199 bool app_on_background_;
200 }; 200 };
201 201
202 } // namespace disk_cache 202 } // namespace disk_cache
203 203
204 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ 204 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_util.h ('k') | net/dns/dns_config_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698