| 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 #ifndef COMPONENTS_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ | 5 #ifndef COMPONENTS_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ |
| 6 #define COMPONENTS_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ | 6 #define COMPONENTS_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
| 14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 15 #include "components/captive_portal/captive_portal_export.h" | 16 #include "components/captive_portal/captive_portal_export.h" |
| 16 #include "components/captive_portal/captive_portal_types.h" | 17 #include "components/captive_portal/captive_portal_types.h" |
| 17 #include "net/url_request/url_fetcher.h" | 18 #include "net/url_request/url_fetcher.h" |
| 18 #include "net/url_request/url_fetcher_delegate.h" | 19 #include "net/url_request/url_fetcher_delegate.h" |
| 19 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
| 20 | 21 |
| 21 class GURL; | 22 class GURL; |
| 22 | 23 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Advances current test time. Used by unit tests. | 88 // Advances current test time. Used by unit tests. |
| 88 void advance_time_for_testing(const base::TimeDelta& delta) { | 89 void advance_time_for_testing(const base::TimeDelta& delta) { |
| 89 time_for_testing_ += delta; | 90 time_for_testing_ += delta; |
| 90 } | 91 } |
| 91 | 92 |
| 92 // URL request context. | 93 // URL request context. |
| 93 scoped_refptr<net::URLRequestContextGetter> request_context_; | 94 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 94 | 95 |
| 95 DetectionCallback detection_callback_; | 96 DetectionCallback detection_callback_; |
| 96 | 97 |
| 97 scoped_ptr<net::URLFetcher> url_fetcher_; | 98 std::unique_ptr<net::URLFetcher> url_fetcher_; |
| 98 | 99 |
| 99 // Test time used by unit tests. | 100 // Test time used by unit tests. |
| 100 base::Time time_for_testing_; | 101 base::Time time_for_testing_; |
| 101 | 102 |
| 102 DISALLOW_COPY_AND_ASSIGN(CaptivePortalDetector); | 103 DISALLOW_COPY_AND_ASSIGN(CaptivePortalDetector); |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 } // namespace captive_portal | 106 } // namespace captive_portal |
| 106 | 107 |
| 107 #endif // COMPONENTS_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ | 108 #endif // COMPONENTS_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ |
| OLD | NEW |