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

Side by Side Diff: remoting/jingle_glue/chromium_socket_factory.cc

Issue 24364005: Update webrtc to r4819. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 3 months 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 | Annotate | Revision Log
OLDNEW
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/jingle_glue/chromium_socket_factory.h" 5 #include "remoting/jingle_glue/chromium_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/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "jingle/glue/utils.h" 10 #include "jingle/glue/utils.h"
(...skipping 27 matching lines...) Expand all
38 public: 38 public:
39 UdpPacketSocket(); 39 UdpPacketSocket();
40 virtual ~UdpPacketSocket(); 40 virtual ~UdpPacketSocket();
41 41
42 bool Init(const talk_base::SocketAddress& local_address, 42 bool Init(const talk_base::SocketAddress& local_address,
43 int min_port, int max_port); 43 int min_port, int max_port);
44 44
45 // talk_base::AsyncPacketSocket interface. 45 // talk_base::AsyncPacketSocket interface.
46 virtual talk_base::SocketAddress GetLocalAddress() const OVERRIDE; 46 virtual talk_base::SocketAddress GetLocalAddress() const OVERRIDE;
47 virtual talk_base::SocketAddress GetRemoteAddress() const OVERRIDE; 47 virtual talk_base::SocketAddress GetRemoteAddress() const OVERRIDE;
48 virtual int Send(const void* data, size_t data_size) OVERRIDE; 48 virtual int Send(const void* data, size_t data_size,
49 talk_base::DiffServCodePoint dscp) OVERRIDE;
49 virtual int SendTo(const void* data, size_t data_size, 50 virtual int SendTo(const void* data, size_t data_size,
50 const talk_base::SocketAddress& address) OVERRIDE; 51 const talk_base::SocketAddress& address,
52 talk_base::DiffServCodePoint dscp) OVERRIDE;
51 virtual int Close() OVERRIDE; 53 virtual int Close() OVERRIDE;
52 virtual State GetState() const OVERRIDE; 54 virtual State GetState() const OVERRIDE;
53 virtual int GetOption(talk_base::Socket::Option option, int* value) OVERRIDE; 55 virtual int GetOption(talk_base::Socket::Option option, int* value) OVERRIDE;
54 virtual int SetOption(talk_base::Socket::Option option, int value) OVERRIDE; 56 virtual int SetOption(talk_base::Socket::Option option, int value) OVERRIDE;
55 virtual int GetError() const OVERRIDE; 57 virtual int GetError() const OVERRIDE;
56 virtual void SetError(int error) OVERRIDE; 58 virtual void SetError(int error) OVERRIDE;
57 59
58 private: 60 private:
59 struct PendingPacket { 61 struct PendingPacket {
60 PendingPacket(const void* buffer, 62 PendingPacket(const void* buffer,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 DCHECK_EQ(state_, STATE_BOUND); 154 DCHECK_EQ(state_, STATE_BOUND);
153 return local_address_; 155 return local_address_;
154 } 156 }
155 157
156 talk_base::SocketAddress UdpPacketSocket::GetRemoteAddress() const { 158 talk_base::SocketAddress UdpPacketSocket::GetRemoteAddress() const {
157 // UDP sockets are not connected - this method should never be called. 159 // UDP sockets are not connected - this method should never be called.
158 NOTREACHED(); 160 NOTREACHED();
159 return talk_base::SocketAddress(); 161 return talk_base::SocketAddress();
160 } 162 }
161 163
162 int UdpPacketSocket::Send(const void* data, size_t data_size) { 164 int UdpPacketSocket::Send(const void* data, size_t data_size,
165 talk_base::DiffServCodePoint dscp) {
163 // UDP sockets are not connected - this method should never be called. 166 // UDP sockets are not connected - this method should never be called.
164 NOTREACHED(); 167 NOTREACHED();
165 return EWOULDBLOCK; 168 return EWOULDBLOCK;
166 } 169 }
167 170
168 int UdpPacketSocket::SendTo(const void* data, size_t data_size, 171 int UdpPacketSocket::SendTo(const void* data, size_t data_size,
169 const talk_base::SocketAddress& address) { 172 const talk_base::SocketAddress& address,
173 talk_base::DiffServCodePoint /*dscp*/) {
Sergey Ulanov 2013/09/23 22:32:36 ditto
Mallinath (Gone from Chromium) 2013/09/23 22:38:14 Done.
170 if (state_ != STATE_BOUND) { 174 if (state_ != STATE_BOUND) {
171 NOTREACHED(); 175 NOTREACHED();
172 return EINVAL; 176 return EINVAL;
173 } 177 }
174 178
175 if (error_ != 0) { 179 if (error_ != 0) {
176 return error_; 180 return error_;
177 } 181 }
178 182
179 net::IPEndPoint endpoint; 183 net::IPEndPoint endpoint;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 234 }
231 235
232 case talk_base::Socket::OPT_NODELAY: 236 case talk_base::Socket::OPT_NODELAY:
233 // OPT_NODELAY is only for TCP sockets. 237 // OPT_NODELAY is only for TCP sockets.
234 NOTREACHED(); 238 NOTREACHED();
235 return -1; 239 return -1;
236 240
237 case talk_base::Socket::OPT_IPV6_V6ONLY: 241 case talk_base::Socket::OPT_IPV6_V6ONLY:
238 NOTIMPLEMENTED(); 242 NOTIMPLEMENTED();
239 return -1; 243 return -1;
244
245 case talk_base::Socket::OPT_DSCP:
246 NOTIMPLEMENTED();
247 return -1;
240 } 248 }
241 249
242 NOTREACHED(); 250 NOTREACHED();
243 return -1; 251 return -1;
244 } 252 }
245 253
246 int UdpPacketSocket::GetError() const { 254 int UdpPacketSocket::GetError() const {
247 return error_; 255 return error_;
248 } 256 }
249 257
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 const talk_base::SocketAddress& remote_address, 365 const talk_base::SocketAddress& remote_address,
358 const talk_base::ProxyInfo& proxy_info, 366 const talk_base::ProxyInfo& proxy_info,
359 const std::string& user_agent, 367 const std::string& user_agent,
360 int opts) { 368 int opts) {
361 // We don't use TCP sockets for remoting connections. 369 // We don't use TCP sockets for remoting connections.
362 NOTREACHED(); 370 NOTREACHED();
363 return NULL; 371 return NULL;
364 } 372 }
365 373
366 } // namespace remoting 374 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698