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

Issue 11538008: Fire SystemMonitor::{RESUME,SUSPEND}_EVENT on Android. (Closed)

Created:
8 years ago by Philippe
Modified:
8 years ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, cbentzel+watch_chromium.org, erikwright+watch_chromium.org, jam, digit1, pasko-google - do not use, felipeg, Kristian Monsen, benm (inactive)
Visibility:
Public.

Description

Fire SystemMonitor::{RESUME,SUSPEND}_EVENT on Android. This improves SystemMonitor on Android by firing RESUME/SUSPEND events when the Android main activity goes to foreground/background. This lets the Android port use the same code path as other platforms to support the close idle network connections functionnality. SUSPEND events are now fired 1 minute after the main activity goes to background. Additionnally this CL cleans up ActivityStatus used by the Java side SystemMonitor class. ActivityStatus was suffering from various refactorings and was providing a counter intuitive interface with the Listener/StateListener duality. In particular it was possible to call SystemMonitor.onPause/Resume() as opposed to onStateChange(). This could lead to SystemMonitor.getActivity() returning null. The issue was raised while this CL was prepared. BUG=164495 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=172864

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : Address Marcus' comment + revert some of the changes in ActivityStatus.java #

Patch Set 4 : Revert changes in http_network_layer.cc #

Patch Set 5 : Update findbugs_known_bugs.txt #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -170 lines) Patch
M base/android/java/src/org/chromium/base/ActivityStatus.java View 1 2 4 chunks +18 lines, -98 lines 0 comments Download
M base/android/java/src/org/chromium/base/ChromiumActivity.java View 2 chunks +5 lines, -6 lines 0 comments Download
M base/android/java/src/org/chromium/base/SystemMonitor.java View 1 2 4 chunks +35 lines, -9 lines 0 comments Download
M base/system_monitor/system_monitor_android.cc View 1 chunk +9 lines, -2 lines 0 comments Download
M build/android/findbugs_filter/findbugs_known_bugs.txt View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ProcessUtils.java View 2 chunks +2 lines, -10 lines 0 comments Download
M chrome/browser/android/process_utils.cc View 2 chunks +0 lines, -44 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/LocationProvider.java View 1 2 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
Philippe
I'm sending this to you Marcus for a sanity check. I will add other reviewers ...
8 years ago (2012-12-11 17:42:48 UTC) #1
Philippe
On 2012/12/11 17:42:48, Philippe wrote: > I'm sending this to you Marcus for a sanity ...
8 years ago (2012-12-11 18:05:37 UTC) #2
Philippe
On 2012/12/11 17:42:48, Philippe wrote: > I'm sending this to you Marcus for a sanity ...
8 years ago (2012-12-11 18:09:58 UTC) #3
Ryan Hamilton
net/http/http_network_layer.cc LGTM
8 years ago (2012-12-11 18:14:02 UTC) #4
bulach
lgtm for android, one nit below, thanks! you may want to add vandebo, he reviewed ...
8 years ago (2012-12-11 19:00:20 UTC) #5
Yaron
+digit - The ActivityStatus changes seem like they're going backwards. I think you caught digit ...
8 years ago (2012-12-11 19:25:23 UTC) #6
Philippe
On 2012/12/11 19:25:23, Yaron wrote: > +digit - The ActivityStatus changes seem like they're going ...
8 years ago (2012-12-12 09:46:13 UTC) #7
Philippe
On 2012/12/12 09:46:13, Philippe wrote: > On 2012/12/11 19:25:23, Yaron wrote: > > +digit - ...
8 years ago (2012-12-12 10:02:47 UTC) #8
Philippe
https://chromiumcodereview.appspot.com/11538008/diff/3001/base/android/java/src/org/chromium/base/SystemMonitor.java File base/android/java/src/org/chromium/base/SystemMonitor.java (right): https://chromiumcodereview.appspot.com/11538008/diff/3001/base/android/java/src/org/chromium/base/SystemMonitor.java#newcode26 base/android/java/src/org/chromium/base/SystemMonitor.java:26: private final Handler mHandler = new Handler(); On 2012/12/11 ...
8 years ago (2012-12-12 10:39:52 UTC) #9
Philippe
On 2012/12/12 10:39:52, Philippe wrote: > https://chromiumcodereview.appspot.com/11538008/diff/3001/base/android/java/src/org/chromium/base/SystemMonitor.java > File base/android/java/src/org/chromium/base/SystemMonitor.java (right): > > https://chromiumcodereview.appspot.com/11538008/diff/3001/base/android/java/src/org/chromium/base/SystemMonitor.java#newcode26 > ...
8 years ago (2012-12-12 16:36:41 UTC) #10
willchan no longer on Chromium
The change in system_monitor_android.cc lgtm. I am concerned about the change in net/. Your change ...
8 years ago (2012-12-12 17:30:06 UTC) #11
Philippe
On 2012/12/12 17:30:06, willchan wrote: > The change in system_monitor_android.cc lgtm. > > I am ...
8 years ago (2012-12-12 17:59:31 UTC) #12
Philippe
On 2012/12/12 17:59:31, Philippe wrote: > On 2012/12/12 17:30:06, willchan wrote: > > The change ...
8 years ago (2012-12-12 18:03:16 UTC) #13
Philippe
On 2012/12/12 18:03:16, Philippe wrote: > On 2012/12/12 17:59:31, Philippe wrote: > > On 2012/12/12 ...
8 years ago (2012-12-12 18:19:53 UTC) #14
willchan no longer on Chromium
Perfect, thanks. Please send the follow up changes to the power and network change notifications ...
8 years ago (2012-12-12 18:24:13 UTC) #15
sgurun-gerrit only
I guess you mean the idle socket changes I did almost a year ago. I ...
8 years ago (2012-12-12 19:01:58 UTC) #16
Philippe
On 2012/12/12 19:01:58, sgurun wrote: > I guess you mean the idle socket changes I ...
8 years ago (2012-12-12 20:25:08 UTC) #17
willchan no longer on Chromium
8 years ago (2012-12-12 20:34:12 UTC) #18
SGTM!


