Update V8 to version 4.6.61.
[chromium-blink-merge.git] / content / renderer / java / gin_java_bridge_value_converter.h
blob33e3af53dfc0689483af410a61bcd80101ad9a90
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"
12 namespace content {
14 class GinJavaBridgeValueConverter : public content::V8ValueConverter::Strategy {
15 public:
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,
28 base::Value** out,
29 v8::Isolate* isolate,
30 const FromV8ValueCallback& callback) const override;
31 bool FromV8ArrayBuffer(v8::Local<v8::Object> value,
32 base::Value** out,
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;
38 private:
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_