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

Unified Diff: chrome/browser/captive_portal/captive_portal_detector.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_detector.cc
diff --git a/chrome/browser/captive_portal/captive_portal_detector.cc b/chrome/browser/captive_portal/captive_portal_detector.cc
index 4c59437cbf662699fc5864d7bfc8ab88cfb4f57f..70dbbc5f536df992b6c2ea270a7b3fc1647fa53a 100644
--- a/chrome/browser/captive_portal/captive_portal_detector.cc
+++ b/chrome/browser/captive_portal/captive_portal_detector.cc
@@ -14,6 +14,19 @@
namespace captive_portal {
+namespace {
+
+const char* const kCaptivePortalResultNames[] = {
+ "InternetConnected",
+ "NoResponse",
+ "BehindCaptivePortal",
+ "NumCaptivePortalResults",
+};
+COMPILE_ASSERT(arraysize(kCaptivePortalResultNames) == RESULT_COUNT + 1,
+ captive_portal_result_name_count_mismatch);
+
+} // namespace
+
const char CaptivePortalDetector::kDefaultURL[] =
"http://www.gstatic.com/generate_204";
@@ -25,6 +38,14 @@ CaptivePortalDetector::CaptivePortalDetector(
CaptivePortalDetector::~CaptivePortalDetector() {
}
+// static
+std::string CaptivePortalDetector::CaptivePortalResultToString(Result result) {
+ DCHECK_GE(result, 0);
+ DCHECK_LT(static_cast<unsigned int>(result),
+ arraysize(kCaptivePortalResultNames));
+ return kCaptivePortalResultNames[result];
+}
+
void CaptivePortalDetector::DetectCaptivePortal(
const GURL& url,
const DetectionCallback& detection_callback) {

Powered by Google App Engine
This is Rietveld 408576698