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

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

Issue 407403002: Chromoting: Synchronize connected/disconnected state between Java/C++ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 4 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 | Annotate | Revision Log
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_instance.h" 5 #include "remoting/client/jni/chromoting_jni_instance.h"
6 6
7 #include <android/log.h> 7 #include <android/log.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 if (create_pairing_ && state == protocol::ConnectionToHost::CONNECTED) { 274 if (create_pairing_ && state == protocol::ConnectionToHost::CONNECTED) {
275 protocol::PairingRequest request; 275 protocol::PairingRequest request;
276 DCHECK(!device_name_.empty()); 276 DCHECK(!device_name_.empty());
277 request.set_client_name(device_name_); 277 request.set_client_name(device_name_);
278 client_->host_stub()->RequestPairing(request); 278 client_->host_stub()->RequestPairing(request);
279 } 279 }
280 280
281 jni_runtime_->ui_task_runner()->PostTask( 281 jni_runtime_->ui_task_runner()->PostTask(
282 FROM_HERE, 282 FROM_HERE,
283 base::Bind(&ChromotingJniRuntime::ReportConnectionStatus, 283 base::Bind(&ChromotingJniRuntime::OnConnectionState,
284 base::Unretained(jni_runtime_), 284 base::Unretained(jni_runtime_),
285 state, 285 state,
286 error)); 286 error));
287 } 287 }
288 288
289 void ChromotingJniInstance::OnConnectionReady(bool ready) { 289 void ChromotingJniInstance::OnConnectionReady(bool ready) {
290 // We ignore this message, since OnConnectionState tells us the same thing. 290 // We ignore this message, since OnConnectionState tells us the same thing.
291 } 291 }
292 292
293 void ChromotingJniInstance::OnRouteChanged( 293 void ChromotingJniInstance::OnRouteChanged(
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 stats->round_trip_ms()->Average()); 495 stats->round_trip_ms()->Average());
496 496
497 client_status_logger_->LogStatistics(stats); 497 client_status_logger_->LogStatistics(stats);
498 498
499 jni_runtime_->network_task_runner()->PostDelayedTask( 499 jni_runtime_->network_task_runner()->PostDelayedTask(
500 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), 500 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this),
501 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); 501 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
502 } 502 }
503 503
504 } // namespace remoting 504 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java ('k') | remoting/client/jni/chromoting_jni_runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698