OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/update_client/request_sender.h" | 5 #include "components/update_client/request_sender.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 query_params.c_str()) | 200 query_params.c_str()) |
201 : query_params); | 201 : query_params); |
202 GURL::Replacements replacements; | 202 GURL::Replacements replacements; |
203 replacements.SetQueryStr(query_string); | 203 replacements.SetQueryStr(query_string); |
204 | 204 |
205 return url.ReplaceComponents(replacements); | 205 return url.ReplaceComponents(replacements); |
206 } | 206 } |
207 | 207 |
208 std::string RequestSender::GetStringHeaderValue(const net::URLFetcher* source, | 208 std::string RequestSender::GetStringHeaderValue(const net::URLFetcher* source, |
209 const char* header_name) { | 209 const char* header_name) { |
210 const auto response_headers(source->GetResponseHeaders()); | 210 auto* response_headers(source->GetResponseHeaders()); |
211 if (!response_headers) | 211 if (!response_headers) |
212 return std::string(); | 212 return std::string(); |
213 | 213 |
214 std::string etag; | 214 std::string etag; |
215 return response_headers->EnumerateHeader(nullptr, header_name, &etag) | 215 return response_headers->EnumerateHeader(nullptr, header_name, &etag) |
216 ? etag | 216 ? etag |
217 : std::string(); | 217 : std::string(); |
218 } | 218 } |
219 | 219 |
220 int64_t RequestSender::GetInt64HeaderValue(const net::URLFetcher* source, | 220 int64_t RequestSender::GetInt64HeaderValue(const net::URLFetcher* source, |
221 const char* header_name) { | 221 const char* header_name) { |
222 const auto response_headers(source->GetResponseHeaders()); | 222 auto* response_headers(source->GetResponseHeaders()); |
223 return response_headers ? response_headers->GetInt64HeaderValue(header_name) | 223 return response_headers ? response_headers->GetInt64HeaderValue(header_name) |
224 : -1; | 224 : -1; |
225 } | 225 } |
226 | 226 |
227 } // namespace update_client | 227 } // namespace update_client |
OLD | NEW |