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

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

Issue 2023113002: Fix bug of posting task inside constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_instance.cc ('k') | no next file » | 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 const std::string& host_pubkey, 255 const std::string& host_pubkey,
256 const std::string& pairing_id, 256 const std::string& pairing_id,
257 const std::string& pairing_secret, 257 const std::string& pairing_secret,
258 const std::string& capabilities, 258 const std::string& capabilities,
259 const std::string& flags) { 259 const std::string& flags) {
260 DCHECK(ui_task_runner()->BelongsToCurrentThread()); 260 DCHECK(ui_task_runner()->BelongsToCurrentThread());
261 DCHECK(!session_.get()); 261 DCHECK(!session_.get());
262 session_ = new ChromotingJniInstance(this, username, auth_token, host_jid, 262 session_ = new ChromotingJniInstance(this, username, auth_token, host_jid,
263 host_id, host_pubkey, pairing_id, 263 host_id, host_pubkey, pairing_id,
264 pairing_secret, capabilities, flags); 264 pairing_secret, capabilities, flags);
265 session_->Connect();
265 } 266 }
266 267
267 void ChromotingJniRuntime::DisconnectFromHost() { 268 void ChromotingJniRuntime::DisconnectFromHost() {
268 DCHECK(ui_task_runner()->BelongsToCurrentThread()); 269 DCHECK(ui_task_runner()->BelongsToCurrentThread());
269 if (session_.get()) { 270 if (session_.get()) {
270 session_->Disconnect(); 271 session_->Disconnect();
271 session_ = nullptr; 272 session_ = nullptr;
272 } 273 }
273 } 274 }
274 275
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 logger_->Start( 405 logger_->Start(
405 base::WrapUnique( 406 base::WrapUnique(
406 new ChromiumUrlRequestFactory(runtime_->url_requester())), 407 new ChromiumUrlRequestFactory(runtime_->url_requester())),
407 kTelemetryBaseUrl); 408 kTelemetryBaseUrl);
408 logger_->SetAuthClosure( 409 logger_->SetAuthClosure(
409 base::Bind(&ChromotingJniRuntime::FetchAuthToken, 410 base::Bind(&ChromotingJniRuntime::FetchAuthToken,
410 base::Unretained(this))); 411 base::Unretained(this)));
411 } 412 }
412 413
413 } // namespace remoting 414 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698