| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/plugin/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 net::EnableSSLServerSockets(); | 225 net::EnableSSLServerSockets(); |
| 226 | 226 |
| 227 // Start all the threads. | 227 // Start all the threads. |
| 228 context_.Start(); | 228 context_.Start(); |
| 229 | 229 |
| 230 // Create the chromoting objects that don't depend on the network connection. | 230 // Create the chromoting objects that don't depend on the network connection. |
| 231 // RectangleUpdateDecoder runs on a separate thread so for now we wrap | 231 // RectangleUpdateDecoder runs on a separate thread so for now we wrap |
| 232 // PepperView with a ref-counted proxy object. | 232 // PepperView with a ref-counted proxy object. |
| 233 scoped_refptr<FrameConsumerProxy> consumer_proxy = | 233 scoped_refptr<FrameConsumerProxy> consumer_proxy = |
| 234 new FrameConsumerProxy(plugin_task_runner_); | 234 new FrameConsumerProxy(plugin_task_runner_); |
| 235 rectangle_decoder_ = new RectangleUpdateDecoder( | 235 rectangle_decoder_ = new RectangleUpdateDecoder(context_.main_task_runner(), |
| 236 context_.decode_task_runner(), consumer_proxy); | 236 context_.decode_task_runner(), |
| 237 consumer_proxy); |
| 237 view_.reset(new PepperView(this, &context_, rectangle_decoder_.get())); | 238 view_.reset(new PepperView(this, &context_, rectangle_decoder_.get())); |
| 238 consumer_proxy->Attach(view_->AsWeakPtr()); | 239 consumer_proxy->Attach(view_->AsWeakPtr()); |
| 239 | 240 |
| 240 return true; | 241 return true; |
| 241 } | 242 } |
| 242 | 243 |
| 243 void ChromotingInstance::HandleMessage(const pp::Var& message) { | 244 void ChromotingInstance::HandleMessage(const pp::Var& message) { |
| 244 if (!message.is_string()) { | 245 if (!message.is_string()) { |
| 245 LOG(ERROR) << "Received a message that is not a string."; | 246 LOG(ERROR) << "Received a message that is not a string."; |
| 246 return; | 247 return; |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 PostChromotingMessage("logDebugMessage", data.Pass()); | 735 PostChromotingMessage("logDebugMessage", data.Pass()); |
| 735 g_logging_to_plugin = false; | 736 g_logging_to_plugin = false; |
| 736 } | 737 } |
| 737 | 738 |
| 738 bool ChromotingInstance::IsConnected() { | 739 bool ChromotingInstance::IsConnected() { |
| 739 return host_connection_.get() && | 740 return host_connection_.get() && |
| 740 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); | 741 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); |
| 741 } | 742 } |
| 742 | 743 |
| 743 } // namespace remoting | 744 } // namespace remoting |
| OLD | NEW |