| 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" |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 17 #include "jni/JniInterface_jni.h" | 17 #include "jni/JniInterface_jni.h" |
| 18 #include "remoting/base/chromium_url_request.h" | 18 #include "remoting/base/chromium_url_request.h" |
| 19 #include "remoting/base/url_request_context_getter.h" | 19 #include "remoting/base/url_request_context_getter.h" |
| 20 #include "remoting/client/jni/jni_touch_event_data.h" | 20 #include "remoting/client/jni/jni_touch_event_data.h" |
| 21 | 21 |
| 22 using base::android::ConvertJavaStringToUTF8; | 22 using base::android::ConvertJavaStringToUTF8; |
| 23 using base::android::ConvertUTF8ToJavaString; | 23 using base::android::ConvertUTF8ToJavaString; |
| 24 using base::android::ToJavaByteArray; | 24 using base::android::ToJavaByteArray; |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 const int kBytesPerPixel = 4; | |
| 29 | |
| 30 const char kTelemetryBaseUrl[] = "https://remoting-pa.googleapis.com/v1/events"; | 28 const char kTelemetryBaseUrl[] = "https://remoting-pa.googleapis.com/v1/events"; |
| 31 | 29 |
| 32 } // namespace | 30 } // namespace |
| 33 | 31 |
| 34 namespace remoting { | 32 namespace remoting { |
| 35 | 33 |
| 36 bool RegisterChromotingJniRuntime(JNIEnv* env) { | 34 bool RegisterChromotingJniRuntime(JNIEnv* env) { |
| 37 return remoting::RegisterNativesImpl(env); | 35 return remoting::RegisterNativesImpl(env); |
| 38 } | 36 } |
| 39 | 37 |
| 40 // Implementation of stubs defined in JniInterface_jni.h. These are the entry | 38 // Implementation of stubs defined in JniInterface_jni.h. These are the entry |
| 41 // points for JNI calls from Java into C++. | 39 // points for JNI calls from Java into C++. |
| 42 | 40 |
| 43 static void LoadNative(JNIEnv* env, const JavaParamRef<jclass>& clazz) { | 41 static void LoadNative(JNIEnv* env, const JavaParamRef<jclass>& clazz) { |
| 44 base::CommandLine::Init(0, nullptr); | 42 base::CommandLine::Init(0, nullptr); |
| 45 | 43 |
| 46 // Create the singleton now so that the Chromoting threads will be set up. | 44 // Create the singleton now so that the Chromoting threads will be set up. |
| 47 remoting::ChromotingJniRuntime::GetInstance(); | 45 remoting::ChromotingJniRuntime::GetInstance(); |
| 48 } | 46 } |
| 49 | 47 |
| 50 static void Connect(JNIEnv* env, | |
| 51 const JavaParamRef<jclass>& clazz, | |
| 52 const JavaParamRef<jstring>& username, | |
| 53 const JavaParamRef<jstring>& authToken, | |
| 54 const JavaParamRef<jstring>& hostJid, | |
| 55 const JavaParamRef<jstring>& hostId, | |
| 56 const JavaParamRef<jstring>& hostPubkey, | |
| 57 const JavaParamRef<jstring>& pairId, | |
| 58 const JavaParamRef<jstring>& pairSecret, | |
| 59 const JavaParamRef<jstring>& capabilities, | |
| 60 const JavaParamRef<jstring>& flags) { | |
| 61 remoting::ChromotingJniRuntime::GetInstance()->ConnectToHost( | |
| 62 ConvertJavaStringToUTF8(env, username), | |
| 63 ConvertJavaStringToUTF8(env, authToken), | |
| 64 ConvertJavaStringToUTF8(env, hostJid), | |
| 65 ConvertJavaStringToUTF8(env, hostId), | |
| 66 ConvertJavaStringToUTF8(env, hostPubkey), | |
| 67 ConvertJavaStringToUTF8(env, pairId), | |
| 68 ConvertJavaStringToUTF8(env, pairSecret), | |
| 69 ConvertJavaStringToUTF8(env, capabilities), | |
| 70 ConvertJavaStringToUTF8(env, flags)); | |
| 71 } | |
| 72 | |
| 73 static void Disconnect(JNIEnv* env, const JavaParamRef<jclass>& clazz) { | |
| 74 remoting::ChromotingJniRuntime::GetInstance()->DisconnectFromHost(); | |
| 75 } | |
| 76 | |
| 77 static void AuthenticationResponse(JNIEnv* env, | |
| 78 const JavaParamRef<jclass>& clazz, | |
| 79 const JavaParamRef<jstring>& pin, | |
| 80 jboolean createPair, | |
| 81 const JavaParamRef<jstring>& deviceName) { | |
| 82 remoting::ChromotingJniRuntime::GetInstance()->session()->ProvideSecret( | |
| 83 ConvertJavaStringToUTF8(env, pin).c_str(), createPair, | |
| 84 ConvertJavaStringToUTF8(env, deviceName)); | |
| 85 } | |
| 86 | |
| 87 static void ScheduleRedraw(JNIEnv* env, const JavaParamRef<jclass>& clazz) { | |
| 88 remoting::ChromotingJniRuntime::GetInstance()->session()->RedrawDesktop(); | |
| 89 } | |
| 90 | |
| 91 static void SendMouseEvent(JNIEnv* env, | |
| 92 const JavaParamRef<jclass>& clazz, | |
| 93 jint x, | |
| 94 jint y, | |
| 95 jint whichButton, | |
| 96 jboolean buttonDown) { | |
| 97 // Button must be within the bounds of the MouseEvent_MouseButton enum. | |
| 98 DCHECK(whichButton >= 0 && whichButton < 5); | |
| 99 | |
| 100 remoting::ChromotingJniRuntime::GetInstance()->session()->SendMouseEvent( | |
| 101 x, y, | |
| 102 static_cast<remoting::protocol::MouseEvent_MouseButton>(whichButton), | |
| 103 buttonDown); | |
| 104 } | |
| 105 | |
| 106 static void SendMouseWheelEvent(JNIEnv* env, | |
| 107 const JavaParamRef<jclass>& clazz, | |
| 108 jint delta_x, | |
| 109 jint delta_y) { | |
| 110 remoting::ChromotingJniRuntime::GetInstance()->session()->SendMouseWheelEvent( | |
| 111 delta_x, delta_y); | |
| 112 } | |
| 113 | |
| 114 static jboolean SendKeyEvent(JNIEnv* env, | |
| 115 const JavaParamRef<jclass>& clazz, | |
| 116 jint scanCode, | |
| 117 jint keyCode, | |
| 118 jboolean keyDown) { | |
| 119 return remoting::ChromotingJniRuntime::GetInstance()->session()->SendKeyEvent( | |
| 120 scanCode, keyCode, keyDown); | |
| 121 } | |
| 122 | |
| 123 static void SendTextEvent(JNIEnv* env, | |
| 124 const JavaParamRef<jclass>& clazz, | |
| 125 const JavaParamRef<jstring>& text) { | |
| 126 remoting::ChromotingJniRuntime::GetInstance()->session()->SendTextEvent( | |
| 127 ConvertJavaStringToUTF8(env, text)); | |
| 128 } | |
| 129 | |
| 130 static void SendTouchEvent( | |
| 131 JNIEnv* env, | |
| 132 const JavaParamRef<jclass>& clazz, | |
| 133 jint eventType, | |
| 134 const JavaParamRef<jobjectArray>& touchEventObjectArray) { | |
| 135 protocol::TouchEvent touch_event; | |
| 136 touch_event.set_event_type( | |
| 137 static_cast<protocol::TouchEvent::TouchEventType>(eventType)); | |
| 138 | |
| 139 // Iterate over the elements in the object array and transfer the data from | |
| 140 // the java object to a native event object. | |
| 141 jsize length = env->GetArrayLength(touchEventObjectArray); | |
| 142 DCHECK_GE(length, 0); | |
| 143 for (jsize i = 0; i < length; ++i) { | |
| 144 protocol::TouchEventPoint* touch_point = touch_event.add_touch_points(); | |
| 145 | |
| 146 ScopedJavaLocalRef<jobject> java_touch_event( | |
| 147 env, env->GetObjectArrayElement(touchEventObjectArray, i)); | |
| 148 | |
| 149 JniTouchEventData::CopyTouchPointData(env, java_touch_event, touch_point); | |
| 150 } | |
| 151 | |
| 152 remoting::ChromotingJniRuntime::GetInstance()->session()->SendTouchEvent( | |
| 153 touch_event); | |
| 154 } | |
| 155 | |
| 156 static void EnableVideoChannel(JNIEnv* env, | |
| 157 const JavaParamRef<jclass>& clazz, | |
| 158 jboolean enable) { | |
| 159 remoting::ChromotingJniRuntime::GetInstance()->session()->EnableVideoChannel( | |
| 160 enable); | |
| 161 } | |
| 162 | |
| 163 static void OnThirdPartyTokenFetched( | |
| 164 JNIEnv* env, | |
| 165 const JavaParamRef<jclass>& clazz, | |
| 166 const JavaParamRef<jstring>& token, | |
| 167 const JavaParamRef<jstring>& shared_secret) { | |
| 168 ChromotingJniRuntime* runtime = remoting::ChromotingJniRuntime::GetInstance(); | |
| 169 runtime->network_task_runner()->PostTask(FROM_HERE, base::Bind( | |
| 170 &ChromotingJniInstance::HandleOnThirdPartyTokenFetched, | |
| 171 runtime->session(), | |
| 172 ConvertJavaStringToUTF8(env, token), | |
| 173 ConvertJavaStringToUTF8(env, shared_secret))); | |
| 174 } | |
| 175 | |
| 176 static void SendExtensionMessage(JNIEnv* env, | |
| 177 const JavaParamRef<jclass>& clazz, | |
| 178 const JavaParamRef<jstring>& type, | |
| 179 const JavaParamRef<jstring>& data) { | |
| 180 remoting::ChromotingJniRuntime::GetInstance()->session()->SendClientMessage( | |
| 181 ConvertJavaStringToUTF8(env, type), | |
| 182 ConvertJavaStringToUTF8(env, data)); | |
| 183 } | |
| 184 | |
| 185 static void HandleAuthTokenOnNetworkThread(const std::string& token) { | 48 static void HandleAuthTokenOnNetworkThread(const std::string& token) { |
| 186 ChromotingJniRuntime* runtime = remoting::ChromotingJniRuntime::GetInstance(); | 49 ChromotingJniRuntime* runtime = remoting::ChromotingJniRuntime::GetInstance(); |
| 187 DCHECK(runtime->network_task_runner()->BelongsToCurrentThread()); | 50 DCHECK(runtime->network_task_runner()->BelongsToCurrentThread()); |
| 188 runtime->logger()->SetAuthToken(token); | 51 runtime->logger()->SetAuthToken(token); |
| 189 } | 52 } |
| 190 | 53 |
| 191 static void OnAuthTokenFetched(JNIEnv* env, | 54 static void OnAuthTokenFetched(JNIEnv* env, |
| 192 const JavaParamRef<jclass>& clazz, | 55 const JavaParamRef<jclass>& clazz, |
| 193 const JavaParamRef<jstring>& token) { | 56 const JavaParamRef<jstring>& token) { |
| 194 ChromotingJniRuntime* runtime = remoting::ChromotingJniRuntime::GetInstance(); | 57 ChromotingJniRuntime* runtime = remoting::ChromotingJniRuntime::GetInstance(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 224 runtime_ = ChromotingClientRuntime::Create(ui_loop_.get()); | 87 runtime_ = ChromotingClientRuntime::Create(ui_loop_.get()); |
| 225 network_task_runner()->PostTask( | 88 network_task_runner()->PostTask( |
| 226 FROM_HERE, base::Bind(&ChromotingJniRuntime::StartLoggerOnNetworkThread, | 89 FROM_HERE, base::Bind(&ChromotingJniRuntime::StartLoggerOnNetworkThread, |
| 227 base::Unretained(this))); | 90 base::Unretained(this))); |
| 228 } | 91 } |
| 229 | 92 |
| 230 ChromotingJniRuntime::~ChromotingJniRuntime() { | 93 ChromotingJniRuntime::~ChromotingJniRuntime() { |
| 231 // The singleton should only ever be destroyed on the main thread. | 94 // The singleton should only ever be destroyed on the main thread. |
| 232 DCHECK(ui_task_runner()->BelongsToCurrentThread()); | 95 DCHECK(ui_task_runner()->BelongsToCurrentThread()); |
| 233 | 96 |
| 234 // The session must be shut down first, since it depends on our other | |
| 235 // components' still being alive. | |
| 236 DisconnectFromHost(); | |
| 237 | |
| 238 base::WaitableEvent done_event(false, false); | 97 base::WaitableEvent done_event(false, false); |
| 239 network_task_runner()->PostTask( | 98 network_task_runner()->PostTask( |
| 240 FROM_HERE, base::Bind(&ChromotingJniRuntime::DetachFromVmAndSignal, | 99 FROM_HERE, base::Bind(&ChromotingJniRuntime::DetachFromVmAndSignal, |
| 241 base::Unretained(this), &done_event)); | 100 base::Unretained(this), &done_event)); |
| 242 done_event.Wait(); | 101 done_event.Wait(); |
| 243 display_task_runner()->PostTask( | 102 display_task_runner()->PostTask( |
| 244 FROM_HERE, base::Bind(&ChromotingJniRuntime::DetachFromVmAndSignal, | 103 FROM_HERE, base::Bind(&ChromotingJniRuntime::DetachFromVmAndSignal, |
| 245 base::Unretained(this), &done_event)); | 104 base::Unretained(this), &done_event)); |
| 246 done_event.Wait(); | 105 done_event.Wait(); |
| 247 base::android::LibraryLoaderExitHook(); | 106 base::android::LibraryLoaderExitHook(); |
| 248 base::android::DetachFromVM(); | 107 base::android::DetachFromVM(); |
| 249 } | 108 } |
| 250 | 109 |
| 251 void ChromotingJniRuntime::ConnectToHost(const std::string& username, | |
| 252 const std::string& auth_token, | |
| 253 const std::string& host_jid, | |
| 254 const std::string& host_id, | |
| 255 const std::string& host_pubkey, | |
| 256 const std::string& pairing_id, | |
| 257 const std::string& pairing_secret, | |
| 258 const std::string& capabilities, | |
| 259 const std::string& flags) { | |
| 260 DCHECK(ui_task_runner()->BelongsToCurrentThread()); | |
| 261 DCHECK(!session_.get()); | |
| 262 session_ = new ChromotingJniInstance(this, username, auth_token, host_jid, | |
| 263 host_id, host_pubkey, pairing_id, | |
| 264 pairing_secret, capabilities, flags); | |
| 265 } | |
| 266 | |
| 267 void ChromotingJniRuntime::DisconnectFromHost() { | |
| 268 DCHECK(ui_task_runner()->BelongsToCurrentThread()); | |
| 269 if (session_.get()) { | |
| 270 session_->Disconnect(); | |
| 271 session_ = nullptr; | |
| 272 } | |
| 273 } | |
| 274 | |
| 275 void ChromotingJniRuntime::OnConnectionState( | |
| 276 protocol::ConnectionToHost::State state, | |
| 277 protocol::ErrorCode error) { | |
| 278 DCHECK(ui_task_runner()->BelongsToCurrentThread()); | |
| 279 | |
| 280 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 281 Java_JniInterface_onConnectionState(env, state, error); | |
| 282 } | |
| 283 | |
| 284 void ChromotingJniRuntime::DisplayAuthenticationPrompt(bool pairing_supported) { | |
| 285 DCHECK(ui_task_runner()->BelongsToCurrentThread()); | |
| 286 | |
| 287 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 288 Java_JniInterface_displayAuthenticationPrompt(env, pairing_supported); | |
| 289 } | |
| 290 | |
| 291 void ChromotingJniRuntime::CommitPairingCredentials(const std::string& host, | |
| 292 const std::string& id, | |
| 293 const std::string& secret) { | |
| 294 DCHECK(ui_task_runner()->BelongsToCurrentThread()); | |
| 295 | |
| 296 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 297 ScopedJavaLocalRef<jstring> j_host = ConvertUTF8ToJavaString(env, host); | |
| 298 ScopedJavaLocalRef<jstring> j_id = ConvertUTF8ToJavaString(env, id); | |
| 299 ScopedJavaLocalRef<jstring> j_secret = ConvertUTF8ToJavaString(env,secret); | |
| 300 | |
| 301 Java_JniInterface_commitPairingCredentials( | |
| 302 env, j_host.obj(), j_id.obj(), j_secret.obj()); | |
| 303 } | |
| 304 | |
| 305 void ChromotingJniRuntime::FetchAuthToken() { | 110 void ChromotingJniRuntime::FetchAuthToken() { |
| 306 if (!ui_task_runner()->BelongsToCurrentThread()) { | 111 if (!ui_task_runner()->BelongsToCurrentThread()) { |
| 307 ui_task_runner()->PostTask( | 112 ui_task_runner()->PostTask( |
| 308 FROM_HERE, base::Bind(&ChromotingJniRuntime::FetchAuthToken, | 113 FROM_HERE, base::Bind(&ChromotingJniRuntime::FetchAuthToken, |
| 309 base::Unretained(this))); | 114 base::Unretained(this))); |
| 310 return; | 115 return; |
| 311 } | 116 } |
| 312 JNIEnv* env = base::android::AttachCurrentThread(); | 117 JNIEnv* env = base::android::AttachCurrentThread(); |
| 313 | 118 |
| 314 Java_JniInterface_fetchAuthToken(env); | 119 Java_JniInterface_fetchAuthToken(env); |
| 315 } | 120 } |
| 316 | 121 |
| 317 void ChromotingJniRuntime::FetchThirdPartyToken(const std::string& token_url, | |
| 318 const std::string& client_id, | |
| 319 const std::string& scope) { | |
| 320 DCHECK(ui_task_runner()->BelongsToCurrentThread()); | |
| 321 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 322 | |
| 323 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, token_url); | |
| 324 ScopedJavaLocalRef<jstring> j_client_id = | |
| 325 ConvertUTF8ToJavaString(env, client_id); | |
| 326 ScopedJavaLocalRef<jstring> j_scope = ConvertUTF8ToJavaString(env, scope); | |
| 327 | |
| 328 Java_JniInterface_fetchThirdPartyToken( | |
| 329 env, j_url.obj(), j_client_id.obj(), j_scope.obj()); | |
| 330 } | |
| 331 | |
| 332 void ChromotingJniRuntime::SetCapabilities(const std::string& capabilities) { | |
| 333 DCHECK(ui_task_runner()->BelongsToCurrentThread()); | |
| 334 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 335 | |
| 336 ScopedJavaLocalRef<jstring> j_cap = | |
| 337 ConvertUTF8ToJavaString(env, capabilities); | |
| 338 | |
| 339 Java_JniInterface_setCapabilities(env, j_cap.obj()); | |
| 340 } | |
| 341 | |
| 342 void ChromotingJniRuntime::HandleExtensionMessage(const std::string& type, | |
| 343 const std::string& message) { | |
| 344 DCHECK(ui_task_runner()->BelongsToCurrentThread()); | |
| 345 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 346 | |
| 347 ScopedJavaLocalRef<jstring> j_type = ConvertUTF8ToJavaString(env, type); | |
| 348 ScopedJavaLocalRef<jstring> j_message = ConvertUTF8ToJavaString(env, message); | |
| 349 | |
| 350 Java_JniInterface_handleExtensionMessage(env, j_type.obj(), j_message.obj()); | |
| 351 } | |
| 352 | |
| 353 base::android::ScopedJavaLocalRef<jobject> ChromotingJniRuntime::NewBitmap( | |
| 354 int width, int height) { | |
| 355 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 356 return Java_JniInterface_newBitmap(env, width, height); | |
| 357 } | |
| 358 | |
| 359 void ChromotingJniRuntime::UpdateFrameBitmap(jobject bitmap) { | |
| 360 DCHECK(display_task_runner()->BelongsToCurrentThread()); | |
| 361 | |
| 362 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 363 Java_JniInterface_setVideoFrame(env, bitmap); | |
| 364 } | |
| 365 | |
| 366 void ChromotingJniRuntime::UpdateCursorShape( | |
| 367 const protocol::CursorShapeInfo& cursor_shape) { | |
| 368 DCHECK(display_task_runner()->BelongsToCurrentThread()); | |
| 369 | |
| 370 // const_cast<> is safe as long as the Java updateCursorShape() method copies | |
| 371 // the data out of the buffer without mutating it, and doesn't keep any | |
| 372 // reference to the buffer afterwards. Unfortunately, there seems to be no way | |
| 373 // to create a read-only ByteBuffer from a pointer-to-const. | |
| 374 char* data = string_as_array(const_cast<std::string*>(&cursor_shape.data())); | |
| 375 int cursor_total_bytes = | |
| 376 cursor_shape.width() * cursor_shape.height() * kBytesPerPixel; | |
| 377 | |
| 378 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 379 base::android::ScopedJavaLocalRef<jobject> buffer(env, | |
| 380 env->NewDirectByteBuffer(data, cursor_total_bytes)); | |
| 381 Java_JniInterface_updateCursorShape(env, | |
| 382 cursor_shape.width(), | |
| 383 cursor_shape.height(), | |
| 384 cursor_shape.hotspot_x(), | |
| 385 cursor_shape.hotspot_y(), | |
| 386 buffer.obj()); | |
| 387 } | |
| 388 | |
| 389 void ChromotingJniRuntime::RedrawCanvas() { | |
| 390 DCHECK(display_task_runner()->BelongsToCurrentThread()); | |
| 391 | |
| 392 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 393 Java_JniInterface_redrawGraphicsInternal(env); | |
| 394 } | |
| 395 | |
| 396 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) { | 122 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) { |
| 397 base::android::DetachFromVM(); | 123 base::android::DetachFromVM(); |
| 398 waiter->Signal(); | 124 waiter->Signal(); |
| 399 } | 125 } |
| 400 | 126 |
| 401 void ChromotingJniRuntime::StartLoggerOnNetworkThread() { | 127 void ChromotingJniRuntime::StartLoggerOnNetworkThread() { |
| 402 DCHECK(network_task_runner()->BelongsToCurrentThread()); | 128 DCHECK(network_task_runner()->BelongsToCurrentThread()); |
| 403 logger_.reset(new ClientTelemetryLogger(ChromotingEvent::Mode::ME2ME)); | 129 logger_.reset(new ClientTelemetryLogger(ChromotingEvent::Mode::ME2ME)); |
| 404 logger_->Start( | 130 logger_->Start( |
| 405 base::WrapUnique( | 131 base::WrapUnique( |
| 406 new ChromiumUrlRequestFactory(runtime_->url_requester())), | 132 new ChromiumUrlRequestFactory(runtime_->url_requester())), |
| 407 kTelemetryBaseUrl); | 133 kTelemetryBaseUrl); |
| 408 logger_->SetAuthClosure( | 134 logger_->SetAuthClosure( |
| 409 base::Bind(&ChromotingJniRuntime::FetchAuthToken, | 135 base::Bind(&ChromotingJniRuntime::FetchAuthToken, |
| 410 base::Unretained(this))); | 136 base::Unretained(this))); |
| 411 } | 137 } |
| 412 | 138 |
| 413 } // namespace remoting | 139 } // namespace remoting |
| OLD | NEW |