summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/global.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-08 11:23:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-08 11:23:24 -0700
commitcd5dc855df0ca37b7667b5f3ceb951d2d417d99f (patch)
tree3b7b7a8ab8a1738fd11a94df733ceff0cfae299f /fpdfsdk/javascript/global.cpp
parent8832fbf53cf71d4d4cb53986d9cfc024edd2bf1f (diff)
downloadpdfium-cd5dc855df0ca37b7667b5f3ceb951d2d417d99f.tar.xz
Remove unused context parameter from JSGetStringFromID
Clean up before using IDS_STRING_JSBADOBJECT in nearly all JS callbacks, which will happen in the next CL when we watch C-side object destruction. Add a "no permission" message as well. Review-Url: https://codereview.chromium.org/2319543003
Diffstat (limited to 'fpdfsdk/javascript/global.cpp')
-rw-r--r--fpdfsdk/javascript/global.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/fpdfsdk/javascript/global.cpp b/fpdfsdk/javascript/global.cpp
index 27c156e527..c0330f3a14 100644
--- a/fpdfsdk/javascript/global.cpp
+++ b/fpdfsdk/javascript/global.cpp
@@ -161,13 +161,12 @@ FX_BOOL JSGlobalAlternate::setPersistent(IJS_Context* cc,
const std::vector<CJS_Value>& params,
CJS_Value& vRet,
CFX_WideString& sError) {
- CJS_Context* pContext = static_cast<CJS_Context*>(cc);
- CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc);
if (params.size() != 2) {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
return FALSE;
}
+ CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc);
auto it = m_mapGlobal.find(params[0].ToCFXByteString(pRuntime));
if (it != m_mapGlobal.end()) {
JSGlobalData* pData = it->second;
@@ -177,7 +176,7 @@ FX_BOOL JSGlobalAlternate::setPersistent(IJS_Context* cc,
}
}
- sError = JSGetStringFromID(pContext, IDS_STRING_JSNOGLOBAL);
+ sError = JSGetStringFromID(IDS_STRING_JSNOGLOBAL);
return FALSE;
}