summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Abd-El-Malek <jam@chromium.org>2015-02-10 09:15:12 -0800
committerJohn Abd-El-Malek <jam@chromium.org>2015-02-10 09:15:12 -0800
commitb045ed21ec797b5d05a6cef819451b0e8bfdee47 (patch)
tree014af0644ce1e673619ac83cc06c75da4af6556e
parent29e20e9d9c42122620b488340d4e78dfed6b0d34 (diff)
downloadpdfium-b045ed21ec797b5d05a6cef819451b0e8bfdee47.tar.xz
Merge https://codereview.chromium.org/897973002/ and https://codereview.chromium.org/902753002/ to XFA branch
R=jochen@chromium.org Review URL: https://codereview.chromium.org/887073005
-rw-r--r--BUILD.gn3
-rw-r--r--fpdfsdk/include/javascript/IJavaScript.h7
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp10
-rw-r--r--pdfium.gyp9
-rw-r--r--samples/BUILD.gn7
-rw-r--r--samples/pdfium_test.cc9
-rw-r--r--samples/samples.gyp7
-rw-r--r--xfa/src/fxjse/src/runtime.cpp4
8 files changed, 25 insertions, 31 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 0d26287d7b..ff0ff97ad1 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -815,9 +815,6 @@ static_library("javascript") {
public_deps = [
"//v8",
]
- deps = [
- "//v8:v8_libplatform",
- ]
}
static_library("jsapi") {
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index fbd89d26f1..9d50b04e82 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -7,10 +7,6 @@
#ifndef _IJAVASCRIPT_H_
#define _IJAVASCRIPT_H_
-namespace v8 {
-class Platform;
-}
-
class IFXJS_Context
{
public:
@@ -101,7 +97,7 @@ class CJS_GlobalData;
class CJS_RuntimeFactory
{
public:
- CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0),m_platform(NULL) {}
+ CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0) {}
~CJS_RuntimeFactory();
IFXJS_Runtime* NewJSRuntime(CPDFDoc_Environment* pApp);
void DeleteJSRuntime(IFXJS_Runtime* pRuntime);
@@ -115,7 +111,6 @@ private:
int m_nRef;
CJS_GlobalData* m_pGlobalData;
FX_INT32 m_nGlobalDataCount;
- v8::Platform* m_platform;
};
#endif //_IJAVASCRIPT_H_
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index cf06f9aba6..b0e80dd6b8 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -29,8 +29,6 @@
#include "../../include/fpdfxfa/fpdfxfa_app.h"
#include "../../../xfa/src/fxjse/src/value.h"
-#include <libplatform/libplatform.h>
-
CJS_RuntimeFactory::~CJS_RuntimeFactory()
{
}
@@ -40,11 +38,6 @@ IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environment* pApp)
if (!m_bInit)
{
JS_Initial();
-/*
- m_platform = v8::platform::CreateDefaultPlatform();
- v8::V8::InitializePlatform(m_platform);
- v8::V8::Initialize();
-*/
m_bInit = TRUE;
}
return new CJS_Runtime(pApp);
@@ -63,9 +56,6 @@ void CJS_RuntimeFactory::Release()
{
JS_Release();
ReleaseGlobalData();
- v8::V8::ShutdownPlatform();
- delete m_platform;
- m_platform = NULL;
m_bInit = FALSE;
}
}
diff --git a/pdfium.gyp b/pdfium.gyp
index 65caf6f4b7..d9c8ac255a 100644
--- a/pdfium.gyp
+++ b/pdfium.gyp
@@ -803,13 +803,12 @@
{
'target_name': 'javascript',
'type': 'static_library',
- 'include_dirs': [
- '<(DEPTH)/v8',
- '<(DEPTH)/v8/include',
- ],
+ 'include_dirs': [
+ '<(DEPTH)/v8',
+ '<(DEPTH)/v8/include',
+ ],
'dependencies': [
'<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
- '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_libplatform',
],
'export_dependent_settings': [
'<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
diff --git a/samples/BUILD.gn b/samples/BUILD.gn
index 7f2f41fa82..6bd2a81359 100644
--- a/samples/BUILD.gn
+++ b/samples/BUILD.gn
@@ -15,6 +15,11 @@ executable("pdfium_test") {
]
deps = [
"//third_party/pdfium",
+ "//v8:v8_libplatform",
+ ]
+ include_dirs = [
+ "//v8",
+ "//v8/include",
]
}
@@ -27,4 +32,4 @@ executable("pdfium_diff") {
deps = [
"//third_party/pdfium",
]
-} \ No newline at end of file
+}
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index a813c9c0b3..4f6e832e0c 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -20,8 +20,10 @@
#include "../fpdfsdk/include/fpdftext.h"
#include "../fpdfsdk/include/fpdfview.h"
#include "../core/include/fxcrt/fx_system.h"
-#include "v8/include/v8.h"
#include "image_diff_png.h"
+#include "v8/include/v8.h"
+#include "v8/include/libplatform/libplatform.h"
+
#ifdef _WIN32
#define snprintf _snprintf
@@ -573,6 +575,9 @@ int main(int argc, const char* argv[]) {
}
v8::V8::InitializeICU();
+ v8::Platform* platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(platform);
+ v8::V8::Initialize();
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
v8::StartupData natives;
@@ -606,6 +611,8 @@ int main(int argc, const char* argv[]) {
}
FPDF_DestroyLibrary();
+ v8::V8::ShutdownPlatform();
+ delete platform;
return 0;
}
diff --git a/samples/samples.gyp b/samples/samples.gyp
index e559790476..c972142ed2 100644
--- a/samples/samples.gyp
+++ b/samples/samples.gyp
@@ -7,8 +7,13 @@
'type': 'executable',
'dependencies': [
'../pdfium.gyp:pdfium',
+ '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_libplatform',
+ ],
+ 'include_dirs': [
+ '<(DEPTH)',
+ '<(DEPTH)/v8',
+ '<(DEPTH)/v8/include',
],
- 'include_dirs': ['<(DEPTH)'],
},
'targets': [
{
diff --git a/xfa/src/fxjse/src/runtime.cpp b/xfa/src/fxjse/src/runtime.cpp
index 0a1b0db78b..c4dc61c249 100644
--- a/xfa/src/fxjse/src/runtime.cpp
+++ b/xfa/src/fxjse/src/runtime.cpp
@@ -28,10 +28,6 @@ void FXJSE_Initialize()
"--block_concurrent_recompilation "
;
v8::V8::SetFlagsFromString(szCmdFlags, FXSYS_strlen(szCmdFlags));
- v8::V8::InitializeICU();
- v8::Platform* platform = v8::platform::CreateDefaultPlatform();
- v8::V8::InitializePlatform(platform);
- v8::V8::Initialize();
}
static void FXJSE_Runtime_DisposeCallback(v8::Isolate* pIsolate)
{