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 // The purpose of SessionManager is to facilitate creation of chromotocol | 5 // The purpose of SessionManager is to facilitate creation of chromotocol |
6 // sessions. Both host and client use it to establish chromotocol | 6 // sessions. Both host and client use it to establish chromotocol |
7 // sessions. JingleChromotocolServer implements this inteface using | 7 // sessions. JingleChromotocolServer implements this inteface using |
8 // libjingle. | 8 // libjingle. |
9 // | 9 // |
10 // OUTGOING SESSIONS | 10 // OUTGOING SESSIONS |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 #ifndef REMOTING_PROTOCOL_SESSION_MANAGER_H_ | 53 #ifndef REMOTING_PROTOCOL_SESSION_MANAGER_H_ |
54 #define REMOTING_PROTOCOL_SESSION_MANAGER_H_ | 54 #define REMOTING_PROTOCOL_SESSION_MANAGER_H_ |
55 | 55 |
56 #include <string> | 56 #include <string> |
57 | 57 |
58 #include "base/callback.h" | 58 #include "base/callback.h" |
59 #include "base/memory/ref_counted.h" | 59 #include "base/memory/ref_counted.h" |
60 #include "base/threading/non_thread_safe.h" | 60 #include "base/threading/non_thread_safe.h" |
61 #include "remoting/protocol/session.h" | 61 #include "remoting/protocol/session.h" |
| 62 #include "remoting/protocol/transport_config.h" |
62 | 63 |
63 namespace remoting { | 64 namespace remoting { |
64 | 65 |
65 class SignalStrategy; | 66 class SignalStrategy; |
66 | 67 |
67 namespace protocol { | 68 namespace protocol { |
68 | 69 |
69 class Authenticator; | 70 class Authenticator; |
70 class AuthenticatorFactory; | 71 class AuthenticatorFactory; |
71 | 72 |
72 // TODO(sergeyu): Remove this struct and use TransportConfig instead. | 73 // TODO(sergeyu): Remove this struct and use TransportConfig instead. |
73 struct NetworkSettings { | 74 struct NetworkSettings { |
74 NetworkSettings() | 75 NetworkSettings() |
75 : allow_nat_traversal(false), | 76 : nat_traversal_mode(TransportConfig::NAT_TRAVERSAL_DISABLED), |
| 77 max_port(0) { |
| 78 } |
| 79 |
| 80 explicit NetworkSettings(bool allow_nat_traversal) |
| 81 : nat_traversal_mode(allow_nat_traversal ? |
| 82 TransportConfig::NAT_TRAVERSAL_ENABLED : |
| 83 TransportConfig::NAT_TRAVERSAL_DISABLED), |
76 min_port(0), | 84 min_port(0), |
77 max_port(0) { | 85 max_port(0) { |
78 } | 86 } |
79 | 87 |
80 explicit NetworkSettings(bool allow_nat_traversal_value) | 88 explicit NetworkSettings(TransportConfig::NatTraversalMode nat_traversal_mode) |
81 : allow_nat_traversal(allow_nat_traversal_value), | 89 : nat_traversal_mode(nat_traversal_mode), |
82 min_port(0), | 90 min_port(0), |
83 max_port(0) { | 91 max_port(0) { |
84 } | 92 } |
85 | 93 |
86 bool allow_nat_traversal; | 94 TransportConfig::NatTraversalMode nat_traversal_mode; |
87 | 95 |
88 // |min_port| and |max_port| specify range (inclusive) of ports used by | 96 // |min_port| and |max_port| specify range (inclusive) of ports used by |
89 // P2P sessions. Any port can be used when both values are set to 0. | 97 // P2P sessions. Any port can be used when both values are set to 0. |
90 int min_port; | 98 int min_port; |
91 int max_port; | 99 int max_port; |
92 }; | 100 }; |
93 | 101 |
94 // Generic interface for Chromoting session manager. | 102 // Generic interface for Chromoting session manager. |
95 // | 103 // |
96 // TODO(sergeyu): Split this into two separate interfaces: one for the | 104 // TODO(sergeyu): Split this into two separate interfaces: one for the |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 scoped_ptr<AuthenticatorFactory> authenticator_factory) = 0; | 170 scoped_ptr<AuthenticatorFactory> authenticator_factory) = 0; |
163 | 171 |
164 private: | 172 private: |
165 DISALLOW_COPY_AND_ASSIGN(SessionManager); | 173 DISALLOW_COPY_AND_ASSIGN(SessionManager); |
166 }; | 174 }; |
167 | 175 |
168 } // namespace protocol | 176 } // namespace protocol |
169 } // namespace remoting | 177 } // namespace remoting |
170 | 178 |
171 #endif // REMOTING_PROTOCOL_SESSION_MANAGER_H_ | 179 #endif // REMOTING_PROTOCOL_SESSION_MANAGER_H_ |
OLD | NEW |