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

Unified Diff: content/browser/renderer_host/p2p/socket_host_tcp.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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/p2p/socket_host_tcp.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.cc b/content/browser/renderer_host/p2p/socket_host_tcp.cc
index 623086d0ba4d33755137e017154bcfe6669921db..252026400e0f2cdd370fd4b719fcf14d7a44390a 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc
@@ -67,14 +67,15 @@ P2PSocketHostTcpBase::~P2PSocketHostTcpBase() {
}
}
-bool P2PSocketHostTcpBase::InitAccepted(const net::IPEndPoint& remote_address,
- net::StreamSocket* socket) {
+bool P2PSocketHostTcpBase::InitAccepted(
+ const net::IPEndPoint& remote_address,
+ std::unique_ptr<net::StreamSocket> socket) {
DCHECK(socket);
DCHECK_EQ(state_, STATE_UNINITIALIZED);
remote_address_.ip_address = remote_address;
// TODO(ronghuawu): Add FakeSSLServerSocket.
- socket_.reset(socket);
+ socket_ = std::move(socket);
state_ = STATE_OPEN;
DoRead();
return state_ != STATE_ERROR;
@@ -110,10 +111,8 @@ bool P2PSocketHostTcpBase::Init(const net::IPEndPoint& local_address,
// The default SSLConfig is good enough for us for now.
const net::SSLConfig ssl_config;
socket_.reset(new jingle_glue::ProxyResolvingClientSocket(
- NULL, // Default socket pool provided by the net::Proxy.
- url_context_,
- ssl_config,
- dest_host_port_pair));
+ nullptr, // Default socket pool provided by the net::Proxy.
+ url_context_, ssl_config, dest_host_port_pair));
int status = socket_->Connect(
base::Bind(&P2PSocketHostTcpBase::OnConnected,
@@ -426,7 +425,7 @@ void P2PSocketHostTcpBase::HandleWriteResult(int result) {
message_sender_->Send(
new P2PMsg_OnSendComplete(id_, P2PSendPacketMetrics()));
if (write_queue_.empty()) {
- write_buffer_ = NULL;
+ write_buffer_ = nullptr;
} else {
write_buffer_ = write_queue_.front();
write_queue_.pop();
@@ -444,11 +443,13 @@ void P2PSocketHostTcpBase::HandleWriteResult(int result) {
}
}
-P2PSocketHost* P2PSocketHostTcpBase::AcceptIncomingTcpConnection(
- const net::IPEndPoint& remote_address, int id) {
+std::unique_ptr<P2PSocketHost>
+P2PSocketHostTcpBase::AcceptIncomingTcpConnection(
+ const net::IPEndPoint& remote_address,
+ int id) {
NOTREACHED();
OnError();
- return NULL;
+ return nullptr;
}
void P2PSocketHostTcpBase::DidCompleteRead(int result) {
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp.h ('k') | content/browser/renderer_host/p2p/socket_host_tcp_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698