OLD | NEW |
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 << ProxyConfigToString(config) << ", " | 120 << ProxyConfigToString(config) << ", " |
121 << ConfigAvailabilityToString(availability) << ")"; | 121 << ConfigAvailabilityToString(availability) << ")"; |
122 } | 122 } |
123 | 123 |
124 private: | 124 private: |
125 DISALLOW_COPY_AND_ASSIGN(NetWatcher); | 125 DISALLOW_COPY_AND_ASSIGN(NetWatcher); |
126 }; | 126 }; |
127 | 127 |
128 } // namespace | 128 } // namespace |
129 | 129 |
| 130 // From glib version 2.36 onwards, g_type_init is implicitly called and it is |
| 131 // deprecated. |
| 132 #if (defined(OS_LINUX) || defined(OS_OPENBSD)) && !defined(OS_CHROMEOS) |
| 133 #pragma GCC diagnostic push |
| 134 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
| 135 #endif |
| 136 |
130 int main(int argc, char* argv[]) { | 137 int main(int argc, char* argv[]) { |
131 #if defined(OS_MACOSX) | 138 #if defined(OS_MACOSX) |
132 base::mac::ScopedNSAutoreleasePool pool; | 139 base::mac::ScopedNSAutoreleasePool pool; |
133 #endif | 140 #endif |
134 #if (defined(OS_LINUX) || defined(OS_OPENBSD)) && !defined(OS_CHROMEOS) | 141 #if (defined(OS_LINUX) || defined(OS_OPENBSD)) && !defined(OS_CHROMEOS) |
135 // Needed so ProxyConfigServiceLinux can use gconf. | 142 // Needed so ProxyConfigServiceLinux can use gconf. |
136 // Normally handled by BrowserMainLoop::InitializeToolkit(). | 143 // Normally handled by BrowserMainLoop::InitializeToolkit(). |
137 g_type_init(); | 144 g_type_init(); |
138 #endif | 145 #endif |
139 base::AtExitManager exit_manager; | 146 base::AtExitManager exit_manager; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 proxy_config_service->RemoveObserver(&net_watcher); | 195 proxy_config_service->RemoveObserver(&net_watcher); |
189 | 196 |
190 // Uses |network_change_notifier|. | 197 // Uses |network_change_notifier|. |
191 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher); | 198 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher); |
192 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher); | 199 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher); |
193 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher); | 200 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher); |
194 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher); | 201 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher); |
195 | 202 |
196 return 0; | 203 return 0; |
197 } | 204 } |
| 205 |
| 206 #if (defined(OS_LINUX) || defined(OS_OPENBSD)) && !defined(OS_CHROMEOS) |
| 207 #pragma GCC diagnostic pop |
| 208 #endif |
OLD | NEW |