OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2010 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_P2P_CLIENT_FAKEPORTALLOCATOR_H_ | 11 #ifndef WEBRTC_P2P_CLIENT_FAKEPORTALLOCATOR_H_ |
12 #define WEBRTC_P2P_CLIENT_FAKEPORTALLOCATOR_H_ | 12 #define WEBRTC_P2P_CLIENT_FAKEPORTALLOCATOR_H_ |
13 | 13 |
| 14 #include <memory> |
14 #include <string> | 15 #include <string> |
| 16 |
15 #include "webrtc/p2p/base/basicpacketsocketfactory.h" | 17 #include "webrtc/p2p/base/basicpacketsocketfactory.h" |
16 #include "webrtc/p2p/base/portallocator.h" | 18 #include "webrtc/p2p/base/portallocator.h" |
17 #include "webrtc/p2p/base/udpport.h" | 19 #include "webrtc/p2p/base/udpport.h" |
18 #include "webrtc/base/scoped_ptr.h" | 20 #include "webrtc/base/scoped_ptr.h" |
19 | 21 |
20 namespace rtc { | 22 namespace rtc { |
21 class SocketFactory; | 23 class SocketFactory; |
22 class Thread; | 24 class Thread; |
23 } | 25 } |
24 | 26 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 128 } |
127 void OnPortComplete(cricket::Port* port) { | 129 void OnPortComplete(cricket::Port* port) { |
128 SignalCandidatesReady(this, port->Candidates()); | 130 SignalCandidatesReady(this, port->Candidates()); |
129 SignalCandidatesAllocationDone(this); | 131 SignalCandidatesAllocationDone(this); |
130 } | 132 } |
131 | 133 |
132 private: | 134 private: |
133 rtc::Thread* worker_thread_; | 135 rtc::Thread* worker_thread_; |
134 rtc::PacketSocketFactory* factory_; | 136 rtc::PacketSocketFactory* factory_; |
135 rtc::Network network_; | 137 rtc::Network network_; |
136 rtc::scoped_ptr<cricket::Port> port_; | 138 std::unique_ptr<cricket::Port> port_; |
137 bool running_; | 139 bool running_; |
138 int port_config_count_; | 140 int port_config_count_; |
139 }; | 141 }; |
140 | 142 |
141 class FakePortAllocator : public cricket::PortAllocator { | 143 class FakePortAllocator : public cricket::PortAllocator { |
142 public: | 144 public: |
143 FakePortAllocator(rtc::Thread* worker_thread, | 145 FakePortAllocator(rtc::Thread* worker_thread, |
144 rtc::PacketSocketFactory* factory) | 146 rtc::PacketSocketFactory* factory) |
145 : worker_thread_(worker_thread), factory_(factory) { | 147 : worker_thread_(worker_thread), factory_(factory) { |
146 if (factory_ == NULL) { | 148 if (factory_ == NULL) { |
(...skipping 23 matching lines...) Expand all Loading... |
170 int component, | 172 int component, |
171 const std::string& ice_ufrag, | 173 const std::string& ice_ufrag, |
172 const std::string& ice_pwd) override { | 174 const std::string& ice_pwd) override { |
173 return new FakePortAllocatorSession( | 175 return new FakePortAllocatorSession( |
174 worker_thread_, factory_, content_name, component, ice_ufrag, ice_pwd); | 176 worker_thread_, factory_, content_name, component, ice_ufrag, ice_pwd); |
175 } | 177 } |
176 | 178 |
177 private: | 179 private: |
178 rtc::Thread* worker_thread_; | 180 rtc::Thread* worker_thread_; |
179 rtc::PacketSocketFactory* factory_; | 181 rtc::PacketSocketFactory* factory_; |
180 rtc::scoped_ptr<rtc::BasicPacketSocketFactory> owned_factory_; | 182 std::unique_ptr<rtc::BasicPacketSocketFactory> owned_factory_; |
181 ServerAddresses stun_servers_; | 183 ServerAddresses stun_servers_; |
182 std::vector<RelayServerConfig> turn_servers_; | 184 std::vector<RelayServerConfig> turn_servers_; |
183 }; | 185 }; |
184 | 186 |
185 } // namespace cricket | 187 } // namespace cricket |
186 | 188 |
187 #endif // WEBRTC_P2P_CLIENT_FAKEPORTALLOCATOR_H_ | 189 #endif // WEBRTC_P2P_CLIENT_FAKEPORTALLOCATOR_H_ |
OLD | NEW |