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 #ifndef JINGLE_GLUE_FAKE_SOCKET_FACTORY_H_ | 5 #ifndef JINGLE_GLUE_FAKE_SOCKET_FACTORY_H_ |
6 #define JINGLE_GLUE_FAKE_SOCKET_FACTORY_H_ | 6 #define JINGLE_GLUE_FAKE_SOCKET_FACTORY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 virtual ~FakeUDPPacketSocket(); | 32 virtual ~FakeUDPPacketSocket(); |
33 | 33 |
34 const net::IPEndPoint& endpoint() const { return endpoint_; } | 34 const net::IPEndPoint& endpoint() const { return endpoint_; } |
35 void DeliverPacket(const net::IPEndPoint& from, | 35 void DeliverPacket(const net::IPEndPoint& from, |
36 const std::vector<char>& data); | 36 const std::vector<char>& data); |
37 | 37 |
38 // talk_base::AsyncPacketSocket implementation. | 38 // talk_base::AsyncPacketSocket implementation. |
39 virtual talk_base::SocketAddress GetLocalAddress() const OVERRIDE; | 39 virtual talk_base::SocketAddress GetLocalAddress() const OVERRIDE; |
40 virtual talk_base::SocketAddress GetRemoteAddress() const OVERRIDE; | 40 virtual talk_base::SocketAddress GetRemoteAddress() const OVERRIDE; |
41 virtual int Send(const void *pv, size_t cb, | 41 virtual int Send(const void *pv, size_t cb, |
42 talk_base::DiffServCodePoint dscp) OVERRIDE; | 42 const talk_base::PacketOptions& options) OVERRIDE; |
43 virtual int SendTo(const void *pv, size_t cb, | 43 virtual int SendTo(const void *pv, size_t cb, |
44 const talk_base::SocketAddress& addr, | 44 const talk_base::SocketAddress& addr, |
45 talk_base::DiffServCodePoint dscp) OVERRIDE; | 45 const talk_base::PacketOptions& options) OVERRIDE; |
46 virtual int Close() OVERRIDE; | 46 virtual int Close() OVERRIDE; |
47 virtual State GetState() const OVERRIDE; | 47 virtual State GetState() const OVERRIDE; |
48 virtual int GetOption(talk_base::Socket::Option opt, int* value) OVERRIDE; | 48 virtual int GetOption(talk_base::Socket::Option opt, int* value) OVERRIDE; |
49 virtual int SetOption(talk_base::Socket::Option opt, int value) OVERRIDE; | 49 virtual int SetOption(talk_base::Socket::Option opt, int value) OVERRIDE; |
50 virtual int GetError() const OVERRIDE; | 50 virtual int GetError() const OVERRIDE; |
51 virtual void SetError(int error) OVERRIDE; | 51 virtual void SetError(int error) OVERRIDE; |
52 | 52 |
53 private: | 53 private: |
54 enum InternalState { | 54 enum InternalState { |
55 IS_OPEN, | 55 IS_OPEN, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 scoped_refptr<FakeSocketManager> socket_manager_; | 116 scoped_refptr<FakeSocketManager> socket_manager_; |
117 net::IPAddressNumber address_; | 117 net::IPAddressNumber address_; |
118 int last_allocated_port_; | 118 int last_allocated_port_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(FakeSocketFactory); | 120 DISALLOW_COPY_AND_ASSIGN(FakeSocketFactory); |
121 }; | 121 }; |
122 | 122 |
123 } // namespace jingle_glue | 123 } // namespace jingle_glue |
124 | 124 |
125 #endif // JINGLE_GLUE_FAKE_SOCKET_FACTORY_H_ | 125 #endif // JINGLE_GLUE_FAKE_SOCKET_FACTORY_H_ |
OLD | NEW |