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

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

Issue 2647323010: [Chromecast] Add proxy server support to chromecast (Closed)
Patch Set: Fix unittest failure 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 #include "chromecast/net/connectivity_checker.h" 5 #include "chromecast/net/connectivity_checker.h"
6 6
7 #include "chromecast/net/connectivity_checker_impl.h" 7 #include "chromecast/net/connectivity_checker_impl.h"
8 #include "components/proxy_config/pref_proxy_config_tracker.h"
8 9
9 namespace chromecast { 10 namespace chromecast {
10 11
11 ConnectivityChecker::ConnectivityChecker() 12 ConnectivityChecker::ConnectivityChecker()
12 : connectivity_observer_list_( 13 : connectivity_observer_list_(
13 new base::ObserverListThreadSafe<ConnectivityObserver>()) { 14 new base::ObserverListThreadSafe<ConnectivityObserver>()) {
14 } 15 }
15 16
16 ConnectivityChecker::~ConnectivityChecker() { 17 ConnectivityChecker::~ConnectivityChecker() {
17 } 18 }
18 19
19 void ConnectivityChecker::AddConnectivityObserver( 20 void ConnectivityChecker::AddConnectivityObserver(
20 ConnectivityObserver* observer) { 21 ConnectivityObserver* observer) {
21 connectivity_observer_list_->AddObserver(observer); 22 connectivity_observer_list_->AddObserver(observer);
22 } 23 }
23 24
24 void ConnectivityChecker::RemoveConnectivityObserver( 25 void ConnectivityChecker::RemoveConnectivityObserver(
25 ConnectivityObserver* observer) { 26 ConnectivityObserver* observer) {
26 connectivity_observer_list_->RemoveObserver(observer); 27 connectivity_observer_list_->RemoveObserver(observer);
27 } 28 }
28 29
29 void ConnectivityChecker::Notify(bool connected) { 30 void ConnectivityChecker::Notify(bool connected) {
30 DCHECK(connectivity_observer_list_.get()); 31 DCHECK(connectivity_observer_list_.get());
31 connectivity_observer_list_->Notify( 32 connectivity_observer_list_->Notify(
32 FROM_HERE, &ConnectivityObserver::OnConnectivityChanged, connected); 33 FROM_HERE, &ConnectivityObserver::OnConnectivityChanged, connected);
33 } 34 }
34 35
35 // static 36 // static
36 scoped_refptr<ConnectivityChecker> ConnectivityChecker::Create( 37 scoped_refptr<ConnectivityChecker> ConnectivityChecker::Create(
37 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { 38 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
38 return make_scoped_refptr(new ConnectivityCheckerImpl(task_runner)); 39 std::unique_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker) {
40 return make_scoped_refptr(new ConnectivityCheckerImpl(
41 task_runner, std::move(pref_proxy_config_tracker)));
39 } 42 }
40 43
41 } // namespace chromecast 44 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698