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

Unified Diff: fpdfsdk/fsdk_actionhandler.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/fsdk_actionhandler.cpp
diff --git a/fpdfsdk/fsdk_actionhandler.cpp b/fpdfsdk/fsdk_actionhandler.cpp
index f6ba4c9d9c9db89ac72826223bbe00760b25a060..8a2b1fa768001b7fead92c205f24221aa6983b15 100644
--- a/fpdfsdk/fsdk_actionhandler.cpp
+++ b/fpdfsdk/fsdk_actionhandler.cpp
@@ -155,8 +155,6 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(
CFX_WideString swJS = action.GetJavaScript();
if (!swJS.IsEmpty()) {
IJS_Runtime* pRuntime = pFormFillEnv->GetJSRuntime();
- pRuntime->SetReaderDocument(pDocument);
dsinclair 2016/10/11 17:37:45 We got the env from the Document, then get the run
-
IJS_Context* pContext = pRuntime->NewContext();
pContext->OnLink_MouseUp(pFormFillEnv);
@@ -284,8 +282,6 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(
CFX_WideString swJS = action.GetJavaScript();
if (!swJS.IsEmpty()) {
IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- pRuntime->SetReaderDocument(pDocument);
-
IJS_Context* pContext = pRuntime->NewContext();
CFX_WideString csInfo;
FX_BOOL bRet = pContext->RunScript(swJS, &csInfo);
@@ -327,8 +323,6 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(
CFX_WideString swJS = action.GetJavaScript();
if (!swJS.IsEmpty()) {
IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- pRuntime->SetReaderDocument(pDocument);
-
IJS_Context* pContext = pRuntime->NewContext();
pContext->OnBookmark_MouseUp(pBookmark);
@@ -478,8 +472,6 @@ void CPDFSDK_ActionHandler::RunFieldJavaScript(CPDFSDK_Document* pDocument,
ASSERT(type != CPDF_AAction::Format);
IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- pRuntime->SetReaderDocument(pDocument);
-
IJS_Context* pContext = pRuntime->NewContext();
switch (type) {
case CPDF_AAction::CursorEnter:
@@ -532,7 +524,6 @@ void CPDFSDK_ActionHandler::RunDocumentOpenJavaScript(
const CFX_WideString& sScriptName,
const CFX_WideString& script) {
IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- pRuntime->SetReaderDocument(pDocument);
IJS_Context* pContext = pRuntime->NewContext();
pContext->OnDoc_Open(pDocument->GetEnv(), sScriptName);
@@ -550,8 +541,6 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(
CPDF_AAction::AActionType type,
const CFX_WideString& script) {
IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- pRuntime->SetReaderDocument(pDocument);
-
IJS_Context* pContext = pRuntime->NewContext();
switch (type) {
case CPDF_AAction::OpenPage:

Powered by Google App Engine
This is Rietveld 408576698