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

Side by Side Diff: remoting/client/jni/chromoting_jni_runtime.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 | « remoting/client/jni/chromoting_jni_runtime.h ('k') | remoting/host/win/host_service.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 "remoting/client/jni/chromoting_jni_runtime.h" 5 #include "remoting/client/jni/chromoting_jni_runtime.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/library_loader/library_loader_hooks.h" 10 #include "base/android/library_loader/library_loader_hooks.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 const JavaParamRef<jstring>& data) { 178 const JavaParamRef<jstring>& data) {
179 remoting::ChromotingJniRuntime::GetInstance()->session()->SendClientMessage( 179 remoting::ChromotingJniRuntime::GetInstance()->session()->SendClientMessage(
180 ConvertJavaStringToUTF8(env, type), 180 ConvertJavaStringToUTF8(env, type),
181 ConvertJavaStringToUTF8(env, data)); 181 ConvertJavaStringToUTF8(env, data));
182 } 182 }
183 183
184 // ChromotingJniRuntime implementation. 184 // ChromotingJniRuntime implementation.
185 185
186 // static 186 // static
187 ChromotingJniRuntime* ChromotingJniRuntime::GetInstance() { 187 ChromotingJniRuntime* ChromotingJniRuntime::GetInstance() {
188 return Singleton<ChromotingJniRuntime>::get(); 188 return base::Singleton<ChromotingJniRuntime>::get();
189 } 189 }
190 190
191 ChromotingJniRuntime::ChromotingJniRuntime() { 191 ChromotingJniRuntime::ChromotingJniRuntime() {
192 // On Android, the UI thread is managed by Java, so we need to attach and 192 // On Android, the UI thread is managed by Java, so we need to attach and
193 // start a special type of message loop to allow Chromium code to run tasks. 193 // start a special type of message loop to allow Chromium code to run tasks.
194 ui_loop_.reset(new base::MessageLoopForUI()); 194 ui_loop_.reset(new base::MessageLoopForUI());
195 ui_loop_->Start(); 195 ui_loop_->Start();
196 196
197 // TODO(solb) Stop pretending to control the managed UI thread's lifetime. 197 // TODO(solb) Stop pretending to control the managed UI thread's lifetime.
198 ui_task_runner_ = new AutoThreadTaskRunner(ui_loop_->task_runner(), 198 ui_task_runner_ = new AutoThreadTaskRunner(ui_loop_->task_runner(),
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 JNIEnv* env = base::android::AttachCurrentThread(); 368 JNIEnv* env = base::android::AttachCurrentThread();
369 Java_JniInterface_redrawGraphicsInternal(env); 369 Java_JniInterface_redrawGraphicsInternal(env);
370 } 370 }
371 371
372 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) { 372 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) {
373 base::android::DetachFromVM(); 373 base::android::DetachFromVM();
374 waiter->Signal(); 374 waiter->Signal();
375 } 375 }
376 } // namespace remoting 376 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/jni/chromoting_jni_runtime.h ('k') | remoting/host/win/host_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698