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

Issue 2810373002: InstalledAppProviderImpl: Assert that code is run off the UI thread. (Closed)

Created:
3 years, 8 months ago by Matt Giuca
Modified:
3 years, 7 months ago
Reviewers:
Ted C, agrieve
CC:
chromium-reviews, jam, darin-cc_chromium.org, agrieve+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

InstalledAppProviderImpl: Assert that code is run off the UI thread. Adds methods to ThreadUtils to support this: a new assertOnBackgroundThread to complement assertOnUiThread, as well as a way to disable these checks for testing (since the tests are single-threaded). BUG=710745 Review-Url: https://codereview.chromium.org/2810373002 Cr-Commit-Position: refs/heads/master@{#470786} Committed: https://chromium.googlesource.com/chromium/src/+/25a9390dce3a08a787c852a3d381322767dace3c

Patch Set 1 #

Patch Set 2 : Rebase. #

Patch Set 3 : Added ThreadUtils methods for assertions. Use that instead of Mockito UI thread shenanigans. #

Patch Set 4 : Use real assert instead of exception (apparently this works now). #

Total comments: 6

Patch Set 5 : Switch setThreadAssertsEnabled to Disabled (for default initialization). #

Patch Set 6 : Renamed to 'ForTesting' and removed @VisibleForTesting. #

Patch Set 7 : Rebase. #

Patch Set 8 : Fix spelling of UI. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -8 lines) Patch
M base/android/java/src/org/chromium/base/ThreadUtils.java View 1 2 3 4 5 6 7 2 chunks +33 lines, -5 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/installedapp/InstalledAppProviderImpl.java View 1 2 3 chunks +4 lines, -2 lines 0 comments Download
M content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java View 1 2 3 4 5 3 chunks +10 lines, -1 line 0 comments Download

Messages

Total messages: 30 (17 generated)
Matt Giuca
Follow-up to discussion on previous CL: https://codereview.chromium.org/2813153002/#msg14 I've cargo-culted the implementation from VariationsSeedFetcherTest.java that you ...
3 years, 8 months ago (2017-04-13 03:08:09 UTC) #2
Ted C
On 2017/04/13 03:08:09, Matt Giuca wrote: > Follow-up to discussion on previous CL: > https://codereview.chromium.org/2813153002/#msg14 ...
3 years, 8 months ago (2017-04-13 16:26:17 UTC) #7
Matt Giuca
agrieve@chromium.org: Please review changes in ThreadUtils.java. Note: Ted told me (in #7) that you've made ...
3 years, 7 months ago (2017-05-05 04:44:59 UTC) #10
Ted C
lgtm https://codereview.chromium.org/2810373002/diff/60001/base/android/java/src/org/chromium/base/ThreadUtils.java File base/android/java/src/org/chromium/base/ThreadUtils.java (right): https://codereview.chromium.org/2810373002/diff/60001/base/android/java/src/org/chromium/base/ThreadUtils.java#newcode229 base/android/java/src/org/chromium/base/ThreadUtils.java:229: public static void setThreadAssertsEnabled(boolean enabled) { I would ...
3 years, 7 months ago (2017-05-05 14:09:39 UTC) #11
agrieve
lgtm /w nits. Asserts work fine now across all API levels, but they are still ...
3 years, 7 months ago (2017-05-05 15:00:49 UTC) #12
Matt Giuca
https://codereview.chromium.org/2810373002/diff/60001/base/android/java/src/org/chromium/base/ThreadUtils.java File base/android/java/src/org/chromium/base/ThreadUtils.java (right): https://codereview.chromium.org/2810373002/diff/60001/base/android/java/src/org/chromium/base/ThreadUtils.java#newcode28 base/android/java/src/org/chromium/base/ThreadUtils.java:28: private static boolean sThreadAssertsEnabled = true; On 2017/05/05 15:00:48, ...
3 years, 7 months ago (2017-05-08 01:18:10 UTC) #13
agrieve
https://codereview.chromium.org/2810373002/diff/60001/base/android/java/src/org/chromium/base/ThreadUtils.java File base/android/java/src/org/chromium/base/ThreadUtils.java (right): https://codereview.chromium.org/2810373002/diff/60001/base/android/java/src/org/chromium/base/ThreadUtils.java#newcode229 base/android/java/src/org/chromium/base/ThreadUtils.java:229: public static void setThreadAssertsEnabled(boolean enabled) { On 2017/05/08 01:18:10, ...
3 years, 7 months ago (2017-05-08 14:18:15 UTC) #18
Matt Giuca
On 2017/05/08 14:18:15, agrieve wrote: > Consistency is certainly not our strong suite. To me, ...
3 years, 7 months ago (2017-05-09 00:26:29 UTC) #19
agrieve
On 2017/05/09 00:26:29, Matt Giuca wrote: > On 2017/05/08 14:18:15, agrieve wrote: > > Consistency ...
3 years, 7 months ago (2017-05-09 01:45:52 UTC) #20
Matt Giuca
On 2017/05/09 01:45:52, agrieve wrote: > On 2017/05/09 00:26:29, Matt Giuca wrote: > > On ...
3 years, 7 months ago (2017-05-11 01:19:10 UTC) #23
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/2810373002/140001
3 years, 7 months ago (2017-05-11 01:21:05 UTC) #26
agrieve
On 2017/05/11 01:21:05, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
3 years, 7 months ago (2017-05-11 01:22:52 UTC) #27
commit-bot: I haz the power
3 years, 7 months ago (2017-05-11 02:59:41 UTC) #30
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/25a9390dce3a08a787c852a3d381...

Powered by Google App Engine
This is Rietveld 408576698