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

Unified Diff: components/safe_browsing_db/util.h

Issue 2650973005: Componentize ping_manager (Closed)
Patch Set: fix deps Created 3 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
« no previous file with comments | « components/safe_browsing_db/DEPS ('k') | components/safe_browsing_db/util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/util.h
diff --git a/components/safe_browsing_db/util.h b/components/safe_browsing_db/util.h
index 0d805a01b2fb9ca9b846f7868ac59df92f59aef6..58553f7cef8985bf28a9b4260fb2263caf350f05 100644
--- a/components/safe_browsing_db/util.h
+++ b/components/safe_browsing_db/util.h
@@ -16,6 +16,7 @@
#include "base/strings/string_piece.h"
#include "base/time/time.h"
+#include "components/safe_browsing_db/safe_browsing_prefs.h"
#include "components/safe_browsing_db/v4_protocol_manager_util.h"
class GURL;
@@ -166,6 +167,41 @@ bool GetListName(ListType list_id, std::string* list);
// other lists. We'll also always add a pattern for the empty path.
void UrlToFullHashes(const GURL& url, bool include_whitelist_hashes,
std::vector<SBFullHash>* full_hashes);
+
+struct SafeBrowsingProtocolConfig {
+ SafeBrowsingProtocolConfig();
+ SafeBrowsingProtocolConfig(const SafeBrowsingProtocolConfig& other);
+ ~SafeBrowsingProtocolConfig();
+ std::string client_name;
+ std::string url_prefix;
+ std::string backup_connect_error_url_prefix;
+ std::string backup_http_error_url_prefix;
+ std::string backup_network_error_url_prefix;
+ std::string version;
+ bool disable_auto_update;
+};
+
+// returns chrome version.
+std::string Version();
vakh (use Gerrit instead) 2017/02/14 02:33:31 The function name is very generic. I think it woul
Jialiu Lin 2017/02/14 18:44:07 Sounds good. Namespace added.
+
+// Composes a URL using |prefix|, |method| (e.g.: gethash, download, report).
+// |client_name| and |version|. When not empty, |additional_query| is
+// appended to the URL with an additional "&" in the front.
+std::string ComposeUrl(const std::string& prefix,
+ const std::string& method,
+ const std::string& client_name,
+ const std::string& version,
+ const std::string& additional_query);
+
+// Similar to above function, and appends "&ext=1" at the end of URL if
+// |is_extended_reporting| is true, otherwise, appends "&ext=0".
+std::string ComposeUrl(const std::string& prefix,
+ const std::string& method,
+ const std::string& client_name,
+ const std::string& version,
+ const std::string& additional_query,
+ ExtendedReportingLevel reporting_level);
+
} // namespace safe_browsing
#endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_
« no previous file with comments | « components/safe_browsing_db/DEPS ('k') | components/safe_browsing_db/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698