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

Side by Side Diff: chromecast/net/connectivity_checker.h

Issue 2647323010: [Chromecast] Add proxy server support to chromecast (Closed)
Patch Set: Cleanup Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
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_H_ 5 #ifndef CHROMECAST_NET_CONNECTIVITY_CHECKER_H_
6 #define CHROMECAST_NET_CONNECTIVITY_CHECKER_H_ 6 #define CHROMECAST_NET_CONNECTIVITY_CHECKER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/observer_list_threadsafe.h" 12 #include "base/observer_list_threadsafe.h"
13 13
14 class GURL; 14 class GURL;
15 15
16 namespace base { 16 namespace base {
17 class SingleThreadTaskRunner; 17 class SingleThreadTaskRunner;
18 } 18 }
19 19
20 namespace net {
21 class ProxyConfig;
22 }
23
20 namespace chromecast { 24 namespace chromecast {
21 25
22 // Checks if internet connectivity is available. 26 // Checks if internet connectivity is available.
23 class ConnectivityChecker 27 class ConnectivityChecker
24 : public base::RefCountedThreadSafe<ConnectivityChecker> { 28 : public base::RefCountedThreadSafe<ConnectivityChecker> {
25 public: 29 public:
26 class ConnectivityObserver { 30 class ConnectivityObserver {
27 public: 31 public:
28 // Will be called when internet connectivity changes. 32 // Will be called when internet connectivity changes.
29 virtual void OnConnectivityChanged(bool connected) = 0; 33 virtual void OnConnectivityChanged(bool connected) = 0;
30 34
31 protected: 35 protected:
32 ConnectivityObserver() {} 36 ConnectivityObserver() {}
33 virtual ~ConnectivityObserver() {} 37 virtual ~ConnectivityObserver() {}
34 38
35 private: 39 private:
36 DISALLOW_COPY_AND_ASSIGN(ConnectivityObserver); 40 DISALLOW_COPY_AND_ASSIGN(ConnectivityObserver);
37 }; 41 };
38 42
39 static scoped_refptr<ConnectivityChecker> Create( 43 static scoped_refptr<ConnectivityChecker> Create(
40 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); 44 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
45 net::ProxyConfig& proxy_config);
41 46
42 ConnectivityChecker(); 47 ConnectivityChecker();
43 48
44 void AddConnectivityObserver(ConnectivityObserver* observer); 49 void AddConnectivityObserver(ConnectivityObserver* observer);
45 void RemoveConnectivityObserver(ConnectivityObserver* observer); 50 void RemoveConnectivityObserver(ConnectivityObserver* observer);
46 51
47 // Returns if there is internet connectivity. 52 // Returns if there is internet connectivity.
48 virtual bool Connected() const = 0; 53 virtual bool Connected() const = 0;
49 54
50 // Checks for connectivity. 55 // Checks for connectivity.
(...skipping 10 matching lines...) Expand all
61 66
62 const scoped_refptr<base::ObserverListThreadSafe<ConnectivityObserver>> 67 const scoped_refptr<base::ObserverListThreadSafe<ConnectivityObserver>>
63 connectivity_observer_list_; 68 connectivity_observer_list_;
64 69
65 DISALLOW_COPY_AND_ASSIGN(ConnectivityChecker); 70 DISALLOW_COPY_AND_ASSIGN(ConnectivityChecker);
66 }; 71 };
67 72
68 } // namespace chromecast 73 } // namespace chromecast
69 74
70 #endif // CHROMECAST_NET_CONNECTIVITY_CHECKER_H_ 75 #endif // CHROMECAST_NET_CONNECTIVITY_CHECKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698