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

Side by Side Diff: net/http/http_stream_parser.cc

Issue 284913003: Remove DCHECK in HttpStreamParser::ReadResponseHeaders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really remove line Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_stream_parser_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/http/http_stream_parser.h" 5 #include "net/http/http_stream_parser.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 int HttpStreamParser::ReadResponseBody(IOBuffer* buf, int buf_len, 338 int HttpStreamParser::ReadResponseBody(IOBuffer* buf, int buf_len,
339 const CompletionCallback& callback) { 339 const CompletionCallback& callback) {
340 DCHECK(io_state_ == STATE_NONE || io_state_ == STATE_DONE); 340 DCHECK(io_state_ == STATE_NONE || io_state_ == STATE_DONE);
341 DCHECK(callback_.is_null()); 341 DCHECK(callback_.is_null());
342 DCHECK(!callback.is_null()); 342 DCHECK(!callback.is_null());
343 DCHECK_LE(buf_len, kMaxBufSize); 343 DCHECK_LE(buf_len, kMaxBufSize);
344 344
345 if (io_state_ == STATE_DONE) 345 if (io_state_ == STATE_DONE)
346 return OK; 346 return OK;
347 347
348 // Must have response headers with a non-1xx error code.
349 DCHECK_NE(1, response_->headers->response_code() / 100);
350
351 user_read_buf_ = buf; 348 user_read_buf_ = buf;
352 user_read_buf_len_ = buf_len; 349 user_read_buf_len_ = buf_len;
353 io_state_ = STATE_READ_BODY; 350 io_state_ = STATE_READ_BODY;
354 351
355 int result = DoLoop(OK); 352 int result = DoLoop(OK);
356 if (result == ERR_IO_PENDING) 353 if (result == ERR_IO_PENDING)
357 callback_ = callback; 354 callback_ = callback;
358 355
359 return result; 356 return result;
360 } 357 }
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 request_body->IsInMemory() && 1049 request_body->IsInMemory() &&
1053 request_body->size() > 0) { 1050 request_body->size() > 0) {
1054 size_t merged_size = request_headers.size() + request_body->size(); 1051 size_t merged_size = request_headers.size() + request_body->size();
1055 if (merged_size <= kMaxMergedHeaderAndBodySize) 1052 if (merged_size <= kMaxMergedHeaderAndBodySize)
1056 return true; 1053 return true;
1057 } 1054 }
1058 return false; 1055 return false;
1059 } 1056 }
1060 1057
1061 } // namespace net 1058 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_stream_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698