| 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> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "content/common/android/gin_java_bridge_value.h" | 15 #include "content/common/android/gin_java_bridge_value.h" |
| 16 #include "content/renderer/java/gin_java_bridge_object.h" | 16 #include "content/renderer/java/gin_java_bridge_object.h" |
| 17 #include "gin/array_buffer.h" | 17 #include "gin/array_buffer.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 GinJavaBridgeValueConverter::GinJavaBridgeValueConverter() | 21 GinJavaBridgeValueConverter::GinJavaBridgeValueConverter() |
| 22 : converter_(V8ValueConverter::create()) { | 22 : converter_(V8ValueConverter::Create()) { |
| 23 converter_->SetDateAllowed(false); | 23 converter_->SetDateAllowed(false); |
| 24 converter_->SetRegExpAllowed(false); | 24 converter_->SetRegExpAllowed(false); |
| 25 converter_->SetFunctionAllowed(true); | 25 converter_->SetFunctionAllowed(true); |
| 26 converter_->SetStrategy(this); | 26 converter_->SetStrategy(this); |
| 27 } | 27 } |
| 28 | 28 |
| 29 GinJavaBridgeValueConverter::~GinJavaBridgeValueConverter() { | 29 GinJavaBridgeValueConverter::~GinJavaBridgeValueConverter() { |
| 30 } | 30 } |
| 31 | 31 |
| 32 v8::Local<v8::Value> GinJavaBridgeValueConverter::ToV8Value( | 32 v8::Local<v8::Value> GinJavaBridgeValueConverter::ToV8Value( |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 return true; | 159 return true; |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool GinJavaBridgeValueConverter::FromV8Undefined( | 162 bool GinJavaBridgeValueConverter::FromV8Undefined( |
| 163 std::unique_ptr<base::Value>* out) const { | 163 std::unique_ptr<base::Value>* out) const { |
| 164 *out = GinJavaBridgeValue::CreateUndefinedValue(); | 164 *out = GinJavaBridgeValue::CreateUndefinedValue(); |
| 165 return true; | 165 return true; |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace content | 168 } // namespace content |
| OLD | NEW |