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

Issue 2593793002: Remove call to WasHidden as part of the app being backgrounded. (Closed)

Created:
4 years ago by Bryan McQuade
Modified:
4 years ago
Reviewers:
RyanSturm
CC:
chromium-reviews, csharrison+watch_chromium.org, loading-reviews+metrics_chromium.org, tbansal+watch-data-reduction-proxy_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove call to WasHidden as part of the app being backgrounded. 2371883002 added support for informing page load metrics observers that the application had gone into the background. As part of this change, we called WasHidden() to guarantee that background state had been updated by the time FlushMetricsOnAppEnterBackground was invoked on the observers. After this change landed, we also saw a shift in the ratio of page loads that were in the foreground vs background (see crbug.com/675970 for details). Though it's unclear whether this change caused the shift, it seems sensible to remove the call to WasHidden for now just to be safe. More details: The FlushMetricsOnAppEnterBackground flow is triggered via Activity.onPause on Android. The docs for this method say "Called as part of the activity lifecycle when an activity is going into the background, but has not (yet) been killed." but later "After receiving this call you will usually receive a following call to onStop() (after the next activity has been resumed and displayed), however in some cases there will be a direct call back to onResume() without going through the stopped state.". This latter comment suggests that a call to onPause may not guarantee that the app is being backgrounded. Additional discussion on stack overflow also suggests that a call to onPause does not guarantee that an app is going to be backgrounded. Thus, it may be invalid for us to invoke WasHidden as part of this flow. DRP observer depended on WasHidden being invoked as part of the FlushMetricsOnAppEnterBackground flow, so we now add an implementation of FlushMetricsOnAppEnterBackground in that observer to address this change. BUG=675970 Committed: https://crrev.com/56e62f80d4980cc9970cc5a719f287c3ba4dcafb Cr-Commit-Position: refs/heads/master@{#440114}

Patch Set 1 #

Patch Set 2 : fix #

Patch Set 3 : add comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -4 lines) Patch
M chrome/browser/page_load_metrics/metrics_web_contents_observer.cc View 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc View 1 2 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (18 generated)
Bryan McQuade
PTAL, thanks!
4 years ago (2016-12-21 14:32:14 UTC) #13
RyanSturm
Thanks! Lgtm
4 years ago (2016-12-21 14:58:00 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2593793002/40001
4 years ago (2016-12-21 16:04:21 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years ago (2016-12-21 16:09:40 UTC) #21
commit-bot: I haz the power
4 years ago (2016-12-21 16:11:52 UTC) #23
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/56e62f80d4980cc9970cc5a719f287c3ba4dcafb
Cr-Commit-Position: refs/heads/master@{#440114}

Powered by Google App Engine
This is Rietveld 408576698