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

Unified Diff: mojo/common/message_pump_mojo.h

Issue 1156923005: Cache vectors to avoid heap allocations on each message pump iteration. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 7 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 | « no previous file | mojo/common/message_pump_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/message_pump_mojo.h
diff --git a/mojo/common/message_pump_mojo.h b/mojo/common/message_pump_mojo.h
index b176b1f694e2cfd98d406dc93305948ada9bdaf3..6c3591df881026a7a1346c4e6e57a4d3545ea834 100644
--- a/mojo/common/message_pump_mojo.h
+++ b/mojo/common/message_pump_mojo.h
@@ -6,6 +6,8 @@
#define MOJO_COMMON_MESSAGE_PUMP_MOJO_H_
#include <map>
+#include <utility>
+#include <vector>
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
@@ -81,6 +83,7 @@ class MessagePumpMojo : public base::MessagePump {
};
typedef std::map<Handle, Handler> HandleToHandler;
+ typedef std::vector<std::pair<Handle, Handler>> HandleToHandlerList;
// Implementation of Run().
void DoRunLoop(RunState* run_state, Delegate* delegate);
@@ -98,7 +101,7 @@ class MessagePumpMojo : public base::MessagePump {
void SignalControlPipe(const RunState& run_state);
- WaitState GetWaitState(const RunState& run_state) const;
+ void GetWaitState(const RunState& run_state, WaitState* wait_state) const;
// Returns the deadline for the call to MojoWaitMany().
MojoDeadline GetDeadlineForWait(const RunState& run_state) const;
« no previous file with comments | « no previous file | mojo/common/message_pump_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698