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

Issue 2523873003: [Android] Fix timing issue in enabling/disabling printing. (Closed)

Created:
4 years, 1 month ago by Ted C
Modified:
4 years ago
Reviewers:
nyquist
CC:
chromium-reviews, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android] Fix timing issue in enabling/disabling printing. There are a couple timing issues in the previous implementation of the code that enables/disables the print activity that is accessible via share. 1.) Multiple calls to enablePrintShareOption could result in the second call having the callback run immediately without the component first being enabled (since it would have been triggered in an AsyncTask in the first call). 2.) Back to back enable/disable calls could result in unpredictable execution ordering as they run their tasks on the thread pool instead of in serial. Because the initial UI is only shown after the first callback is run, this would require a show, followed by a hide, followed by a show where the task enqueued by the hide is run after the enabling call in the second show. To work around this (and due to the expected usage pattern of this class), just wait for the task to be run in either of these states to avoid this being possible. It would also be possible to use the SERIAL executor, but that might end up slowing down the default share flow where we don't expect this interleaving issue. BUG=649453, 664486 Committed: https://crrev.com/bce6119f7e2937314f787b8d430ce71142714496 Cr-Commit-Position: refs/heads/master@{#434676}

Patch Set 1 #

Patch Set 2 : Moar fixes #

Total comments: 2

Patch Set 3 : comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -2 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java View 1 2 6 chunks +43 lines, -2 lines 0 comments Download

Messages

Total messages: 22 (12 generated)
Ted C
PTAL
4 years ago (2016-11-23 18:01:18 UTC) #3
nyquist
lgtm https://codereview.chromium.org/2523873003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java File chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java (right): https://codereview.chromium.org/2523873003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java#newcode127 chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java:127: private static void waitForPendingStateChangeTask() { Could you copy-paste ...
4 years ago (2016-11-23 21:22:07 UTC) #5
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/2523873003/40001
4 years ago (2016-11-23 21:34:53 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
4 years ago (2016-11-23 23:37:07 UTC) #10
Ted C
https://codereview.chromium.org/2523873003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java File chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java (right): https://codereview.chromium.org/2523873003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java#newcode127 chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java:127: private static void waitForPendingStateChangeTask() { On 2016/11/23 21:22:07, nyquist ...
4 years ago (2016-11-24 00:01:02 UTC) #11
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/2523873003/40001
4 years ago (2016-11-24 00:02:45 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
4 years ago (2016-11-24 02:05:08 UTC) #15
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/2523873003/40001
4 years ago (2016-11-28 16:54:53 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years ago (2016-11-28 17:30:41 UTC) #20
commit-bot: I haz the power
4 years ago (2016-11-28 17:33:03 UTC) #22
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/bce6119f7e2937314f787b8d430ce71142714496
Cr-Commit-Position: refs/heads/master@{#434676}

Powered by Google App Engine
This is Rietveld 408576698