summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 06:28:20 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 06:28:20 +0000
commitccaff65dbdd32a73f588ff5766f29910a8097d2a (patch)
tree31bb657f82eca6d679a0e72a6df5a4b0a37827be
parentf706b19cc858ede2ba8be3b36122f84019e9ed35 (diff)
downloadchromium_src-ccaff65dbdd32a73f588ff5766f29910a8097d2a.zip
chromium_src-ccaff65dbdd32a73f588ff5766f29910a8097d2a.tar.gz
chromium_src-ccaff65dbdd32a73f588ff5766f29910a8097d2a.tar.bz2
Convert src/net to use std::string/char* for DictionaryValue keys.
Hopefully I got them all. BUG=23581 TEST=net_unittests Review URL: http://codereview.chromium.org/3013048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54433 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/base/address_list_net_log_param.cc2
-rw-r--r--net/base/host_resolver_impl.cc11
-rw-r--r--net/base/net_log.cc11
-rw-r--r--net/base/transport_security_state.cc24
-rw-r--r--net/http/http_net_log_params.h6
-rw-r--r--net/proxy/proxy_resolver_js_bindings.cc6
-rw-r--r--net/spdy/spdy_session.cc10
-rw-r--r--net/url_request/url_request_netlog_params.cc8
8 files changed, 39 insertions, 39 deletions
diff --git a/net/base/address_list_net_log_param.cc b/net/base/address_list_net_log_param.cc
index 05b1a0d..72332ef 100644
--- a/net/base/address_list_net_log_param.cc
+++ b/net/base/address_list_net_log_param.cc
@@ -23,7 +23,7 @@ Value* AddressListNetLogParam::ToValue() const {
list->Append(Value::CreateStringValue(NetAddressToStringWithPort(head)));
}
- dict->Set(L"address_list", list);
+ dict->Set("address_list", list);
return dict;
}
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 43889ac..aa1ed9c 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -23,6 +23,7 @@
#include "base/stl_util-inl.h"
#include "base/string_util.h"
#include "base/time.h"
+#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "base/worker_pool.h"
#include "net/base/address_list.h"
@@ -95,13 +96,13 @@ class HostResolveFailedParams : public NetLog::EventParameters {
virtual Value* ToValue() const {
DictionaryValue* dict = new DictionaryValue();
- dict->SetInteger(L"net_error", net_error_);
- dict->SetBoolean(L"was_from_cache", was_from_cache_);
+ dict->SetInteger("net_error", net_error_);
+ dict->SetBoolean("was_from_cache", was_from_cache_);
if (os_error_) {
- dict->SetInteger(L"os_error", os_error_);
+ dict->SetInteger("os_error", os_error_);
#if defined(OS_POSIX)
- dict->SetString(L"os_error_string", gai_strerror(os_error_));
+ dict->SetString("os_error_string", gai_strerror(os_error_));
#elif defined(OS_WIN)
// Map the error code to a human-readable string.
LPWSTR error_string = NULL;
@@ -113,7 +114,7 @@ class HostResolveFailedParams : public NetLog::EventParameters {
(LPWSTR)&error_string,
0, // Buffer size.
0); // Arguments (unused).
- dict->SetString(L"os_error_string", error_string);
+ dict->SetString("os_error_string", WideToUTF8(error_string));
LocalFree(error_string);
#endif
}
diff --git a/net/base/net_log.cc b/net/base/net_log.cc
index bd62f91..bc79a30 100644
--- a/net/base/net_log.cc
+++ b/net/base/net_log.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "net/base/net_log.h"
-#include "base/string_util.h"
#include "base/time.h"
#include "base/values.h"
@@ -88,13 +87,13 @@ NetLogStringParameter::NetLogStringParameter(const char* name,
Value* NetLogIntegerParameter::ToValue() const {
DictionaryValue* dict = new DictionaryValue();
- dict->SetInteger(ASCIIToWide(name_), value_);
+ dict->SetInteger(name_, value_);
return dict;
}
Value* NetLogStringParameter::ToValue() const {
DictionaryValue* dict = new DictionaryValue();
- dict->SetString(ASCIIToWide(name_), value_);
+ dict->SetString(name_, value_);
return dict;
}
@@ -102,10 +101,10 @@ Value* NetLogSourceParameter::ToValue() const {
DictionaryValue* dict = new DictionaryValue();
DictionaryValue* source_dict = new DictionaryValue();
- source_dict->SetInteger(L"type", static_cast<int>(value_.type));
- source_dict->SetInteger(L"id", static_cast<int>(value_.id));
+ source_dict->SetInteger("type", static_cast<int>(value_.type));
+ source_dict->SetInteger("id", static_cast<int>(value_.id));
- dict->Set(ASCIIToWide(name_), source_dict);
+ dict->Set(name_, source_dict);
return dict;
}
diff --git a/net/base/transport_security_state.cc b/net/base/transport_security_state.cc
index ca4dc1a..a450560 100644
--- a/net/base/transport_security_state.cc
+++ b/net/base/transport_security_state.cc
@@ -202,10 +202,10 @@ void TransportSecurityState::SetDelegate(
// This function converts the binary hashes, which we store in
// |enabled_hosts_|, to a base64 string which we can include in a JSON file.
-static std::wstring HashedDomainToExternalString(const std::string& hashed) {
+static std::string HashedDomainToExternalString(const std::string& hashed) {
std::string out;
CHECK(base::Base64Encode(hashed, &out));
- return ASCIIToWide(out);
+ return out;
}
// This inverts |HashedDomainToExternalString|, above. It turns an external
@@ -225,19 +225,19 @@ bool TransportSecurityState::Serialise(std::string* output) {
for (std::map<std::string, DomainState>::const_iterator
i = enabled_hosts_.begin(); i != enabled_hosts_.end(); ++i) {
DictionaryValue* state = new DictionaryValue;
- state->SetBoolean(L"include_subdomains", i->second.include_subdomains);
- state->SetReal(L"created", i->second.created.ToDoubleT());
- state->SetReal(L"expiry", i->second.expiry.ToDoubleT());
+ state->SetBoolean("include_subdomains", i->second.include_subdomains);
+ state->SetReal("created", i->second.created.ToDoubleT());
+ state->SetReal("expiry", i->second.expiry.ToDoubleT());
switch (i->second.mode) {
case DomainState::MODE_STRICT:
- state->SetString(L"mode", "strict");
+ state->SetString("mode", "strict");
break;
case DomainState::MODE_OPPORTUNISTIC:
- state->SetString(L"mode", "opportunistic");
+ state->SetString("mode", "opportunistic");
break;
case DomainState::MODE_SPDY_ONLY:
- state->SetString(L"mode", "spdy-only");
+ state->SetString("mode", "spdy-only");
break;
default:
NOTREACHED() << "DomainState with unknown mode";
@@ -276,9 +276,9 @@ bool TransportSecurityState::Deserialise(const std::string& input,
double created;
double expiry;
- if (!state->GetBoolean(L"include_subdomains", &include_subdomains) ||
- !state->GetString(L"mode", &mode_string) ||
- !state->GetReal(L"expiry", &expiry)) {
+ if (!state->GetBoolean("include_subdomains", &include_subdomains) ||
+ !state->GetString("mode", &mode_string) ||
+ !state->GetReal("expiry", &expiry)) {
continue;
}
@@ -297,7 +297,7 @@ bool TransportSecurityState::Deserialise(const std::string& input,
base::Time expiry_time = base::Time::FromDoubleT(expiry);
base::Time created_time;
- if (state->GetReal(L"created", &created)) {
+ if (state->GetReal("created", &created)) {
created_time = base::Time::FromDoubleT(created);
} else {
// We're migrating an old entry with no creation date. Make sure we
diff --git a/net/http/http_net_log_params.h b/net/http/http_net_log_params.h
index 639d959..4b419da 100644
--- a/net/http/http_net_log_params.h
+++ b/net/http/http_net_log_params.h
@@ -28,7 +28,7 @@ class NetLogHttpRequestParameter : public NetLog::EventParameters {
Value* ToValue() const {
DictionaryValue* dict = new DictionaryValue();
- dict->SetString(L"line", line_);
+ dict->SetString("line", line_);
ListValue* headers = new ListValue();
HttpRequestHeaders::Iterator iterator(headers_);
while (iterator.GetNext()) {
@@ -37,7 +37,7 @@ class NetLogHttpRequestParameter : public NetLog::EventParameters {
iterator.name().c_str(),
iterator.value().c_str())));
}
- dict->Set(L"headers", headers);
+ dict->Set("headers", headers);
return dict;
}
@@ -67,7 +67,7 @@ class NetLogHttpResponseParameter : public NetLog::EventParameters {
headers->Append(
new StringValue(StringPrintf("%s: %s", name.c_str(), value.c_str())));
}
- dict->Set(L"headers", headers);
+ dict->Set("headers", headers);
return dict;
}
diff --git a/net/proxy/proxy_resolver_js_bindings.cc b/net/proxy/proxy_resolver_js_bindings.cc
index 56604cd..95ccdb5 100644
--- a/net/proxy/proxy_resolver_js_bindings.cc
+++ b/net/proxy/proxy_resolver_js_bindings.cc
@@ -31,8 +31,8 @@ class ErrorNetlogParams : public NetLog::EventParameters {
virtual Value* ToValue() const {
DictionaryValue* dict = new DictionaryValue();
- dict->SetInteger(L"line_number", line_number_);
- dict->SetStringFromUTF16(L"message", message_);
+ dict->SetInteger("line_number", line_number_);
+ dict->SetStringFromUTF16("message", message_);
return dict;
}
@@ -51,7 +51,7 @@ class AlertNetlogParams : public NetLog::EventParameters {
virtual Value* ToValue() const {
DictionaryValue* dict = new DictionaryValue();
- dict->SetStringFromUTF16(L"message", message_);
+ dict->SetStringFromUTF16("message", message_);
return dict;
}
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 7ff500a..e9ecec3 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -86,11 +86,11 @@ class NetLogSpdySynParameter : public NetLog::EventParameters {
DictionaryValue* headers_dict = new DictionaryValue();
for (spdy::SpdyHeaderBlock::const_iterator it = headers_->begin();
it != headers_->end(); ++it) {
- headers_dict->SetString(ASCIIToWide(it->first), it->second);
+ headers_dict->SetString(it->first, it->second);
}
- dict->SetInteger(L"flags", flags_);
- dict->Set(L"headers", headers_dict);
- dict->SetInteger(L"id", id_);
+ dict->SetInteger("flags", flags_);
+ dict->Set("headers", headers_dict);
+ dict->SetInteger("id", id_);
return dict;
}
@@ -117,7 +117,7 @@ class NetLogSpdySettingsParameter : public NetLog::EventParameters {
settings->Append(new StringValue(
StringPrintf("[%u:%u]", it->first.id(), it->second)));
}
- dict->Set(L"settings", settings);
+ dict->Set("settings", settings);
return dict;
}
diff --git a/net/url_request/url_request_netlog_params.cc b/net/url_request/url_request_netlog_params.cc
index 3693ee9..56414b1 100644
--- a/net/url_request/url_request_netlog_params.cc
+++ b/net/url_request/url_request_netlog_params.cc
@@ -19,9 +19,9 @@ URLRequestStartEventParameters::URLRequestStartEventParameters(
Value* URLRequestStartEventParameters::ToValue() const {
DictionaryValue* dict = new DictionaryValue();
- dict->SetString(L"url", url_.possibly_invalid_spec());
- dict->SetString(L"method", method_);
- dict->SetInteger(L"load_flags", load_flags_);
- dict->SetInteger(L"priority", static_cast<int>(priority_));
+ dict->SetString("url", url_.possibly_invalid_spec());
+ dict->SetString("method", method_);
+ dict->SetInteger("load_flags", load_flags_);
+ dict->SetInteger("priority", static_cast<int>(priority_));
return dict;
}