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 29 matching lines...) Expand all Loading... |
40 scoped_refptr<FakeNetworkDispatcher> dispatcher, | 40 scoped_refptr<FakeNetworkDispatcher> dispatcher, |
41 const rtc::SocketAddress& local_address); | 41 const rtc::SocketAddress& local_address); |
42 virtual ~FakeUdpSocket(); | 42 virtual ~FakeUdpSocket(); |
43 | 43 |
44 void ReceivePacket(const rtc::SocketAddress& from, | 44 void ReceivePacket(const rtc::SocketAddress& from, |
45 const rtc::SocketAddress& to, | 45 const rtc::SocketAddress& to, |
46 const scoped_refptr<net::IOBuffer>& data, | 46 const scoped_refptr<net::IOBuffer>& data, |
47 int data_size); | 47 int data_size); |
48 | 48 |
49 // rtc::AsyncPacketSocket interface. | 49 // rtc::AsyncPacketSocket interface. |
50 virtual rtc::SocketAddress GetLocalAddress() const OVERRIDE; | 50 virtual rtc::SocketAddress GetLocalAddress() const override; |
51 virtual rtc::SocketAddress GetRemoteAddress() const OVERRIDE; | 51 virtual rtc::SocketAddress GetRemoteAddress() const override; |
52 virtual int Send(const void* data, size_t data_size, | 52 virtual int Send(const void* data, size_t data_size, |
53 const rtc::PacketOptions& options) OVERRIDE; | 53 const rtc::PacketOptions& options) override; |
54 virtual int SendTo(const void* data, size_t data_size, | 54 virtual int SendTo(const void* data, size_t data_size, |
55 const rtc::SocketAddress& address, | 55 const rtc::SocketAddress& address, |
56 const rtc::PacketOptions& options) OVERRIDE; | 56 const rtc::PacketOptions& options) override; |
57 virtual int Close() OVERRIDE; | 57 virtual int Close() override; |
58 virtual State GetState() const OVERRIDE; | 58 virtual State GetState() const override; |
59 virtual int GetOption(rtc::Socket::Option option, int* value) OVERRIDE; | 59 virtual int GetOption(rtc::Socket::Option option, int* value) override; |
60 virtual int SetOption(rtc::Socket::Option option, int value) OVERRIDE; | 60 virtual int SetOption(rtc::Socket::Option option, int value) override; |
61 virtual int GetError() const OVERRIDE; | 61 virtual int GetError() const override; |
62 virtual void SetError(int error) OVERRIDE; | 62 virtual void SetError(int error) override; |
63 | 63 |
64 private: | 64 private: |
65 FakePacketSocketFactory* factory_; | 65 FakePacketSocketFactory* factory_; |
66 scoped_refptr<FakeNetworkDispatcher> dispatcher_; | 66 scoped_refptr<FakeNetworkDispatcher> dispatcher_; |
67 rtc::SocketAddress local_address_; | 67 rtc::SocketAddress local_address_; |
68 State state_; | 68 State state_; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(FakeUdpSocket); | 70 DISALLOW_COPY_AND_ASSIGN(FakeUdpSocket); |
71 }; | 71 }; |
72 | 72 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 UdpSocketsMap::iterator iter = udp_sockets_.find(packet.to.port()); | 319 UdpSocketsMap::iterator iter = udp_sockets_.find(packet.to.port()); |
320 if (iter == udp_sockets_.end()) { | 320 if (iter == udp_sockets_.end()) { |
321 // Invalid port number. | 321 // Invalid port number. |
322 return; | 322 return; |
323 } | 323 } |
324 | 324 |
325 iter->second.Run(packet.from, packet.to, packet.data, packet.data_size); | 325 iter->second.Run(packet.from, packet.to, packet.data, packet.data_size); |
326 } | 326 } |
327 | 327 |
328 } // namespace remoting | 328 } // namespace remoting |
OLD | NEW |