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

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

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 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
« no previous file with comments | « net/tools/get_server_time/get_server_time.cc ('k') | pdf/out_of_process_instance.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 case net::NetworkChangeNotifier::CONNECTION_BLUETOOTH: 64 case net::NetworkChangeNotifier::CONNECTION_BLUETOOTH:
65 return "CONNECTION_BLUETOOTH"; 65 return "CONNECTION_BLUETOOTH";
66 default: 66 default:
67 return "CONNECTION_UNEXPECTED"; 67 return "CONNECTION_UNEXPECTED";
68 } 68 }
69 } 69 }
70 70
71 std::string ProxyConfigToString(const net::ProxyConfig& config) { 71 std::string ProxyConfigToString(const net::ProxyConfig& config) {
72 scoped_ptr<base::Value> config_value(config.ToValue()); 72 scoped_ptr<base::Value> config_value(config.ToValue());
73 std::string str; 73 std::string str;
74 base::JSONWriter::Write(config_value.get(), &str); 74 base::JSONWriter::Write(*config_value, &str);
75 return str; 75 return str;
76 } 76 }
77 77
78 const char* ConfigAvailabilityToString( 78 const char* ConfigAvailabilityToString(
79 net::ProxyConfigService::ConfigAvailability availability) { 79 net::ProxyConfigService::ConfigAvailability availability) {
80 switch (availability) { 80 switch (availability) {
81 case net::ProxyConfigService::CONFIG_PENDING: 81 case net::ProxyConfigService::CONFIG_PENDING:
82 return "CONFIG_PENDING"; 82 return "CONFIG_PENDING";
83 case net::ProxyConfigService::CONFIG_VALID: 83 case net::ProxyConfigService::CONFIG_VALID:
84 return "CONFIG_VALID"; 84 return "CONFIG_VALID";
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 proxy_config_service->RemoveObserver(&net_watcher); 219 proxy_config_service->RemoveObserver(&net_watcher);
220 220
221 // Uses |network_change_notifier|. 221 // Uses |network_change_notifier|.
222 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher); 222 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher);
223 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher); 223 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher);
224 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher); 224 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher);
225 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher); 225 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher);
226 226
227 return 0; 227 return 0;
228 } 228 }
OLDNEW
« no previous file with comments | « net/tools/get_server_time/get_server_time.cc ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698