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

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: Addressed Comments 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..252c7a4dcc4227187a539a182196f71d5809ae7c 100644
--- a/net/disk_cache/simple/simple_index.cc
+++ b/net/disk_cache/simple/simple_index.cc
@@ -1,4 +1,3 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
bulach 2014/02/13 11:17:48 trigger happy! :)
David Trainor- moved to gerrit 2014/02/14 19:13:36 DELETE DELETE DELETE OMNOMNOM
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -188,7 +187,7 @@ 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())));
+ base::Bind(&SimpleIndex::OnApplicationStateChange, AsWeakPtr())));
}
#endif
@@ -455,15 +454,14 @@ 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_RUNNING) {
app_on_background_ = false;
- } else if (state == base::android::ACTIVITY_STATE_STOPPED) {
+ } else if (state == base::android::APPLICATION_STATE_STOPPED) {
app_on_background_ = true;
WriteToDisk();
}

Powered by Google App Engine
This is Rietveld 408576698