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

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: 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
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
348 // Must have response headers with a non-1xx error code.
349 DCHECK_NE(1, response_->headers->response_code() / 100); 347 DCHECK_NE(1, response_->headers->response_code() / 100);
willchan no longer on Chromium 2014/05/15 08:49:02 I'm confused, don't you need to delete this DCHECK
mmenke 2014/05/15 12:20:07 Erm...oops. Added it back for local testing of th
350 348
351 user_read_buf_ = buf; 349 user_read_buf_ = buf;
352 user_read_buf_len_ = buf_len; 350 user_read_buf_len_ = buf_len;
353 io_state_ = STATE_READ_BODY; 351 io_state_ = STATE_READ_BODY;
354 352
355 int result = DoLoop(OK); 353 int result = DoLoop(OK);
356 if (result == ERR_IO_PENDING) 354 if (result == ERR_IO_PENDING)
357 callback_ = callback; 355 callback_ = callback;
358 356
359 return result; 357 return result;
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 request_body->IsInMemory() && 1050 request_body->IsInMemory() &&
1053 request_body->size() > 0) { 1051 request_body->size() > 0) {
1054 size_t merged_size = request_headers.size() + request_body->size(); 1052 size_t merged_size = request_headers.size() + request_body->size();
1055 if (merged_size <= kMaxMergedHeaderAndBodySize) 1053 if (merged_size <= kMaxMergedHeaderAndBodySize)
1056 return true; 1054 return true;
1057 } 1055 }
1058 return false; 1056 return false;
1059 } 1057 }
1060 1058
1061 } // namespace net 1059 } // 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