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

Unified Diff: net/disk_cache/simple/simple_index.h

Issue 14771009: Have SimpleCache index listen to android activity status notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1-digit
Patch Set: rebase, clear to land Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_index.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_index.h
diff --git a/net/disk_cache/simple/simple_index.h b/net/disk_cache/simple/simple_index.h
index 2347aa9a3d41cd8540d9d975f53facf0c8664b9e..4b90b21c6011e7f15b37dcaa18097d30f751cc56 100644
--- a/net/disk_cache/simple/simple_index.h
+++ b/net/disk_cache/simple/simple_index.h
@@ -23,6 +23,10 @@
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
+#if defined(OS_ANDROID)
+#include "base/android/activity_status.h"
+#endif
+
class Pickle;
class PickleIterator;
@@ -154,7 +158,14 @@ class NET_EXPORT_PRIVATE SimpleIndex
void MergeInitializingSet(scoped_ptr<EntrySet> index_file_entries,
bool force_index_flush);
+#if defined(OS_ANDROID)
+ void OnActivityStateChange(base::android::ActivityState state);
+
+ scoped_ptr<base::android::ActivityStatus::Listener> activity_status_listener_;
+#endif
+
EntrySet entries_set_;
+
uint64 cache_size_; // Total cache storage size in bytes.
uint64 max_size_;
uint64 high_watermark_;
@@ -184,6 +195,11 @@ class NET_EXPORT_PRIVATE SimpleIndex
typedef std::list<net::CompletionCallback> CallbackList;
CallbackList to_run_when_initialized_;
+
+ // Set to true when the app is on the background. When the app is in the
+ // background we can write the index much more frequently, to insure fresh
+ // index on next startup.
+ bool app_on_background_;
};
} // namespace disk_cache
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698