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

Unified Diff: fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.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/fpdfxfa/cpdfxfa_docenvironment.cpp
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 6e8f6711cd22207ea1954e3226f0adc32003e98f..1d4b36efd772ed219a5ee0fe267f92b4667e2431 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -1012,13 +1012,10 @@ FX_BOOL CPDFXFA_DocEnvironment::GetGlobalProperty(
!m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime())
return FALSE;
- if (!m_pJSContext) {
- m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->SetReaderDocument(
- m_pDocument->GetSDKDoc());
dsinclair 2016/10/11 17:37:45 We get the runtime from the env, which will have t
- m_pJSContext =
- m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->NewContext();
- }
+ CPDFSDK_FormFillEnvironment* pFormFillEnv =
+ m_pDocument->GetSDKDoc()->GetEnv();
+ if (!m_pJSContext)
+ m_pJSContext = pFormFillEnv->GetJSRuntime()->NewContext();
- return m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->GetValueByName(
- szPropName, pValue);
+ return pFormFillEnv->GetJSRuntime()->GetValueByName(szPropName, pValue);
}

Powered by Google App Engine
This is Rietveld 408576698