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

Unified Diff: fpdfsdk/javascript/JS_Runtime_Stub.cpp

Issue 2394313002: Convert IJS_Runtime to CPDFSDK_FormFillEnvironment (Closed)
Patch Set: Rebase to master Created 4 years, 2 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
Index: fpdfsdk/javascript/JS_Runtime_Stub.cpp
diff --git a/fpdfsdk/javascript/JS_Runtime_Stub.cpp b/fpdfsdk/javascript/JS_Runtime_Stub.cpp
index 904ee12cca99a7287a48a0812a0aba88ac51f4f9..e7853fba7a690756bae778160914715c1c6aad39 100644
--- a/fpdfsdk/javascript/JS_Runtime_Stub.cpp
+++ b/fpdfsdk/javascript/JS_Runtime_Stub.cpp
@@ -121,7 +121,8 @@ class CJS_ContextStub final : public IJS_Context {
class CJS_RuntimeStub final : public IJS_Runtime {
public:
- CJS_RuntimeStub() : m_pDoc(nullptr) {}
+ CJS_RuntimeStub(CPDFSDK_FormFillEnvironment* pFormFillEnv)
+ : m_pFormFillEnv(pFormFillEnv) {}
~CJS_RuntimeStub() override {}
IJS_Context* NewContext() override {
@@ -133,10 +134,9 @@ class CJS_RuntimeStub final : public IJS_Runtime {
IJS_Context* GetCurrentContext() override { return m_pContext.get(); }
void ReleaseContext(IJS_Context* pContext) override {}
- void SetReaderDocument(CPDFSDK_Document* pReaderDoc) override {
- m_pDoc = pReaderDoc;
+ CPDFSDK_FormFillEnvironment* GetFormFillEnv() const override {
+ return m_pFormFillEnv;
}
- CPDFSDK_Document* GetReaderDocument() override { return m_pDoc; }
#ifdef PDF_ENABLE_XFA
FX_BOOL GetValueByName(const CFX_ByteStringC&, CFXJSE_Value*) override {
@@ -154,7 +154,7 @@ class CJS_RuntimeStub final : public IJS_Runtime {
}
protected:
- CPDFSDK_Document* m_pDoc;
+ CPDFSDK_FormFillEnvironment* m_pFormFillEnv;
std::unique_ptr<CJS_ContextStub> m_pContext;
};
@@ -165,6 +165,6 @@ void IJS_Runtime::Initialize(unsigned int slot, void* isolate) {}
void IJS_Runtime::Destroy() {}
// static
-IJS_Runtime* IJS_Runtime::Create(CPDFSDK_FormFillEnvironment* pEnv) {
- return new CJS_RuntimeStub;
+IJS_Runtime* IJS_Runtime::Create(CPDFSDK_FormFillEnvironment* pFormFillEnv) {
+ return new CJS_RuntimeStub(pFormFillEnv);
}

Powered by Google App Engine
This is Rietveld 408576698