On Wed, Dec 12, 2012 at 12:25 PM, <pliard@chromium.org> wrote:

> On 2012/12/12 19:01:58, sgurun wrote:
>
>> I guess you mean the idle socket changes I did almost a year ago. I think
>>
> these
>
>> were to defer closing the idle sockets so that network interface would
>> not be
>> activated just for the purpose of sending a FIN which would waste a lot of
>>
> power
>
>> (somebody had stats I guess, I don't know who though).
>>
>
Ah yes, https://code.google.com/p/chromium/issues/detail?id=101820. This
means that even when we call Close() on the sockets, it won't actually
close the OS handle. And I believe this is a better approach than waking up
the radio to send a FIN, *unless* we believe the server(s) will send
data/FINs that will wake us up repeatedly later.


>
>  When tcp keepalive is off, I am not sure why or how much power would be
>> wasted
>> for keeping the idle sockets open. In fact explicitly closing them would
>> turn
>>
> on
>
>> the interface and waste more power, am I missing anything?
>>
>
Nope, you're not missing anything unless the server is sending TCP packets,
as I've mentioned above. I do not believe we need to make changes to
forcibly close these sockets rather than delaying FINs.


>
>
>  On 2012/12/12 18:24:13, willchan wrote:
>> > Perfect, thanks. Please send the follow up changes to the power and
>> network
>> > change notifications in net/ to szym@ & pauljensen@. I've pointed them
>> to
>>
> this
>
>> > thread so they can read the history and figure out the right path
>> forward.
>>
>
> You made a good point, thanks for bringing this up!
>
> I don't have much background with all this as I said before but I think
> that
> these subtleties make one more reason to stay away from an Android specific
> implementation and use instead the same mechanism as other platforms (that
> can
> be improved too).
>
> To be honest I'm more interested in fixing the crash right now caused by
> process_utils.cc (ReleaseBlock dev bug whose fix has to land before Friday
> EOD).
> This CL should guarantee that and should also align us at least partially
> with
> all platforms regarding the power events handled  by URLRequestJob.
>
> I will do a follow up change anyway that can be discussed without this
> deadline
> pressure.
>
> I will submit this CL in a few hours (during the morning in Paris where I'm
> working from).
>
>
https://chromiumcodereview.**appspot.com/11538008/<https://chromiumcodereview...
>

Powered by Google App Engine
This is Rietveld 408576698