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

Issue 1338073002: Refactor fxjs_v8 and add embeddertests for it. (Closed)

Created:
5 years, 3 months ago by Tom Sepez
Modified:
5 years, 3 months ago
Reviewers:
Lei Zhang, Nico
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Refactor fxjs_v8 and add embeddertests for it. This forces the layer defined by fxjs_v8.h to be (more) self-contained, so that it can be tested apart from the CJS_* objects (in fpdfsdk/{src,include}/javascript. This implies the array buffer allocator must be part of fxjs_v8. One wrinkle is that we'd like to be able to test an isolate upon which no native objects have been added, so some initialization that would have occurred as part of object definition must be made explicit. R=thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/09ed30750282bf56a92d0e646ab22c64bea81a36

Patch Set 1 #

Patch Set 2 : GN #

Patch Set 3 : rebase #

Patch Set 4 : Working, expose new API to condition the isolate #

Total comments: 11

Patch Set 5 : Address comments in C#6. #

Total comments: 1

Patch Set 6 : JS_InitialRuntime => JS_InitializeRuntime. #

Patch Set 7 : Comment about IFXJS_Context and IFXJS_Runtime. #

Total comments: 2

Patch Set 8 : Typo. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -50 lines) Patch
M BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M fpdfsdk/include/javascript/IJavaScript.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M fpdfsdk/include/javascript/JS_Runtime.h View 3 chunks +2 lines, -8 lines 0 comments Download
M fpdfsdk/include/jsapi/fxjs_v8.h View 1 2 3 4 5 6 7 2 chunks +24 lines, -6 lines 0 comments Download
M fpdfsdk/src/javascript/JS_Runtime.cpp View 1 2 3 4 5 4 chunks +6 lines, -25 lines 0 comments Download
M fpdfsdk/src/jsapi/fxjs_v8.cpp View 1 2 3 4 5 4 chunks +24 lines, -9 lines 0 comments Download
A fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp View 1 2 3 4 5 1 chunk +69 lines, -0 lines 0 comments Download
M pdfium.gyp View 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (2 generated)
Tom Sepez
Lei, for review.
5 years, 3 months ago (2015-09-14 23:39:13 UTC) #1
Tom Sepez
Lei, for review.
5 years, 3 months ago (2015-09-14 23:39:14 UTC) #2
Tom Sepez
Lei, for review.
5 years, 3 months ago (2015-09-14 23:39:40 UTC) #4
Tom Sepez
https://codereview.chromium.org/1338073002/diff/60001/fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp File fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp (right): https://codereview.chromium.org/1338073002/diff/60001/fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp#newcode35 fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp:35: JS_PrepareIsolate(m_pIsolate); note: this is the important step, since PrepareIsolate ...
5 years, 3 months ago (2015-09-14 23:42:52 UTC) #5
Lei Zhang
https://codereview.chromium.org/1338073002/diff/60001/fpdfsdk/include/jsapi/fxjs_v8.h File fpdfsdk/include/jsapi/fxjs_v8.h (right): https://codereview.chromium.org/1338073002/diff/60001/fpdfsdk/include/jsapi/fxjs_v8.h#newcode63 fpdfsdk/include/jsapi/fxjs_v8.h:63: void JS_Initial(unsigned int embedderDataSlot); Can we rename this to ...
5 years, 3 months ago (2015-09-15 01:59:55 UTC) #6
Tom Sepez
https://codereview.chromium.org/1338073002/diff/60001/fpdfsdk/include/jsapi/fxjs_v8.h File fpdfsdk/include/jsapi/fxjs_v8.h (right): https://codereview.chromium.org/1338073002/diff/60001/fpdfsdk/include/jsapi/fxjs_v8.h#newcode63 fpdfsdk/include/jsapi/fxjs_v8.h:63: void JS_Initial(unsigned int embedderDataSlot); On 2015/09/15 01:59:55, Lei Zhang ...
5 years, 3 months ago (2015-09-15 15:56:42 UTC) #7
Tom Sepez
https://codereview.chromium.org/1338073002/diff/80001/fpdfsdk/include/jsapi/fxjs_v8.h File fpdfsdk/include/jsapi/fxjs_v8.h (right): https://codereview.chromium.org/1338073002/diff/80001/fpdfsdk/include/jsapi/fxjs_v8.h#newcode104 fpdfsdk/include/jsapi/fxjs_v8.h:104: void JS_InitialRuntime(v8::Isolate* pIsolate, I suppose you want this named ...
5 years, 3 months ago (2015-09-15 15:57:44 UTC) #8
Tom Sepez
Fixed.
5 years, 3 months ago (2015-09-15 16:00:54 UTC) #9
Tom Sepez
Lei, really ready now.
5 years, 3 months ago (2015-09-15 16:09:48 UTC) #10
Lei Zhang
lgtm with typo fixed https://codereview.chromium.org/1338073002/diff/120001/fpdfsdk/include/jsapi/fxjs_v8.h File fpdfsdk/include/jsapi/fxjs_v8.h (right): https://codereview.chromium.org/1338073002/diff/120001/fpdfsdk/include/jsapi/fxjs_v8.h#newcode69 fpdfsdk/include/jsapi/fxjs_v8.h:69: // as part of JS_ReleaseRunime(). ...
5 years, 3 months ago (2015-09-15 21:00:32 UTC) #11
Tom Sepez
https://codereview.chromium.org/1338073002/diff/120001/fpdfsdk/include/jsapi/fxjs_v8.h File fpdfsdk/include/jsapi/fxjs_v8.h (right): https://codereview.chromium.org/1338073002/diff/120001/fpdfsdk/include/jsapi/fxjs_v8.h#newcode69 fpdfsdk/include/jsapi/fxjs_v8.h:69: // as part of JS_ReleaseRunime(). On 2015/09/15 21:00:32, Lei ...
5 years, 3 months ago (2015-09-15 21:03:42 UTC) #12
Tom Sepez
Committed patchset #8 (id:140001) manually as 09ed30750282bf56a92d0e646ab22c64bea81a36 (presubmit successful).
5 years, 3 months ago (2015-09-15 21:03:56 UTC) #13
Nico
5 years, 3 months ago (2015-09-16 19:15:07 UTC) #15
Message was sent while issue was closed.
This doesn't build with clang/win/gn 64bit debug builds:

