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

Issue 159173002: Refactor ActivityStatus to not store current activity (Closed)

Created:
6 years, 10 months ago by David Trainor- moved to gerrit
Modified:
6 years, 10 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, erikwright+watch_chromium.org, gavinp+disk_chromium.org, Philippe
Visibility:
Public.

Description

Refactor ActivityStatus to not store current - Refactor ActivityStatus to expose application level visibility over activity visbility. - Add a listener for the visibility of the Application (are any Activities visible?) BUG=341231 NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=252679

Patch Set 1 #

Patch Set 2 : Updated comments and restored sActivity #

Patch Set 3 : Update visibility listner, fix SSL usage #

Patch Set 4 : Updated description #

Patch Set 5 : Fixed naming bug #

Patch Set 6 : Added window focus check #

Patch Set 7 : Addressed Comments #

Total comments: 46

Patch Set 8 : Addressed More Comments. Moved application_status to just expose listener #

Patch Set 9 : Forgot to set callback_, fixed unit tests #

Total comments: 16

Patch Set 10 : Addressed Comments. Renamed classes and changed static variable usage #

Patch Set 11 : Fixed unit test breakage #

Patch Set 12 : Rebased #

Patch Set 13 : Fixed webview build breka #

Patch Set 14 : Added Landmine to fix ActivityState.template change #

Patch Set 15 : Fixed unit test break #

