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

Unified Diff: base/json/json_string_value_serializer.cc

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 | « base/json/json_string_value_serializer.h ('k') | base/json/json_value_converter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_string_value_serializer.cc
diff --git a/base/json/json_string_value_serializer.cc b/base/json/json_string_value_serializer.cc
deleted file mode 100644
index 5425c7e7b94391b58f353617372939106863a1e0..0000000000000000000000000000000000000000
--- a/base/json/json_string_value_serializer.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/json/json_string_value_serializer.h"
-
-#include "base/json/json_reader.h"
-#include "base/json/json_writer.h"
-#include "base/logging.h"
-
-using base::Value;
-
-JSONStringValueSerializer::JSONStringValueSerializer(std::string* json_string)
- : json_string_(json_string),
- pretty_print_(false) {
-}
-
-JSONStringValueSerializer::~JSONStringValueSerializer() {}
-
-bool JSONStringValueSerializer::Serialize(const Value& root) {
- return SerializeInternal(root, false);
-}
-
-bool JSONStringValueSerializer::SerializeAndOmitBinaryValues(
- const Value& root) {
- return SerializeInternal(root, true);
-}
-
-bool JSONStringValueSerializer::SerializeInternal(const Value& root,
- bool omit_binary_values) {
- if (!json_string_)
- return false;
-
- int options = 0;
- if (omit_binary_values)
- options |= base::JSONWriter::OPTIONS_OMIT_BINARY_VALUES;
- if (pretty_print_)
- options |= base::JSONWriter::OPTIONS_PRETTY_PRINT;
-
- return base::JSONWriter::WriteWithOptions(root, options, json_string_);
-}
-
-JSONStringValueDeserializer::JSONStringValueDeserializer(
- const base::StringPiece& json_string)
- : json_string_(json_string),
- allow_trailing_comma_(false) {
-}
-
-JSONStringValueDeserializer::~JSONStringValueDeserializer() {}
-
-Value* JSONStringValueDeserializer::Deserialize(int* error_code,
- std::string* error_str) {
- return base::JSONReader::DeprecatedReadAndReturnError(
- json_string_, allow_trailing_comma_ ? base::JSON_ALLOW_TRAILING_COMMAS
- : base::JSON_PARSE_RFC,
- error_code, error_str);
-}
« no previous file with comments | « base/json/json_string_value_serializer.h ('k') | base/json/json_value_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698