summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-06-06 09:49:32 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-06 09:49:32 -0700
commit884b4f942d510974e713361b84a717340eb928b9 (patch)
tree712d15560e345be172f2e6c71a5f2bd85fe5e663 /fpdfsdk/javascript
parentf7e108b2d0c2f67a143e99693df084bfff7037ec (diff)
downloadpdfium-884b4f942d510974e713361b84a717340eb928b9.tar.xz
Remove unused context param from execute.
The IJS_Context parameter is never used, removed. Review-Url: https://codereview.chromium.org/2035743002
Diffstat (limited to 'fpdfsdk/javascript')
-rw-r--r--fpdfsdk/javascript/JS_Runtime_Stub.cpp4
-rw-r--r--fpdfsdk/javascript/cjs_context.cpp2
-rw-r--r--fpdfsdk/javascript/cjs_runtime.cpp6
-rw-r--r--fpdfsdk/javascript/cjs_runtime.h4
-rw-r--r--fpdfsdk/javascript/ijs_runtime.h4
5 files changed, 6 insertions, 14 deletions
diff --git a/fpdfsdk/javascript/JS_Runtime_Stub.cpp b/fpdfsdk/javascript/JS_Runtime_Stub.cpp
index e94f8c7780..4930900337 100644
--- a/fpdfsdk/javascript/JS_Runtime_Stub.cpp
+++ b/fpdfsdk/javascript/JS_Runtime_Stub.cpp
@@ -148,9 +148,7 @@ class CJS_RuntimeStub final : public IJS_Runtime {
}
#endif // PDF_ENABLE_XFA
- int Execute(IJS_Context* cc,
- const wchar_t* script,
- CFX_WideString* info) override {
+ int Execute(const CFX_WideString& script, CFX_WideString* info) override {
return 0;
}
diff --git a/fpdfsdk/javascript/cjs_context.cpp b/fpdfsdk/javascript/cjs_context.cpp
index c8630ab32d..b844dc6e5c 100644
--- a/fpdfsdk/javascript/cjs_context.cpp
+++ b/fpdfsdk/javascript/cjs_context.cpp
@@ -51,7 +51,7 @@ FX_BOOL CJS_Context::RunScript(const CFX_WideString& script,
CFX_WideString sErrorMessage;
int nRet = 0;
if (script.GetLength() > 0) {
- nRet = m_pRuntime->Execute(this, script.c_str(), &sErrorMessage);
+ nRet = m_pRuntime->Execute(script.c_str(), &sErrorMessage);
}
if (nRet < 0) {
diff --git a/fpdfsdk/javascript/cjs_runtime.cpp b/fpdfsdk/javascript/cjs_runtime.cpp
index 9cbf1b003a..2c0ed32bd6 100644
--- a/fpdfsdk/javascript/cjs_runtime.cpp
+++ b/fpdfsdk/javascript/cjs_runtime.cpp
@@ -214,11 +214,9 @@ void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc) {
}
}
-int CJS_Runtime::Execute(IJS_Context* cc,
- const wchar_t* script,
- CFX_WideString* info) {
+int CJS_Runtime::Execute(const CFX_WideString& script, CFX_WideString* info) {
FXJSErr error = {};
- int nRet = FXJS_Execute(m_isolate, cc, script, &error);
+ int nRet = FXJS_Execute(m_isolate, script, &error);
if (nRet < 0) {
info->Format(L"[ Line: %05d { %s } ] : %s", error.linnum - 1, error.srcline,
error.message);
diff --git a/fpdfsdk/javascript/cjs_runtime.h b/fpdfsdk/javascript/cjs_runtime.h
index cc0f6545ac..4181bd21c9 100644
--- a/fpdfsdk/javascript/cjs_runtime.h
+++ b/fpdfsdk/javascript/cjs_runtime.h
@@ -43,9 +43,7 @@ class CJS_Runtime : public IJS_Runtime {
IJS_Context* GetCurrentContext() override;
void SetReaderDocument(CPDFSDK_Document* pReaderDoc) override;
CPDFSDK_Document* GetReaderDocument() override { return m_pDocument; }
- int Execute(IJS_Context* cc,
- const wchar_t* script,
- CFX_WideString* info) override;
+ int Execute(const CFX_WideString& script, CFX_WideString* info) override;
CPDFDoc_Environment* GetReaderApp() const { return m_pApp; }
diff --git a/fpdfsdk/javascript/ijs_runtime.h b/fpdfsdk/javascript/ijs_runtime.h
index ef80feb820..19a440e6ed 100644
--- a/fpdfsdk/javascript/ijs_runtime.h
+++ b/fpdfsdk/javascript/ijs_runtime.h
@@ -30,9 +30,7 @@ class IJS_Runtime {
virtual IJS_Context* GetCurrentContext() = 0;
virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0;
virtual CPDFSDK_Document* GetReaderDocument() = 0;
- virtual int Execute(IJS_Context* cc,
- const wchar_t* script,
- CFX_WideString* info) = 0;
+ virtual int Execute(const CFX_WideString& script, CFX_WideString* info) = 0;
#ifdef PDF_ENABLE_XFA
virtual FX_BOOL GetValueByName(const CFX_ByteStringC& utf8Name,