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

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

Issue 159173002: Refactor ActivityStatus to not store current activity (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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 | Annotate | Revision Log
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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/containers/hash_tables.h" 13 #include "base/containers/hash_tables.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "base/single_thread_task_runner.h" 19 #include "base/single_thread_task_runner.h"
20 #include "base/threading/thread_checker.h" 20 #include "base/threading/thread_checker.h"
21 #include "base/time/time.h" 21 #include "base/time/time.h"
22 #include "base/timer/timer.h" 22 #include "base/timer/timer.h"
23 #include "net/base/cache_type.h" 23 #include "net/base/cache_type.h"
24 #include "net/base/completion_callback.h" 24 #include "net/base/completion_callback.h"
25 #include "net/base/net_export.h" 25 #include "net/base/net_export.h"
26 26
27 #if defined(OS_ANDROID) 27 #if defined(OS_ANDROID)
28 #include "base/android/activity_status.h" 28 #include "base/android/application_status_listener.h"
29 #endif 29 #endif
30 30
31 class Pickle; 31 class Pickle;
32 class PickleIterator; 32 class PickleIterator;
33 33
34 namespace disk_cache { 34 namespace disk_cache {
35 35
36 class SimpleIndexDelegate; 36 class SimpleIndexDelegate;
37 class SimpleIndexFile; 37 class SimpleIndexFile;
38 struct SimpleIndexLoadResult; 38 struct SimpleIndexLoadResult;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 void EvictionDone(int result); 142 void EvictionDone(int result);
143 143
144 void PostponeWritingToDisk(); 144 void PostponeWritingToDisk();
145 145
146 void UpdateEntryIteratorSize(EntrySet::iterator* it, int entry_size); 146 void UpdateEntryIteratorSize(EntrySet::iterator* it, int entry_size);
147 147
148 // Must run on IO Thread. 148 // Must run on IO Thread.
149 void MergeInitializingSet(scoped_ptr<SimpleIndexLoadResult> load_result); 149 void MergeInitializingSet(scoped_ptr<SimpleIndexLoadResult> load_result);
150 150
151 #if defined(OS_ANDROID) 151 #if defined(OS_ANDROID)
152 void OnActivityStateChange(base::android::ActivityState state); 152 void OnApplicationStateChange(base::android::ApplicationState state);
153 153
154 scoped_ptr<base::android::ActivityStatus::Listener> activity_status_listener_; 154 scoped_ptr<base::android::ApplicationStatusListener> app_status_listener_;
155 #endif 155 #endif
156 156
157 // The owner of |this| must ensure the |delegate_| outlives |this|. 157 // The owner of |this| must ensure the |delegate_| outlives |this|.
158 SimpleIndexDelegate* delegate_; 158 SimpleIndexDelegate* delegate_;
159 159
160 EntrySet entries_set_; 160 EntrySet entries_set_;
161 161
162 const net::CacheType cache_type_; 162 const net::CacheType cache_type_;
163 uint64 cache_size_; // Total cache storage size in bytes. 163 uint64 cache_size_; // Total cache storage size in bytes.
164 uint64 max_size_; 164 uint64 max_size_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // The time in milliseconds for the index to be idle before it gets flushed to 199 // The time in milliseconds for the index to be idle before it gets flushed to
200 // the disk. When the app is on foreground the delay is different from the 200 // the disk. When the app is on foreground the delay is different from the
201 // background state. 201 // background state.
202 int foreground_flush_delay_; 202 int foreground_flush_delay_;
203 int background_flush_delay_; 203 int background_flush_delay_;
204 }; 204 };
205 205
206 } // namespace disk_cache 206 } // namespace disk_cache
207 207
208 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ 208 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698