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/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // There's at least one |field_name| header. Check if there are any more | 52 // There's at least one |field_name| header. Check if there are any more |
53 // such headers, and if so, return true if they have different values. | 53 // such headers, and if so, return true if they have different values. |
54 std::string field_value2; | 54 std::string field_value2; |
55 while (headers.EnumerateHeader(&it, field_name, &field_value2)) { | 55 while (headers.EnumerateHeader(&it, field_name, &field_value2)) { |
56 if (field_value != field_value2) | 56 if (field_value != field_value2) |
57 return true; | 57 return true; |
58 } | 58 } |
59 return false; | 59 return false; |
60 } | 60 } |
61 | 61 |
62 base::Value* NetLogSendRequestBodyCallback(uint64 length, | 62 base::Value* NetLogSendRequestBodyCallback( |
63 bool is_chunked, | 63 uint64 length, |
64 bool did_merge, | 64 bool is_chunked, |
65 NetLog::LogLevel /* log_level */) { | 65 bool did_merge, |
| 66 NetLogCaptureMode /* capture_mode */) { |
66 base::DictionaryValue* dict = new base::DictionaryValue(); | 67 base::DictionaryValue* dict = new base::DictionaryValue(); |
67 dict->SetInteger("length", static_cast<int>(length)); | 68 dict->SetInteger("length", static_cast<int>(length)); |
68 dict->SetBoolean("is_chunked", is_chunked); | 69 dict->SetBoolean("is_chunked", is_chunked); |
69 dict->SetBoolean("did_merge", did_merge); | 70 dict->SetBoolean("did_merge", did_merge); |
70 return dict; | 71 return dict; |
71 } | 72 } |
72 | 73 |
73 // Returns true if |error_code| is an error for which we give the server a | 74 // Returns true if |error_code| is an error for which we give the server a |
74 // chance to send a body containing error information, if the error was received | 75 // chance to send a body containing error information, if the error was received |
75 // while trying to upload a request body. | 76 // while trying to upload a request body. |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 request_body->IsInMemory() && | 1056 request_body->IsInMemory() && |
1056 request_body->size() > 0) { | 1057 request_body->size() > 0) { |
1057 uint64 merged_size = request_headers.size() + request_body->size(); | 1058 uint64 merged_size = request_headers.size() + request_body->size(); |
1058 if (merged_size <= kMaxMergedHeaderAndBodySize) | 1059 if (merged_size <= kMaxMergedHeaderAndBodySize) |
1059 return true; | 1060 return true; |
1060 } | 1061 } |
1061 return false; | 1062 return false; |
1062 } | 1063 } |
1063 | 1064 |
1064 } // namespace net | 1065 } // namespace net |
OLD | NEW |