| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |