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

Unified Diff: base/android/java/src/org/chromium/base/ThreadUtils.java

Issue 2177473004: Switch to a java exception in assertOnUiThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/ThreadUtils.java
diff --git a/base/android/java/src/org/chromium/base/ThreadUtils.java b/base/android/java/src/org/chromium/base/ThreadUtils.java
index ef2887acd0c97e5c8ca97beb489c1dbe50302d98..5fc1d21324abc6155488a31736d1739faf5e17b8 100644
--- a/base/android/java/src/org/chromium/base/ThreadUtils.java
+++ b/base/android/java/src/org/chromium/base/ThreadUtils.java
@@ -189,7 +189,9 @@ public class ThreadUtils {
* Asserts that the current thread is running on the main thread.
*/
public static void assertOnUiThread() {
- assert runningOnUiThread();
+ if (BuildConfig.IS_DEBUG && !runningOnUiThread()) {
+ throw new IllegalStateException("Must be called on the Ui thread.");
+ }
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698