OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/values.h" | 5 #include <limits.h> |
| 6 #include <stddef.h> |
| 7 #include <string.h> |
| 8 #include <map> |
| 9 #include <string> |
| 10 #include <utility> |
| 11 #include <vector> |
6 | 12 |
7 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/string16.h" |
| 15 #include "base/string_piece.h" |
8 #include "base/string_util.h" | 16 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "base/values.h" |
10 | 19 |
11 namespace { | 20 namespace { |
12 | 21 |
13 // Make a deep copy of |node|, but don't include empty lists or dictionaries | 22 // Make a deep copy of |node|, but don't include empty lists or dictionaries |
14 // in the copy. It's possible for this function to return NULL and it | 23 // in the copy. It's possible for this function to return NULL and it |
15 // expects |node| to always be non-NULL. | 24 // expects |node| to always be non-NULL. |
16 Value* CopyWithoutEmptyChildren(Value* node) { | 25 Value* CopyWithoutEmptyChildren(Value* node) { |
17 DCHECK(node); | 26 DCHECK(node); |
18 switch (node->GetType()) { | 27 switch (node->GetType()) { |
19 case Value::TYPE_LIST: { | 28 case Value::TYPE_LIST: { |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 return false; | 894 return false; |
886 } | 895 } |
887 if (lhs_it != end() || rhs_it != other_list->end()) | 896 if (lhs_it != end() || rhs_it != other_list->end()) |
888 return false; | 897 return false; |
889 | 898 |
890 return true; | 899 return true; |
891 } | 900 } |
892 | 901 |
893 ValueSerializer::~ValueSerializer() { | 902 ValueSerializer::~ValueSerializer() { |
894 } | 903 } |
OLD | NEW |