| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 IPC_IPC_CHANNEL_WIN_H_ | 5 #ifndef IPC_IPC_CHANNEL_WIN_H_ |
| 6 #define IPC_IPC_CHANNEL_WIN_H_ | 6 #define IPC_IPC_CHANNEL_WIN_H_ |
| 7 | 7 |
| 8 #include "ipc/ipc_channel.h" | 8 #include "ipc/ipc_channel.h" |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/win/scoped_handle.h" |
| 16 #include "ipc/ipc_channel_reader.h" | 17 #include "ipc/ipc_channel_reader.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class ThreadChecker; | 20 class ThreadChecker; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace IPC { | 23 namespace IPC { |
| 23 | 24 |
| 24 class ChannelWin : public Channel, | 25 class ChannelWin : public Channel, |
| 25 public internal::ChannelReader, | 26 public internal::ChannelReader, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 struct State { | 67 struct State { |
| 67 explicit State(ChannelWin* channel); | 68 explicit State(ChannelWin* channel); |
| 68 ~State(); | 69 ~State(); |
| 69 base::MessageLoopForIO::IOContext context; | 70 base::MessageLoopForIO::IOContext context; |
| 70 bool is_pending; | 71 bool is_pending; |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 State input_state_; | 74 State input_state_; |
| 74 State output_state_; | 75 State output_state_; |
| 75 | 76 |
| 76 HANDLE pipe_; | 77 base::win::ScopedHandle pipe_; |
| 77 | 78 |
| 78 base::ProcessId peer_pid_; | 79 base::ProcessId peer_pid_; |
| 79 | 80 |
| 80 // Messages to be sent are queued here. | 81 // Messages to be sent are queued here. |
| 81 std::queue<Message*> output_queue_; | 82 std::queue<Message*> output_queue_; |
| 82 | 83 |
| 83 // In server-mode, we have to wait for the client to connect before we | 84 // In server-mode, we have to wait for the client to connect before we |
| 84 // can begin reading. We make use of the input_state_ when performing | 85 // can begin reading. We make use of the input_state_ when performing |
| 85 // the connect operation in overlapped mode. | 86 // the connect operation in overlapped mode. |
| 86 bool waiting_connect_; | 87 bool waiting_connect_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 116 | 117 |
| 117 scoped_ptr<base::ThreadChecker> thread_check_; | 118 scoped_ptr<base::ThreadChecker> thread_check_; |
| 118 base::WeakPtrFactory<ChannelWin> weak_factory_; | 119 base::WeakPtrFactory<ChannelWin> weak_factory_; |
| 119 | 120 |
| 120 DISALLOW_COPY_AND_ASSIGN(ChannelWin); | 121 DISALLOW_COPY_AND_ASSIGN(ChannelWin); |
| 121 }; | 122 }; |
| 122 | 123 |
| 123 } // namespace IPC | 124 } // namespace IPC |
| 124 | 125 |
| 125 #endif // IPC_IPC_CHANNEL_WIN_H_ | 126 #endif // IPC_IPC_CHANNEL_WIN_H_ |
| OLD | NEW |