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

Unified Diff: xfa/src/fwl/src/core/fwl_appimp.cpp

Issue 1707433002: IFWL_App::Create() always passed adapter, "fuel" adapter unused (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 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 | « xfa/include/fwl/adapter/fwl_adapternative.h ('k') | xfa/src/fwl/src/core/include/fwl_appimp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fwl/src/core/fwl_appimp.cpp
diff --git a/xfa/src/fwl/src/core/fwl_appimp.cpp b/xfa/src/fwl/src/core/fwl_appimp.cpp
index a9d8e2834e2876ee9dd8d59564ea24d9b0fd337a..aced5e66c6362d769652de29e8183bb855e063e5 100644
--- a/xfa/src/fwl/src/core/fwl_appimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_appimp.cpp
@@ -39,46 +39,33 @@ FWL_ERR IFWL_App::Exit(int32_t iExitCode) {
}
CFWL_AppImp::CFWL_AppImp(IFWL_App* pIface, IFWL_AdapterNative* pAdapter)
- : CFWL_NoteThreadImp(pIface), m_pWidgetMgr(NULL), m_pThemeProvider(NULL) {
- if (!pAdapter) {
- pAdapter = FWL_CreateFuelAdapterNative();
- m_bFuelAdapter = TRUE;
- } else {
- m_bFuelAdapter = FALSE;
- }
- m_pAdapterNative = pAdapter;
-}
+ : CFWL_NoteThreadImp(pIface),
+ m_pAdapterNative(pAdapter),
+ m_pThemeProvider(nullptr) {}
+
CFWL_AppImp::~CFWL_AppImp() {
CFWL_ToolTipContainer::DeleteInstance();
- if (m_bFuelAdapter) {
- FWL_ReleaseFuelAdapterNative(m_pAdapterNative);
- m_pAdapterNative = NULL;
- }
- if (m_pWidgetMgr) {
- delete m_pWidgetMgr;
- m_pWidgetMgr = NULL;
- }
}
+
FWL_ERR CFWL_AppImp::Initialize() {
if (!m_pWidgetMgr) {
- m_pWidgetMgr = new CFWL_WidgetMgr(m_pAdapterNative);
+ m_pWidgetMgr.reset(new CFWL_WidgetMgr(m_pAdapterNative));
}
return FWL_ERR_Succeeded;
}
FWL_ERR CFWL_AppImp::Finalize() {
- delete m_pWidgetMgr;
- m_pWidgetMgr = NULL;
+ m_pWidgetMgr.reset();
return FWL_ERR_Succeeded;
}
-IFWL_AdapterNative* CFWL_AppImp::GetAdapterNative() {
+IFWL_AdapterNative* CFWL_AppImp::GetAdapterNative() const {
return m_pAdapterNative;
}
IFWL_AdapterWidgetMgr* FWL_GetAdapterWidgetMgr() {
return static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr())
->GetAdapterWidgetMgr();
}
-IFWL_WidgetMgr* CFWL_AppImp::GetWidgetMgr() {
- return m_pWidgetMgr;
+IFWL_WidgetMgr* CFWL_AppImp::GetWidgetMgr() const {
+ return m_pWidgetMgr.get();
}
FWL_ERR CFWL_AppImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
m_pThemeProvider = pThemeProvider;
@@ -89,7 +76,7 @@ FWL_ERR CFWL_AppImp::Exit(int32_t iExitCode) {
;
return m_pWidgetMgr->GetAdapterWidgetMgr()->Exit(0);
}
-IFWL_ThemeProvider* CFWL_AppImp::GetThemeProvider() {
+IFWL_ThemeProvider* CFWL_AppImp::GetThemeProvider() const {
return m_pThemeProvider;
}
IFWL_AdapterNative* FWL_GetAdapterNative() {
« no previous file with comments | « xfa/include/fwl/adapter/fwl_adapternative.h ('k') | xfa/src/fwl/src/core/include/fwl_appimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698