| 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_update_protocol_manager.h" | 5 #include "components/safe_browsing_db/v4_update_protocol_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 void V4UpdateProtocolManager::ResetUpdateErrors() { | 94 void V4UpdateProtocolManager::ResetUpdateErrors() { |
| 95 update_error_count_ = 0; | 95 update_error_count_ = 0; |
| 96 update_back_off_mult_ = 1; | 96 update_back_off_mult_ = 1; |
| 97 } | 97 } |
| 98 | 98 |
| 99 V4UpdateProtocolManager::V4UpdateProtocolManager( | 99 V4UpdateProtocolManager::V4UpdateProtocolManager( |
| 100 net::URLRequestContextGetter* request_context_getter, | 100 net::URLRequestContextGetter* request_context_getter, |
| 101 const V4ProtocolConfig& config) | 101 const V4ProtocolConfig& config) |
| 102 : update_error_count_(0), | 102 : update_error_count_(0), |
| 103 update_back_off_mult_(1), | 103 update_back_off_mult_(1), |
| 104 next_update_time_(Time::Now()), | 104 next_update_time_(base::Time()), |
| 105 config_(config), | 105 config_(config), |
| 106 request_context_getter_(request_context_getter), | 106 request_context_getter_(request_context_getter), |
| 107 url_fetcher_id_(0) {} | 107 url_fetcher_id_(0) {} |
| 108 | 108 |
| 109 V4UpdateProtocolManager::~V4UpdateProtocolManager() { | 109 V4UpdateProtocolManager::~V4UpdateProtocolManager() { |
| 110 } | 110 } |
| 111 | 111 |
| 112 std::string V4UpdateProtocolManager::GetUpdateRequest( | 112 std::string V4UpdateProtocolManager::GetUpdateRequest( |
| 113 const base::hash_set<UpdateListIdentifier>& lists_to_update, | 113 const base::hash_set<UpdateListIdentifier>& lists_to_update, |
| 114 const base::hash_map<UpdateListIdentifier, std::string>& | 114 const base::hash_map<UpdateListIdentifier, std::string>& |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 next_update_time_ = now + next; | 268 next_update_time_ = now + next; |
| 269 } | 269 } |
| 270 | 270 |
| 271 GURL V4UpdateProtocolManager::GetUpdateUrl( | 271 GURL V4UpdateProtocolManager::GetUpdateUrl( |
| 272 const std::string& req_base64) const { | 272 const std::string& req_base64) const { |
| 273 return V4ProtocolManagerUtil::GetRequestUrl(req_base64, "encodedUpdates", | 273 return V4ProtocolManagerUtil::GetRequestUrl(req_base64, "encodedUpdates", |
| 274 config_); | 274 config_); |
| 275 } | 275 } |
| 276 | 276 |
| 277 } // namespace safe_browsing | 277 } // namespace safe_browsing |
| OLD | NEW |