| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/json/json_writer.h" | 5 #include "base/json/json_writer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } | 191 } |
| 192 | 192 |
| 193 json_string_->push_back('}'); | 193 json_string_->push_back('}'); |
| 194 return result; | 194 return result; |
| 195 } | 195 } |
| 196 | 196 |
| 197 case Value::Type::BINARY: | 197 case Value::Type::BINARY: |
| 198 // Successful only if we're allowed to omit it. | 198 // Successful only if we're allowed to omit it. |
| 199 DLOG_IF(ERROR, !omit_binary_values_) << "Cannot serialize binary value."; | 199 DLOG_IF(ERROR, !omit_binary_values_) << "Cannot serialize binary value."; |
| 200 return omit_binary_values_; | 200 return omit_binary_values_; |
| 201 |
| 202 case Value::Type::DELETED: |
| 203 // TODO(crbug.com/697817): This means |node| is used after free. |
| 204 CHECK(false); |
| 205 return false; |
| 201 } | 206 } |
| 202 NOTREACHED(); | 207 NOTREACHED(); |
| 203 return false; | 208 return false; |
| 204 } | 209 } |
| 205 | 210 |
| 206 void JSONWriter::IndentLine(size_t depth) { | 211 void JSONWriter::IndentLine(size_t depth) { |
| 207 json_string_->append(depth * 3U, ' '); | 212 json_string_->append(depth * 3U, ' '); |
| 208 } | 213 } |
| 209 | 214 |
| 210 } // namespace base | 215 } // namespace base |
| OLD | NEW |