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

Unified Diff: webrtc/base/java/src/org/webrtc/ThreadUtils.java

Issue 2386253003: Android: Move layout measure code from SurfaceViewRenderer to RendererCommon (Closed)
Patch Set: Run SurfaceViewRendererOnMeasureTest on UI thread Created 4 years, 2 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 | « webrtc/api/androidtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/java/src/org/webrtc/ThreadUtils.java
diff --git a/webrtc/base/java/src/org/webrtc/ThreadUtils.java b/webrtc/base/java/src/org/webrtc/ThreadUtils.java
index 4337fd0349c1638cb6f4a31914a283b71171fbbc..efe1fbd884507758ad54e7c270c3d9b2faf731d8 100644
--- a/webrtc/base/java/src/org/webrtc/ThreadUtils.java
+++ b/webrtc/base/java/src/org/webrtc/ThreadUtils.java
@@ -11,6 +11,7 @@
package org.webrtc;
import android.os.Handler;
+import android.os.Looper;
import android.os.SystemClock;
import java.util.concurrent.Callable;
@@ -39,6 +40,15 @@ public class ThreadUtils {
}
/**
+ * Throws exception if called from other than main thread.
+ */
+ public static void checkIsOnMainThread() {
+ if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
+ throw new IllegalStateException("Not on main thread!");
+ }
+ }
+
+ /**
* Utility interface to be used with executeUninterruptibly() to wait for blocking operations
* to complete without getting interrupted..
*/
« no previous file with comments | « webrtc/api/androidtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698