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

Unified Diff: components/safe_browsing_db/safe_browsing_api_handler_util.h

Issue 1726403006: Switch Safe Browsing's metadata from string to struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix safe_browsing_service_browsertest and update components_tests.gyp Created 4 years, 10 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/safe_browsing_api_handler_util.h
diff --git a/components/safe_browsing_db/safe_browsing_api_handler_util.h b/components/safe_browsing_db/safe_browsing_api_handler_util.h
index 5733c664a51143d028e39afc25da4148522ec32d..fa5802342b0eb48cfeaf53659dcb4492f038282e 100644
--- a/components/safe_browsing_db/safe_browsing_api_handler_util.h
+++ b/components/safe_browsing_db/safe_browsing_api_handler_util.h
@@ -43,13 +43,15 @@ enum UmaRemoteCallResult {
// This parses the JSON from the GMSCore API and then:
// 1) Picks the most severe threat type
-// 2) Parses remaining key/value pairs into a MalwarePatternType PB
-// so DisplayBlockingPage() can unmarshal it. We make this string
-// is binary compatible with the Pver3 API's metadata string even
-// though it comes from Pver4.
+// 2) Parses that threat's key/value pairs into the metadata struct.
//
// If anything fails to parse, this sets the threat to "safe". The caller
// should report the return value via UMA.
+UmaRemoteCallResult ParseJson(const std::string& metadata_str,
mattm 2016/02/26 02:32:23 less generic name
+ SBThreatType* worst_threat,
+ ThreatMetadata* metadata);
+
+// DEPRECATED. Will be removed.
UmaRemoteCallResult ParseJsonToThreatAndPB(const std::string& metadata_str,
SBThreatType* worst_threat,
std::string* metadata_pb_str);

Powered by Google App Engine
This is Rietveld 408576698