aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar Andreas Haas <ahaas@chromium.org>2017-11-09 16:52:04 +0100
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-09 17:19:14 +0000
commitae99d29f6bf147346f3360cd0b764223afadfc99 (patch)
treeb06d79335ee248b54300c35132eabb6d1debb148 /experimental
parent6fdde9bc7195a3e62a013973adfa82c2481fc5ab (diff)
[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=egdaniel@google.com Change-Id: Ib0bb743ca0acd98018cb28828890868f1e0fc612 Reviewed-on: https://skia-review.googlesource.com/69320 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'experimental')
-rw-r--r--experimental/SkV8Example/SkV8Example.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/experimental/SkV8Example/SkV8Example.cpp b/experimental/SkV8Example/SkV8Example.cpp
index 5cad12577f..7d78f76a41 100644
--- a/experimental/SkV8Example/SkV8Example.cpp
+++ b/experimental/SkV8Example/SkV8Example.cpp
@@ -121,6 +121,7 @@ void SkV8ExampleWindow::onSizeChange() {
}
Global* global = NULL;
+std::unique_ptr<v8::Platform> platform;
void SkV8ExampleWindow::onDraw(SkCanvas* canvas) {
@@ -161,8 +162,8 @@ SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) {
SkCommandLineFlags::Parse(argc, argv);
v8::V8::InitializeICU();
- v8::Platform* platform = v8::platform::CreateDefaultPlatform();
- v8::V8::InitializePlatform(platform);
+ platform = std::unique_ptr<v8::Platform>(v8::platform::CreateDefaultPlatform());
+ v8::V8::InitializePlatform(platform.get());
v8::V8::Initialize();
v8::Isolate* isolate = v8::Isolate::New();