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

Unified Diff: ipc/ipc_channel_win.h

Issue 9568031: Refactoring on Windows IPC channel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « no previous file | ipc/ipc_channel_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_win.h
diff --git a/ipc/ipc_channel_win.h b/ipc/ipc_channel_win.h
index 77bc119bc197c28e13f86aef10c1c77f91f6db79..121bc8623dbc6b5e1ec7179e161610f1abd09d24 100644
--- a/ipc/ipc_channel_win.h
+++ b/ipc/ipc_channel_win.h
@@ -32,13 +32,35 @@ class Channel::ChannelImpl : public MessageLoopForIO::IOHandler {
void set_listener(Listener* listener) { listener_ = listener; }
bool Send(Message* message);
static bool IsNamedServerInitialized(const std::string& channel_id);
+
private:
+ enum ReadState { READ_SUCCEEDED, READ_FAILED, READ_PENDING };
+
+ // This will become the virtual interface implemented by this class to
+ // handle platform-specific reading.
+ // TODO(brettw) finish refactoring.
+ ReadState ReadData(char* buffer, int buffer_len, int* bytes_read);
+ bool WillDispatchInputMessage(Message* msg);
+ void HandleHelloMessage(const Message& msg);
+ bool DidEmptyInputBuffers();
+
+ bool DispatchInputData(const char* input_data, int input_data_len);
+
+ // Returns true if the given message is the hello message.
+ bool IsHelloMessage(const Message& m) const;
+
+ // Handles asynchronously read data.
+ //
+ // Optionally call this after returning READ_PENDING from ReadData to
+ // indicate that buffer was filled with the given number of bytes of
+ // data. See ReadData for more.
+ bool AsyncReadComplete(int bytes_read);
+
static const std::wstring PipeName(const std::string& channel_id);
bool CreatePipe(const IPC::ChannelHandle &channel_handle, Mode mode);
bool ProcessConnection();
- bool ProcessIncomingMessages(MessageLoopForIO::IOContext* context,
- DWORD bytes_read);
+ bool ProcessIncomingMessages();
bool ProcessOutgoingMessages(MessageLoopForIO::IOContext* context,
DWORD bytes_written);
« no previous file with comments | « no previous file | ipc/ipc_channel_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698