Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: fpdfsdk/src/javascript/JS_Runtime.cpp

Issue 374123002: Hook up the default v8::Platform implementation to pdfium (Closed) Base URL: https://pdfium.googlesource.com/pdfium/@master
Patch Set: updates Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/javascript/IJavaScript.h ('k') | pdfium.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/JS_Runtime.cpp
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index c7a92ebde2f7227a4495201d63e0fdfdd1d59728..543540bd4d29e91aca54566d3fb2997ad1707b84 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -27,6 +27,8 @@
#include "../../include/javascript/global.h"
#include "../../include/javascript/console.h"
+#include <libplatform/libplatform.h>
+
CJS_RuntimeFactory::~CJS_RuntimeFactory()
{
}
@@ -36,6 +38,8 @@ IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environment* pApp)
if (!m_bInit)
{
JS_Initial();
+ m_platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(m_platform);
Lei Zhang 2014/08/01 06:51:22 With component builds on Linux, when loading PDFs
m_bInit = TRUE;
}
@@ -55,6 +59,9 @@ void CJS_RuntimeFactory::Release()
{
JS_Release();
ReleaseGlobalData();
+ v8::V8::ShutdownPlatform();
+ delete m_platform;
+ m_platform = NULL;
m_bInit = FALSE;
}
}
« no previous file with comments | « fpdfsdk/include/javascript/IJavaScript.h ('k') | pdfium.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698