blob: b0cca464fc4fd037d742c695366c0746c3711d59 [file] [log] [blame]
Avi Drissmandb497b32022-09-15 19:47:281// Copyright 2022 The Chromium Authors
Lei Zhangb6b710f42022-02-26 06:03:222// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef PDF_V8_VALUE_CONVERTER_H_
6#define PDF_V8_VALUE_CONVERTER_H_
7
8#include <memory>
9
10#include "v8/include/v8-forward.h"
11
12namespace base {
13class Value;
14} // namespace base
15
16namespace chrome_pdf {
17
18// Abstraction layer for base::Value from/to V8::Value conversions.
19// Necessary because //pdf should not directly depend on //content. If the V8
20// V8 value conversion code ever moves into Blink, remove this and use the
21// conversion code from Blink directly.
22
23class V8ValueConverter {
24 public:
25 virtual std::unique_ptr<base::Value> FromV8Value(
26 v8::Local<v8::Value> value,
27 v8::Local<v8::Context> context) = 0;
Lei Zhangb6b710f42022-02-26 06:03:2228
29 protected:
30 ~V8ValueConverter() = default;
31};
32
33} // namespace chrome_pdf
34
35#endif // PDF_V8_VALUE_CONVERTER_H_