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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_VALUE_CONVERTER_H_
6 #define CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_VALUE_CONVERTER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/common/content_export.h"
10 #include "content/public/child/v8_value_converter.h"
14 class GinJavaBridgeValueConverter
: public content::V8ValueConverter::Strategy
{
16 CONTENT_EXPORT
GinJavaBridgeValueConverter();
17 CONTENT_EXPORT
~GinJavaBridgeValueConverter() override
;
19 CONTENT_EXPORT
v8::Local
<v8::Value
> ToV8Value(
20 const base::Value
* value
,
21 v8::Local
<v8::Context
> context
) const;
22 CONTENT_EXPORT scoped_ptr
<base::Value
> FromV8Value(
23 v8::Local
<v8::Value
> value
,
24 v8::Local
<v8::Context
> context
) const;
26 // content::V8ValueConverter::Strategy
27 bool FromV8Object(v8::Local
<v8::Object
> value
,
30 const FromV8ValueCallback
& callback
) const override
;
31 bool FromV8ArrayBuffer(v8::Local
<v8::Object
> value
,
33 v8::Isolate
* isolate
) const override
;
34 bool FromV8Number(v8::Local
<v8::Number
> value
,
35 base::Value
** out
) const override
;
36 bool FromV8Undefined(base::Value
** out
) const override
;
39 scoped_ptr
<V8ValueConverter
> converter_
;
41 DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeValueConverter
);
44 } // namespace content
46 #endif // CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_VALUE_CONVERTER_H_