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

Unified Diff: net/base/network_change_notifier_win.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/base/network_change_notifier_win.cc
diff --git a/net/base/network_change_notifier_win.cc b/net/base/network_change_notifier_win.cc
index 77a72b0d6934150162ff5b4516c4ac6b8c7f3266..8497e7f12ce3dc240644c7a4bec6f32a26b75a20 100644
--- a/net/base/network_change_notifier_win.cc
+++ b/net/base/network_change_notifier_win.cc
@@ -32,18 +32,14 @@ class NetworkChangeNotifierWin::DnsConfigServiceThread : public base::Thread {
public:
DnsConfigServiceThread() : base::Thread("DnsConfigService") {}
- virtual ~DnsConfigServiceThread() {
- Stop();
- }
+ virtual ~DnsConfigServiceThread() { Stop(); }
virtual void Init() OVERRIDE {
service_ = DnsConfigService::CreateSystemService();
service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig));
}
- virtual void CleanUp() OVERRIDE {
- service_.reset();
- }
+ virtual void CleanUp() OVERRIDE { service_.reset(); }
private:
scoped_ptr<DnsConfigService> service_;
@@ -58,8 +54,8 @@ NetworkChangeNotifierWin::NetworkChangeNotifierWin()
weak_factory_(this),
dns_config_service_thread_(new DnsConfigServiceThread()),
last_computed_connection_type_(RecomputeCurrentConnectionType()),
- last_announced_offline_(
- last_computed_connection_type_ == CONNECTION_NONE) {
+ last_announced_offline_(last_computed_connection_type_ ==
+ CONNECTION_NONE) {
memset(&addr_overlapped_, 0, sizeof addr_overlapped_);
addr_overlapped_.hEvent = WSACreateEvent();
}
@@ -152,8 +148,7 @@ NetworkChangeNotifierWin::RecomputeCurrentConnectionType() const {
query_set.dwNameSpace = NS_NLA;
// Initiate a client query to iterate through the
// currently connected networks.
- if (0 != WSALookupServiceBegin(&query_set, LUP_RETURN_ALL,
- &ws_handle)) {
+ if (0 != WSALookupServiceBegin(&query_set, LUP_RETURN_ALL, &ws_handle)) {
LOG(ERROR) << "WSALookupServiceBegin failed with: " << WSAGetLastError();
return NetworkChangeNotifier::CONNECTION_UNKNOWN;
}
@@ -169,11 +164,11 @@ NetworkChangeNotifierWin::RecomputeCurrentConnectionType() const {
DWORD length = sizeof(result_buffer);
reinterpret_cast<WSAQUERYSET*>(&result_buffer[0])->dwSize =
sizeof(WSAQUERYSET);
- int result = WSALookupServiceNext(
- ws_handle,
- LUP_RETURN_NAME,
- &length,
- reinterpret_cast<WSAQUERYSET*>(&result_buffer[0]));
+ int result =
+ WSALookupServiceNext(ws_handle,
+ LUP_RETURN_NAME,
+ &length,
+ reinterpret_cast<WSAQUERYSET*>(&result_buffer[0]));
if (result == 0) {
// Found a connection!
@@ -197,12 +192,11 @@ NetworkChangeNotifierWin::RecomputeCurrentConnectionType() const {
}
result = WSALookupServiceEnd(ws_handle);
- LOG_IF(ERROR, result != 0)
- << "WSALookupServiceEnd() failed with: " << result;
+ LOG_IF(ERROR, result != 0) << "WSALookupServiceEnd() failed with: " << result;
// TODO(droger): Return something more detailed than CONNECTION_UNKNOWN.
- return found_connection ? NetworkChangeNotifier::CONNECTION_UNKNOWN :
- NetworkChangeNotifier::CONNECTION_NONE;
+ return found_connection ? NetworkChangeNotifier::CONNECTION_UNKNOWN
+ : NetworkChangeNotifier::CONNECTION_NONE;
}
NetworkChangeNotifier::ConnectionType
@@ -241,7 +235,9 @@ void NetworkChangeNotifierWin::NotifyObservers() {
// If after one second we determine we are still offline, we will
// delay again.
offline_polls_ = 0;
- timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(1), this,
+ timer_.Start(FROM_HERE,
+ base::TimeDelta::FromSeconds(1),
+ this,
&NetworkChangeNotifierWin::NotifyParentOfConnectionTypeChange);
}
@@ -292,7 +288,7 @@ bool NetworkChangeNotifierWin::WatchForAddressChangeInternal() {
if (!dns_config_service_thread_->IsRunning()) {
dns_config_service_thread_->StartWithOptions(
- base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
+ base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
}
HANDLE handle = NULL;
@@ -313,7 +309,9 @@ void NetworkChangeNotifierWin::NotifyParentOfConnectionTypeChange() {
// we may not detect the transition to online state after 1 second but within
// 20 seconds we generally do.
if (last_announced_offline_ && current_offline && offline_polls_ <= 20) {
- timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(1), this,
+ timer_.Start(FROM_HERE,
+ base::TimeDelta::FromSeconds(1),
+ this,
&NetworkChangeNotifierWin::NotifyParentOfConnectionTypeChange);
return;
}

Powered by Google App Engine
This is Rietveld 408576698