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

Unified Diff: components/safe_browsing_db/v4_update_protocol_manager.cc

Issue 2057433002: Replace the old URL format for PVer4 requests with the new format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move #include to *.cc and use forward declaration in .h Created 4 years, 6 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 483d57871f50d366d9bb69eb886b3e848f3b7bc6..9bdf7726fb6c6431c6a213a28b9c10e93465e26e 100644
--- a/components/safe_browsing_db/v4_update_protocol_manager.cc
+++ b/components/safe_browsing_db/v4_update_protocol_manager.cc
@@ -276,13 +276,16 @@ void V4UpdateProtocolManager::IssueUpdateRequest() {
return;
}
+ net::HttpRequestHeaders headers;
std::string req_base64 =
GetBase64SerializedUpdateRequestProto(current_list_states_);
- GURL update_url = GetUpdateUrl(req_base64);
+ GURL update_url = GetUpdateUrlAndUpdateHeaders(req_base64, &headers);
- request_.reset(net::URLFetcher::Create(url_fetcher_id_++, update_url,
- net::URLFetcher::GET, this)
- .release());
+ std::unique_ptr<net::URLFetcher> fetcher = net::URLFetcher::Create(
+ url_fetcher_id_++, update_url, net::URLFetcher::GET, this);
+ fetcher->SetExtraRequestHeaders(headers.ToString());
+
+ request_.reset(fetcher.release());
request_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
request_->SetRequestContext(request_context_getter_.get());
@@ -339,10 +342,11 @@ void V4UpdateProtocolManager::OnURLFetchComplete(
}
}
-GURL V4UpdateProtocolManager::GetUpdateUrl(
- const std::string& req_base64) const {
- GURL url = V4ProtocolManagerUtil::GetRequestUrl(req_base64, "encodedUpdates",
- config_);
+GURL V4UpdateProtocolManager::GetUpdateUrlAndUpdateHeaders(
+ const std::string& req_base64,
+ net::HttpRequestHeaders* headers) const {
+ GURL url = V4ProtocolManagerUtil::GetRequestUrlAndUpdateHeaders(
+ req_base64, "threatListUpdates:fetch", config_, headers);
DVLOG(1) << "V4UpdateProtocolManager::GetUpdateUrl: "
<< "url: " << url;
return url;

Powered by Google App Engine
This is Rietveld 408576698