1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PDF_V8_VALUE_CONVERTER_H_
6 #define PDF_V8_VALUE_CONVERTER_H_
10 #include "v8/include/v8-forward.h"
16 namespace chrome_pdf {
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.
23 class V8ValueConverter {
25 virtual std::unique_ptr<base::Value> FromV8Value(
26 v8::Local<v8::Value> value,
27 v8::Local<v8::Context> context) = 0;
30 ~V8ValueConverter() = default;
33 } // namespace chrome_pdf
35 #endif // PDF_V8_VALUE_CONVERTER_H_