Chromium Code Reviews
DescriptionRemove 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 #
Messages
Total messages: 23 (18 generated)
|
|||||||||||||||||||||||||||||||||||||