Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1127)

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_tcp.h

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 14 matching lines...) Expand all
25 } // namespace net 25 } // namespace net
26 26
27 namespace content { 27 namespace content {
28 28
29 class CONTENT_EXPORT P2PSocketHostTcpBase : public P2PSocketHost { 29 class CONTENT_EXPORT P2PSocketHostTcpBase : public P2PSocketHost {
30 public: 30 public:
31 P2PSocketHostTcpBase(IPC::Sender* message_sender, 31 P2PSocketHostTcpBase(IPC::Sender* message_sender,
32 int socket_id, 32 int socket_id,
33 P2PSocketType type, 33 P2PSocketType type,
34 net::URLRequestContextGetter* url_context); 34 net::URLRequestContextGetter* url_context);
35 virtual ~P2PSocketHostTcpBase(); 35 ~P2PSocketHostTcpBase() override;
36 36
37 bool InitAccepted(const net::IPEndPoint& remote_address, 37 bool InitAccepted(const net::IPEndPoint& remote_address,
38 net::StreamSocket* socket); 38 net::StreamSocket* socket);
39 39
40 // P2PSocketHost overrides. 40 // P2PSocketHost overrides.
41 virtual bool Init(const net::IPEndPoint& local_address, 41 bool Init(const net::IPEndPoint& local_address,
42 const P2PHostAndIPEndPoint& remote_address) override; 42 const P2PHostAndIPEndPoint& remote_address) override;
43 virtual void Send(const net::IPEndPoint& to, 43 void Send(const net::IPEndPoint& to,
44 const std::vector<char>& data, 44 const std::vector<char>& data,
45 const rtc::PacketOptions& options, 45 const rtc::PacketOptions& options,
46 uint64 packet_id) override; 46 uint64 packet_id) override;
47 virtual P2PSocketHost* AcceptIncomingTcpConnection( 47 P2PSocketHost* AcceptIncomingTcpConnection(
48 const net::IPEndPoint& remote_address, int id) override; 48 const net::IPEndPoint& remote_address,
49 virtual bool SetOption(P2PSocketOption option, int value) override; 49 int id) override;
50 bool SetOption(P2PSocketOption option, int value) override;
50 51
51 protected: 52 protected:
52 // Derived classes will provide the implementation. 53 // Derived classes will provide the implementation.
53 virtual int ProcessInput(char* input, int input_len) = 0; 54 virtual int ProcessInput(char* input, int input_len) = 0;
54 virtual void DoSend(const net::IPEndPoint& to, 55 virtual void DoSend(const net::IPEndPoint& to,
55 const std::vector<char>& data, 56 const std::vector<char>& data,
56 const rtc::PacketOptions& options) = 0; 57 const rtc::PacketOptions& options) = 0;
57 58
58 void WriteOrQueue(scoped_refptr<net::DrainableIOBuffer>& buffer); 59 void WriteOrQueue(scoped_refptr<net::DrainableIOBuffer>& buffer);
59 void OnPacket(const std::vector<char>& data); 60 void OnPacket(const std::vector<char>& data);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 98
98 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostTcpBase); 99 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostTcpBase);
99 }; 100 };
100 101
101 class CONTENT_EXPORT P2PSocketHostTcp : public P2PSocketHostTcpBase { 102 class CONTENT_EXPORT P2PSocketHostTcp : public P2PSocketHostTcpBase {
102 public: 103 public:
103 P2PSocketHostTcp(IPC::Sender* message_sender, 104 P2PSocketHostTcp(IPC::Sender* message_sender,
104 int socket_id, 105 int socket_id,
105 P2PSocketType type, 106 P2PSocketType type,
106 net::URLRequestContextGetter* url_context); 107 net::URLRequestContextGetter* url_context);
107 virtual ~P2PSocketHostTcp(); 108 ~P2PSocketHostTcp() override;
108 109
109 protected: 110 protected:
110 virtual int ProcessInput(char* input, int input_len) override; 111 int ProcessInput(char* input, int input_len) override;
111 virtual void DoSend(const net::IPEndPoint& to, 112 void DoSend(const net::IPEndPoint& to,
112 const std::vector<char>& data, 113 const std::vector<char>& data,
113 const rtc::PacketOptions& options) override; 114 const rtc::PacketOptions& options) override;
115
114 private: 116 private:
115 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostTcp); 117 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostTcp);
116 }; 118 };
117 119
118 // P2PSocketHostStunTcp class provides the framing of STUN messages when used 120 // P2PSocketHostStunTcp class provides the framing of STUN messages when used
119 // with TURN. These messages will not have length at front of the packet and 121 // with TURN. These messages will not have length at front of the packet and
120 // are padded to multiple of 4 bytes. 122 // are padded to multiple of 4 bytes.
121 // Formatting of messages is defined in RFC5766. 123 // Formatting of messages is defined in RFC5766.
122 class CONTENT_EXPORT P2PSocketHostStunTcp : public P2PSocketHostTcpBase { 124 class CONTENT_EXPORT P2PSocketHostStunTcp : public P2PSocketHostTcpBase {
123 public: 125 public:
124 P2PSocketHostStunTcp(IPC::Sender* message_sender, 126 P2PSocketHostStunTcp(IPC::Sender* message_sender,
125 int socket_id, 127 int socket_id,
126 P2PSocketType type, 128 P2PSocketType type,
127 net::URLRequestContextGetter* url_context); 129 net::URLRequestContextGetter* url_context);
128 130
129 virtual ~P2PSocketHostStunTcp(); 131 ~P2PSocketHostStunTcp() override;
130 132
131 protected: 133 protected:
132 virtual int ProcessInput(char* input, int input_len) override; 134 int ProcessInput(char* input, int input_len) override;
133 virtual void DoSend(const net::IPEndPoint& to, 135 void DoSend(const net::IPEndPoint& to,
134 const std::vector<char>& data, 136 const std::vector<char>& data,
135 const rtc::PacketOptions& options) override; 137 const rtc::PacketOptions& options) override;
138
136 private: 139 private:
137 int GetExpectedPacketSize(const char* data, int len, int* pad_bytes); 140 int GetExpectedPacketSize(const char* data, int len, int* pad_bytes);
138 141
139 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostStunTcp); 142 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostStunTcp);
140 }; 143 };
141 144
142 145
143 } // namespace content 146 } // namespace content
144 147
145 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ 148 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/p2p/socket_dispatcher_host.h ('k') | content/browser/renderer_host/p2p/socket_host_tcp_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698