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

Side by Side Diff: net/server/http_server.cc

Issue 2229393003: net: 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
« no previous file with comments | « net/quic/test_tools/simple_quic_framer.cc ('k') | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »
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 "net/server/http_server.h" 5 #include "net/server/http_server.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 27 matching lines...) Expand all
38 weak_ptr_factory_(this) { 38 weak_ptr_factory_(this) {
39 DCHECK(server_socket_); 39 DCHECK(server_socket_);
40 // Start accepting connections in next run loop in case when delegate is not 40 // Start accepting connections in next run loop in case when delegate is not
41 // ready to get callbacks. 41 // ready to get callbacks.
42 base::ThreadTaskRunnerHandle::Get()->PostTask( 42 base::ThreadTaskRunnerHandle::Get()->PostTask(
43 FROM_HERE, 43 FROM_HERE,
44 base::Bind(&HttpServer::DoAcceptLoop, weak_ptr_factory_.GetWeakPtr())); 44 base::Bind(&HttpServer::DoAcceptLoop, weak_ptr_factory_.GetWeakPtr()));
45 } 45 }
46 46
47 HttpServer::~HttpServer() { 47 HttpServer::~HttpServer() {
48 STLDeleteContainerPairSecondPointers( 48 base::STLDeleteContainerPairSecondPointers(id_to_connection_.begin(),
49 id_to_connection_.begin(), id_to_connection_.end()); 49 id_to_connection_.end());
50 } 50 }
51 51
52 void HttpServer::AcceptWebSocket( 52 void HttpServer::AcceptWebSocket(
53 int connection_id, 53 int connection_id,
54 const HttpServerRequestInfo& request) { 54 const HttpServerRequestInfo& request) {
55 HttpConnection* connection = FindConnection(connection_id); 55 HttpConnection* connection = FindConnection(connection_id);
56 if (connection == NULL) 56 if (connection == NULL)
57 return; 57 return;
58 DCHECK(connection->web_socket()); 58 DCHECK(connection->web_socket());
59 connection->web_socket()->Accept(request); 59 connection->web_socket()->Accept(request);
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 462
463 // This is called after any delegate callbacks are called to check if Close() 463 // This is called after any delegate callbacks are called to check if Close()
464 // has been called during callback processing. Using the pointer of connection, 464 // has been called during callback processing. Using the pointer of connection,
465 // |connection| is safe here because Close() deletes the connection in next run 465 // |connection| is safe here because Close() deletes the connection in next run
466 // loop. 466 // loop.
467 bool HttpServer::HasClosedConnection(HttpConnection* connection) { 467 bool HttpServer::HasClosedConnection(HttpConnection* connection) {
468 return FindConnection(connection->id()) != connection; 468 return FindConnection(connection->id()) != connection;
469 } 469 }
470 470
471 } // namespace net 471 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/simple_quic_framer.cc ('k') | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698