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

Side by Side Diff: net/udp/udp_client_socket.cc

Issue 1327923002: Migrates QUIC sessions to a new network when old network is (about to be) disconnected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Fixes a few scoped_ptr issues. Created 5 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 #include "net/udp/udp_client_socket.h" 5 #include "net/udp/udp_client_socket.h"
6 6
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.h"
8 #include "net/log/net_log.h" 8 #include "net/log/net_log.h"
9 9
10 namespace net { 10 namespace net {
11 11
12 UDPClientSocket::UDPClientSocket(DatagramSocket::BindType bind_type, 12 UDPClientSocket::UDPClientSocket(DatagramSocket::BindType bind_type,
13 const RandIntCallback& rand_int_cb, 13 const RandIntCallback& rand_int_cb,
14 net::NetLog* net_log, 14 net::NetLog* net_log,
15 const net::NetLog::Source& source) 15 const net::NetLog::Source& source)
16 : socket_(bind_type, rand_int_cb, net_log, source) { 16 : socket_(bind_type, rand_int_cb, net_log, source) {
17 } 17 }
18 18
19 UDPClientSocket::~UDPClientSocket() { 19 UDPClientSocket::~UDPClientSocket() {
20 } 20 }
21 21
22 int UDPClientSocket::BindToNetwork( 22 int UDPClientSocket::BindToNetwork(
23 NetworkChangeNotifier::NetworkHandle network) { 23 NetworkChangeNotifier::NetworkHandle network) {
24 return socket_.BindToNetwork(network); 24 return socket_.BindToNetwork(network);
25 } 25 }
26 26
27 int UDPClientSocket::BindToDefaultNetwork() {
28 NetworkChangeNotifier::NetworkHandle network =
29 NetworkChangeNotifier::GetDefaultNetwork();
30 return BindToNetwork(network);
Ryan Hamilton 2015/11/18 22:23:36 I'm not sure there is much benefit to this method
pauljensen 2015/11/19 15:25:43 Jana's implementation and Ryan's suggestion both s
Jana 2015/11/21 02:21:22 What Paul said. Paul CL will be submitted before m
31 }
32
27 int UDPClientSocket::Connect(const IPEndPoint& address) { 33 int UDPClientSocket::Connect(const IPEndPoint& address) {
28 int rv = socket_.Open(address.GetFamily()); 34 int rv = socket_.Open(address.GetFamily());
29 if (rv != OK) 35 if (rv != OK)
30 return rv; 36 return rv;
31 return socket_.Connect(address); 37 return socket_.Connect(address);
32 } 38 }
33 39
34 int UDPClientSocket::Read(IOBuffer* buf, 40 int UDPClientSocket::Read(IOBuffer* buf,
35 int buf_len, 41 int buf_len,
36 const CompletionCallback& callback) { 42 const CompletionCallback& callback) {
(...skipping 30 matching lines...) Expand all
67 return socket_.NetLog(); 73 return socket_.NetLog();
68 } 74 }
69 75
70 #if defined(OS_WIN) 76 #if defined(OS_WIN)
71 void UDPClientSocket::UseNonBlockingIO() { 77 void UDPClientSocket::UseNonBlockingIO() {
72 socket_.UseNonBlockingIO(); 78 socket_.UseNonBlockingIO();
73 } 79 }
74 #endif 80 #endif
75 81
76 } // namespace net 82 } // namespace net
OLDNEW
« net/udp/datagram_client_socket.h ('K') | « net/udp/udp_client_socket.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698