summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 20:00:20 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 20:00:20 +0000
commit93d49d70b89b22ec46d0b00b7950297f64865d56 (patch)
tree3243e0209c738df0c18c2ba615667f757fcaec94 /net/base
parenta9f607e33a91604bc63bd8c846aefbda9bf0dfa9 (diff)
downloadchromium_src-93d49d70b89b22ec46d0b00b7950297f64865d56.zip
chromium_src-93d49d70b89b22ec46d0b00b7950297f64865d56.tar.gz
chromium_src-93d49d70b89b22ec46d0b00b7950297f64865d56.tar.bz2
Move the json-related files into a separate json directory. This hopefully also
makes the naming of string_escape more clear (it's actually JSON-specific). Move the files into the base namespace. TEST=none BUG=none Review URL: http://codereview.chromium.org/316016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29934 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/net_util.cc14
-rw-r--r--net/base/strict_transport_security_state.cc8
2 files changed, 11 insertions, 11 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 49ded14..5d2089d 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -32,13 +32,13 @@
#include "base/i18n/file_util_icu.h"
#include "base/i18n/icu_string_conversions.h"
#include "base/i18n/time_formatting.h"
+#include "base/json/string_escape.h"
#include "base/lock.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/singleton.h"
#include "base/stl_util-inl.h"
-#include "base/string_escape.h"
#include "base/string_piece.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
@@ -945,7 +945,7 @@ std::string GetDirectoryListingHeader(const string16& title) {
result.assign(header.data(), header.size());
result.append("<script>start(");
- string_escape::JsonDoubleQuote(title, true, &result);
+ base::JsonDoubleQuote(title, true, &result);
result.append(");</script>\n");
return result;
@@ -1006,13 +1006,13 @@ std::string GetDirectoryListingEntry(const string16& name,
Time modified) {
std::string result;
result.append("<script>addRow(");
- string_escape::JsonDoubleQuote(name, true, &result);
+ base::JsonDoubleQuote(name, true, &result);
result.append(",");
if (raw_bytes.empty()) {
- string_escape::JsonDoubleQuote(EscapePath(UTF16ToUTF8(name)),
+ base::JsonDoubleQuote(EscapePath(UTF16ToUTF8(name)),
true, &result);
} else {
- string_escape::JsonDoubleQuote(EscapePath(raw_bytes), true, &result);
+ base::JsonDoubleQuote(EscapePath(raw_bytes), true, &result);
}
if (is_dir) {
result.append(",1,");
@@ -1020,7 +1020,7 @@ std::string GetDirectoryListingEntry(const string16& name,
result.append(",0,");
}
- string_escape::JsonDoubleQuote(
+ base::JsonDoubleQuote(
WideToUTF16Hack(FormatBytes(size, GetByteDisplayUnits(size), true)), true,
&result);
@@ -1031,7 +1031,7 @@ std::string GetDirectoryListingEntry(const string16& name,
if (!modified.is_null()) {
modified_str = WideToUTF16Hack(base::TimeFormatShortDateAndTime(modified));
}
- string_escape::JsonDoubleQuote(modified_str, true, &result);
+ base::JsonDoubleQuote(modified_str, true, &result);
result.append(");</script>\n");
diff --git a/net/base/strict_transport_security_state.cc b/net/base/strict_transport_security_state.cc
index fc267c5..8318185 100644
--- a/net/base/strict_transport_security_state.cc
+++ b/net/base/strict_transport_security_state.cc
@@ -4,8 +4,8 @@
#include "net/base/strict_transport_security_state.h"
-#include "base/json_reader.h"
-#include "base/json_writer.h"
+#include "base/json/json_reader.h"
+#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/sha2.h"
@@ -228,7 +228,7 @@ bool StrictTransportSecurityState::Serialise(std::string* output) {
toplevel.Set(HashedDomainToExternalString(i->first), state);
}
- JSONWriter::Write(&toplevel, true /* pretty print */, output);
+ base::JSONWriter::Write(&toplevel, true /* pretty print */, output);
return true;
}
@@ -238,7 +238,7 @@ bool StrictTransportSecurityState::Deserialise(const std::string& input) {
enabled_hosts_.clear();
scoped_ptr<Value> value(
- JSONReader::Read(input, false /* do not allow trailing commas */));
+ base::JSONReader::Read(input, false /* do not allow trailing commas */));
if (!value.get() || !value->IsType(Value::TYPE_DICTIONARY))
return false;