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

Unified Diff: components/safe_browsing_db/v4_update_protocol_manager.cc

Issue 2356443002: Set client_id and client_version in requests sent to SafeBrowsing (Closed)
Patch Set: Make GetBase64SerializedUpdateRequestProto non static Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/safe_browsing_db/v4_update_protocol_manager.cc
diff --git a/components/safe_browsing_db/v4_update_protocol_manager.cc b/components/safe_browsing_db/v4_update_protocol_manager.cc
index 69458fc860e667aab5574f442fe91f4cc9b4caca..85ff87961e85977856cc867ee6eb43e0b6552e5d 100644
--- a/components/safe_browsing_db/v4_update_protocol_manager.cc
+++ b/components/safe_browsing_db/v4_update_protocol_manager.cc
@@ -192,14 +192,12 @@ void V4UpdateProtocolManager::ScheduleNextUpdateAfterInterval(
&V4UpdateProtocolManager::IssueUpdateRequest);
}
-// static
-std::string V4UpdateProtocolManager::GetBase64SerializedUpdateRequestProto(
- const StoreStateMap& store_state_map) {
- DCHECK(!store_state_map.empty());
+std::string V4UpdateProtocolManager::GetBase64SerializedUpdateRequestProto() {
+ DCHECK(!store_state_map_->empty());
// Build the request. Client info and client states are not added to the
// request protocol buffer. Client info is passed as params in the url.
FetchThreatListUpdatesRequest request;
- for (const auto& entry : store_state_map) {
+ for (const auto& entry : *store_state_map_) {
const auto& list_to_update = entry.first;
const auto& state = entry.second;
ListUpdateRequest* list_update_request = request.add_list_update_requests();
@@ -217,6 +215,9 @@ std::string V4UpdateProtocolManager::GetBase64SerializedUpdateRequestProto(
RICE);
}
+ V4ProtocolManagerUtil::SetClientInfoFromConfig(request.mutable_client(),
+ config_);
+
// Serialize and Base64 encode.
std::string req_data, req_base64;
request.SerializeToString(&req_data);
@@ -277,8 +278,7 @@ void V4UpdateProtocolManager::IssueUpdateRequest() {
return;
}
- std::string req_base64 =
- GetBase64SerializedUpdateRequestProto(*store_state_map_.get());
+ std::string req_base64 = GetBase64SerializedUpdateRequestProto();
GURL update_url;
net::HttpRequestHeaders headers;
GetUpdateUrlAndHeaders(req_base64, &update_url, &headers);

Powered by Google App Engine
This is Rietveld 408576698