| 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 "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
| 15 #include "components/update_client/client_update_protocol_ecdsa.h" | 15 #include "components/update_client/client_update_protocol_ecdsa.h" |
| 16 #include "components/update_client/configurator.h" | 16 #include "components/update_client/configurator.h" |
| 17 #include "components/update_client/utils.h" | 17 #include "components/update_client/utils.h" |
| 18 #include "net/http/http_response_headers.h" | 18 #include "net/http/http_response_headers.h" |
| 19 #include "net/url_request/url_fetcher.h" | 19 #include "net/url_request/url_fetcher.h" |
| 20 | 20 |
| 21 namespace update_client { | 21 namespace update_client { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // This is an ECDSA prime256v1 named-curve key. | 25 // This is an ECDSA prime256v1 named-curve key. |
| 26 const int kKeyVersion = 5; | 26 const int kKeyVersion = 6; |
| 27 const char kKeyPubBytesBase64[] = | 27 const char kKeyPubBytesBase64[] = |
| 28 "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEB+Yi+3SdJKCyFJmm+suW3CyXygvVsbDbPnJgoC" | 28 "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECEDSRcZPKv8k4JEYbF7MJxxx56m+x8Z+svg5gB" |
| 29 "X4GeTtoL8Q/WjPx7CGtXOL1Xjbx0VPPN3DrvqZSL/oXy9hVw=="; | 29 "mRX1J8A9DYRL6NvFkNcmcRtSNemUm7/iqrUnxaadkqcWSODw=="; |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 // This value is chosen not to conflict with network errors defined by | 33 // This value is chosen not to conflict with network errors defined by |
| 34 // net/base/net_error_list.h. The callers don't have to handle this error in | 34 // net/base/net_error_list.h. The callers don't have to handle this error in |
| 35 // any meaningful way, but this value may be reported in UMA stats, therefore | 35 // any meaningful way, but this value may be reported in UMA stats, therefore |
| 36 // avoiding collisions with known network errors is desirable. | 36 // avoiding collisions with known network errors is desirable. |
| 37 int RequestSender::kErrorResponseNotTrusted = -10000; | 37 int RequestSender::kErrorResponseNotTrusted = -10000; |
| 38 | 38 |
| 39 RequestSender::RequestSender(const scoped_refptr<Configurator>& config) | 39 RequestSender::RequestSender(const scoped_refptr<Configurator>& config) |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 if (!response_headers) | 171 if (!response_headers) |
| 172 return std::string(); | 172 return std::string(); |
| 173 | 173 |
| 174 std::string etag; | 174 std::string etag; |
| 175 return response_headers->EnumerateHeader(nullptr, "ETag", &etag) | 175 return response_headers->EnumerateHeader(nullptr, "ETag", &etag) |
| 176 ? etag | 176 ? etag |
| 177 : std::string(); | 177 : std::string(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace update_client | 180 } // namespace update_client |
| OLD | NEW |