Replace PDF_ENABLE_XFA with an interface in CFXJS_Engine.
Then remove some JS calls from fpdfsdk when fxjs/xfa wants to interact
with fxjs/non-xfa, merely returning the reference itself. In turn,
we are now passing V8 locals, so the lifetime of the handle scope
must increase in the callers.
Also remove an ifdef from messages just to get more similarity
between xfa/non-xfa at the cost of a few bytes of string.
The result is no more PDF_ENABLE_XFA in fjxs.
-- Remove unused ChangeObjName().
-- Set result to undefined at method start so early returns are safer.
-- Always set up handle/isolate scopes prior to defining objects, even
though it may not be strictly required for non-xfa.
Change-Id: Ie69077cca17d132122050073f15743ffdd1a4e07
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/59257
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/xfa/cfxjse_runtimedata.h b/fxjs/xfa/cfxjse_runtimedata.h
index c0f5da3..148b01e 100644
--- a/fxjs/xfa/cfxjse_runtimedata.h
+++ b/fxjs/xfa/cfxjse_runtimedata.h
@@ -9,13 +9,12 @@
#include <memory>
+#include "fxjs/cfxjs_engine.h"
#include "v8/include/v8.h"
-class CFXJSE_RuntimeList;
-
-class CFXJSE_RuntimeData {
+class CFXJSE_RuntimeData : public FXJS_PerIsolateData::ExtensionIface {
public:
- ~CFXJSE_RuntimeData();
+ ~CFXJSE_RuntimeData() override;
static CFXJSE_RuntimeData* Get(v8::Isolate* pIsolate);