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

Unified Diff: mojo/public/cpp/bindings/lib/multiplex_router.h

Issue 1831513002: Mojo C++ bindings: some MultiplexRouter optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/public/cpp/bindings/lib/multiplex_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/multiplex_router.h
diff --git a/mojo/public/cpp/bindings/lib/multiplex_router.h b/mojo/public/cpp/bindings/lib/multiplex_router.h
index f66d202f79aa66e522a4a9d8db437ad48dde2873..a8bf9b556b7da7704ac1d0e30148a61af7a89788 100644
--- a/mojo/public/cpp/bindings/lib/multiplex_router.h
+++ b/mojo/public/cpp/bindings/lib/multiplex_router.h
@@ -27,6 +27,10 @@
#include "mojo/public/cpp/bindings/lib/pipe_control_message_proxy.h"
#include "mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.h"
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace mojo {
class AssociatedGroup;
@@ -172,11 +176,11 @@ class MultiplexRouter
// on to a ref outside of |lock_| before calling this method.
void ProcessTasks(bool force_async);
- // Returns true to indicate that |task| has been processed. Otherwise the task
- // will be added back to the front of the queue.
+ // Returns true to indicate that |task|/|message| has been processed.
bool ProcessNotifyErrorTask(Task* task, bool force_async);
- bool ProcessIncomingMessageTask(Task* task, bool force_async);
+ bool ProcessIncomingMessage(Message* message, bool force_async);
+ void MaybePostToProcessTasks(base::SingleThreadTaskRunner* task_runner);
void LockAndCallProcessTasks();
// Updates the state of |endpoint|. If both the endpoint and its peer have
@@ -188,6 +192,8 @@ class MultiplexRouter
void RaiseErrorInNonTestingMode();
+ InterfaceEndpoint* FindOrInsertEndpoint(InterfaceId id, bool* inserted);
+
// Whether to set the namespace bit when generating interface IDs. Please see
// comments of kInterfaceIdNamespaceMask.
const bool set_interface_id_namespace_bit_;
@@ -208,6 +214,8 @@ class MultiplexRouter
std::deque<scoped_ptr<Task>> tasks_;
+ bool posted_to_process_tasks_;
+
bool testing_mode_;
DISALLOW_COPY_AND_ASSIGN(MultiplexRouter);
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/multiplex_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698