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

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

Issue 16519003: Define a LoggingSettings struct to use for InitLogging() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 7 years, 6 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/tools/get_server_time/get_server_time.cc ('k') | net/tools/testserver/run_testserver.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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 G_GNUC_BEGIN_IGNORE_DEPRECATIONS 146 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
147 #endif 147 #endif
148 g_type_init(); 148 g_type_init();
149 #if defined(USE_GLIB_DEPRECATIONS_MACROS) 149 #if defined(USE_GLIB_DEPRECATIONS_MACROS)
150 G_GNUC_END_IGNORE_DEPRECATIONS 150 G_GNUC_END_IGNORE_DEPRECATIONS
151 #endif 151 #endif
152 #undef USE_GLIB_DEPRECATIONS_MACROS 152 #undef USE_GLIB_DEPRECATIONS_MACROS
153 #endif // (defined(OS_LINUX) || defined(OS_OPENBSD)) && !defined(OS_CHROMEOS) 153 #endif // (defined(OS_LINUX) || defined(OS_OPENBSD)) && !defined(OS_CHROMEOS)
154 base::AtExitManager exit_manager; 154 base::AtExitManager exit_manager;
155 CommandLine::Init(argc, argv); 155 CommandLine::Init(argc, argv);
156 logging::InitLogging( 156 logging::LoggingSettings settings;
157 NULL, 157 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
158 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, 158 logging::InitLogging(settings);
159 logging::LOCK_LOG_FILE,
160 logging::DELETE_OLD_LOG_FILE,
161 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
162 159
163 // Just make the main message loop the network loop. 160 // Just make the main message loop the network loop.
164 base::MessageLoopForIO network_loop; 161 base::MessageLoopForIO network_loop;
165 162
166 NetWatcher net_watcher; 163 NetWatcher net_watcher;
167 164
168 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier( 165 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier(
169 net::NetworkChangeNotifier::Create()); 166 net::NetworkChangeNotifier::Create());
170 167
171 // Use the network loop as the file loop also. 168 // Use the network loop as the file loop also.
(...skipping 30 matching lines...) Expand all
202 proxy_config_service->RemoveObserver(&net_watcher); 199 proxy_config_service->RemoveObserver(&net_watcher);
203 200
204 // Uses |network_change_notifier|. 201 // Uses |network_change_notifier|.
205 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher); 202 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher);
206 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher); 203 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher);
207 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher); 204 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher);
208 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher); 205 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher);
209 206
210 return 0; 207 return 0;
211 } 208 }
OLDNEW
« no previous file with comments | « net/tools/get_server_time/get_server_time.cc ('k') | net/tools/testserver/run_testserver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698