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

Unified Diff: components/safe_browsing_db/v4_get_hash_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_get_hash_protocol_manager.cc
diff --git a/components/safe_browsing_db/v4_get_hash_protocol_manager.cc b/components/safe_browsing_db/v4_get_hash_protocol_manager.cc
index aebbfe9ba0dbce3750cd86e90c491715cd0b578e..d81565e6220af833a27232f8e9a5dc3c3c8bee78 100644
--- a/components/safe_browsing_db/v4_get_hash_protocol_manager.cc
+++ b/components/safe_browsing_db/v4_get_hash_protocol_manager.cc
@@ -317,13 +317,15 @@ void V4GetHashProtocolManager::GetFullHashes(
return;
}
+ net::HttpRequestHeaders headers;
std::string req_base64 = GetHashRequest(prefixes, platforms, threat_type);
- GURL gethash_url = GetHashUrl(req_base64);
+ GURL gethash_url = GetHashUrlAndUpdateHeaders(req_base64, &headers);
net::URLFetcher* fetcher =
net::URLFetcher::Create(url_fetcher_id_++, gethash_url,
net::URLFetcher::GET, this)
.release();
+ fetcher->SetExtraRequestHeaders(headers.ToString());
hash_requests_[fetcher] = callback;
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE);
@@ -403,9 +405,11 @@ void V4GetHashProtocolManager::HandleGetHashError(const Time& now) {
next_gethash_time_ = now + next;
}
-GURL V4GetHashProtocolManager::GetHashUrl(const std::string& req_base64) const {
- return V4ProtocolManagerUtil::GetRequestUrl(req_base64, "encodedFullHashes",
- config_);
+GURL V4GetHashProtocolManager::GetHashUrlAndUpdateHeaders(
Nathan Parker 2016/06/09 20:22:18 nit: What is the "update" mean here? How about Ge
vakh (use Gerrit instead) 2016/06/09 21:02:15 Done.
+ const std::string& req_base64,
+ net::HttpRequestHeaders* headers) const {
+ return V4ProtocolManagerUtil::GetRequestUrlAndUpdateHeaders(
+ req_base64, "fullHashes:find", config_, headers);
}

Powered by Google App Engine
This is Rietveld 408576698