summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_notedriver.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-07-03 18:48:04 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-03 18:48:04 +0000
commitd96fa3b42797332ab53c05b8e6b6357676838e55 (patch)
tree346819d245a14cd41b240f2284ff62c5819f7542 /xfa/fwl/cfwl_notedriver.h
parent08d939291804b7f867d077d05eaead2adccb0e2d (diff)
downloadpdfium-d96fa3b42797332ab53c05b8e6b6357676838e55.tar.xz
Use UnownedPtr<> in cfwl_notedriver.h
Re-order owned/unowned references to obey lifetime constraint. Change-Id: I589746b3c2e7d8c45d26d63d09eef977b095226d Reviewed-on: https://pdfium-review.googlesource.com/36970 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_notedriver.h')
-rw-r--r--xfa/fwl/cfwl_notedriver.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/xfa/fwl/cfwl_notedriver.h b/xfa/fwl/cfwl_notedriver.h
index 0db482ecbc..f894fe33d8 100644
--- a/xfa/fwl/cfwl_notedriver.h
+++ b/xfa/fwl/cfwl_notedriver.h
@@ -12,6 +12,7 @@
#include <memory>
#include <vector>
+#include "core/fxcrt/unowned_ptr.h"
#include "xfa/fwl/cfwl_event.h"
#include "xfa/fwl/cfwl_widget.h"
#include "xfa/fxgraphics/cxfa_graphics.h"
@@ -36,7 +37,7 @@ class CFWL_NoteDriver {
void PushNoteLoop(CFWL_NoteLoop* pNoteLoop);
CFWL_NoteLoop* PopNoteLoop();
- CFWL_Widget* GetFocus() const { return m_pFocus; }
+ CFWL_Widget* GetFocus() const { return m_pFocus.Get(); }
bool SetFocus(CFWL_Widget* pFocus);
void SetGrab(CFWL_Widget* pGrab, bool bSet) {
m_pGrab = bSet ? pGrab : nullptr;
@@ -66,14 +67,14 @@ class CFWL_NoteDriver {
bool IsValidMessage(CFWL_Message* pMessage);
CFWL_Widget* GetMessageForm(CFWL_Widget* pDstTarget);
- std::vector<CFWL_Widget*> m_Forms;
+ std::vector<UnownedPtr<CFWL_Widget>> m_Forms;
std::deque<std::unique_ptr<CFWL_Message>> m_NoteQueue;
- std::vector<CFWL_NoteLoop*> m_NoteLoopQueue;
- std::map<uint32_t, std::unique_ptr<CFWL_EventTarget>> m_eventTargets;
- CFWL_Widget* m_pHover;
- CFWL_Widget* m_pFocus;
- CFWL_Widget* m_pGrab;
std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop;
+ std::vector<UnownedPtr<CFWL_NoteLoop>> m_NoteLoopQueue;
+ std::map<uint32_t, std::unique_ptr<CFWL_EventTarget>> m_eventTargets;
+ UnownedPtr<CFWL_Widget> m_pHover;
+ UnownedPtr<CFWL_Widget> m_pFocus;
+ UnownedPtr<CFWL_Widget> m_pGrab;
};
#endif // XFA_FWL_CFWL_NOTEDRIVER_H_