diff options
author | Lei Zhang <thestig@chromium.org> | 2018-02-05 21:13:35 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-05 21:13:35 +0000 |
commit | 3355f459ecd2207c0cd1719c2cdafa15eea87bf6 (patch) | |
tree | 23f6a83c8d8213093acd4e1509662532197fdaa3 /testing/test_support.cpp | |
parent | 57e097750846bf3ffc3e4e2ef9e78be8a82c69de (diff) | |
download | pdfium-3355f459ecd2207c0cd1719c2cdafa15eea87bf6.tar.xz |
Fix testing.cpp build with v8_use_external_startup_data=false.
Also change the InitializeV8ForPDFium() for use with startup data to
InitializeV8ForPDFiumWithStartupData().
Change-Id: I594c2bf9470b6549195b7361bb7fcb45def50c61
Reviewed-on: https://pdfium-review.googlesource.com/25371
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'testing/test_support.cpp')
-rw-r--r-- | testing/test_support.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/testing/test_support.cpp b/testing/test_support.cpp index f682451c27..2b6f436c32 100644 --- a/testing/test_support.cpp +++ b/testing/test_support.cpp @@ -60,8 +60,8 @@ bool GetExternalData(const std::string& exe_path, } #endif // V8_USE_EXTERNAL_STARTUP_DATA -std::unique_ptr<v8::Platform> InitializeV8Common(const char* exe_path) { - v8::V8::InitializeICUDefaultLocation(exe_path); +std::unique_ptr<v8::Platform> InitializeV8Common(const std::string& exe_path) { + v8::V8::InitializeICUDefaultLocation(exe_path.c_str()); std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform(); v8::V8::InitializePlatform(platform.get()); @@ -178,12 +178,12 @@ std::string GenerateMD5Base16(const uint8_t* data, uint32_t size) { #ifdef PDF_ENABLE_V8 #ifdef V8_USE_EXTERNAL_STARTUP_DATA -std::unique_ptr<v8::Platform> InitializeV8ForPDFium( +std::unique_ptr<v8::Platform> InitializeV8ForPDFiumWithStartupData( const std::string& exe_path, const std::string& bin_dir, v8::StartupData* natives_blob, v8::StartupData* snapshot_blob) { - std::unique_ptr<v8::Platform> platform = InitializeV8Common(exe_path.c_str()); + std::unique_ptr<v8::Platform> platform = InitializeV8Common(exe_path); if (natives_blob && snapshot_blob) { if (!GetExternalData(exe_path, bin_dir, "natives_blob.bin", natives_blob)) return nullptr; @@ -196,11 +196,8 @@ std::unique_ptr<v8::Platform> InitializeV8ForPDFium( } #else // V8_USE_EXTERNAL_STARTUP_DATA std::unique_ptr<v8::Platform> InitializeV8ForPDFium( - const std::string& exe_path, - std::unique_ptr<v8::Platform>* platform) { - std::unique_ptr<v8::Platform> platform = - InitializeV8Common(exe_path.c_str(), platform); - return platform; + const std::string& exe_path) { + return InitializeV8Common(exe_path); } #endif // V8_USE_EXTERNAL_STARTUP_DATA #endif // PDF_ENABLE_V8 |