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

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

Issue 8575013: Offline state detection for linux, using new D-Bus library. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/network_change_notifier.h ('k') | net/base/network_change_notifier_linux.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "net/base/network_change_notifier.h"
6 #include "net/base/network_change_notifier_factory.h" 6 #include "net/base/network_change_notifier_factory.h"
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #if defined(OS_WIN) 8 #if defined(OS_WIN)
9 #include "net/base/network_change_notifier_win.h" 9 #include "net/base/network_change_notifier_win.h"
10 #elif defined(OS_LINUX) || defined(OS_ANDROID) 10 #elif defined(OS_LINUX) || defined(OS_ANDROID)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #if defined(OS_WIN) 53 #if defined(OS_WIN)
54 NetworkChangeNotifierWin* network_change_notifier = 54 NetworkChangeNotifierWin* network_change_notifier =
55 new NetworkChangeNotifierWin(); 55 new NetworkChangeNotifierWin();
56 network_change_notifier->WatchForAddressChange(); 56 network_change_notifier->WatchForAddressChange();
57 return network_change_notifier; 57 return network_change_notifier;
58 #elif defined(OS_CHROMEOS) 58 #elif defined(OS_CHROMEOS)
59 // ChromeOS builds MUST use its own class factory. 59 // ChromeOS builds MUST use its own class factory.
60 CHECK(false); 60 CHECK(false);
61 return NULL; 61 return NULL;
62 #elif defined(OS_LINUX) || defined(OS_ANDROID) 62 #elif defined(OS_LINUX) || defined(OS_ANDROID)
63 return new NetworkChangeNotifierLinux(); 63 return NetworkChangeNotifierLinux::Create();
64 #elif defined(OS_MACOSX) 64 #elif defined(OS_MACOSX)
65 return new NetworkChangeNotifierMac(); 65 return new NetworkChangeNotifierMac();
66 #else 66 #else
67 NOTIMPLEMENTED(); 67 NOTIMPLEMENTED();
68 return NULL; 68 return NULL;
69 #endif 69 #endif
70 } 70 }
71 71
72 // static 72 // static
73 bool NetworkChangeNotifier::IsOffline() { 73 bool NetworkChangeNotifier::IsOffline() {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 DCHECK(g_network_change_notifier); 163 DCHECK(g_network_change_notifier);
164 g_network_change_notifier = NULL; 164 g_network_change_notifier = NULL;
165 } 165 }
166 166
167 NetworkChangeNotifier::DisableForTest::~DisableForTest() { 167 NetworkChangeNotifier::DisableForTest::~DisableForTest() {
168 DCHECK(!g_network_change_notifier); 168 DCHECK(!g_network_change_notifier);
169 g_network_change_notifier = network_change_notifier_; 169 g_network_change_notifier = network_change_notifier_;
170 } 170 }
171 171
172 } // namespace net 172 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_change_notifier.h ('k') | net/base/network_change_notifier_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698