[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>
This commit is contained in:
Andreas Haas 2017-11-09 16:52:04 +01:00 committed by Skia Commit-Bot
parent 6fdde9bc71
commit ae99d29f6b

View File

@ -121,6 +121,7 @@ void SkV8ExampleWindow::onSizeChange() {
} }
Global* global = NULL; Global* global = NULL;
std::unique_ptr<v8::Platform> platform;
void SkV8ExampleWindow::onDraw(SkCanvas* canvas) { void SkV8ExampleWindow::onDraw(SkCanvas* canvas) {
@ -161,8 +162,8 @@ SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) {
SkCommandLineFlags::Parse(argc, argv); SkCommandLineFlags::Parse(argc, argv);
v8::V8::InitializeICU(); v8::V8::InitializeICU();
v8::Platform* platform = v8::platform::CreateDefaultPlatform(); platform = std::unique_ptr<v8::Platform>(v8::platform::CreateDefaultPlatform());
v8::V8::InitializePlatform(platform); v8::V8::InitializePlatform(platform.get());
v8::V8::Initialize(); v8::V8::Initialize();
v8::Isolate* isolate = v8::Isolate::New(); v8::Isolate* isolate = v8::Isolate::New();