Chromium Code Reviews| 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 #ifndef CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ |
| 6 #define CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ | 6 #define CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 // P2P_SOCKET_TCP_CLIENT. The methods on the returned socket may only be | 29 // P2P_SOCKET_TCP_CLIENT. The methods on the returned socket may only be |
| 30 // called on the same thread that created it. | 30 // called on the same thread that created it. |
| 31 static scoped_refptr<P2PSocketClient> Create( | 31 static scoped_refptr<P2PSocketClient> Create( |
| 32 P2PSocketType type, | 32 P2PSocketType type, |
| 33 const net::IPEndPoint& local_address, | 33 const net::IPEndPoint& local_address, |
| 34 const net::IPEndPoint& remote_address, | 34 const net::IPEndPoint& remote_address, |
| 35 P2PSocketClientDelegate* delegate); | 35 P2PSocketClientDelegate* delegate); |
| 36 | 36 |
| 37 P2PSocketClient() {} | 37 P2PSocketClient() {} |
| 38 | 38 |
| 39 // Send the |data| to the |address|. | |
| 40 virtual void Send(const net::IPEndPoint& address, | |
| 41 const std::vector<char>& data) = 0; | |
| 42 | |
| 43 // Send the |data| to the |address| using Differentiated Services Code Point | 39 // Send the |data| to the |address| using Differentiated Services Code Point |
| 44 // |dscp|. | 40 // |dscp|. Return value is the unique packet_id for this packet. |
| 45 virtual void SendWithDscp(const net::IPEndPoint& address, | 41 virtual uint64_t SendWithDscp(const net::IPEndPoint& address, |
|
Sergey Ulanov
2014/12/23 01:11:02
rename this to Send()?
guoweis_left_chromium
2014/12/23 19:08:32
Done.
| |
| 46 const std::vector<char>& data, | 42 const std::vector<char>& data, |
| 47 const rtc::PacketOptions& options) = 0; | 43 const rtc::PacketOptions& options) = 0; |
| 48 | 44 |
| 49 virtual void SetOption(P2PSocketOption option, int value) = 0; | 45 virtual void SetOption(P2PSocketOption option, int value) = 0; |
| 50 | 46 |
| 51 // Must be called before the socket is destroyed. | 47 // Must be called before the socket is destroyed. |
| 52 virtual void Close() = 0; | 48 virtual void Close() = 0; |
| 53 | 49 |
| 54 virtual int GetSocketID() const = 0; | 50 virtual int GetSocketID() const = 0; |
| 55 virtual void SetDelegate(P2PSocketClientDelegate* delegate) = 0; | 51 virtual void SetDelegate(P2PSocketClientDelegate* delegate) = 0; |
| 56 | 52 |
| 57 protected: | 53 protected: |
| 58 virtual ~P2PSocketClient() {} | 54 virtual ~P2PSocketClient() {} |
| 59 | 55 |
| 60 private: | 56 private: |
| 61 // Calls destructor. | 57 // Calls destructor. |
| 62 friend class base::RefCountedThreadSafe<P2PSocketClient>; | 58 friend class base::RefCountedThreadSafe<P2PSocketClient>; |
| 63 }; | 59 }; |
| 64 } // namespace content | 60 } // namespace content |
| 65 | 61 |
| 66 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ | 62 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ |
| OLD | NEW |