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

Unified Diff: fpdfsdk/src/fsdk_mgr.cpp

Issue 1153553003: Make CPDFXFA_App / IXFA_AppProvider saner (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address comments. Created 5 years, 7 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
« no previous file with comments | « fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fsdk_mgr.cpp
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index e783532ca24bd50dd706b69d2bd35d2585880c04..ccb1ab6e343ac610423a9bf05fdc4247d486fcdf 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -215,8 +215,6 @@ FX_SYSTEMTIME CFX_SystemHandler::GetLocalTime()
return m_pEnv->FFI_GetLocalTime();
}
-
-
CPDFDoc_Environment::CPDFDoc_Environment(CPDFXFA_Document* pDoc) :
m_pAnnotHandlerMgr(NULL),
m_pActionHandler(NULL),
@@ -226,50 +224,34 @@ CPDFDoc_Environment::CPDFDoc_Environment(CPDFXFA_Document* pDoc) :
m_pDoc(pDoc),
m_pIFormFiller(NULL)
{
-
m_pSysHandler = NULL;
m_pSysHandler = new CFX_SystemHandler(this);
-
- //m_pJSRuntimeFactory = pDoc->GetApp()->GetRuntimeFactory();
-
}
CPDFDoc_Environment::~CPDFDoc_Environment()
{
- if ( m_pIFormFiller )
- {
- delete m_pIFormFiller;
- m_pIFormFiller = NULL;
- }
-
- if (m_pJSRuntime && FPDFXFA_GetApp()->GetRuntimeFactory())
- FPDFXFA_GetApp()->GetRuntimeFactory()->DeleteJSRuntime(m_pJSRuntime);
+ delete m_pIFormFiller;
+ m_pIFormFiller = NULL;
- if (FPDFXFA_GetApp()->m_pEnvList.GetSize() == 0)
- {
- FPDFXFA_GetApp()->ReleaseRuntime();
- FPDFXFA_GetApp()->InitRuntime(TRUE);
- }
+ CPDFXFA_App* pProvider = CPDFXFA_App::GetInstance();
+ if (m_pJSRuntime && pProvider->GetRuntimeFactory())
+ pProvider->GetRuntimeFactory()->DeleteJSRuntime(m_pJSRuntime);
- if(m_pSysHandler)
- {
- delete m_pSysHandler;
- m_pSysHandler = NULL;
- }
+ if (pProvider->m_pEnvList.GetSize() == 0)
+ {
+ pProvider->ReleaseRuntime();
+ pProvider->InitRuntime(TRUE);
+ }
- if(m_pAnnotHandlerMgr)
- {
- delete m_pAnnotHandlerMgr;
- m_pAnnotHandlerMgr = NULL;
- }
- if(m_pActionHandler)
- {
- delete m_pActionHandler;
- m_pActionHandler = NULL;
- }
+ delete m_pSysHandler;
+ m_pSysHandler = NULL;
+ delete m_pAnnotHandlerMgr;
+ m_pAnnotHandlerMgr = NULL;
+ delete m_pActionHandler;
+ m_pActionHandler = NULL;
}
@@ -278,7 +260,7 @@ IFXJS_Runtime* CPDFDoc_Environment::GetJSRuntime()
if(!IsJSInitiated())
return NULL;
if(!m_pJSRuntime)
- m_pJSRuntime = FPDFXFA_GetApp()->GetRuntimeFactory()->NewJSRuntime(this);
+ m_pJSRuntime = CPDFXFA_App::GetInstance()->GetRuntimeFactory()->NewJSRuntime(this);
return m_pJSRuntime;
}
« no previous file with comments | « fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698