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

Side by Side Diff: base/android/java_handler_thread.cc

Issue 1390513002: Remove base::MessageLoop::{Quit,QuitClosure} functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split into small CLs Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/message_loop/message_loop.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "base/android/java_handler_thread.h" 5 #include "base/android/java_handler_thread.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 void JavaHandlerThread::InitializeThread(JNIEnv* env, jobject obj, 58 void JavaHandlerThread::InitializeThread(JNIEnv* env, jobject obj,
59 jlong event) { 59 jlong event) {
60 // TYPE_JAVA to get the Android java style message loop. 60 // TYPE_JAVA to get the Android java style message loop.
61 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_JAVA)); 61 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_JAVA));
62 static_cast<MessageLoopForUI*>(message_loop_.get())->Start(); 62 static_cast<MessageLoopForUI*>(message_loop_.get())->Start();
63 reinterpret_cast<base::WaitableEvent*>(event)->Signal(); 63 reinterpret_cast<base::WaitableEvent*>(event)->Signal();
64 } 64 }
65 65
66 void JavaHandlerThread::StopThread(JNIEnv* env, jobject obj, jlong event) { 66 void JavaHandlerThread::StopThread(JNIEnv* env, jobject obj, jlong event) {
67 static_cast<MessageLoopForUI*>(message_loop_.get())->Quit(); 67 static_cast<MessageLoopForUI*>(message_loop_.get())->QuitWhenIdle();
68 reinterpret_cast<base::WaitableEvent*>(event)->Signal(); 68 reinterpret_cast<base::WaitableEvent*>(event)->Signal();
69 } 69 }
70 70
71 // static 71 // static
72 bool JavaHandlerThread::RegisterBindings(JNIEnv* env) { 72 bool JavaHandlerThread::RegisterBindings(JNIEnv* env) {
73 return RegisterNativesImpl(env); 73 return RegisterNativesImpl(env);
74 } 74 }
75 75
76 } // namespace android 76 } // namespace android
77 } // namespace base 77 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/message_loop/message_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698