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

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: CR feedback: nparker. GetRequestUrlAndUpdateHeaders -> GetRequestUrlAndHeaders 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
« no previous file with comments | « components/safe_browsing_db/v4_update_protocol_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f0fad8d07acf607a566378cdc9baf9f0eaf42e7c 100644
--- a/components/safe_browsing_db/v4_update_protocol_manager.cc
+++ b/components/safe_browsing_db/v4_update_protocol_manager.cc
@@ -278,11 +278,15 @@ void V4UpdateProtocolManager::IssueUpdateRequest() {
std::string req_base64 =
GetBase64SerializedUpdateRequestProto(current_list_states_);
- GURL update_url = GetUpdateUrl(req_base64);
+ GURL update_url;
+ net::HttpRequestHeaders headers;
+ GetUpdateUrlAndHeaders(req_base64, &update_url, &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,13 +343,12 @@ void V4UpdateProtocolManager::OnURLFetchComplete(
}
}
-GURL V4UpdateProtocolManager::GetUpdateUrl(
- const std::string& req_base64) const {
- GURL url = V4ProtocolManagerUtil::GetRequestUrl(req_base64, "encodedUpdates",
- config_);
- DVLOG(1) << "V4UpdateProtocolManager::GetUpdateUrl: "
- << "url: " << url;
- return url;
+void V4UpdateProtocolManager::GetUpdateUrlAndHeaders(
+ const std::string& req_base64,
+ GURL* gurl,
+ net::HttpRequestHeaders* headers) const {
+ V4ProtocolManagerUtil::GetRequestUrlAndHeaders(
+ req_base64, "threatListUpdates:fetch", config_, gurl, headers);
}
} // namespace safe_browsing
« no previous file with comments | « components/safe_browsing_db/v4_update_protocol_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698