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

Unified Diff: net/base/transport_security_state.cc

Issue 3013048: Convert src/net to use std::string/char* for DictionaryValue keys. (Closed)
Patch Set: fix for windows Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/net_log.cc ('k') | net/http/http_net_log_params.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/transport_security_state.cc
diff --git a/net/base/transport_security_state.cc b/net/base/transport_security_state.cc
index ca4dc1a52ba14faf84877e39a2fd054ae3defe7d..a450560903d9d4cec4d83b0671a882f8bf9af98f 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
« no previous file with comments | « net/base/net_log.cc ('k') | net/http/http_net_log_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698