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

Side by Side Diff: base/android/java/src/org/chromium/base/ThreadUtils.java

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.base; 5 package org.chromium.base;
6 6
7 import android.os.Handler; 7 import android.os.Handler;
8 import android.os.Looper; 8 import android.os.Looper;
9 import android.os.Process; 9 import android.os.Process;
10 10
(...skipping 11 matching lines...) Expand all
22 private static boolean sWillOverride = false; 22 private static boolean sWillOverride = false;
23 23
24 private static Handler sUiThreadHandler = null; 24 private static Handler sUiThreadHandler = null;
25 25
26 public static void setWillOverrideUiThread() { 26 public static void setWillOverrideUiThread() {
27 synchronized (sLock) { 27 synchronized (sLock) {
28 sWillOverride = true; 28 sWillOverride = true;
29 } 29 }
30 } 30 }
31 31
32 @VisibleForTesting
32 public static void setUiThread(Looper looper) { 33 public static void setUiThread(Looper looper) {
33 synchronized (sLock) { 34 synchronized (sLock) {
34 if (sUiThreadHandler != null && sUiThreadHandler.getLooper() != loop er) { 35 if (sUiThreadHandler != null && sUiThreadHandler.getLooper() != loop er) {
35 throw new RuntimeException("UI thread looper is already set to " 36 throw new RuntimeException("UI thread looper is already set to "
36 + sUiThreadHandler.getLooper() + " (Main thread looper i s " 37 + sUiThreadHandler.getLooper() + " (Main thread looper i s "
37 + Looper.getMainLooper() + "), cannot set to new looper " + looper); 38 + Looper.getMainLooper() + "), cannot set to new looper " + looper);
38 } else { 39 } else {
39 sUiThreadHandler = new Handler(looper); 40 sUiThreadHandler = new Handler(looper);
40 } 41 }
41 } 42 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 201 }
201 202
202 /** 203 /**
203 * Set thread priority to audio. 204 * Set thread priority to audio.
204 */ 205 */
205 @CalledByNative 206 @CalledByNative
206 public static void setThreadPriorityAudio(int tid) { 207 public static void setThreadPriorityAudio(int tid) {
207 Process.setThreadPriority(tid, Process.THREAD_PRIORITY_AUDIO); 208 Process.setThreadPriority(tid, Process.THREAD_PRIORITY_AUDIO);
208 } 209 }
209 } 210 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698