From b3a3eaab0471ed4fe22299c02b51b16bec813773 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 7 Feb 2018 16:46:42 +0000 Subject: Revert "[v8-platform] Store the platform in a unique_ptr" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 608e8dd6b87b15772862dca9b7b2e6791a25dab6. Reason for revert: Breaks the roll into Chromium pdf/pdfium/fuzzers/pdfium_fuzzer_helper.cc:238:5: error: no matching function for call to 'InitializeV8ForPDFium' InitializeV8ForPDFium(ProgramPath(), "", &natives_blob, &snapshot_blob, ^~~~~~~~~~~~~~~~~~~~~ ../../third_party/pdfium/testing/test_support.h:94:31: note: candidate function not viable: requires 4 arguments, but 5 were provided std::unique_ptr InitializeV8ForPDFium( ^ https://logs.chromium.org/v/?s=chromium%2Fbb%2Ftryserver.chromium.linux%2Flinux_chromium_compile_dbg_ng%2F461077%2F%2B%2Frecipes%2Fsteps%2Fcompile__with_patch_%2F0%2Fstdout Original change's description: > [v8-platform] Store the platform in a unique_ptr > > We want to change the signature of {CreateDefaultPlatform} in the V8 > API to return a unique_ptr instead of a raw pointer to indicate that the > caller owns the platform. With this change we prepare pdfium for this > change. > > R=​thestig@chromium.org > > Change-Id: I4a0a466dfc37b28387a91543623a7a481ca8035a > Reviewed-on: https://pdfium-review.googlesource.com/18191 > Commit-Queue: Lei Zhang > Reviewed-by: Lei Zhang TBR=thestig@chromium.org,ahaas@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I418c97653e8aba93560537f0d41e1aaa238bf3b4 Reviewed-on: https://pdfium-review.googlesource.com/25850 Commit-Queue: dsinclair Reviewed-by: dsinclair --- samples/pdfium_test.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'samples') diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index ebc7412055..b83663db69 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -1567,14 +1567,14 @@ int main(int argc, const char* argv[]) { } #ifdef PDF_ENABLE_V8 - std::unique_ptr platform; + v8::Platform* platform; #ifdef V8_USE_EXTERNAL_STARTUP_DATA v8::StartupData natives; v8::StartupData snapshot; - platform = InitializeV8ForPDFiumWithStartupData( - options.exe_path, options.bin_directory, &natives, &snapshot); + InitializeV8ForPDFium(options.exe_path, options.bin_directory, &natives, + &snapshot, &platform); #else // V8_USE_EXTERNAL_STARTUP_DATA - platform = InitializeV8ForPDFium(options.exe_path); + InitializeV8ForPDFium(options.exe_path, &platform); #endif // V8_USE_EXTERNAL_STARTUP_DATA #endif // PDF_ENABLE_V8 @@ -1641,6 +1641,7 @@ int main(int argc, const char* argv[]) { FPDF_DestroyLibrary(); #ifdef PDF_ENABLE_V8 v8::V8::ShutdownPlatform(); + delete platform; #ifdef V8_USE_EXTERNAL_STARTUP_DATA free(const_cast(natives.data)); -- cgit v1.2.3