| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 14 matching lines...) Expand all Loading... |
| 25 #include "ppapi/c/dev/ppb_query_policy_dev.h" | 25 #include "ppapi/c/dev/ppb_query_policy_dev.h" |
| 26 #include "ppapi/cpp/completion_callback.h" | 26 #include "ppapi/cpp/completion_callback.h" |
| 27 #include "ppapi/cpp/input_event.h" | 27 #include "ppapi/cpp/input_event.h" |
| 28 #include "ppapi/cpp/rect.h" | 28 #include "ppapi/cpp/rect.h" |
| 29 // TODO(wez): Remove this when crbug.com/86353 is complete. | 29 // TODO(wez): Remove this when crbug.com/86353 is complete. |
| 30 #include "ppapi/cpp/private/var_private.h" | 30 #include "ppapi/cpp/private/var_private.h" |
| 31 #include "remoting/base/task_thread_proxy.h" | 31 #include "remoting/base/task_thread_proxy.h" |
| 32 #include "remoting/base/util.h" | 32 #include "remoting/base/util.h" |
| 33 #include "remoting/client/client_config.h" | 33 #include "remoting/client/client_config.h" |
| 34 #include "remoting/client/chromoting_client.h" | 34 #include "remoting/client/chromoting_client.h" |
| 35 #include "remoting/client/rectangle_update_decoder.h" | 35 #include "remoting/client/ipc_host_address_resolver.h" |
| 36 #include "remoting/client/plugin/chromoting_scriptable_object.h" | 36 #include "remoting/client/plugin/chromoting_scriptable_object.h" |
| 37 #include "remoting/client/plugin/pepper_input_handler.h" | 37 #include "remoting/client/plugin/pepper_input_handler.h" |
| 38 #include "remoting/client/plugin/pepper_port_allocator_session.h" | 38 #include "remoting/client/plugin/pepper_port_allocator_session.h" |
| 39 #include "remoting/client/plugin/pepper_view.h" | 39 #include "remoting/client/plugin/pepper_view.h" |
| 40 #include "remoting/client/plugin/pepper_view_proxy.h" | 40 #include "remoting/client/plugin/pepper_view_proxy.h" |
| 41 #include "remoting/client/plugin/pepper_util.h" | 41 #include "remoting/client/plugin/pepper_util.h" |
| 42 #include "remoting/client/plugin/pepper_xmpp_proxy.h" | 42 #include "remoting/client/plugin/pepper_xmpp_proxy.h" |
| 43 #include "remoting/client/rectangle_update_decoder.h" |
| 43 #include "remoting/proto/auth.pb.h" | 44 #include "remoting/proto/auth.pb.h" |
| 44 #include "remoting/protocol/connection_to_host.h" | 45 #include "remoting/protocol/connection_to_host.h" |
| 45 #include "remoting/protocol/host_stub.h" | 46 #include "remoting/protocol/host_stub.h" |
| 46 // TODO(sergeyu): This is a hack: plugin should not depend on webkit | 47 // TODO(sergeyu): This is a hack: plugin should not depend on webkit |
| 47 // glue. It is used here to get P2PPacketDispatcher corresponding to | 48 // glue. It is used here to get P2PPacketDispatcher corresponding to |
| 48 // the current RenderView. Use P2P Pepper API for connection and | 49 // the current RenderView. Use P2P Pepper API for connection and |
| 49 // remove these includes. | 50 // remove these includes. |
| 50 // crbug.com/74951 | 51 // crbug.com/74951 |
| 51 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 52 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 52 #include "webkit/plugins/ppapi/resource_tracker.h" | 53 #include "webkit/plugins/ppapi/resource_tracker.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 174 } |
| 174 | 175 |
| 175 webkit::ppapi::PluginInstance* plugin_instance = | 176 webkit::ppapi::PluginInstance* plugin_instance = |
| 176 webkit::ppapi::ResourceTracker::Get()->GetInstance(pp_instance()); | 177 webkit::ppapi::ResourceTracker::Get()->GetInstance(pp_instance()); |
| 177 | 178 |
| 178 P2PSocketDispatcher* socket_dispatcher = | 179 P2PSocketDispatcher* socket_dispatcher = |
| 179 plugin_instance->delegate()->GetP2PSocketDispatcher(); | 180 plugin_instance->delegate()->GetP2PSocketDispatcher(); |
| 180 | 181 |
| 181 IpcNetworkManager* network_manager = NULL; | 182 IpcNetworkManager* network_manager = NULL; |
| 182 IpcPacketSocketFactory* socket_factory = NULL; | 183 IpcPacketSocketFactory* socket_factory = NULL; |
| 184 HostAddressResolver* host_address_resolver = NULL; |
| 183 PortAllocatorSessionFactory* session_factory = | 185 PortAllocatorSessionFactory* session_factory = |
| 184 CreatePepperPortAllocatorSessionFactory(this); | 186 CreatePepperPortAllocatorSessionFactory(this); |
| 185 | 187 |
| 186 // If we don't have socket dispatcher for IPC (e.g. P2P API is | 188 // If we don't have socket dispatcher for IPC (e.g. P2P API is |
| 187 // disabled), then JingleSessionManager will try to use physical sockets. | 189 // disabled), then JingleSessionManager will try to use physical sockets. |
| 188 if (socket_dispatcher) { | 190 if (socket_dispatcher) { |
| 189 VLOG(1) << "Creating IpcNetworkManager and IpcPacketSocketFactory."; | 191 VLOG(1) << "Creating IpcNetworkManager and IpcPacketSocketFactory."; |
| 190 network_manager = new IpcNetworkManager(socket_dispatcher); | 192 network_manager = new IpcNetworkManager(socket_dispatcher); |
| 191 socket_factory = new IpcPacketSocketFactory(socket_dispatcher); | 193 socket_factory = new IpcPacketSocketFactory(socket_dispatcher); |
| 194 host_address_resolver = new IpcHostAddressResolver(socket_dispatcher); |
| 192 } | 195 } |
| 193 | 196 |
| 194 host_connection_.reset(new protocol::ConnectionToHost( | 197 host_connection_.reset(new protocol::ConnectionToHost( |
| 195 context_.network_message_loop(), network_manager, socket_factory, | 198 context_.network_message_loop(), network_manager, socket_factory, |
| 196 session_factory, enable_client_nat_traversal_)); | 199 host_address_resolver, session_factory, enable_client_nat_traversal_)); |
| 197 input_handler_.reset(new PepperInputHandler(&context_, | 200 input_handler_.reset(new PepperInputHandler(&context_, |
| 198 host_connection_.get(), | 201 host_connection_.get(), |
| 199 view_proxy_)); | 202 view_proxy_)); |
| 200 | 203 |
| 201 client_.reset(new ChromotingClient(config, &context_, host_connection_.get(), | 204 client_.reset(new ChromotingClient(config, &context_, host_connection_.get(), |
| 202 view_proxy_, rectangle_decoder_.get(), | 205 view_proxy_, rectangle_decoder_.get(), |
| 203 input_handler_.get(), NULL)); | 206 input_handler_.get(), NULL)); |
| 204 | 207 |
| 205 LOG(INFO) << "Connecting."; | 208 LOG(INFO) << "Connecting."; |
| 206 | 209 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 492 |
| 490 initial_policy_received_ = true; | 493 initial_policy_received_ = true; |
| 491 enable_client_nat_traversal_ = traversal_policy; | 494 enable_client_nat_traversal_ = traversal_policy; |
| 492 | 495 |
| 493 if (delayed_connect_.get()) { | 496 if (delayed_connect_.get()) { |
| 494 RunTaskOnPluginThread(delayed_connect_.release()); | 497 RunTaskOnPluginThread(delayed_connect_.release()); |
| 495 } | 498 } |
| 496 } | 499 } |
| 497 | 500 |
| 498 } // namespace remoting | 501 } // namespace remoting |
| OLD | NEW |