summaryrefslogtreecommitdiffstats
path: root/base/json
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 17:56:08 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 17:56:08 +0000
commita43a667b33d3540ed3c1f7cd1ce427cf9bdf9d23 (patch)
tree48e5ca8e97ed632bdad1e47c6b2257a08ac7077f /base/json
parent1aab0f657157c1f29e2a537f755b552eede68ba2 (diff)
downloadchromium_src-a43a667b33d3540ed3c1f7cd1ce427cf9bdf9d23.zip
chromium_src-a43a667b33d3540ed3c1f7cd1ce427cf9bdf9d23.tar.gz
chromium_src-a43a667b33d3540ed3c1f7cd1ce427cf9bdf9d23.tar.bz2
Make base compile with no "using base::Value" in values.h
This adds explicit namespace to a bunch of places. BUG= R=avi@chromium.org Review URL: https://codereview.chromium.org/16797003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/json')
-rw-r--r--base/json/json_file_value_serializer.cc11
-rw-r--r--base/json/json_file_value_serializer.h10
-rw-r--r--base/json/json_string_value_serializer.cc2
-rw-r--r--base/json/json_string_value_serializer.h10
4 files changed, 18 insertions, 15 deletions
diff --git a/base/json/json_file_value_serializer.cc b/base/json/json_file_value_serializer.cc
index 5ee974b..d6cff33 100644
--- a/base/json/json_file_value_serializer.cc
+++ b/base/json/json_file_value_serializer.cc
@@ -15,15 +15,16 @@ const char* JSONFileValueSerializer::kCannotReadFile = "Can't read file.";
const char* JSONFileValueSerializer::kFileLocked = "File locked.";
const char* JSONFileValueSerializer::kNoSuchFile = "File doesn't exist.";
-bool JSONFileValueSerializer::Serialize(const Value& root) {
+bool JSONFileValueSerializer::Serialize(const base::Value& root) {
return SerializeInternal(root, false);
}
-bool JSONFileValueSerializer::SerializeAndOmitBinaryValues(const Value& root) {
+bool JSONFileValueSerializer::SerializeAndOmitBinaryValues(
+ const base::Value& root) {
return SerializeInternal(root, true);
}
-bool JSONFileValueSerializer::SerializeInternal(const Value& root,
+bool JSONFileValueSerializer::SerializeInternal(const base::Value& root,
bool omit_binary_values) {
std::string json_string;
JSONStringValueSerializer serializer(&json_string);
@@ -80,8 +81,8 @@ const char* JSONFileValueSerializer::GetErrorMessageForCode(int error_code) {
}
}
-Value* JSONFileValueSerializer::Deserialize(int* error_code,
- std::string* error_str) {
+base::Value* JSONFileValueSerializer::Deserialize(int* error_code,
+ std::string* error_str) {
std::string json_string;
int error = ReadFileToString(&json_string);
if (error != JSON_NO_ERROR) {
diff --git a/base/json/json_file_value_serializer.h b/base/json/json_file_value_serializer.h
index 81904df..4a0c334 100644
--- a/base/json/json_file_value_serializer.h
+++ b/base/json/json_file_value_serializer.h
@@ -32,11 +32,11 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer {
// Attempt to serialize the data structure represented by Value into
// JSON. If the return value is true, the result will have been written
// into the file whose name was passed into the constructor.
- virtual bool Serialize(const Value& root) OVERRIDE;
+ virtual bool Serialize(const base::Value& root) OVERRIDE;
// Equivalent to Serialize(root) except binary values are omitted from the
// output.
- bool SerializeAndOmitBinaryValues(const Value& root);
+ bool SerializeAndOmitBinaryValues(const base::Value& root);
// Attempt to deserialize the data structure encoded in the file passed
// in to the constructor into a structure of Value objects. If the return
@@ -45,8 +45,8 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer {
// If |error_message| is non-null, it will be filled in with a formatted
// error message including the location of the error if appropriate.
// The caller takes ownership of the returned value.
- virtual Value* Deserialize(int* error_code,
- std::string* error_message) OVERRIDE;
+ virtual base::Value* Deserialize(int* error_code,
+ std::string* error_message) OVERRIDE;
// This enum is designed to safely overlap with JSONReader::JsonParseError.
enum JsonFileError {
@@ -72,7 +72,7 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer {
}
private:
- bool SerializeInternal(const Value& root, bool omit_binary_values);
+ bool SerializeInternal(const base::Value& root, bool omit_binary_values);
base::FilePath json_file_path_;
bool allow_trailing_comma_;
diff --git a/base/json/json_string_value_serializer.cc b/base/json/json_string_value_serializer.cc
index 59c0765..7611fbe 100644
--- a/base/json/json_string_value_serializer.cc
+++ b/base/json/json_string_value_serializer.cc
@@ -8,6 +8,8 @@
#include "base/json/json_writer.h"
#include "base/logging.h"
+using base::Value;
+
JSONStringValueSerializer::~JSONStringValueSerializer() {}
bool JSONStringValueSerializer::Serialize(const Value& root) {
diff --git a/base/json/json_string_value_serializer.h b/base/json/json_string_value_serializer.h
index 71bd152..8aa3f95 100644
--- a/base/json/json_string_value_serializer.h
+++ b/base/json/json_string_value_serializer.h
@@ -38,11 +38,11 @@ class BASE_EXPORT JSONStringValueSerializer : public base::ValueSerializer {
// Attempt to serialize the data structure represented by Value into
// JSON. If the return value is true, the result will have been written
// into the string passed into the constructor.
- virtual bool Serialize(const Value& root) OVERRIDE;
+ virtual bool Serialize(const base::Value& root) OVERRIDE;
// Equivalent to Serialize(root) except binary values are omitted from the
// output.
- bool SerializeAndOmitBinaryValues(const Value& root);
+ bool SerializeAndOmitBinaryValues(const base::Value& root);
// Attempt to deserialize the data structure encoded in the string passed
// in to the constructor into a structure of Value objects. If the return
@@ -51,8 +51,8 @@ class BASE_EXPORT JSONStringValueSerializer : public base::ValueSerializer {
// If |error_message| is non-null, it will be filled in with a formatted
// error message including the location of the error if appropriate.
// The caller takes ownership of the returned value.
- virtual Value* Deserialize(int* error_code,
- std::string* error_message) OVERRIDE;
+ virtual base::Value* Deserialize(int* error_code,
+ std::string* error_message) OVERRIDE;
void set_pretty_print(bool new_value) { pretty_print_ = new_value; }
bool pretty_print() { return pretty_print_; }
@@ -62,7 +62,7 @@ class BASE_EXPORT JSONStringValueSerializer : public base::ValueSerializer {
}
private:
- bool SerializeInternal(const Value& root, bool omit_binary_values);
+ bool SerializeInternal(const base::Value& root, bool omit_binary_values);
std::string* json_string_;
bool initialized_with_const_string_;