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

Side by Side Diff: chrome/common/ipc_channel.h

Issue 8156: Switch MessagePumpForIO to use completion ports on Windows.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/message_pump_win.cc ('k') | chrome/common/ipc_channel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_COMMON_IPC_CHANNEL_H_ 5 #ifndef CHROME_COMMON_IPC_CHANNEL_H_
6 #define CHROME_COMMON_IPC_CHANNEL_H_ 6 #define CHROME_COMMON_IPC_CHANNEL_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // processed. Returns false if there are pending messages that cannot be 92 // processed. Returns false if there are pending messages that cannot be
93 // processed for some reason (e.g., because ProcessIncomingMessages would be 93 // processed for some reason (e.g., because ProcessIncomingMessages would be
94 // re-entered). 94 // re-entered).
95 // TODO(darin): Need a better way of dealing with the recursion problem. 95 // TODO(darin): Need a better way of dealing with the recursion problem.
96 bool ProcessPendingMessages(DWORD max_wait_msec); 96 bool ProcessPendingMessages(DWORD max_wait_msec);
97 97
98 private: 98 private:
99 const std::wstring PipeName(const std::wstring& channel_id) const; 99 const std::wstring PipeName(const std::wstring& channel_id) const;
100 bool CreatePipe(const std::wstring& channel_id, Mode mode); 100 bool CreatePipe(const std::wstring& channel_id, Mode mode);
101 bool ProcessConnection(); 101 bool ProcessConnection();
102 bool ProcessIncomingMessages(OVERLAPPED* context, DWORD bytes_read); 102 bool ProcessIncomingMessages(MessageLoopForIO::IOContext* context,
103 bool ProcessOutgoingMessages(OVERLAPPED* context, DWORD bytes_written); 103 DWORD bytes_read);
104 bool ProcessOutgoingMessages(MessageLoopForIO::IOContext* context,
105 DWORD bytes_written);
104 106
105 // MessageLoop::IOHandler implementation. 107 // MessageLoop::IOHandler implementation.
106 virtual void OnIOCompleted(OVERLAPPED* context, DWORD bytes_transfered, 108 virtual void OnIOCompleted(MessageLoopForIO::IOContext* context,
107 DWORD error); 109 DWORD bytes_transfered, DWORD error);
108 110
109 private: 111 private:
110 enum { 112 enum {
111 BUF_SIZE = 4096 113 BUF_SIZE = 4096
112 }; 114 };
113 115
114 struct State { 116 struct State {
115 State(); 117 explicit State(Channel* channel);
116 ~State(); 118 ~State();
117 OVERLAPPED overlapped; 119 MessageLoopForIO::IOContext context;
118 bool is_pending; 120 bool is_pending;
119 }; 121 };
120 122
121 State input_state_; 123 State input_state_;
122 State output_state_; 124 State output_state_;
123 125
124 HANDLE pipe_; 126 HANDLE pipe_;
125 Listener* listener_; 127 Listener* listener_;
126 128
127 // Messages to be sent are queued here. 129 // Messages to be sent are queued here.
(...skipping 27 matching lines...) Expand all
155 // to avoid conflicting with normal 157 // to avoid conflicting with normal
156 // message types, which are enumeration 158 // message types, which are enumeration
157 // constants starting from 0. 159 // constants starting from 0.
158 }; 160 };
159 }; 161 };
160 162
161 } 163 }
162 164
163 #endif // CHROME_COMMON_IPC_CHANNEL_H_ 165 #endif // CHROME_COMMON_IPC_CHANNEL_H_
164 166
OLDNEW
« no previous file with comments | « base/message_pump_win.cc ('k') | chrome/common/ipc_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698