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

Unified Diff: components/safe_browsing_db/v4_get_hash_protocol_manager.cc

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_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 b78a4b5fb0b94e5b4c628848db656fb446714a6e..db07d87cb9150c7e0bb7f2844264149a8c80b2cf 100644
--- a/components/safe_browsing_db/v4_get_hash_protocol_manager.cc
+++ b/components/safe_browsing_db/v4_get_hash_protocol_manager.cc
@@ -109,9 +109,10 @@ V4GetHashProtocolManager::V4GetHashProtocolManager(
}
// static
-void V4GetHashProtocolManager::RecordGetHashResult(ResultType result_type) {
+void V4GetHashProtocolManager::RecordGetHashResult(
+ OperationResultType result_type) {
UMA_HISTOGRAM_ENUMERATION("SafeBrowsing.GetV4HashResult", result_type,
- GET_HASH_RESULT_MAX);
+ OPERATION_RESULT_TYPE_MAX);
}
V4GetHashProtocolManager::~V4GetHashProtocolManager() {
@@ -248,9 +249,9 @@ void V4GetHashProtocolManager::GetFullHashes(
// (i.e. treat the page as safe).
if (Time::Now() <= next_gethash_time_) {
if (gethash_error_count_) {
- RecordGetHashResult(GET_HASH_BACKOFF_ERROR);
+ RecordGetHashResult(ORT_BACKOFF_ERROR);
Nathan Parker 2016/02/23 18:47:06 What's ORT? An idea: You could make these a "class
vakh (use Gerrit instead) 2016/02/23 23:58:20 Done. ORT was short for OperationResultType. I gav
} else {
- RecordGetHashResult(GET_HASH_MIN_WAIT_DURATION_ERROR);
+ RecordGetHashResult(ORT_MIN_WAIT_DURATION_ERROR);
}
std::vector<SBFullHashResult> full_hashes;
callback.Run(full_hashes, base::TimeDelta());
@@ -301,13 +302,13 @@ void V4GetHashProtocolManager::OnURLFetchComplete(
std::vector<SBFullHashResult> full_hashes;
base::TimeDelta negative_cache_duration;
if (status.is_success() && response_code == net::HTTP_OK) {
- RecordGetHashResult(GET_HASH_STATUS_200);
+ RecordGetHashResult(ORT_STATUS_200);
ResetGetHashErrors();
std::string data;
source->GetResponseAsString(&data);
if (!ParseHashResponse(data, &full_hashes, &negative_cache_duration)) {
full_hashes.clear();
- RecordGetHashResult(GET_HASH_PARSE_ERROR);
+ RecordGetHashResult(ORT_PARSE_ERROR);
}
} else {
HandleGetHashError(Time::Now());
@@ -317,9 +318,9 @@ void V4GetHashProtocolManager::OnURLFetchComplete(
<< " and response code: " << response_code;
if (status.status() == net::URLRequestStatus::FAILED) {
- RecordGetHashResult(GET_HASH_NETWORK_ERROR);
+ RecordGetHashResult(ORT_NETWORK_ERROR);
} else {
- RecordGetHashResult(GET_HASH_HTTP_ERROR);
+ RecordGetHashResult(ORT_HTTP_ERROR);
}
}

Powered by Google App Engine
This is Rietveld 408576698