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/protocol/jingle_session_manager.h" | 5 #include "remoting/protocol/jingle_session_manager.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop_proxy.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/task.h" | 12 #include "base/task.h" |
13 #include "remoting/base/constants.h" | 13 #include "remoting/base/constants.h" |
14 #include "remoting/jingle_glue/host_resolver.h" | 14 #include "remoting/jingle_glue/host_resolver.h" |
15 #include "remoting/jingle_glue/http_port_allocator.h" | 15 #include "remoting/jingle_glue/http_port_allocator.h" |
16 #include "remoting/jingle_glue/jingle_info_request.h" | 16 #include "remoting/jingle_glue/jingle_info_request.h" |
17 #include "remoting/jingle_glue/jingle_signaling_connector.h" | 17 #include "remoting/jingle_glue/jingle_signaling_connector.h" |
18 #include "remoting/jingle_glue/signal_strategy.h" | 18 #include "remoting/jingle_glue/signal_strategy.h" |
19 #include "third_party/libjingle/source/talk/base/basicpacketsocketfactory.h" | 19 #include "third_party/libjingle/source/talk/base/basicpacketsocketfactory.h" |
20 #include "third_party/libjingle/source/talk/p2p/base/sessionmanager.h" | 20 #include "third_party/libjingle/source/talk/p2p/base/sessionmanager.h" |
21 #include "third_party/libjingle/source/talk/p2p/base/transport.h" | 21 #include "third_party/libjingle/source/talk/p2p/base/transport.h" |
22 #include "third_party/libjingle/source/talk/p2p/base/constants.h" | 22 #include "third_party/libjingle/source/talk/p2p/base/constants.h" |
23 #include "third_party/libjingle/source/talk/p2p/base/transport.h" | 23 #include "third_party/libjingle/source/talk/p2p/base/transport.h" |
24 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" | 24 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
25 | 25 |
26 using buzz::XmlElement; | 26 using buzz::XmlElement; |
27 | 27 |
28 namespace remoting { | 28 namespace remoting { |
29 namespace protocol { | 29 namespace protocol { |
30 | 30 |
31 // static | 31 // static |
32 JingleSessionManager* JingleSessionManager::CreateNotSandboxed() { | 32 JingleSessionManager* JingleSessionManager::CreateNotSandboxed( |
33 return new JingleSessionManager(NULL, NULL, NULL, NULL); | 33 base::MessageLoopProxy* message_loop) { |
| 34 return new JingleSessionManager(message_loop, NULL, NULL, NULL, NULL); |
34 } | 35 } |
35 | 36 |
36 // static | 37 // static |
37 JingleSessionManager* JingleSessionManager::CreateSandboxed( | 38 JingleSessionManager* JingleSessionManager::CreateSandboxed( |
| 39 base::MessageLoopProxy* message_loop, |
38 talk_base::NetworkManager* network_manager, | 40 talk_base::NetworkManager* network_manager, |
39 talk_base::PacketSocketFactory* socket_factory, | 41 talk_base::PacketSocketFactory* socket_factory, |
40 HostResolverFactory* host_resolver_factory, | 42 HostResolverFactory* host_resolver_factory, |
41 PortAllocatorSessionFactory* port_allocator_session_factory) { | 43 PortAllocatorSessionFactory* port_allocator_session_factory) { |
42 return new JingleSessionManager(network_manager, socket_factory, | 44 return new JingleSessionManager(message_loop, network_manager, socket_factory, |
43 host_resolver_factory, | 45 host_resolver_factory, |
44 port_allocator_session_factory); | 46 port_allocator_session_factory); |
45 } | 47 } |
46 | 48 |
47 JingleSessionManager::JingleSessionManager( | 49 JingleSessionManager::JingleSessionManager( |
| 50 base::MessageLoopProxy* message_loop, |
48 talk_base::NetworkManager* network_manager, | 51 talk_base::NetworkManager* network_manager, |
49 talk_base::PacketSocketFactory* socket_factory, | 52 talk_base::PacketSocketFactory* socket_factory, |
50 HostResolverFactory* host_resolver_factory, | 53 HostResolverFactory* host_resolver_factory, |
51 PortAllocatorSessionFactory* port_allocator_session_factory) | 54 PortAllocatorSessionFactory* port_allocator_session_factory) |
52 : network_manager_(network_manager), | 55 : message_loop_(message_loop), |
| 56 network_manager_(network_manager), |
53 socket_factory_(socket_factory), | 57 socket_factory_(socket_factory), |
54 host_resolver_factory_(host_resolver_factory), | 58 host_resolver_factory_(host_resolver_factory), |
55 port_allocator_session_factory_(port_allocator_session_factory), | 59 port_allocator_session_factory_(port_allocator_session_factory), |
56 signal_strategy_(NULL), | 60 signal_strategy_(NULL), |
57 allow_nat_traversal_(false), | 61 allow_nat_traversal_(false), |
58 allow_local_ips_(false), | 62 allow_local_ips_(false), |
59 http_port_allocator_(NULL), | 63 http_port_allocator_(NULL), |
60 closed_(false), | 64 closed_(false), |
61 ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)) { | 65 ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)) { |
62 } | 66 } |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 const std::string& certificate) { | 349 const std::string& certificate) { |
346 cricket::SessionDescription* desc = new cricket::SessionDescription(); | 350 cricket::SessionDescription* desc = new cricket::SessionDescription(); |
347 desc->AddContent( | 351 desc->AddContent( |
348 JingleSession::kChromotingContentName, kChromotingXmlNamespace, | 352 JingleSession::kChromotingContentName, kChromotingXmlNamespace, |
349 new ContentDescription(config, "", certificate)); | 353 new ContentDescription(config, "", certificate)); |
350 return desc; | 354 return desc; |
351 } | 355 } |
352 | 356 |
353 } // namespace protocol | 357 } // namespace protocol |
354 } // namespace remoting | 358 } // namespace remoting |
OLD | NEW |