Remove CFWL_NoteDriver::ClearEventTargets(). It doesn't change any logic, as it only removes invalid events, and these are not dispatched to anyways in SendEvent(). It does return some memory, but this is only called during document cleanup, so the memory is about to be returned anyways. Follow-on from https://pdfium-review.googlesource.com/c/pdfium/+/72016 Change-Id: I734fbf7cf63ca47251ed0856a37e10006d72d3d5 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/72021 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fwl/cfwl_notedriver.cpp b/xfa/fwl/cfwl_notedriver.cpp index 2cd91c1..1d6643e 100644 --- a/xfa/fwl/cfwl_notedriver.cpp +++ b/xfa/fwl/cfwl_notedriver.cpp
@@ -280,12 +280,3 @@ CFWL_WidgetMgr* pWidgetMgr = pDstTarget->GetOwnerApp()->GetWidgetMgr(); return pWidgetMgr->GetSystemFormWidget(pDstTarget); } - -void CFWL_NoteDriver::ClearEventTargets() { - auto it = m_eventTargets.begin(); - while (it != m_eventTargets.end()) { - auto old = it++; - if (!old->second->IsValid()) - m_eventTargets.erase(old); - } -}
diff --git a/xfa/fwl/cfwl_notedriver.h b/xfa/fwl/cfwl_notedriver.h index a519d19..93ae6fb 100644 --- a/xfa/fwl/cfwl_notedriver.h +++ b/xfa/fwl/cfwl_notedriver.h
@@ -25,10 +25,8 @@ ~CFWL_NoteDriver(); void SendEvent(CFWL_Event* pNote); - void RegisterEventTarget(CFWL_Widget* pListener, CFWL_Widget* pEventSource); void UnregisterEventTarget(CFWL_Widget* pListener); - void ClearEventTargets(); CFWL_Widget* GetFocus() const { return m_pFocus.Get(); } bool SetFocus(CFWL_Widget* pFocus);
diff --git a/xfa/fxfa/cxfa_ffapp.cpp b/xfa/fxfa/cxfa_ffapp.cpp index b5d9daa..d6f06a4 100644 --- a/xfa/fxfa/cxfa_ffapp.cpp +++ b/xfa/fxfa/cxfa_ffapp.cpp
@@ -66,7 +66,3 @@ TimerHandlerIface* CXFA_FFApp::GetTimerHandler() { return m_pProvider->GetTimerHandler(); } - -void CXFA_FFApp::ClearEventTargets() { - m_pFWLApp->GetNoteDriver()->ClearEventTargets(); -}
diff --git a/xfa/fxfa/cxfa_ffapp.h b/xfa/fxfa/cxfa_ffapp.h index b01ba2f..e3bac30 100644 --- a/xfa/fxfa/cxfa_ffapp.h +++ b/xfa/fxfa/cxfa_ffapp.h
@@ -38,8 +38,6 @@ const CFWL_App* GetFWLApp() const { return m_pFWLApp.get(); } CXFA_FontMgr* GetXFAFontMgr() { return &m_pFontMgr; } - void ClearEventTargets(); - private: UnownedPtr<IXFA_AppProvider> const m_pProvider;
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp index 41cfe36..3eb0a75 100644 --- a/xfa/fxfa/cxfa_ffdoc.cpp +++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -96,7 +96,6 @@ m_pNotify.reset(); m_pPDFFontMgr.reset(); m_HashToDibDpiMap.clear(); - m_pApp->ClearEventTargets(); } bool CXFA_FFDoc::BuildDoc(CFX_XMLDocument* pXML) {