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

Side by Side Diff: net/socket/socket_test_util.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: Naming fixes. Created 5 years 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) 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 "net/socket/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 int DeterministicMockUDPClientSocket::BindToNetwork( 1353 int DeterministicMockUDPClientSocket::BindToNetwork(
1354 NetworkChangeNotifier::NetworkHandle network) { 1354 NetworkChangeNotifier::NetworkHandle network) {
1355 return ERR_NOT_IMPLEMENTED; 1355 return ERR_NOT_IMPLEMENTED;
1356 } 1356 }
1357 1357
1358 int DeterministicMockUDPClientSocket::BindToDefaultNetwork() { 1358 int DeterministicMockUDPClientSocket::BindToDefaultNetwork() {
1359 return ERR_NOT_IMPLEMENTED; 1359 return ERR_NOT_IMPLEMENTED;
1360 } 1360 }
1361 1361
1362 NetworkChangeNotifier::NetworkHandle 1362 NetworkChangeNotifier::NetworkHandle
1363 DeterministicMockUDPClientSocket::GetBoundNetwork() { 1363 DeterministicMockUDPClientSocket::GetBoundNetwork() const {
1364 return NetworkChangeNotifier::kInvalidNetworkHandle; 1364 return NetworkChangeNotifier::kInvalidNetworkHandle;
1365 } 1365 }
1366 1366
1367 int DeterministicMockUDPClientSocket::Connect(const IPEndPoint& address) { 1367 int DeterministicMockUDPClientSocket::Connect(const IPEndPoint& address) {
1368 if (connected_) 1368 if (connected_)
1369 return OK; 1369 return OK;
1370 connected_ = true; 1370 connected_ = true;
1371 peer_address_ = address; 1371 peer_address_ = address;
1372 return helper_.data()->connect_data().result; 1372 return helper_.data()->connect_data().result;
1373 }; 1373 };
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 1739
1740 int MockUDPClientSocket::BindToNetwork( 1740 int MockUDPClientSocket::BindToNetwork(
1741 NetworkChangeNotifier::NetworkHandle network) { 1741 NetworkChangeNotifier::NetworkHandle network) {
1742 return ERR_NOT_IMPLEMENTED; 1742 return ERR_NOT_IMPLEMENTED;
1743 } 1743 }
1744 1744
1745 int MockUDPClientSocket::BindToDefaultNetwork() { 1745 int MockUDPClientSocket::BindToDefaultNetwork() {
1746 return ERR_NOT_IMPLEMENTED; 1746 return ERR_NOT_IMPLEMENTED;
1747 } 1747 }
1748 1748
1749 NetworkChangeNotifier::NetworkHandle MockUDPClientSocket::GetBoundNetwork() { 1749 NetworkChangeNotifier::NetworkHandle MockUDPClientSocket::GetBoundNetwork()
1750 const {
1750 return NetworkChangeNotifier::kInvalidNetworkHandle; 1751 return NetworkChangeNotifier::kInvalidNetworkHandle;
1751 } 1752 }
1752 1753
1753 int MockUDPClientSocket::Connect(const IPEndPoint& address) { 1754 int MockUDPClientSocket::Connect(const IPEndPoint& address) {
1754 if (!data_) 1755 if (!data_)
1755 return ERR_UNEXPECTED; 1756 return ERR_UNEXPECTED;
1756 connected_ = true; 1757 connected_ = true;
1757 peer_addr_ = address; 1758 peer_addr_ = address;
1758 return data_->connect_data().result; 1759 return data_->connect_data().result;
1759 } 1760 }
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2164 } 2165 }
2165 2166
2166 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { 2167 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) {
2167 int64_t total = 0; 2168 int64_t total = 0;
2168 for (const MockWrite* write = writes; write != writes + writes_size; ++write) 2169 for (const MockWrite* write = writes; write != writes + writes_size; ++write)
2169 total += write->data_len; 2170 total += write->data_len;
2170 return total; 2171 return total;
2171 } 2172 }
2172 2173
2173 } // namespace net 2174 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698