Commit 443da379 authored by Sam Maier's avatar Sam Maier Committed by Commit Bot

Android: chromoting OAuthToken AsyncTasks explicitly on SERIAL_EXECUTOR

Currently, AsyncTask.execute() defaults to the SERIAL_EXECUTOR. This
exector is good for preventing concurrency errors since it guarantees
serial execution, but bad for performance since the entire app shares
this single queue.

Looking at this code, I don't think we can escape the SERIAL_EXECUTOR
here, since there appears to be non-thread-safe things happening in the
AsyncTasks, and no guarantee they won't get scheduled at the same time.

Bug: 869907
Change-Id: I7c1e1a74e48c2d2e774d71e04d89a83c02562e5b
Reviewed-on: https://chromium-review.googlesource.com/1162662Reviewed-by: default avatarYuwei Huang <yuweih@chromium.org>
Commit-Queue: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580636}
parent c67dbeb6
...@@ -122,7 +122,7 @@ public class OAuthTokenConsumer { ...@@ -122,7 +122,7 @@ public class OAuthTokenConsumer {
return null; return null;
} }
} }
.execute(); .executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
} }
private void handleErrorOnMainThread(final OAuthTokenFetcher.Callback callback, private void handleErrorOnMainThread(final OAuthTokenFetcher.Callback callback,
......
...@@ -116,7 +116,7 @@ public class OAuthTokenFetcher { ...@@ -116,7 +116,7 @@ public class OAuthTokenFetcher {
return null; return null;
} }
} }
.execute(); .executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
} }
private void handleTokenReceived(final String token) { private void handleTokenReceived(final String token) {
......
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