aboutsummaryrefslogtreecommitdiff
path: root/testing/v8_initializer.h
blob: bd2301c3adb1bff2bcda5401d4b6b417d0dbd7c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2019 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef TESTING_V8_INITIALIZER_H_
#define TESTING_V8_INITIALIZER_H_

#include <memory>
#include <string>

#ifndef PDF_ENABLE_V8
#error "V8 must be enabled"
#endif

namespace v8 {
class Platform;
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
class StartupData;
#endif
}  // namespace v8

#ifdef V8_USE_EXTERNAL_STARTUP_DATA
// |snapshot_blob| is an optional out parameter.
std::unique_ptr<v8::Platform> InitializeV8ForPDFiumWithStartupData(
    const std::string& exe_path,
    const std::string& bin_dir,
    v8::StartupData* snapshot_blob);
#else
std::unique_ptr<v8::Platform> InitializeV8ForPDFium(
    const std::string& exe_path);
#endif

#endif  // TESTING_V8_INITIALIZER_H_