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

Unified Diff: chrome/browser/captive_portal/captive_portal_service.cc

Issue 11419070: Added detection timeouts and usage of Retry-After HTTP header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 8 years, 1 month 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: chrome/browser/captive_portal/captive_portal_service.cc
diff --git a/chrome/browser/captive_portal/captive_portal_service.cc b/chrome/browser/captive_portal/captive_portal_service.cc
index 6e818321ed05711e35cac6c457925b6f03d6f7c3..e31575e348ed83da7d9e04c3b1e9269d90a6c4f8 100644
--- a/chrome/browser/captive_portal/captive_portal_service.cc
+++ b/chrome/browser/captive_portal/captive_portal_service.cc
@@ -27,24 +27,6 @@ namespace captive_portal {
namespace {
-// Used for histograms.
-const char* const kCaptivePortalResultNames[] = {
- "InternetConnected",
- "NoResponse",
- "BehindCaptivePortal",
- "NumCaptivePortalResults",
-};
-COMPILE_ASSERT(arraysize(kCaptivePortalResultNames) == RESULT_COUNT + 1,
- captive_portal_result_name_count_mismatch);
-
-// Used for histograms.
-std::string CaptivePortalResultToString(Result result) {
- DCHECK_GE(result, 0);
- DCHECK_LT(static_cast<unsigned int>(result),
- arraysize(kCaptivePortalResultNames));
- return kCaptivePortalResultNames[result];
-}
-
// Records histograms relating to how often captive portal detection attempts
// ended with |result| in a row, and for how long |result| was the last result
// of a detection attempt. Recorded both on quit and on a new Result.
@@ -65,7 +47,7 @@ void RecordRepeatHistograms(Result result,
base::Histogram* result_repeated_histogram =
base::Histogram::FactoryGet(
"CaptivePortal.ResultRepeated." +
- CaptivePortalResultToString(result),
+ CaptivePortalDetector::CaptivePortalResultToString(result),
1, // min
100, // max
100, // bucket_count
@@ -79,7 +61,7 @@ void RecordRepeatHistograms(Result result,
base::Histogram* result_duration_histogram =
base::Histogram::FactoryTimeGet(
"CaptivePortal.ResultDuration." +
- CaptivePortalResultToString(result),
+ CaptivePortalDetector::CaptivePortalResultToString(result),
base::TimeDelta::FromSeconds(1), // min
base::TimeDelta::FromHours(1), // max
50, // bucket_count

Powered by Google App Engine
This is Rietveld 408576698