summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/JS_Runtime_Stub.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-11 12:38:01 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-11 12:38:01 -0700
commit82e1767b757d96e6b81d3e42b24048a9bea387a8 (patch)
treeb7d14dfcd42ce6acf7a5552be0ff185cf0a9ed58 /fpdfsdk/javascript/JS_Runtime_Stub.cpp
parent9fa95efa11f211a6faf9b2adb27211f784aee89a (diff)
downloadpdfium-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.cpp14
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);
}