http://build.chromium.org/p/chromium.fyi/builders/CrWinClang64%28dbg%29/build...

FAILED: E:/b/depot_tools/python276_bin/python.exe gyp-win-tool link-wrapper
environment.x64 False link.exe /nologo /OUT:pdfium_embeddertests.exe
/PDB:pdfium_embeddertests.exe.pdb @pdfium_embeddertests.exe.rsp
v8.dll.lib(v8.dll) : error LNK2005: "public: __cdecl
v8::ArrayBuffer::Allocator::Allocator(void)"
(??0Allocator@ArrayBuffer@v8@@QEAA@XZ) already defined in
fxjs_v8_embeddertest.obj

v8.dll.lib(v8.dll) : error LNK2005: "public: __cdecl
v8::Isolate::Scope::Scope(class v8::Isolate *)"
(??0Scope@Isolate@v8@@QEAA@PEAV12@@Z) already defined in
fxjs_v8_embeddertest.obj

v8.dll.lib(v8.dll) : error LNK2005: "public: __cdecl
v8::Isolate::Scope::~Scope(void)" (??1Scope@Isolate@v8@@QEAA@XZ) already defined
in fxjs_v8_embeddertest.obj

v8.dll.lib(v8.dll) : error LNK2005: "public: virtual __cdecl
v8::ArrayBuffer::Allocator::~Allocator(void)"
(??1Allocator@ArrayBuffer@v8@@UEAA@XZ) already defined in
fxjs_v8_embeddertest.obj

pdfium_embeddertests.exe : fatal error LNK1169: one or more multiply defined
symbols found

(maybe it's broken with visual studio and gn in that config too, i'm not sure we
have a bot for that)

Powered by Google App Engine
This is Rietveld 408576698