Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/JsEngine.cpp

Issue 29812646: Issue 6526 - Remove deprecated CreateDefaultPlatform() (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created June 21, 2018, 9:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsEngine.cpp
===================================================================
--- a/src/JsEngine.cpp
+++ b/src/JsEngine.cpp
@@ -42,28 +42,27 @@
class V8Initializer
{
V8Initializer()
: platform{nullptr}
{
std::string cmd = "--use_strict";
v8::V8::SetFlagsFromString(cmd.c_str(), cmd.length());
- platform = v8::platform::CreateDefaultPlatform();
- v8::V8::InitializePlatform(platform);
+ platform = v8::platform::NewDefaultPlatform();
+ v8::V8::InitializePlatform(platform.get());
v8::V8::Initialize();
}
~V8Initializer()
{
v8::V8::Dispose();
v8::V8::ShutdownPlatform();
- delete platform;
}
- v8::Platform* platform;
+ std::unique_ptr<v8::Platform> platform;
public:
static void Init()
{
// it's threadsafe since C++11 and it will be instantiated only once and
// destroyed at the application exit
static V8Initializer initializer;
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld