OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 | 7 |
8 #include "remoting/test/fake_socket_factory.h" | 8 #include "remoting/test/fake_socket_factory.h" |
9 | 9 |
10 #include <math.h> | 10 #include <math.h> |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 | 160 |
161 FakePacketSocketFactory::PendingPacket::PendingPacket( | 161 FakePacketSocketFactory::PendingPacket::PendingPacket( |
162 const rtc::SocketAddress& from, | 162 const rtc::SocketAddress& from, |
163 const rtc::SocketAddress& to, | 163 const rtc::SocketAddress& to, |
164 const scoped_refptr<net::IOBuffer>& data, | 164 const scoped_refptr<net::IOBuffer>& data, |
165 int data_size) | 165 int data_size) |
166 : from(from), to(to), data(data), data_size(data_size) { | 166 : from(from), to(to), data(data), data_size(data_size) { |
167 } | 167 } |
168 | 168 |
| 169 FakePacketSocketFactory::PendingPacket::PendingPacket( |
| 170 const PendingPacket& other) = default; |
| 171 |
169 FakePacketSocketFactory::PendingPacket::~PendingPacket() { | 172 FakePacketSocketFactory::PendingPacket::~PendingPacket() { |
170 } | 173 } |
171 | 174 |
172 FakePacketSocketFactory::FakePacketSocketFactory( | 175 FakePacketSocketFactory::FakePacketSocketFactory( |
173 FakeNetworkDispatcher* dispatcher) | 176 FakeNetworkDispatcher* dispatcher) |
174 : task_runner_(base::ThreadTaskRunnerHandle::Get()), | 177 : task_runner_(base::ThreadTaskRunnerHandle::Get()), |
175 dispatcher_(dispatcher), | 178 dispatcher_(dispatcher), |
176 address_(dispatcher_->AllocateAddress()), | 179 address_(dispatcher_->AllocateAddress()), |
177 out_of_order_rate_(0.0), | 180 out_of_order_rate_(0.0), |
178 next_port_(kPortRangeStart), | 181 next_port_(kPortRangeStart), |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 UdpSocketsMap::iterator iter = udp_sockets_.find(packet.to.port()); | 334 UdpSocketsMap::iterator iter = udp_sockets_.find(packet.to.port()); |
332 if (iter == udp_sockets_.end()) { | 335 if (iter == udp_sockets_.end()) { |
333 // Invalid port number. | 336 // Invalid port number. |
334 return; | 337 return; |
335 } | 338 } |
336 | 339 |
337 iter->second.Run(packet.from, packet.to, packet.data, packet.data_size); | 340 iter->second.Run(packet.from, packet.to, packet.data, packet.data_size); |
338 } | 341 } |
339 | 342 |
340 } // namespace remoting | 343 } // namespace remoting |
OLD | NEW |