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

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_test_utils.cc

Issue 2249473002: Remove use of stl_util's STLDeleteContainerPairSecondPointers from content/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/renderer_host/p2p/socket_host_test_utils.h" 5 #include "content/browser/renderer_host/p2p/socket_host_test_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/sys_byteorder.h" 10 #include "base/sys_byteorder.h"
(...skipping 24 matching lines...) Expand all
35 void FakeSocket::AppendInputData(const char* data, int data_size) { 35 void FakeSocket::AppendInputData(const char* data, int data_size) {
36 input_data_.insert(input_data_.end(), data, data + data_size); 36 input_data_.insert(input_data_.end(), data, data + data_size);
37 // Complete pending read if any. 37 // Complete pending read if any.
38 if (read_pending_) { 38 if (read_pending_) {
39 read_pending_ = false; 39 read_pending_ = false;
40 int result = std::min(read_buffer_size_, 40 int result = std::min(read_buffer_size_,
41 static_cast<int>(input_data_.size() - input_pos_)); 41 static_cast<int>(input_data_.size() - input_pos_));
42 CHECK(result > 0); 42 CHECK(result > 0);
43 memcpy(read_buffer_->data(), &input_data_[0] + input_pos_, result); 43 memcpy(read_buffer_->data(), &input_data_[0] + input_pos_, result);
44 input_pos_ += result; 44 input_pos_ += result;
45 read_buffer_ = NULL; 45 read_buffer_ = nullptr;
46 net::CompletionCallback cb = read_callback_; 46 net::CompletionCallback cb = read_callback_;
47 read_callback_.Reset(); 47 read_callback_.Reset();
48 cb.Run(result); 48 cb.Run(result);
49 } 49 }
50 } 50 }
51 51
52 void FakeSocket::SetPeerAddress(const net::IPEndPoint& peer_address) { 52 void FakeSocket::SetPeerAddress(const net::IPEndPoint& peer_address) {
53 peer_address_ = peer_address; 53 peer_address_ = peer_address;
54 } 54 }
55 55
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 void CreateStunError(std::vector<char>* packet) { 212 void CreateStunError(std::vector<char>* packet) {
213 CreateStunPacket(packet, kStunBindingError); 213 CreateStunPacket(packet, kStunBindingError);
214 } 214 }
215 215
216 net::IPEndPoint ParseAddress(const std::string& ip_str, uint16_t port) { 216 net::IPEndPoint ParseAddress(const std::string& ip_str, uint16_t port) {
217 net::IPAddress ip; 217 net::IPAddress ip;
218 EXPECT_TRUE(ip.AssignFromIPLiteral(ip_str)); 218 EXPECT_TRUE(ip.AssignFromIPLiteral(ip_str));
219 return net::IPEndPoint(ip, port); 219 return net::IPEndPoint(ip, port);
220 } 220 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc ('k') | content/browser/renderer_host/p2p/socket_host_udp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698