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

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

Issue 2510823003: Move the message definitions to their own files. (Closed)
Patch Set: 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
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..425075e43fcdcad0327545dc63d9412b85e66ac4 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(m_noteQueue[0].release());
Tom Sepez 2016/11/16 21:34:02 nit: just ... = std::move(m_noteQueue.front());
dsinclair 2016/11/16 21:41:07 Done.
+ m_noteQueue.pop_front();
+
+ if (!IsValidMessage(pMessage.get()))
return;
- }
- ProcessMessage(pMessage);
- pMessage->Release();
+
+ ProcessMessage(pMessage.get());
}
CFWL_NoteLoop* CFWL_NoteDriver::GetTopLoop() const {

Powered by Google App Engine
This is Rietveld 408576698