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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 2838893002: Remove base::ListValue::Set(size_t, base::Value*) (Closed)
Patch Set: Android, Fuzzer and JSON Test Fixes Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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"
11 #include "base/json/json_writer.h" 11 #include "base/json/json_writer.h"
12 #include "base/memory/ptr_util.h"
12 #include "base/strings/nullable_string16.h" 13 #include "base/strings/nullable_string16.h"
13 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
15 #include "base/time/time.h" 16 #include "base/time/time.h"
16 #include "base/unguessable_token.h" 17 #include "base/unguessable_token.h"
17 #include "base/values.h" 18 #include "base/values.h"
18 #include "build/build_config.h" 19 #include "build/build_config.h"
19 #include "ipc/ipc_channel_handle.h" 20 #include "ipc/ipc_channel_handle.h"
20 #include "ipc/ipc_message_attachment.h" 21 #include "ipc/ipc_message_attachment.h"
21 #include "ipc/ipc_message_attachment_set.h" 22 #include "ipc/ipc_message_attachment_set.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 bool ReadListValue(const base::Pickle* m, 233 bool ReadListValue(const base::Pickle* m,
233 base::PickleIterator* iter, 234 base::PickleIterator* iter,
234 base::ListValue* value, 235 base::ListValue* value,
235 int recursion) { 236 int recursion) {
236 int size; 237 int size;
237 if (!ReadParam(m, iter, &size)) 238 if (!ReadParam(m, iter, &size))
238 return false; 239 return false;
239 240
240 for (int i = 0; i < size; ++i) { 241 for (int i = 0; i < size; ++i) {
241 base::Value* subval; 242 base::Value* subval;
242 if (!ReadValue(m, iter, &subval, recursion + 1)) 243 if (!ReadValue(m, iter, &subval, recursion + 1))
vabr (Chromium) 2017/04/25 17:13:15 I suggest fixing ReadValue to take a pointer to un
jdoerrie 2017/04/26 11:34:37 Done.
243 return false; 244 return false;
244 value->Set(i, subval); 245 value->Set(i, base::WrapUnique(subval));
245 } 246 }
246 247
247 return true; 248 return true;
248 } 249 }
249 250
250 bool ReadValue(const base::Pickle* m, 251 bool ReadValue(const base::Pickle* m,
251 base::PickleIterator* iter, 252 base::PickleIterator* iter,
252 base::Value** value, 253 base::Value** value,
253 int recursion) { 254 int recursion) {
254 if (recursion > kMaxRecursionDepth) { 255 if (recursion > kMaxRecursionDepth) {
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 return result; 1230 return result;
1230 } 1231 }
1231 1232
1232 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { 1233 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) {
1233 l->append("<MSG>"); 1234 l->append("<MSG>");
1234 } 1235 }
1235 1236
1236 #endif // OS_WIN 1237 #endif // OS_WIN
1237 1238
1238 } // namespace IPC 1239 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698