Patch Set 16 : Rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+981 lines, -688 lines) Patch
M android_webview/Android.mk View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M android_webview/all_webview.gyp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
D base/android/activity_state_list.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -16 lines 0 comments Download
M base/android/activity_status.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -98 lines 0 comments Download
M base/android/activity_status.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -66 lines 0 comments Download
M base/android/activity_status_unittest.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -128 lines 0 comments Download
A base/android/application_state_list.h View 1 2 3 4 5 6 7 8 9 1 chunk +17 lines, -0 lines 0 comments Download
A base/android/application_status_listener.h View 1 2 3 4 5 6 7 1 chunk +79 lines, -0 lines 0 comments Download
A base/android/application_status_listener.cc View 1 2 3 4 5 6 7 8 9 1 chunk +74 lines, -0 lines 0 comments Download
A + base/android/application_status_listener_unittest.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +28 lines, -26 lines 0 comments Download
M base/android/base_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
A base/android/java/src/org/chromium/base/ActivityState.java View 1 2 3 4 5 6 7 8 9 1 chunk +40 lines, -0 lines 0 comments Download
M base/android/java/src/org/chromium/base/ActivityState.template View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -14 lines 0 comments Download
M base/android/java/src/org/chromium/base/ActivityStatus.java View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -259 lines 0 comments Download
A base/android/java/src/org/chromium/base/ApplicationState.template View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +14 lines, -0 lines 0 comments Download
A base/android/java/src/org/chromium/base/ApplicationStatus.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +421 lines, -0 lines 0 comments Download
M base/android/java/src/org/chromium/base/BaseChromiumApplication.java View 1 2 3 4 5 6 7 8 9 1 chunk +80 lines, -1 line 0 comments Download
M base/android/java/src/org/chromium/base/PowerMonitor.java View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -5 lines 0 comments Download
A base/android/java/src/org/chromium/base/WindowCallbackWrapper.java View 1 2 3 4 5 1 chunk +134 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +8 lines, -8 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -2 lines 0 comments Download
M build/get_landmines.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/SSLClientCertificateRequest.java View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +15 lines, -11 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java View 1 2 3 4 5 6 7 8 9 3 chunks +8 lines, -7 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/sync/DelayedSyncController.java View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +9 lines, -7 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/sync/DelayedSyncControllerTest.java View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/android/ssl_client_certificate_request.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +14 lines, -3 lines 0 comments Download
M net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +8 lines, -13 lines 0 comments Download
M net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download
M net/disk_cache/simple/simple_index.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M net/disk_cache/simple/simple_index.cc View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -7 lines 1 comment Download
M sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
David Trainor- moved to gerrit
ptal for initial comments on the change.
6 years, 10 months ago (2014-02-11 04:14:51 UTC) #1
David Trainor- moved to gerrit
Updated based on in person comments.
6 years, 10 months ago (2014-02-12 18:03:09 UTC) #2
Ted C
+bulach for an extra set of eyes and for ensure my nits/comments are not draconian ...
6 years, 10 months ago (2014-02-13 04:38:43 UTC) #3
David Trainor- moved to gerrit
https://chromiumcodereview.appspot.com/159173002/diff/130001/base/android/java/src/org/chromium/base/ActivityStatus.java File base/android/java/src/org/chromium/base/ActivityStatus.java (right): https://chromiumcodereview.appspot.com/159173002/diff/130001/base/android/java/src/org/chromium/base/ActivityStatus.java#newcode49 base/android/java/src/org/chromium/base/ActivityStatus.java:49: private static final Map<Activity, Integer> sActivityStates = On 2014/02/13 ...
6 years, 10 months ago (2014-02-13 05:03:55 UTC) #4
bulach
good stuff, I think we're very close! I have just some suggestions below but except ...
6 years, 10 months ago (2014-02-13 11:17:48 UTC) #5
David Trainor- moved to gerrit
Addressed comments. ptal https://chromiumcodereview.appspot.com/159173002/diff/130001/base/android/activity_status.h File base/android/activity_status.h (right): https://chromiumcodereview.appspot.com/159173002/diff/130001/base/android/activity_status.h#newcode40 base/android/activity_status.h:40: // void OnApplicationStateChange(bool foreground, bool active) ...
6 years, 10 months ago (2014-02-14 19:13:35 UTC) #6
bulach
lgtm, good stuff! I'm happy with the overall API, but please make sure ted is ...
6 years, 10 months ago (2014-02-17 12:04:00 UTC) #7
Ted C
lgtm (w/ bulach's comments as well) https://codereview.chromium.org/159173002/diff/320001/base/android/application_state_list.h File base/android/application_state_list.h (right): https://codereview.chromium.org/159173002/diff/320001/base/android/application_state_list.h#newcode12 base/android/application_state_list.h:12: DEFINE_APPLICATION_STATE(HAS_ONLY_PAUSED_ACTIVITIES, 2) I ...
6 years, 10 months ago (2014-02-18 18:18:29 UTC) #8
David Trainor- moved to gerrit
https://chromiumcodereview.appspot.com/159173002/diff/320001/base/android/application_state_list.h File base/android/application_state_list.h (right): https://chromiumcodereview.appspot.com/159173002/diff/320001/base/android/application_state_list.h#newcode12 base/android/application_state_list.h:12: DEFINE_APPLICATION_STATE(HAS_ONLY_PAUSED_ACTIVITIES, 2) On 2014/02/18 18:18:29, Ted C wrote: > ...
6 years, 10 months ago (2014-02-18 19:54:15 UTC) #9
David Trainor- moved to gerrit
boliu@: Can you review android_webview changes? darin@: Can you review base.gyp/base.gypi? yfriedman@: Can you review ...
6 years, 10 months ago (2014-02-19 23:01:41 UTC) #10
boliu
android_webview lgtm
6 years, 10 months ago (2014-02-19 23:13:06 UTC) #11
Yaron
net/android and sync/android lgtm. I trust Marcus/Ted for the others
6 years, 10 months ago (2014-02-20 05:48:46 UTC) #12
David Trainor- moved to gerrit
Dogh forgot to add you to the reviewer list! darin@: Can you review base.gyp(i) changes? ...
6 years, 10 months ago (2014-02-20 19:02:04 UTC) #13
darin (slow to review)
base/base.gyp* LGTM
6 years, 10 months ago (2014-02-20 19:03:59 UTC) #14
Ryan Hamilton
net/ LGTM
6 years, 10 months ago (2014-02-21 18:49:58 UTC) #15
David Trainor- moved to gerrit
The CQ bit was checked by dtrainor@chromium.org
6 years, 10 months ago (2014-02-21 19:04:43 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtrainor@chromium.org/159173002/1180001
6 years, 10 months ago (2014-02-21 19:04:50 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtrainor@chromium.org/159173002/1180001
6 years, 10 months ago (2014-02-21 19:16:15 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-21 21:40:22 UTC) #19
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=268078
6 years, 10 months ago (2014-02-21 21:40:23 UTC) #20
David Trainor- moved to gerrit
The CQ bit was checked by dtrainor@chromium.org
6 years, 10 months ago (2014-02-21 22:57:27 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtrainor@chromium.org/159173002/1180001
6 years, 10 months ago (2014-02-21 23:01:09 UTC) #22
commit-bot: I haz the power
Change committed as 252679
6 years, 10 months ago (2014-02-21 23:04:11 UTC) #23
pasko
6 years, 10 months ago (2014-02-24 14:43:30 UTC) #24
Message was sent while issue was closed.
sorry for late response, was on vacation.

https://chromiumcodereview.appspot.com/159173002/diff/1180001/net/disk_cache/...
File net/disk_cache/simple/simple_index.cc (right):

https://chromiumcodereview.appspot.com/159173002/diff/1180001/net/disk_cache/...
net/disk_cache/simple/simple_index.cc:463: if (state ==
base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) {
app_on_background_ should be set to false when HAS_PAUSED_ACTIVITIES because in
this case we are still on foreground. This would match hasVisibleActivities().

I have a more general question: why do we ever need to subscribe to
onPause()/onResume() in chrome?

Powered by Google App Engine
This is Rietveld 408576698