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

Side by Side Diff: net/base/network_change_notifier_win.cc

Issue 2081007: Enable warning 4389 as an error on windows builds. This will make... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « net/base/listen_socket_unittest.cc ('k') | net/tools/dump_cache/cache_dumper.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "net/base/network_change_notifier_win.h" 5 #include "net/base/network_change_notifier_win.h"
6 6
7 #include <iphlpapi.h> 7 #include <iphlpapi.h>
8 #include <windows.h> 8 #include <windows.h>
9 #include <winsock2.h> 9 #include <winsock2.h>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 NetworkChangeNotifierWin::Impl::~Impl() { 44 NetworkChangeNotifierWin::Impl::~Impl() {
45 CancelIPChangeNotify(&addr_overlapped_); 45 CancelIPChangeNotify(&addr_overlapped_);
46 addr_watcher_.StopWatching(); 46 addr_watcher_.StopWatching();
47 WSACloseEvent(addr_overlapped_.hEvent); 47 WSACloseEvent(addr_overlapped_.hEvent);
48 memset(&addr_overlapped_, 0, sizeof(addr_overlapped_)); 48 memset(&addr_overlapped_, 0, sizeof(addr_overlapped_));
49 } 49 }
50 50
51 void NetworkChangeNotifierWin::Impl::WatchForAddressChange() { 51 void NetworkChangeNotifierWin::Impl::WatchForAddressChange() {
52 HANDLE handle = NULL; 52 HANDLE handle = NULL;
53 DWORD ret = NotifyAddrChange(&handle, &addr_overlapped_); 53 DWORD ret = NotifyAddrChange(&handle, &addr_overlapped_);
54 CHECK_EQ(ERROR_IO_PENDING, ret); 54 CHECK(ret == ERROR_IO_PENDING);
55 addr_watcher_.StartWatching(addr_overlapped_.hEvent, this); 55 addr_watcher_.StartWatching(addr_overlapped_.hEvent, this);
56 } 56 }
57 57
58 void NetworkChangeNotifierWin::Impl::OnObjectSignaled(HANDLE object) { 58 void NetworkChangeNotifierWin::Impl::OnObjectSignaled(HANDLE object) {
59 notifier_->OnIPAddressChanged(); 59 notifier_->OnIPAddressChanged();
60 60
61 // Start watching for further address changes. 61 // Start watching for further address changes.
62 WatchForAddressChange(); 62 WatchForAddressChange();
63 } 63 }
64 64
65 NetworkChangeNotifierWin::NetworkChangeNotifierWin() 65 NetworkChangeNotifierWin::NetworkChangeNotifierWin()
66 : impl_(new Impl(ALLOW_THIS_IN_INITIALIZER_LIST(this))) { 66 : impl_(new Impl(ALLOW_THIS_IN_INITIALIZER_LIST(this))) {
67 impl_->WatchForAddressChange(); 67 impl_->WatchForAddressChange();
68 } 68 }
69 69
70 NetworkChangeNotifierWin::~NetworkChangeNotifierWin() {} 70 NetworkChangeNotifierWin::~NetworkChangeNotifierWin() {}
71 71
72 } // namespace net 72 } // namespace net
OLDNEW
« no previous file with comments | « net/base/listen_socket_unittest.cc ('k') | net/tools/dump_cache/cache_dumper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698