| 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_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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // The weak pointers must be invalidated on the same thread they were used. | 99 // The weak pointers must be invalidated on the same thread they were used. |
| 100 view_weak_factory_->InvalidateWeakPtrs(); | 100 view_weak_factory_->InvalidateWeakPtrs(); |
| 101 | 101 |
| 102 jni_runtime_->network_task_runner()->PostTask( | 102 jni_runtime_->network_task_runner()->PostTask( |
| 103 FROM_HERE, | 103 FROM_HERE, |
| 104 base::Bind(&ChromotingJniInstance::DisconnectFromHostOnNetworkThread, | 104 base::Bind(&ChromotingJniInstance::DisconnectFromHostOnNetworkThread, |
| 105 this)); | 105 this)); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void ChromotingJniInstance::FetchThirdPartyToken( |
| 109 const GURL& token_url, |
| 110 const std::string& client_id, |
| 111 const std::string& scope, |
| 112 base::WeakPtr<JniTokenFetcher> jni_token_fetcher) { |
| 113 // TODO(kelvinp) Calls into the jni_runtime_ to obtain a token from the |
| 114 // android app (Android Beyond Corp - Part II). |
| 115 } |
| 116 |
| 108 void ChromotingJniInstance::ProvideSecret(const std::string& pin, | 117 void ChromotingJniInstance::ProvideSecret(const std::string& pin, |
| 109 bool create_pairing, | 118 bool create_pairing, |
| 110 const std::string& device_name) { | 119 const std::string& device_name) { |
| 111 DCHECK(jni_runtime_->ui_task_runner()->BelongsToCurrentThread()); | 120 DCHECK(jni_runtime_->ui_task_runner()->BelongsToCurrentThread()); |
| 112 DCHECK(!pin_callback_.is_null()); | 121 DCHECK(!pin_callback_.is_null()); |
| 113 | 122 |
| 114 create_pairing_ = create_pairing; | 123 create_pairing_ = create_pairing; |
| 115 | 124 |
| 116 if (create_pairing) | 125 if (create_pairing) |
| 117 SetDeviceName(device_name); | 126 SetDeviceName(device_name); |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 stats->round_trip_ms()->Average()); | 442 stats->round_trip_ms()->Average()); |
| 434 | 443 |
| 435 log_to_server_->LogStatistics(stats); | 444 log_to_server_->LogStatistics(stats); |
| 436 | 445 |
| 437 jni_runtime_->network_task_runner()->PostDelayedTask( | 446 jni_runtime_->network_task_runner()->PostDelayedTask( |
| 438 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), | 447 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), |
| 439 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); | 448 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |
| 440 } | 449 } |
| 441 | 450 |
| 442 } // namespace remoting | 451 } // namespace remoting |
| OLD | NEW |