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

Unified Diff: ipc/mojo/ipc_message_pipe_reader.h

Issue 929433005: WIP: A couple of more ChannelMojo speedup ideas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build and test fix Created 5 years, 10 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 | « ipc/mojo/async_handle_waiter_unittest.cc ('k') | ipc/mojo/ipc_message_pipe_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_message_pipe_reader.h
diff --git a/ipc/mojo/ipc_message_pipe_reader.h b/ipc/mojo/ipc_message_pipe_reader.h
index 74de71b80ba87ef9f02d159409c6e8efd70bc5c1..ad14fe33afff4afb670d8f6e274f5ac21b3ca0ce 100644
--- a/ipc/mojo/ipc_message_pipe_reader.h
+++ b/ipc/mojo/ipc_message_pipe_reader.h
@@ -10,14 +10,13 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "ipc/ipc_message.h"
+#include "ipc/mojo/async_handle_waiter.h"
#include "third_party/mojo/src/mojo/public/c/environment/async_waiter.h"
#include "third_party/mojo/src/mojo/public/cpp/system/core.h"
namespace IPC {
namespace internal {
-class AsyncHandleWaiter;
-
// A helper class to handle bytestream directly over mojo::MessagePipe
// in template-method pattern. MessagePipeReader manages the lifetime
// of given MessagePipe and participates the event loop, and
@@ -32,7 +31,7 @@ class AsyncHandleWaiter;
//
// MessageReader has to be used in IO thread. It isn't thread-safe.
//
-class MessagePipeReader {
+class MessagePipeReader : public AsyncHandleWaiter::Delegate {
public:
class Delegate {
public:
@@ -90,8 +89,11 @@ class MessagePipeReader {
void OnPipeClosed();
void OnPipeError(MojoResult error);
+ // AsyncHandleWaiter::Delegate implementations
+ void PipeIsReady(MojoResult wait_result) override;
+ void MessageWasArrived(const void* bytes, uint32_t num_bytes) override;
+
MojoResult ReadMessageBytes();
- void PipeIsReady(MojoResult wait_result);
void ReadAvailableMessages();
std::vector<char> data_buffer_;
« no previous file with comments | « ipc/mojo/async_handle_waiter_unittest.cc ('k') | ipc/mojo/ipc_message_pipe_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698