From 608e8dd6b87b15772862dca9b7b2e6791a25dab6 Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Mon, 5 Feb 2018 18:32:18 +0000 Subject: [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 --- samples/pdfium_test.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'samples') diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index d7648f6bde..37e36d322d 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -1564,14 +1564,14 @@ int main(int argc, const char* argv[]) { } #ifdef PDF_ENABLE_V8 - v8::Platform* platform; + std::unique_ptr platform; #ifdef V8_USE_EXTERNAL_STARTUP_DATA v8::StartupData natives; v8::StartupData snapshot; - InitializeV8ForPDFium(options.exe_path, options.bin_directory, &natives, - &snapshot, &platform); + platform = InitializeV8ForPDFium(options.exe_path, options.bin_directory, + &natives, &snapshot); #else // V8_USE_EXTERNAL_STARTUP_DATA - InitializeV8ForPDFium(options.exe_path, &platform); + platform = InitializeV8ForPDFium(options.exe_path); #endif // V8_USE_EXTERNAL_STARTUP_DATA #endif // PDF_ENABLE_V8 @@ -1638,7 +1638,6 @@ 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