| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // There's at least one |field_name| header. Check if there are any more | 67 // There's at least one |field_name| header. Check if there are any more |
| 68 // such headers, and if so, return true if they have different values. | 68 // such headers, and if so, return true if they have different values. |
| 69 std::string field_value2; | 69 std::string field_value2; |
| 70 while (headers.EnumerateHeader(&it, field_name, &field_value2)) { | 70 while (headers.EnumerateHeader(&it, field_name, &field_value2)) { |
| 71 if (field_value != field_value2) | 71 if (field_value != field_value2) |
| 72 return true; | 72 return true; |
| 73 } | 73 } |
| 74 return false; | 74 return false; |
| 75 } | 75 } |
| 76 | 76 |
| 77 base::Value* NetLogSendRequestBodyCallback(uint64 length, | 77 base::Value* NetLogSendRequestBodyCallback( |
| 78 bool is_chunked, | 78 uint64 length, |
| 79 bool did_merge, | 79 bool is_chunked, |
| 80 NetLog::LogLevel /* log_level */) { | 80 bool did_merge, |
| 81 NetLogCaptureMode /* capture_mode */) { |
| 81 base::DictionaryValue* dict = new base::DictionaryValue(); | 82 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 82 dict->SetInteger("length", static_cast<int>(length)); | 83 dict->SetInteger("length", static_cast<int>(length)); |
| 83 dict->SetBoolean("is_chunked", is_chunked); | 84 dict->SetBoolean("is_chunked", is_chunked); |
| 84 dict->SetBoolean("did_merge", did_merge); | 85 dict->SetBoolean("did_merge", did_merge); |
| 85 return dict; | 86 return dict; |
| 86 } | 87 } |
| 87 | 88 |
| 88 // Returns true if |error_code| is an error for which we give the server a | 89 // Returns true if |error_code| is an error for which we give the server a |
| 89 // chance to send a body containing error information, if the error was received | 90 // chance to send a body containing error information, if the error was received |
| 90 // while trying to upload a request body. | 91 // while trying to upload a request body. |
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 request_body->IsInMemory() && | 1130 request_body->IsInMemory() && |
| 1130 request_body->size() > 0) { | 1131 request_body->size() > 0) { |
| 1131 uint64 merged_size = request_headers.size() + request_body->size(); | 1132 uint64 merged_size = request_headers.size() + request_body->size(); |
| 1132 if (merged_size <= kMaxMergedHeaderAndBodySize) | 1133 if (merged_size <= kMaxMergedHeaderAndBodySize) |
| 1133 return true; | 1134 return true; |
| 1134 } | 1135 } |
| 1135 return false; | 1136 return false; |
| 1136 } | 1137 } |
| 1137 | 1138 |
| 1138 } // namespace net | 1139 } // namespace net |
| OLD | NEW |