[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>
diff --git a/experimental/SkV8Example/SkV8Example.cpp b/experimental/SkV8Example/SkV8Example.cpp
index 5cad125..7d78f76 100644
--- a/experimental/SkV8Example/SkV8Example.cpp
+++ b/experimental/SkV8Example/SkV8Example.cpp
@@ -121,6 +121,7 @@
}
Global* global = NULL;
+std::unique_ptr<v8::Platform> platform;
void SkV8ExampleWindow::onDraw(SkCanvas* canvas) {
@@ -161,8 +162,8 @@
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();