| 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..983df4255445c534b36cd297516e0a8ea7fa06bb 100644
|
| --- a/components/safe_browsing_db/v4_protocol_manager_util.h
|
| +++ b/components/safe_browsing_db/v4_protocol_manager_util.h
|
| @@ -11,11 +11,11 @@
|
| #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 {
|
| -
|
| // Config passed to the constructor of a V4 protocol manager.
|
| struct V4ProtocolConfig {
|
| // The safe browsing client name sent in each request.
|
| @@ -28,8 +28,50 @@ struct V4ProtocolConfig {
|
| std::string key_param;
|
| };
|
|
|
| +// The information required to uniquely identify each list the client is
|
| +// interested in maintaining and downloading from the SafeBrowsing servers.
|
| +// For example, for digests of Malware binaries on Windows:
|
| +// platform_type = WINDOWS,
|
| +// threat_entry_type = BINARY_DIGEST,
|
| +// threat_type = MALWARE
|
| +struct UpdateListIdentifier {
|
| + PlatformType platform_type;
|
| + ThreatEntryType threat_entry_type;
|
| + ThreatType threat_type;
|
| +};
|
| +
|
| +// A class that provides static methods related to the Pver4 protocol.
|
| class V4ProtocolManagerUtil {
|
| public:
|
| + // Enumerate failures for histogramming purposes. DO NOT CHANGE THE
|
| + // ORDERING OF THESE VALUES.
|
| + enum OperationResultType {
|
| + // 200 response code means that the server recognized the request.
|
| + STATUS_200 = 0,
|
| +
|
| + // Subset of successful responses where the response body wasn't parsable.
|
| + PARSE_ERROR = 1,
|
| +
|
| + // Operation request failed (network error).
|
| + NETWORK_ERROR = 2,
|
| +
|
| + // Operation request returned HTTP result code other than 200.
|
| + HTTP_ERROR = 3,
|
| +
|
| + // Operation attempted during error backoff, no request sent.
|
| + BACKOFF_ERROR = 4,
|
| +
|
| + // Operation attempted before min wait duration elapsed, no request sent.
|
| + MIN_WAIT_DURATION_ERROR = 5,
|
| +
|
| + // Identical operation already pending.
|
| + ALREADY_PENDING_ERROR = 6,
|
| +
|
| + // Memory space for histograms is determined by the max. ALWAYS
|
| + // ADD NEW VALUES BEFORE THIS ONE.
|
| + OPERATION_RESULT_TYPE_MAX = 7
|
| + };
|
| +
|
| // Record HTTP response code when there's no error in fetching an HTTP
|
| // request, and the error code, when there is.
|
| // |metric_name| is the name of the UMA metric to record the response code or
|
|
|