| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/safe_browsing_db/v4_protocol_manager_util.h" | 5 #include "components/safe_browsing_db/v4_protocol_manager_util.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/metrics/sparse_histogram.h" | 8 #include "base/metrics/sparse_histogram.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 ThreatEntryType threat_entry_type, | 51 ThreatEntryType threat_entry_type, |
| 52 ThreatType threat_type) | 52 ThreatType threat_type) |
| 53 : platform_type(platform_type), | 53 : platform_type(platform_type), |
| 54 threat_entry_type(threat_entry_type), | 54 threat_entry_type(threat_entry_type), |
| 55 threat_type(threat_type) { | 55 threat_type(threat_type) { |
| 56 DCHECK(PlatformType_IsValid(platform_type)); | 56 DCHECK(PlatformType_IsValid(platform_type)); |
| 57 DCHECK(ThreatEntryType_IsValid(threat_entry_type)); | 57 DCHECK(ThreatEntryType_IsValid(threat_entry_type)); |
| 58 DCHECK(ThreatType_IsValid(threat_type)); | 58 DCHECK(ThreatType_IsValid(threat_type)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 UpdateListIdentifier::UpdateListIdentifier(const ListUpdateResponse& response) | 61 UpdateListIdentifier::UpdateListIdentifier(const ListUpdateResponse* response) |
| 62 : UpdateListIdentifier(response.platform_type(), | 62 : UpdateListIdentifier(response->platform_type(), |
| 63 response.threat_entry_type(), | 63 response->threat_entry_type(), |
| 64 response.threat_type()) {} | 64 response->threat_type()) {} |
| 65 | 65 |
| 66 V4ProtocolConfig::V4ProtocolConfig() : disable_auto_update(false) {} | 66 V4ProtocolConfig::V4ProtocolConfig() : disable_auto_update(false) {} |
| 67 | 67 |
| 68 V4ProtocolConfig::V4ProtocolConfig(const V4ProtocolConfig& other) = default; | 68 V4ProtocolConfig::V4ProtocolConfig(const V4ProtocolConfig& other) = default; |
| 69 | 69 |
| 70 V4ProtocolConfig::~V4ProtocolConfig() {} | 70 V4ProtocolConfig::~V4ProtocolConfig() {} |
| 71 | 71 |
| 72 // static | 72 // static |
| 73 // Backoff interval is MIN(((2^(n-1))*15 minutes) * (RAND + 1), 24 hours) where | 73 // Backoff interval is MIN(((2^(n-1))*15 minutes) * (RAND + 1), 24 hours) where |
| 74 // n is the number of consecutive errors. | 74 // n is the number of consecutive errors. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 // static | 133 // static |
| 134 void V4ProtocolManagerUtil::UpdateHeaders(net::HttpRequestHeaders* headers) { | 134 void V4ProtocolManagerUtil::UpdateHeaders(net::HttpRequestHeaders* headers) { |
| 135 // NOTE(vakh): The following header informs the envelope server (which sits in | 135 // NOTE(vakh): The following header informs the envelope server (which sits in |
| 136 // front of Google's stubby server) that the received GET request should be | 136 // front of Google's stubby server) that the received GET request should be |
| 137 // interpreted as a POST. | 137 // interpreted as a POST. |
| 138 headers->SetHeaderIfMissing("X-HTTP-Method-Override", "POST"); | 138 headers->SetHeaderIfMissing("X-HTTP-Method-Override", "POST"); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace safe_browsing | 141 } // namespace safe_browsing |
| OLD | NEW |