Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 25 matching lines...) Expand all Loading... | |
| 36 bool RegisterChromotingJniRuntime(JNIEnv* env) { | 36 bool RegisterChromotingJniRuntime(JNIEnv* env) { |
| 37 return remoting::RegisterNativesImpl(env); | 37 return remoting::RegisterNativesImpl(env); |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Implementation of stubs defined in JniInterface_jni.h. These are the entry | 40 // Implementation of stubs defined in JniInterface_jni.h. These are the entry |
| 41 // points for JNI calls from Java into C++. | 41 // points for JNI calls from Java into C++. |
| 42 | 42 |
| 43 static void LoadNative(JNIEnv* env, const JavaParamRef<jclass>& clazz) { | 43 static void LoadNative(JNIEnv* env, const JavaParamRef<jclass>& clazz) { |
| 44 base::CommandLine::Init(0, nullptr); | 44 base::CommandLine::Init(0, nullptr); |
| 45 | 45 |
| 46 // TODO(sergeyu): Consider adding separate pools for different task classes. | 46 base::TaskScheduler::CreateAndSetSimpleTaskScheduler("RemotingJava"); |
|
nicholss
2017/03/17 17:20:54
I have removed this file in https://codereview.chr
fdoray
2017/03/20 16:58:41
Done.
| |
| 47 const int kMaxBackgroundThreads = 5; | |
| 48 base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxBackgroundThreads); | |
| 49 | 47 |
| 50 // Create the singleton now so that the Chromoting threads will be set up. | 48 // Create the singleton now so that the Chromoting threads will be set up. |
| 51 remoting::ChromotingJniRuntime::GetInstance(); | 49 remoting::ChromotingJniRuntime::GetInstance(); |
| 52 } | 50 } |
| 53 | 51 |
| 54 static void HandleAuthTokenOnNetworkThread(const std::string& token) { | 52 static void HandleAuthTokenOnNetworkThread(const std::string& token) { |
| 55 ChromotingJniRuntime* runtime = remoting::ChromotingJniRuntime::GetInstance(); | 53 ChromotingJniRuntime* runtime = remoting::ChromotingJniRuntime::GetInstance(); |
| 56 DCHECK(runtime->network_task_runner()->BelongsToCurrentThread()); | 54 DCHECK(runtime->network_task_runner()->BelongsToCurrentThread()); |
| 57 runtime->GetLogWriter()->SetAuthToken(token); | 55 runtime->GetLogWriter()->SetAuthToken(token); |
| 58 } | 56 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 DCHECK(network_task_runner()->BelongsToCurrentThread()); | 143 DCHECK(network_task_runner()->BelongsToCurrentThread()); |
| 146 log_writer_.reset(new TelemetryLogWriter( | 144 log_writer_.reset(new TelemetryLogWriter( |
| 147 kTelemetryBaseUrl, | 145 kTelemetryBaseUrl, |
| 148 base::MakeUnique<ChromiumUrlRequestFactory>(runtime_->url_requester()))); | 146 base::MakeUnique<ChromiumUrlRequestFactory>(runtime_->url_requester()))); |
| 149 log_writer_->SetAuthClosure( | 147 log_writer_->SetAuthClosure( |
| 150 base::Bind(&ChromotingJniRuntime::FetchAuthToken, | 148 base::Bind(&ChromotingJniRuntime::FetchAuthToken, |
| 151 base::Unretained(this))); | 149 base::Unretained(this))); |
| 152 } | 150 } |
| 153 | 151 |
| 154 } // namespace remoting | 152 } // namespace remoting |
| OLD | NEW |