OLD | NEW |
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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 if (result < 0) | 372 if (result < 0) |
373 can_do_more = false; | 373 can_do_more = false; |
374 else | 374 else |
375 result = DoSendNonChunkedBody(result); | 375 result = DoSendNonChunkedBody(result); |
376 break; | 376 break; |
377 case STATE_REQUEST_SENT: | 377 case STATE_REQUEST_SENT: |
378 DCHECK(result != ERR_IO_PENDING); | 378 DCHECK(result != ERR_IO_PENDING); |
379 can_do_more = false; | 379 can_do_more = false; |
380 break; | 380 break; |
381 case STATE_READ_HEADERS: | 381 case STATE_READ_HEADERS: |
382 net_log_.BeginEvent(NetLog::TYPE_HTTP_STREAM_PARSER_READ_HEADERS, NULL); | 382 net_log_.BeginEvent(NetLog::TYPE_HTTP_STREAM_PARSER_READ_HEADERS); |
383 result = DoReadHeaders(); | 383 result = DoReadHeaders(); |
384 break; | 384 break; |
385 case STATE_READ_HEADERS_COMPLETE: | 385 case STATE_READ_HEADERS_COMPLETE: |
386 result = DoReadHeadersComplete(result); | 386 result = DoReadHeadersComplete(result); |
387 net_log_.EndEventWithNetErrorCode( | 387 net_log_.EndEventWithNetErrorCode( |
388 NetLog::TYPE_HTTP_STREAM_PARSER_READ_HEADERS, result); | 388 NetLog::TYPE_HTTP_STREAM_PARSER_READ_HEADERS, result); |
389 break; | 389 break; |
390 case STATE_BODY_PENDING: | 390 case STATE_BODY_PENDING: |
391 DCHECK(result != ERR_IO_PENDING); | 391 DCHECK(result != ERR_IO_PENDING); |
392 can_do_more = false; | 392 can_do_more = false; |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 request_body->IsInMemory() && | 952 request_body->IsInMemory() && |
953 request_body->size() > 0) { | 953 request_body->size() > 0) { |
954 size_t merged_size = request_headers.size() + request_body->size(); | 954 size_t merged_size = request_headers.size() + request_body->size(); |
955 if (merged_size <= kMaxMergedHeaderAndBodySize) | 955 if (merged_size <= kMaxMergedHeaderAndBodySize) |
956 return true; | 956 return true; |
957 } | 957 } |
958 return false; | 958 return false; |
959 } | 959 } |
960 | 960 |
961 } // namespace net | 961 } // namespace net |
OLD | NEW |