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 <utility> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 11 #include "base/logging.h" |
10 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
11 #include "base/profiler/scoped_tracker.h" | 13 #include "base/profiler/scoped_tracker.h" |
12 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
13 #include "base/values.h" | 15 #include "base/values.h" |
14 #include "net/base/io_buffer.h" | 16 #include "net/base/io_buffer.h" |
15 #include "net/base/ip_endpoint.h" | 17 #include "net/base/ip_endpoint.h" |
16 #include "net/base/upload_data_stream.h" | 18 #include "net/base/upload_data_stream.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 82 |
81 scoped_ptr<base::Value> NetLogSendRequestBodyCallback( | 83 scoped_ptr<base::Value> NetLogSendRequestBodyCallback( |
82 uint64_t length, | 84 uint64_t length, |
83 bool is_chunked, | 85 bool is_chunked, |
84 bool did_merge, | 86 bool did_merge, |
85 NetLogCaptureMode /* capture_mode */) { | 87 NetLogCaptureMode /* capture_mode */) { |
86 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 88 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
87 dict->SetInteger("length", static_cast<int>(length)); | 89 dict->SetInteger("length", static_cast<int>(length)); |
88 dict->SetBoolean("is_chunked", is_chunked); | 90 dict->SetBoolean("is_chunked", is_chunked); |
89 dict->SetBoolean("did_merge", did_merge); | 91 dict->SetBoolean("did_merge", did_merge); |
90 return dict.Pass(); | 92 return std::move(dict); |
91 } | 93 } |
92 | 94 |
93 // Returns true if |error_code| is an error for which we give the server a | 95 // Returns true if |error_code| is an error for which we give the server a |
94 // chance to send a body containing error information, if the error was received | 96 // chance to send a body containing error information, if the error was received |
95 // while trying to upload a request body. | 97 // while trying to upload a request body. |
96 bool ShouldTryReadingOnUploadError(int error_code) { | 98 bool ShouldTryReadingOnUploadError(int error_code) { |
97 return (error_code == ERR_CONNECTION_RESET); | 99 return (error_code == ERR_CONNECTION_RESET); |
98 } | 100 } |
99 | 101 |
100 } // namespace | 102 } // namespace |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 } | 1140 } |
1139 | 1141 |
1140 void HttpStreamParser::ValidateStatusLine(const std::string& status_line) { | 1142 void HttpStreamParser::ValidateStatusLine(const std::string& status_line) { |
1141 HttpStatusLineValidator::StatusLineStatus status = | 1143 HttpStatusLineValidator::StatusLineStatus status = |
1142 HttpStatusLineValidator::ValidateStatusLine(status_line); | 1144 HttpStatusLineValidator::ValidateStatusLine(status_line); |
1143 UMA_HISTOGRAM_ENUMERATION("Net.HttpStatusLineStatus", status, | 1145 UMA_HISTOGRAM_ENUMERATION("Net.HttpStatusLineStatus", status, |
1144 HttpStatusLineValidator::STATUS_LINE_MAX); | 1146 HttpStatusLineValidator::STATUS_LINE_MAX); |
1145 } | 1147 } |
1146 | 1148 |
1147 } // namespace net | 1149 } // namespace net |
OLD | NEW |