| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/captive_portal/captive_portal_detector.h" | 5 #include "components/captive_portal/captive_portal_detector.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "net/base/load_flags.h" | 9 #include "net/base/load_flags.h" |
| 10 #include "net/http/http_response_headers.h" | 10 #include "net/http/http_response_headers.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 url, | 38 url, |
| 39 net::URLFetcher::GET, | 39 net::URLFetcher::GET, |
| 40 this)); | 40 this)); |
| 41 url_fetcher_->SetAutomaticallyRetryOn5xx(false); | 41 url_fetcher_->SetAutomaticallyRetryOn5xx(false); |
| 42 url_fetcher_->SetRequestContext(request_context_.get()); | 42 url_fetcher_->SetRequestContext(request_context_.get()); |
| 43 | 43 |
| 44 // Can't safely use net::LOAD_DISABLE_CERT_REVOCATION_CHECKING here, | 44 // Can't safely use net::LOAD_DISABLE_CERT_REVOCATION_CHECKING here, |
| 45 // since then the connection may be reused without checking the cert. | 45 // since then the connection may be reused without checking the cert. |
| 46 url_fetcher_->SetLoadFlags( | 46 url_fetcher_->SetLoadFlags( |
| 47 net::LOAD_BYPASS_CACHE | | 47 net::LOAD_BYPASS_CACHE | |
| 48 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN | | |
| 49 net::LOAD_DO_NOT_SAVE_COOKIES | | 48 net::LOAD_DO_NOT_SAVE_COOKIES | |
| 50 net::LOAD_DO_NOT_SEND_COOKIES | | 49 net::LOAD_DO_NOT_SEND_COOKIES | |
| 51 net::LOAD_DO_NOT_SEND_AUTH_DATA); | 50 net::LOAD_DO_NOT_SEND_AUTH_DATA); |
| 52 url_fetcher_->Start(); | 51 url_fetcher_->Start(); |
| 53 } | 52 } |
| 54 | 53 |
| 55 void CaptivePortalDetector::Cancel() { | 54 void CaptivePortalDetector::Cancel() { |
| 56 url_fetcher_.reset(); | 55 url_fetcher_.reset(); |
| 57 detection_callback_.Reset(); | 56 detection_callback_.Reset(); |
| 58 } | 57 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 return base::Time::Now(); | 136 return base::Time::Now(); |
| 138 else | 137 else |
| 139 return time_for_testing_; | 138 return time_for_testing_; |
| 140 } | 139 } |
| 141 | 140 |
| 142 bool CaptivePortalDetector::FetchingURL() const { | 141 bool CaptivePortalDetector::FetchingURL() const { |
| 143 return url_fetcher_.get() != NULL; | 142 return url_fetcher_.get() != NULL; |
| 144 } | 143 } |
| 145 | 144 |
| 146 } // namespace captive_portal | 145 } // namespace captive_portal |
| OLD | NEW |