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

Unified Diff: xfa/fwl/core/fwl_noteimp.cpp

Issue 2510823003: Move the message definitions to their own files. (Closed)
Patch Set: Review feedback Created 4 years, 1 month 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/fwl/core/fwl_noteimp.h ('k') | xfa/fwl/core/ifwl_checkbox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/fwl_noteimp.cpp
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index 1e2b7bf479eeac4d184c5f44941eac0a227cf6d2..857fdfbac679a8d3f4f843555802f7757641d6c6 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -9,7 +9,11 @@
#include "core/fxcrt/fx_ext.h"
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
-#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_msgkey.h"
+#include "xfa/fwl/core/cfwl_msgkillfocus.h"
+#include "xfa/fwl/core/cfwl_msgmouse.h"
+#include "xfa/fwl/core/cfwl_msgmousewheel.h"
+#include "xfa/fwl/core/cfwl_msgsetfocus.h"
#include "xfa/fwl/core/cfwl_widgetmgr.h"
#include "xfa/fwl/core/ifwl_app.h"
#include "xfa/fwl/core/ifwl_tooltip.h"
@@ -182,23 +186,21 @@ void CFWL_NoteDriver::UnRegisterForm(IFWL_Widget* pForm) {
m_forms.RemoveAt(nIndex);
}
-void CFWL_NoteDriver::QueueMessage(CFWL_Message* pMessage) {
- pMessage->Retain();
- m_noteQueue.Add(pMessage);
+void CFWL_NoteDriver::QueueMessage(std::unique_ptr<CFWL_Message> pMessage) {
+ m_noteQueue.push_back(std::move(pMessage));
}
void CFWL_NoteDriver::UnqueueMessage(CFWL_NoteLoop* pNoteLoop) {
- if (m_noteQueue.GetSize() < 1)
+ if (m_noteQueue.empty())
return;
- CFWL_Message* pMessage = m_noteQueue[0];
- m_noteQueue.RemoveAt(0);
- if (!IsValidMessage(pMessage)) {
- pMessage->Release();
+ std::unique_ptr<CFWL_Message> pMessage = std::move(m_noteQueue[0]);
+ m_noteQueue.pop_front();
+
+ if (!IsValidMessage(pMessage.get()))
return;
- }
- ProcessMessage(pMessage);
- pMessage->Release();
+
+ ProcessMessage(pMessage.get());
}
CFWL_NoteLoop* CFWL_NoteDriver::GetTopLoop() const {
« no previous file with comments | « xfa/fwl/core/fwl_noteimp.h ('k') | xfa/fwl/core/ifwl_checkbox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698