| OLD | NEW |
| 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 Loading... |
| 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::FundamentalValue(list_value)); | 89 out->Append(new base::Value(list_value)); |
| 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 Loading... |
| 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 |
| OLD | NEW |