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

Side by Side Diff: net/dns/dns_config_service.cc

Issue 12209080: Cleanup: Remove deprecated base::Value methods from net. Use base::Value too. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 10 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/x509_certificate_net_log_param.cc ('k') | net/proxy/proxy_config.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 #include "net/dns/dns_config_service.h" 5 #include "net/dns/dns_config_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "net/base/ip_endpoint.h" 10 #include "net/base/ip_endpoint.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 search = d.search; 44 search = d.search;
45 append_to_multi_label_name = d.append_to_multi_label_name; 45 append_to_multi_label_name = d.append_to_multi_label_name;
46 ndots = d.ndots; 46 ndots = d.ndots;
47 timeout = d.timeout; 47 timeout = d.timeout;
48 attempts = d.attempts; 48 attempts = d.attempts;
49 rotate = d.rotate; 49 rotate = d.rotate;
50 edns0 = d.edns0; 50 edns0 = d.edns0;
51 } 51 }
52 52
53 base::Value* DnsConfig::ToValue() const { 53 base::Value* DnsConfig::ToValue() const {
54 DictionaryValue* dict = new DictionaryValue(); 54 base::DictionaryValue* dict = new base::DictionaryValue();
55 55
56 ListValue* list = new ListValue(); 56 base::ListValue* list = new base::ListValue();
57 for (size_t i = 0; i < nameservers.size(); ++i) 57 for (size_t i = 0; i < nameservers.size(); ++i)
58 list->Append(Value::CreateStringValue(nameservers[i].ToString())); 58 list->Append(new base::StringValue(nameservers[i].ToString()));
59 dict->Set("nameservers", list); 59 dict->Set("nameservers", list);
60 60
61 list = new ListValue(); 61 list = new base::ListValue();
62 for (size_t i = 0; i < search.size(); ++i) 62 for (size_t i = 0; i < search.size(); ++i)
63 list->Append(Value::CreateStringValue(search[i])); 63 list->Append(new base::StringValue(search[i]));
64 dict->Set("search", list); 64 dict->Set("search", list);
65 65
66 dict->SetBoolean("append_to_multi_label_name", append_to_multi_label_name); 66 dict->SetBoolean("append_to_multi_label_name", append_to_multi_label_name);
67 dict->SetInteger("ndots", ndots); 67 dict->SetInteger("ndots", ndots);
68 dict->SetDouble("timeout", timeout.InSecondsF()); 68 dict->SetDouble("timeout", timeout.InSecondsF());
69 dict->SetInteger("attempts", attempts); 69 dict->SetInteger("attempts", attempts);
70 dict->SetBoolean("rotate", rotate); 70 dict->SetBoolean("rotate", rotate);
71 dict->SetBoolean("edns0", edns0); 71 dict->SetBoolean("edns0", edns0);
72 dict->SetInteger("num_hosts", hosts.size()); 72 dict->SetInteger("num_hosts", hosts.size());
73 73
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 if (watch_failed_) { 217 if (watch_failed_) {
218 // If a watch failed, the config may not be accurate, so report empty. 218 // If a watch failed, the config may not be accurate, so report empty.
219 callback_.Run(DnsConfig()); 219 callback_.Run(DnsConfig());
220 } else { 220 } else {
221 callback_.Run(dns_config_); 221 callback_.Run(dns_config_);
222 } 222 }
223 } 223 }
224 224
225 } // namespace net 225 } // namespace net
226 226
OLDNEW
« no previous file with comments | « net/base/x509_certificate_net_log_param.cc ('k') | net/proxy/proxy_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698