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

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

Issue 2228403003: content: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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) 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_tcp_server.h" 5 #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" 10 #include "content/browser/renderer_host/p2p/socket_host_tcp.h"
(...skipping 12 matching lines...) Expand all
23 int socket_id, 23 int socket_id,
24 P2PSocketType client_type) 24 P2PSocketType client_type)
25 : P2PSocketHost(message_sender, socket_id, P2PSocketHost::TCP), 25 : P2PSocketHost(message_sender, socket_id, P2PSocketHost::TCP),
26 client_type_(client_type), 26 client_type_(client_type),
27 socket_(new net::TCPServerSocket(NULL, net::NetLog::Source())), 27 socket_(new net::TCPServerSocket(NULL, net::NetLog::Source())),
28 accept_callback_(base::Bind(&P2PSocketHostTcpServer::OnAccepted, 28 accept_callback_(base::Bind(&P2PSocketHostTcpServer::OnAccepted,
29 base::Unretained(this))) { 29 base::Unretained(this))) {
30 } 30 }
31 31
32 P2PSocketHostTcpServer::~P2PSocketHostTcpServer() { 32 P2PSocketHostTcpServer::~P2PSocketHostTcpServer() {
33 STLDeleteContainerPairSecondPointers(accepted_sockets_.begin(), 33 base::STLDeleteContainerPairSecondPointers(accepted_sockets_.begin(),
34 accepted_sockets_.end()); 34 accepted_sockets_.end());
35 35
36 if (state_ == STATE_OPEN) { 36 if (state_ == STATE_OPEN) {
37 DCHECK(socket_.get()); 37 DCHECK(socket_.get());
38 socket_.reset(); 38 socket_.reset();
39 } 39 }
40 } 40 }
41 41
42 // TODO(guidou): Add support for port range. 42 // TODO(guidou): Add support for port range.
43 bool P2PSocketHostTcpServer::Init(const net::IPEndPoint& local_address, 43 bool P2PSocketHostTcpServer::Init(const net::IPEndPoint& local_address,
44 uint16_t min_port, 44 uint16_t min_port,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return result.release(); 148 return result.release();
149 } 149 }
150 150
151 bool P2PSocketHostTcpServer::SetOption(P2PSocketOption option, 151 bool P2PSocketHostTcpServer::SetOption(P2PSocketOption option,
152 int value) { 152 int value) {
153 // Currently we don't have use case tcp server sockets are used for p2p. 153 // Currently we don't have use case tcp server sockets are used for p2p.
154 return false; 154 return false;
155 } 155 }
156 156
157 } // namespace content 157 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/p2p/socket_dispatcher_host.cc ('k') | content/browser/renderer_host/p2p/socket_host_udp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698