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 #include "remoting/client/plugin/pepper_packet_socket_factory.h" | 5 #include "remoting/client/plugin/pepper_packet_socket_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 explicit UdpPacketSocket(const pp::InstanceHandle& instance); | 31 explicit UdpPacketSocket(const pp::InstanceHandle& instance); |
32 virtual ~UdpPacketSocket(); | 32 virtual ~UdpPacketSocket(); |
33 | 33 |
34 // |min_port| and |max_port| are set to zero if the port number | 34 // |min_port| and |max_port| are set to zero if the port number |
35 // should be assigned by the OS. | 35 // should be assigned by the OS. |
36 bool Init(const talk_base::SocketAddress& local_address, | 36 bool Init(const talk_base::SocketAddress& local_address, |
37 int min_port, | 37 int min_port, |
38 int max_port); | 38 int max_port); |
39 | 39 |
40 // talk_base::AsyncPacketSocket interface. | 40 // talk_base::AsyncPacketSocket interface. |
41 virtual talk_base::SocketAddress GetLocalAddress() const; | 41 virtual talk_base::SocketAddress GetLocalAddress() const OVERRIDE; |
42 virtual talk_base::SocketAddress GetRemoteAddress() const; | 42 virtual talk_base::SocketAddress GetRemoteAddress() const OVERRIDE; |
43 virtual int Send(const void* data, size_t data_size); | 43 virtual int Send(const void* data, size_t data_size) OVERRIDE; |
44 virtual int SendTo(const void* data, | 44 virtual int SendTo(const void* data, |
45 size_t data_size, | 45 size_t data_size, |
46 const talk_base::SocketAddress& address); | 46 const talk_base::SocketAddress& address) OVERRIDE; |
47 virtual int Close(); | 47 virtual int Close() OVERRIDE; |
48 virtual State GetState() const; | 48 virtual State GetState() const OVERRIDE; |
49 virtual int GetOption(talk_base::Socket::Option opt, int* value); | 49 virtual int GetOption(talk_base::Socket::Option opt, int* value) OVERRIDE; |
50 virtual int SetOption(talk_base::Socket::Option opt, int value); | 50 virtual int SetOption(talk_base::Socket::Option opt, int value) OVERRIDE; |
51 virtual int GetError() const; | 51 virtual int GetError() const OVERRIDE; |
52 virtual void SetError(int error); | 52 virtual void SetError(int error) OVERRIDE; |
53 | 53 |
54 private: | 54 private: |
55 struct PendingPacket { | 55 struct PendingPacket { |
56 PendingPacket(const void* buffer, | 56 PendingPacket(const void* buffer, |
57 int buffer_size, | 57 int buffer_size, |
58 const PP_NetAddress_Private& address); | 58 const PP_NetAddress_Private& address); |
59 | 59 |
60 scoped_refptr<net::IOBufferWithSize> data; | 60 scoped_refptr<net::IOBufferWithSize> data; |
61 PP_NetAddress_Private address; | 61 PP_NetAddress_Private address; |
62 }; | 62 }; |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 const talk_base::SocketAddress& remote_address, | 374 const talk_base::SocketAddress& remote_address, |
375 const talk_base::ProxyInfo& proxy_info, | 375 const talk_base::ProxyInfo& proxy_info, |
376 const std::string& user_agent, | 376 const std::string& user_agent, |
377 bool ssl) { | 377 bool ssl) { |
378 // We don't use TCP sockets for remoting connections. | 378 // We don't use TCP sockets for remoting connections. |
379 NOTREACHED(); | 379 NOTREACHED(); |
380 return NULL; | 380 return NULL; |
381 } | 381 } |
382 | 382 |
383 } // namespace remoting | 383 } // namespace remoting |
OLD | NEW |