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

Side by Side Diff: net/tools/net_watcher/net_watcher.cc

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « net/tools/get_server_time/get_server_time.cc ('k') | net/tools/quic/quic_client_bin.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // This is a small utility that watches for and logs network changes. 5 // This is a small utility that watches for and logs network changes.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier( 180 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier(
181 new net::NetworkChangeNotifierLinux(ignored_interfaces)); 181 new net::NetworkChangeNotifierLinux(ignored_interfaces));
182 #else 182 #else
183 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier( 183 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier(
184 net::NetworkChangeNotifier::Create()); 184 net::NetworkChangeNotifier::Create());
185 #endif 185 #endif
186 186
187 // Use the network loop as the file loop also. 187 // Use the network loop as the file loop also.
188 scoped_ptr<net::ProxyConfigService> proxy_config_service( 188 scoped_ptr<net::ProxyConfigService> proxy_config_service(
189 net::ProxyService::CreateSystemProxyConfigService( 189 net::ProxyService::CreateSystemProxyConfigService(
190 network_loop.message_loop_proxy(), 190 network_loop.task_runner(), network_loop.task_runner()));
191 network_loop.message_loop_proxy()));
192 191
193 // Uses |network_change_notifier|. 192 // Uses |network_change_notifier|.
194 net::NetworkChangeNotifier::AddIPAddressObserver(&net_watcher); 193 net::NetworkChangeNotifier::AddIPAddressObserver(&net_watcher);
195 net::NetworkChangeNotifier::AddConnectionTypeObserver(&net_watcher); 194 net::NetworkChangeNotifier::AddConnectionTypeObserver(&net_watcher);
196 net::NetworkChangeNotifier::AddDNSObserver(&net_watcher); 195 net::NetworkChangeNotifier::AddDNSObserver(&net_watcher);
197 net::NetworkChangeNotifier::AddNetworkChangeObserver(&net_watcher); 196 net::NetworkChangeNotifier::AddNetworkChangeObserver(&net_watcher);
198 197
199 proxy_config_service->AddObserver(&net_watcher); 198 proxy_config_service->AddObserver(&net_watcher);
200 199
201 LOG(INFO) << "Initial connection type: " 200 LOG(INFO) << "Initial connection type: "
(...skipping 17 matching lines...) Expand all
219 proxy_config_service->RemoveObserver(&net_watcher); 218 proxy_config_service->RemoveObserver(&net_watcher);
220 219
221 // Uses |network_change_notifier|. 220 // Uses |network_change_notifier|.
222 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher); 221 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher);
223 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher); 222 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher);
224 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher); 223 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher);
225 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher); 224 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher);
226 225
227 return 0; 226 return 0;
228 } 227 }
OLDNEW
« no previous file with comments | « net/tools/get_server_time/get_server_time.cc ('k') | net/tools/quic/quic_client_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698