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

Side by Side Diff: content/browser/android/java/gin_java_method_invocation_helper.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/android/java/gin_java_method_invocation_helper.h" 5 #include "content/browser/android/java/gin_java_method_invocation_helper.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 #include <cmath> 8 #include <cmath>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 // As V8ValueConverter has finite recursion depth when serializing 51 // As V8ValueConverter has finite recursion depth when serializing
52 // JavaScript values, we don't bother about having a recursion threshold here. 52 // JavaScript values, we don't bother about having a recursion threshold here.
53 void GinJavaMethodInvocationHelper::BuildObjectRefsFromListValue( 53 void GinJavaMethodInvocationHelper::BuildObjectRefsFromListValue(
54 DispatcherDelegate* dispatcher, 54 DispatcherDelegate* dispatcher,
55 const base::Value& list_value) { 55 const base::Value& list_value) {
56 DCHECK(list_value.IsType(base::Value::Type::LIST)); 56 DCHECK(list_value.IsType(base::Value::Type::LIST));
57 const base::ListValue* list; 57 const base::ListValue* list;
58 list_value.GetAsList(&list); 58 list_value.GetAsList(&list);
59 for (const auto& entry : *list) { 59 for (const auto& entry : *list) {
60 if (AppendObjectRef(dispatcher, entry)) 60 if (AppendObjectRef(dispatcher, *entry))
61 continue; 61 continue;
62 if (entry.IsType(base::Value::Type::LIST)) { 62 if (entry->IsType(base::Value::Type::LIST)) {
63 BuildObjectRefsFromListValue(dispatcher, entry); 63 BuildObjectRefsFromListValue(dispatcher, *entry);
64 } else if (entry.IsType(base::Value::Type::DICTIONARY)) { 64 } else if (entry->IsType(base::Value::Type::DICTIONARY)) {
65 BuildObjectRefsFromDictionaryValue(dispatcher, entry); 65 BuildObjectRefsFromDictionaryValue(dispatcher, *entry);
66 } 66 }
67 } 67 }
68 } 68 }
69 69
70 void GinJavaMethodInvocationHelper::BuildObjectRefsFromDictionaryValue( 70 void GinJavaMethodInvocationHelper::BuildObjectRefsFromDictionaryValue(
71 DispatcherDelegate* dispatcher, 71 DispatcherDelegate* dispatcher,
72 const base::Value& dict_value) { 72 const base::Value& dict_value) {
73 DCHECK(dict_value.IsType(base::Value::Type::DICTIONARY)); 73 DCHECK(dict_value.IsType(base::Value::Type::DICTIONARY));
74 const base::DictionaryValue* dict; 74 const base::DictionaryValue* dict;
75 dict_value.GetAsDictionary(&dict); 75 dict_value.GetAsDictionary(&dict);
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 335 }
336 // This is for all cases except JavaType::TypeObject. 336 // This is for all cases except JavaType::TypeObject.
337 if (!base::android::ClearException(env)) { 337 if (!base::android::ClearException(env)) {
338 SetPrimitiveResult(result_wrapper); 338 SetPrimitiveResult(result_wrapper);
339 } else { 339 } else {
340 SetInvocationError(kGinJavaBridgeJavaExceptionRaised); 340 SetInvocationError(kGinJavaBridgeJavaExceptionRaised);
341 } 341 }
342 } 342 }
343 343
344 } // namespace content 344 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698