| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "net/socket/client_socket_factory.h" | 9 #include "net/socket/client_socket_factory.h" |
| 10 #include "remoting/client/audio_player.h" | 10 #include "remoting/client/audio_player.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 base::Bind(&ChromotingJniInstance::SetCursorShape, this, shape)); | 221 base::Bind(&ChromotingJniInstance::SetCursorShape, this, shape)); |
| 222 return; | 222 return; |
| 223 } | 223 } |
| 224 | 224 |
| 225 jni_runtime_->UpdateCursorShape(shape); | 225 jni_runtime_->UpdateCursorShape(shape); |
| 226 } | 226 } |
| 227 | 227 |
| 228 void ChromotingJniInstance::ConnectToHostOnDisplayThread() { | 228 void ChromotingJniInstance::ConnectToHostOnDisplayThread() { |
| 229 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread()); | 229 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread()); |
| 230 | 230 |
| 231 frame_consumer_ = new FrameConsumerProxy(jni_runtime_->display_task_runner()); | |
| 232 view_.reset(new JniFrameConsumer(jni_runtime_)); | 231 view_.reset(new JniFrameConsumer(jni_runtime_)); |
| 233 view_weak_factory_.reset(new base::WeakPtrFactory<JniFrameConsumer>( | 232 view_weak_factory_.reset(new base::WeakPtrFactory<JniFrameConsumer>( |
| 234 view_.get())); | 233 view_.get())); |
| 235 frame_consumer_->Attach(view_weak_factory_->GetWeakPtr()); | 234 frame_consumer_ = new FrameConsumerProxy(jni_runtime_->display_task_runner(), |
| 235 view_weak_factory_->GetWeakPtr()); |
| 236 | 236 |
| 237 jni_runtime_->network_task_runner()->PostTask( | 237 jni_runtime_->network_task_runner()->PostTask( |
| 238 FROM_HERE, | 238 FROM_HERE, |
| 239 base::Bind(&ChromotingJniInstance::ConnectToHostOnNetworkThread, | 239 base::Bind(&ChromotingJniInstance::ConnectToHostOnNetworkThread, |
| 240 this)); | 240 this)); |
| 241 } | 241 } |
| 242 | 242 |
| 243 void ChromotingJniInstance::ConnectToHostOnNetworkThread() { | 243 void ChromotingJniInstance::ConnectToHostOnNetworkThread() { |
| 244 DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread()); | 244 DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread()); |
| 245 | 245 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // Unless we forget about the stale credentials, we'll continue trying them. | 294 // Unless we forget about the stale credentials, we'll continue trying them. |
| 295 LOG(INFO) << "Deleting rejected pairing credentials"; | 295 LOG(INFO) << "Deleting rejected pairing credentials"; |
| 296 jni_runtime_->CommitPairingCredentials(host_id_, "", ""); | 296 jni_runtime_->CommitPairingCredentials(host_id_, "", ""); |
| 297 } | 297 } |
| 298 | 298 |
| 299 pin_callback_ = callback; | 299 pin_callback_ = callback; |
| 300 jni_runtime_->DisplayAuthenticationPrompt(pairable); | 300 jni_runtime_->DisplayAuthenticationPrompt(pairable); |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace remoting | 303 } // namespace remoting |
| OLD | NEW |