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

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

Issue 594393002: Add net::HttpServer::Delegate::OnConnect() function and set ChromeDriver buffer sizes to 100 MB (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/server/http_server.h ('k') | net/server/http_server_unittest.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 "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 int HttpServer::HandleAcceptResult(int rv) { 147 int HttpServer::HandleAcceptResult(int rv) {
148 if (rv < 0) { 148 if (rv < 0) {
149 LOG(ERROR) << "Accept error: rv=" << rv; 149 LOG(ERROR) << "Accept error: rv=" << rv;
150 return rv; 150 return rv;
151 } 151 }
152 152
153 HttpConnection* connection = 153 HttpConnection* connection =
154 new HttpConnection(++last_id_, accepted_socket_.Pass()); 154 new HttpConnection(++last_id_, accepted_socket_.Pass());
155 id_to_connection_[connection->id()] = connection; 155 id_to_connection_[connection->id()] = connection;
156 delegate_->OnConnect(connection->id());
mmenke 2014/09/23 22:29:31 Should allow the embedder to close the connection
samuong 2014/09/24 00:07:13 Done.
156 DoReadLoop(connection); 157 DoReadLoop(connection);
157 return OK; 158 return OK;
158 } 159 }
159 160
160 void HttpServer::DoReadLoop(HttpConnection* connection) { 161 void HttpServer::DoReadLoop(HttpConnection* connection) {
161 int rv; 162 int rv;
162 do { 163 do {
163 HttpConnection::ReadIOBuffer* read_buf = connection->read_buf(); 164 HttpConnection::ReadIOBuffer* read_buf = connection->read_buf();
164 // Increases read buffer size if necessary. 165 // Increases read buffer size if necessary.
165 if (read_buf->RemainingCapacity() == 0 && !read_buf->IncreaseCapacity()) { 166 if (read_buf->RemainingCapacity() == 0 && !read_buf->IncreaseCapacity()) {
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 454
454 // This is called after any delegate callbacks are called to check if Close() 455 // This is called after any delegate callbacks are called to check if Close()
455 // has been called during callback processing. Using the pointer of connection, 456 // has been called during callback processing. Using the pointer of connection,
456 // |connection| is safe here because Close() deletes the connection in next run 457 // |connection| is safe here because Close() deletes the connection in next run
457 // loop. 458 // loop.
458 bool HttpServer::HasClosedConnection(HttpConnection* connection) { 459 bool HttpServer::HasClosedConnection(HttpConnection* connection) {
459 return FindConnection(connection->id()) != connection; 460 return FindConnection(connection->id()) != connection;
460 } 461 }
461 462
462 } // namespace net 463 } // namespace net
OLDNEW
« no previous file with comments | « net/server/http_server.h ('k') | net/server/http_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698