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

Side by Side Diff: content/renderer/java/gin_java_bridge_value_converter.cc

Issue 2811253004: Remove ListValue::Append(raw ptr) on Android (Closed)
Patch Set: Add includes 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/renderer/java/gin_java_bridge_value_converter.h" 5 #include "content/renderer/java/gin_java_bridge_value_converter.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 void serializeTo(char* data, 80 void serializeTo(char* data,
81 size_t data_length, 81 size_t data_length,
82 base::ListValue* out) override { 82 base::ListValue* out) override {
83 DCHECK_EQ(data_length, typed_array_->Length() * sizeof(ElementType)); 83 DCHECK_EQ(data_length, typed_array_->Length() * sizeof(ElementType));
84 for (ElementType *element = reinterpret_cast<ElementType*>(data), 84 for (ElementType *element = reinterpret_cast<ElementType*>(data),
85 *end = element + typed_array_->Length(); 85 *end = element + typed_array_->Length();
86 element != end; 86 element != end;
87 ++element) { 87 ++element) {
88 const ListType list_value = *element; 88 const ListType list_value = *element;
89 out->Append(new base::Value(list_value)); 89 out->Append(base::MakeUnique<base::Value>(list_value));
jdoerrie 2017/04/12 16:08:55 Inline list_value?
vabr (Chromium) 2017/04/12 16:40:53 Done. I admit I was not sure whether the explicit
jdoerrie 2017/04/12 18:30:19 True, good point. I think having ListType explicit
90 } 90 }
91 } 91 }
92 92
93 private: 93 private:
94 explicit TypedArraySerializerImpl(v8::Local<v8::TypedArray> typed_array) 94 explicit TypedArraySerializerImpl(v8::Local<v8::TypedArray> typed_array)
95 : typed_array_(typed_array) {} 95 : typed_array_(typed_array) {}
96 96
97 v8::Local<v8::TypedArray> typed_array_; 97 v8::Local<v8::TypedArray> typed_array_;
98 98
99 DISALLOW_COPY_AND_ASSIGN(TypedArraySerializerImpl); 99 DISALLOW_COPY_AND_ASSIGN(TypedArraySerializerImpl);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return true; 160 return true;
161 } 161 }
162 162
163 bool GinJavaBridgeValueConverter::FromV8Undefined( 163 bool GinJavaBridgeValueConverter::FromV8Undefined(
164 std::unique_ptr<base::Value>* out) const { 164 std::unique_ptr<base::Value>* out) const {
165 *out = GinJavaBridgeValue::CreateUndefinedValue(); 165 *out = GinJavaBridgeValue::CreateUndefinedValue();
166 return true; 166 return true;
167 } 167 }
168 168
169 } // namespace content 169 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698