diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-11 12:38:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-11 12:38:01 -0700 |
commit | 82e1767b757d96e6b81d3e42b24048a9bea387a8 (patch) | |
tree | b7d14dfcd42ce6acf7a5552be0ff185cf0a9ed58 /fpdfsdk/javascript/JS_Runtime_Stub.cpp | |
parent | 9fa95efa11f211a6faf9b2adb27211f784aee89a (diff) | |
download | pdfium-82e1767b757d96e6b81d3e42b24048a9bea387a8.tar.xz |
Convert IJS_Runtime to CPDFSDK_FormFillEnvironment
This CL changes the use of CPDFSDK_Document to CPDFSDK_FormFillEnvironment.
Review-Url: https://codereview.chromium.org/2394313002
Diffstat (limited to 'fpdfsdk/javascript/JS_Runtime_Stub.cpp')
-rw-r--r-- | fpdfsdk/javascript/JS_Runtime_Stub.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fpdfsdk/javascript/JS_Runtime_Stub.cpp b/fpdfsdk/javascript/JS_Runtime_Stub.cpp index 904ee12cca..e7853fba7a 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); } |