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

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

Issue 1142513004: Chromecast: MessageLoopProxy cleanup --> SingleThreadTaskRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chromecast/net/net_switches.h" 10 #include "chromecast/net/net_switches.h"
(...skipping 17 matching lines...) Expand all
28 // changed to offline 28 // changed to offline
29 const unsigned int kNumBadResponses = 3; 29 const unsigned int kNumBadResponses = 3;
30 30
31 // Default url for connectivity checking. 31 // Default url for connectivity checking.
32 const char kDefaultConnectivityCheckUrl[] = 32 const char kDefaultConnectivityCheckUrl[] =
33 "https://clients3.google.com/generate_204"; 33 "https://clients3.google.com/generate_204";
34 34
35 } // namespace 35 } // namespace
36 36
37 ConnectivityChecker::ConnectivityChecker( 37 ConnectivityChecker::ConnectivityChecker(
38 const scoped_refptr<base::MessageLoopProxy>& loop_proxy) 38 const scoped_refptr<base::SingleThreadTaskRunner>& loop_proxy)
lcwu1 2015/05/19 01:45:38 Ditto.
gunsch 2015/05/19 03:01:58 Done.
39 : connectivity_observer_list_( 39 : connectivity_observer_list_(
40 new ObserverListThreadSafe<ConnectivityObserver>()), 40 new ObserverListThreadSafe<ConnectivityObserver>()),
41 loop_proxy_(loop_proxy), 41 loop_proxy_(loop_proxy),
42 connected_(false), 42 connected_(false),
43 bad_responses_(0) { 43 bad_responses_(0) {
44 DCHECK(loop_proxy_.get()); 44 DCHECK(loop_proxy_.get());
45 loop_proxy->PostTask(FROM_HERE, 45 loop_proxy->PostTask(FROM_HERE,
46 base::Bind(&ConnectivityChecker::Initialize, this)); 46 base::Bind(&ConnectivityChecker::Initialize, this));
47 } 47 }
48 48
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 void ConnectivityChecker::Cancel() { 177 void ConnectivityChecker::Cancel() {
178 if (url_request_.get()) { 178 if (url_request_.get()) {
179 VLOG(2) << "Cancel connectivity check in progress"; 179 VLOG(2) << "Cancel connectivity check in progress";
180 url_request_.reset(NULL); // URLRequest::Cancel() is called in destructor. 180 url_request_.reset(NULL); // URLRequest::Cancel() is called in destructor.
181 } 181 }
182 } 182 }
183 183
184 } // namespace chromecast 184 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698