Commit d4b3971d authored by Willie Koomson's avatar Willie Koomson Committed by Commit Bot

Run OnLaunchedOrRequestExpired on current thread

This change adjusts the call to
ArcAppLaunchThrottleObserver::OnLaunchedOrRequestExpired so that it always runs
in the current thread. This prevents crashes resulting from
SetArcCpuRestriction being called on different thread.

and build/flash/run. Ensure no crashes when a launch request expires.

Bug: 1017211
Test: Test launch request expiration by setting kAppLaunchTimeout to 0
Change-Id: I2430471aa5d69344a879a2c312764d810a03aa55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879332Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Commit-Queue: Willie Koomson <wvk@google.com>
Auto-Submit: Willie Koomson <wvk@google.com>
Cr-Commit-Position: refs/heads/master@{#709512}
parent aa191cb4
...@@ -46,7 +46,7 @@ void ArcAppLaunchThrottleObserver::OnAppLaunchRequested( ...@@ -46,7 +46,7 @@ void ArcAppLaunchThrottleObserver::OnAppLaunchRequested(
SetActive(true); SetActive(true);
current_requests_.insert(app_info.package_name); current_requests_.insert(app_info.package_name);
base::PostDelayedTask( base::PostDelayedTask(
FROM_HERE, FROM_HERE, {base::CurrentThread()},
base::BindOnce(&ArcAppLaunchThrottleObserver::OnLaunchedOrRequestExpired, base::BindOnce(&ArcAppLaunchThrottleObserver::OnLaunchedOrRequestExpired,
weak_ptr_factory_.GetWeakPtr(), app_info.package_name), weak_ptr_factory_.GetWeakPtr(), app_info.package_name),
kAppLaunchTimeout); kAppLaunchTimeout);
......
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