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 "ipc/ipc_message_utils.h" | 5 #include "ipc/ipc_message_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 it.Advance()) { | 121 it.Advance()) { |
122 GetParamSize(sizer, it.key()); | 122 GetParamSize(sizer, it.key()); |
123 GetValueSize(sizer, &it.value(), recursion + 1); | 123 GetValueSize(sizer, &it.value(), recursion + 1); |
124 } | 124 } |
125 break; | 125 break; |
126 } | 126 } |
127 case base::Value::Type::LIST: { | 127 case base::Value::Type::LIST: { |
128 sizer->AddInt(); | 128 sizer->AddInt(); |
129 const base::ListValue* list = static_cast<const base::ListValue*>(value); | 129 const base::ListValue* list = static_cast<const base::ListValue*>(value); |
130 for (const auto& entry : *list) { | 130 for (const auto& entry : *list) { |
131 GetValueSize(sizer, entry.get(), recursion + 1); | 131 GetValueSize(sizer, &entry, recursion + 1); |
132 } | 132 } |
133 break; | 133 break; |
134 } | 134 } |
135 default: | 135 default: |
136 NOTREACHED() << "Invalid base::Value type."; | 136 NOTREACHED() << "Invalid base::Value type."; |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 void WriteValue(base::Pickle* m, const base::Value* value, int recursion) { | 140 void WriteValue(base::Pickle* m, const base::Value* value, int recursion) { |
141 bool result; | 141 bool result; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 it.Advance()) { | 191 it.Advance()) { |
192 WriteParam(m, it.key()); | 192 WriteParam(m, it.key()); |
193 WriteValue(m, &it.value(), recursion + 1); | 193 WriteValue(m, &it.value(), recursion + 1); |
194 } | 194 } |
195 break; | 195 break; |
196 } | 196 } |
197 case base::Value::Type::LIST: { | 197 case base::Value::Type::LIST: { |
198 const base::ListValue* list = static_cast<const base::ListValue*>(value); | 198 const base::ListValue* list = static_cast<const base::ListValue*>(value); |
199 WriteParam(m, static_cast<int>(list->GetSize())); | 199 WriteParam(m, static_cast<int>(list->GetSize())); |
200 for (const auto& entry : *list) { | 200 for (const auto& entry : *list) { |
201 WriteValue(m, entry.get(), recursion + 1); | 201 WriteValue(m, &entry, recursion + 1); |
202 } | 202 } |
203 break; | 203 break; |
204 } | 204 } |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
208 // Helper for ReadValue that reads a DictionaryValue into a pre-allocated | 208 // Helper for ReadValue that reads a DictionaryValue into a pre-allocated |
209 // object. | 209 // object. |
210 bool ReadDictionaryValue(const base::Pickle* m, | 210 bool ReadDictionaryValue(const base::Pickle* m, |
211 base::PickleIterator* iter, | 211 base::PickleIterator* iter, |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 return result; | 1229 return result; |
1230 } | 1230 } |
1231 | 1231 |
1232 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 1232 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
1233 l->append("<MSG>"); | 1233 l->append("<MSG>"); |
1234 } | 1234 } |
1235 | 1235 |
1236 #endif // OS_WIN | 1236 #endif // OS_WIN |
1237 | 1237 |
1238 } // namespace IPC | 1238 } // namespace IPC |
OLD | NEW |