summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorAndreas Haas <ahaas@chromium.org>2018-02-05 18:32:18 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-05 18:32:18 +0000
commit608e8dd6b87b15772862dca9b7b2e6791a25dab6 (patch)
tree384dbec190cf8a7901af8dd1cdb37aafac10766a /samples
parenta21d593e202cbef9a0641d0123917ac3b8d73ee6 (diff)
downloadpdfium-608e8dd6b87b15772862dca9b7b2e6791a25dab6.tar.xz
[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 <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/pdfium_test.cc9
1 files changed, 4 insertions, 5 deletions
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<v8::Platform> 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<char*>(natives.data));