OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_ | 5 #ifndef CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_ |
6 #define CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_ | 6 #define CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_ |
7 | 7 |
8 #include "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "chromecast/net/connectivity_checker.h" | 10 #include "chromecast/net/connectivity_checker.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 // Sets connectivity and alerts observers if it has changed | 65 // Sets connectivity and alerts observers if it has changed |
66 void SetConnected(bool connected); | 66 void SetConnected(bool connected); |
67 | 67 |
68 // Called when URL request failed. | 68 // Called when URL request failed. |
69 void OnUrlRequestError(); | 69 void OnUrlRequestError(); |
70 | 70 |
71 // Called when URL request timed out. | 71 // Called when URL request timed out. |
72 void OnUrlRequestTimeout(); | 72 void OnUrlRequestTimeout(); |
73 | 73 |
74 scoped_ptr<GURL> connectivity_check_url_; | 74 std::unique_ptr<GURL> connectivity_check_url_; |
75 scoped_ptr<net::URLRequestContext> url_request_context_; | 75 std::unique_ptr<net::URLRequestContext> url_request_context_; |
76 scoped_ptr<net::URLRequest> url_request_; | 76 std::unique_ptr<net::URLRequest> url_request_; |
77 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 77 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
78 bool connected_; | 78 bool connected_; |
79 net::NetworkChangeNotifier::ConnectionType connection_type_; | 79 net::NetworkChangeNotifier::ConnectionType connection_type_; |
80 // Number of connectivity check errors. | 80 // Number of connectivity check errors. |
81 unsigned int check_errors_; | 81 unsigned int check_errors_; |
82 bool network_changed_pending_; | 82 bool network_changed_pending_; |
83 // Timeout handler for connectivity checks. | 83 // Timeout handler for connectivity checks. |
84 // Note: Cancelling this timeout can cause the destructor for this class to be | 84 // Note: Cancelling this timeout can cause the destructor for this class to be |
85 // to be called. | 85 // to be called. |
86 base::CancelableCallback<void()> timeout_; | 86 base::CancelableCallback<void()> timeout_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(ConnectivityCheckerImpl); | 88 DISALLOW_COPY_AND_ASSIGN(ConnectivityCheckerImpl); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace chromecast | 91 } // namespace chromecast |
92 | 92 |
93 #endif // CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_ | 93 #endif // CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_ |
OLD | NEW |