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

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

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 side-by-side diff with in-line comments
Download patch
Index: net/disk_cache/simple/simple_index.cc
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc
index dafc0e72177541e1bbdfcf43c636457d36336c88..1f316a59ed65d198ac732d7beb634089be54912e 100644
--- a/net/disk_cache/simple/simple_index.cc
+++ b/net/disk_cache/simple/simple_index.cc
@@ -187,8 +187,8 @@ void SimpleIndex::Initialize(base::Time cache_mtime) {
#if defined(OS_ANDROID)
if (base::android::IsVMInitialized()) {
- activity_status_listener_.reset(new base::android::ActivityStatus::Listener(
- base::Bind(&SimpleIndex::OnActivityStateChange, AsWeakPtr())));
+ app_status_listener_.reset(new base::android::ApplicationStatusListener(
+ base::Bind(&SimpleIndex::OnApplicationStateChange, AsWeakPtr())));
}
#endif
@@ -455,15 +455,15 @@ void SimpleIndex::MergeInitializingSet(
}
#if defined(OS_ANDROID)
-void SimpleIndex::OnActivityStateChange(
- base::android::ActivityState state) {
+void SimpleIndex::OnApplicationStateChange(
+ base::android::ApplicationState state) {
DCHECK(io_thread_checker_.CalledOnValidThread());
// For more info about android activities, see:
// developer.android.com/training/basics/activity-lifecycle/pausing.html
- // These values are defined in the file ActivityStatus.java
- if (state == base::android::ACTIVITY_STATE_RESUMED) {
+ if (state == base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) {
pasko 2014/02/24 14:43:31 app_on_background_ should be set to false when HAS
app_on_background_ = false;
- } else if (state == base::android::ACTIVITY_STATE_STOPPED) {
+ } else if (state ==
+ base::android::APPLICATION_STATE_HAS_STOPPED_ACTIVITIES) {
app_on_background_ = true;
WriteToDisk();
}
« no previous file with comments | « net/disk_cache/simple/simple_index.h ('k') | sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698