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

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

Issue 2235973002: Add a SetDoNotFragment() method to DatagramSocket, and call this for (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: progress 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
« no previous file with comments | « no previous file | net/dns/address_sorter_posix_unittest.cc » ('j') | net/udp/datagram_socket.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/renderer_host/p2p/socket_host_udp.h" 5 #include "content/browser/renderer_host/p2p/socket_host_udp.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <deque> 8 #include <deque>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 scoped_refptr<net::IOBuffer> buffer(buf); 106 scoped_refptr<net::IOBuffer> buffer(buf);
107 std::vector<char> data_vector(buffer->data(), buffer->data() + buf_len); 107 std::vector<char> data_vector(buffer->data(), buffer->data() + buf_len);
108 sent_packets_->push_back(UDPPacket(address, data_vector)); 108 sent_packets_->push_back(UDPPacket(address, data_vector));
109 return buf_len; 109 return buf_len;
110 } 110 }
111 111
112 int SetReceiveBufferSize(int32_t size) override { return net::OK; } 112 int SetReceiveBufferSize(int32_t size) override { return net::OK; }
113 113
114 int SetSendBufferSize(int32_t size) override { return net::OK; } 114 int SetSendBufferSize(int32_t size) override { return net::OK; }
115 115
116 int SetDoNotFragment() override { return net::OK; }
117
116 void ReceivePacket(const net::IPEndPoint& address, std::vector<char> data) { 118 void ReceivePacket(const net::IPEndPoint& address, std::vector<char> data) {
117 if (!recv_callback_.is_null()) { 119 if (!recv_callback_.is_null()) {
118 int size = std::min(recv_size_, static_cast<int>(data.size())); 120 int size = std::min(recv_size_, static_cast<int>(data.size()));
119 memcpy(recv_buffer_->data(), &*data.begin(), size); 121 memcpy(recv_buffer_->data(), &*data.begin(), size);
120 *recv_address_ = address; 122 *recv_address_ = address;
121 net::CompletionCallback cb = recv_callback_; 123 net::CompletionCallback cb = recv_callback_;
122 recv_callback_.Reset(); 124 recv_callback_.Reset();
123 recv_buffer_ = NULL; 125 recv_buffer_ = NULL;
124 cb.Run(size); 126 cb.Run(size);
125 } else { 127 } else {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 std::unique_ptr<P2PSocketHostUdp> socket_host( 500 std::unique_ptr<P2PSocketHostUdp> socket_host(
499 new P2PSocketHostUdp(&sender, 0, &throttler, fake_socket_factory)); 501 new P2PSocketHostUdp(&sender, 0, &throttler, fake_socket_factory));
500 net::IPEndPoint local_address = 502 net::IPEndPoint local_address =
501 ParseAddress(kTestLocalIpAddress, invalid_port); 503 ParseAddress(kTestLocalIpAddress, invalid_port);
502 bool rv = socket_host->Init(local_address, min_port, max_port, 504 bool rv = socket_host->Init(local_address, min_port, max_port,
503 P2PHostAndIPEndPoint()); 505 P2PHostAndIPEndPoint());
504 EXPECT_FALSE(rv); 506 EXPECT_FALSE(rv);
505 } 507 }
506 508
507 } // namespace content 509 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | net/dns/address_sorter_posix_unittest.cc » ('j') | net/udp/datagram_socket.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698