Commit 0f0378c9 authored by Henrique Nakashima's avatar Henrique Nakashima Committed by Commit Bot

Revert "Fix crash when Background Memory metrics task is scheduled immediately."

This reverts commit 5f4571dc.

Reason for revert: Another metric, TaskStartedNative, is logged incorrectly.

Original change's description:
> Fix crash when Background Memory metrics task is scheduled immediately.
> 
> It is scheduled with a random delay between 0ms and 59999ms. When it is
> exactly 0, the delayed task is actually executed as a regular task,
> and since it is scheduled just before the task that starts native,
> it runs without native, causing a crash.
> 
> Moving recordMetrics() to after native is initialized fixes the issue.
> 
> Bug: 1017130
> Change-Id: Ica5d0a125b93433bd2291a6c73ac30d3fd890aa8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880172
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
> Reviewed-by: Mohamed Heikal <mheikal@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#709269}

TBR=hnakashima@chromium.org,mheikal@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1017130
Change-Id: Ie5bef0866b02530232aeb383adfaae5feaf6511a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1883044Reviewed-by: default avatarHenrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709906}
parent 3f4c7ae8
......@@ -136,12 +136,12 @@ public abstract class NativeBackgroundTask implements BackgroundTask {
boolean wasInServiceManagerOnlyMode = isNativeLoadedInServiceManagerOnlyMode();
mRunningInServiceManagerOnlyMode = supportsServiceManagerOnly();
recordMetrics();
final BrowserParts parts = new EmptyBrowserParts() {
@Override
public void finishNativeInitialization() {
PostTask.postTask(UiThreadTaskTraits.DEFAULT, startWithNativeRunnable);
recordMetrics();
}
@Override
public boolean startServiceManagerOnly() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment