From a282c7380f3964de41ea93c9980b12c4513d3473 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 13 Oct 2016 12:14:34 -0700 Subject: Revert of Reland: Make the CPDFXFA_App non-global (patchset #2 id:20001 of https://codereview.chromium.org/2418653003/ ) Reason for revert: https://build.chromium.org/p/client.pdfium/builders/linux_xfa_asan_lsan/builds/117/steps/corpus%20tests/logs/stdio Original issue's description: > Reland: Make the CPDFXFA_App non-global > > This reverts commit b685e6471075bebd26711bc183de3128f54932e3. > > This CL changes CPDFXFA_App from a global object to a child of the CPDFXFA_Document objects. > > BUG=pdfium:623 > > Committed: https://pdfium.googlesource.com/pdfium/+/f3736bca5f874b0889c5906ffbd74a405089f671 TBR=tsepez@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=pdfium:623 Review-Url: https://codereview.chromium.org/2414883006 --- fxjs/fxjs_v8.cpp | 8 ++++++++ fxjs/fxjs_v8.h | 7 +++++++ 2 files changed, 15 insertions(+) (limited to 'fxjs') diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp index 5ce8c47569..d74d355dc9 100644 --- a/fxjs/fxjs_v8.cpp +++ b/fxjs/fxjs_v8.cpp @@ -233,6 +233,14 @@ CFXJS_Engine* CFXJS_Engine::CurrentEngineFromIsolate(v8::Isolate* pIsolate) { kPerContextDataIndex)); } +#ifdef PDF_ENABLE_XFA +// static +void CFXJS_Engine::SetForV8Context(v8::Local v8Context, + CFXJS_Engine* pEngine) { + v8Context->SetAlignedPointerInEmbedderData(kPerContextDataIndex, pEngine); +} +#endif // PDF_ENABLE_XFA + // static int CFXJS_Engine::GetObjDefnID(v8::Local pObj) { if (pObj.IsEmpty() || !pObj->InternalFieldCount()) diff --git a/fxjs/fxjs_v8.h b/fxjs/fxjs_v8.h index ba729626f2..5f658989a5 100644 --- a/fxjs/fxjs_v8.h +++ b/fxjs/fxjs_v8.h @@ -139,6 +139,13 @@ class CFXJS_Engine { static CFXJS_Engine* CurrentEngineFromIsolate(v8::Isolate* pIsolate); static int GetObjDefnID(v8::Local pObj); +#ifdef PDF_ENABLE_XFA + // Called as part of FXJS_InitializeEngine, exposed so PDF can make its + // own contexts compatible with XFA or vice versa. + static void SetForV8Context(v8::Local v8Context, + CFXJS_Engine* pEngine); +#endif // PDF_ENABLE_XFA + v8::Isolate* GetIsolate() const { return m_isolate; } // Always returns a valid, newly-created objDefnID. -- cgit v1.2.3