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

Unified Diff: components/safe_browsing_db/v4_protocol_manager_util.h

Issue 1719883003: Ignore: v4_update_protocol_manager: Basic implementation with TODOs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v4_01_prot_mgr
Patch Set: Basic implementation of the update protocol manager with histograms and TODOs. No tests yet. 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/v4_protocol_manager_util.h
diff --git a/components/safe_browsing_db/v4_protocol_manager_util.h b/components/safe_browsing_db/v4_protocol_manager_util.h
index f4665f00587fc979ddbab8bb19c4530b87cd4287..b7df61a152216707ba049d6331c1fdad42c5f9a2 100644
--- a/components/safe_browsing_db/v4_protocol_manager_util.h
+++ b/components/safe_browsing_db/v4_protocol_manager_util.h
@@ -11,10 +11,37 @@
#include <string>
#include "base/gtest_prod_util.h"
+#include "components/safe_browsing_db/safebrowsing.pb.h"
#include "net/url_request/url_request_status.h"
#include "url/gurl.h"
namespace safe_browsing {
+// Enumerate failures for histogramming purposes. DO NOT CHANGE THE
+// ORDERING OF THESE VALUES.
+enum OperationResultType {
+ // 200 response code means that the server recognized the hash
+ // prefix.
+ ORT_STATUS_200 = 0,
+
+ // Subset of successful responses where the response body wasn't parsable.
+ ORT_PARSE_ERROR = 1,
+
+ // Gethash request failed (network error).
+ ORT_NETWORK_ERROR = 2,
+
+ // Gethash request returned HTTP result code other than 200.
+ ORT_HTTP_ERROR = 3,
+
+ // Gethash attempted during error backoff, no request sent.
+ ORT_BACKOFF_ERROR = 4,
+
+ // Gethash attempted before min wait duration elapsed, no request sent.
+ ORT_MIN_WAIT_DURATION_ERROR = 5,
+
+ // Memory space for histograms is determined by the max. ALWAYS
+ // ADD NEW VALUES BEFORE THIS ONE.
+ OPERATION_RESULT_TYPE_MAX = 6
+};
// Config passed to the constructor of a V4 protocol manager.
struct V4ProtocolConfig {
@@ -28,6 +55,12 @@ struct V4ProtocolConfig {
std::string key_param;
};
+struct UpdateListIdentifier {
Nathan Parker 2016/02/23 18:47:06 Is this the key for the list, like in the map of k
vakh (use Gerrit instead) 2016/02/24 03:25:56 Done.
+ ThreatType threat_type;
+ PlatformType platform_type;
+ ThreatEntryType threat_entry_type;
+};
+
class V4ProtocolManagerUtil {
public:
// Record HTTP response code when there's no error in fetching an HTTP

Powered by Google App Engine
This is Rietveld 408576698