Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: components/safe_browsing_db/v4_update_protocol_manager.cc

Issue 1845643002: Initialize next_update_time_ to allow immediate updating (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize next_update_time_ with time=0 instead of now-1 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_update_protocol_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_update_protocol_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698