| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ipc/ipc_channel.h" | 9 #include "ipc/ipc_channel.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 // Mirror methods of Channel, see ipc_channel.h for description. | 25 // Mirror methods of Channel, see ipc_channel.h for description. |
| 26 ChannelImpl(const IPC::ChannelHandle &channel_handle, Mode mode, | 26 ChannelImpl(const IPC::ChannelHandle &channel_handle, Mode mode, |
| 27 Listener* listener); | 27 Listener* listener); |
| 28 ~ChannelImpl(); | 28 ~ChannelImpl(); |
| 29 bool Connect(); | 29 bool Connect(); |
| 30 void Close(); | 30 void Close(); |
| 31 void set_listener(Listener* listener) { listener_ = listener; } | 31 void set_listener(Listener* listener) { listener_ = listener; } |
| 32 bool Send(Message* message); | 32 bool Send(Message* message); |
| 33 private: | 33 private: |
| 34 const std::wstring PipeName(const std::string& channel_id) const; | |
| 35 bool CreatePipe(const IPC::ChannelHandle &channel_handle, Mode mode); | 34 bool CreatePipe(const IPC::ChannelHandle &channel_handle, Mode mode); |
| 36 | 35 |
| 37 bool ProcessConnection(); | 36 bool ProcessConnection(); |
| 38 bool ProcessIncomingMessages(MessageLoopForIO::IOContext* context, | 37 bool ProcessIncomingMessages(MessageLoopForIO::IOContext* context, |
| 39 DWORD bytes_read); | 38 DWORD bytes_read); |
| 40 bool ProcessOutgoingMessages(MessageLoopForIO::IOContext* context, | 39 bool ProcessOutgoingMessages(MessageLoopForIO::IOContext* context, |
| 41 DWORD bytes_written); | 40 DWORD bytes_written); |
| 42 | 41 |
| 43 // MessageLoop::IOHandler implementation. | 42 // MessageLoop::IOHandler implementation. |
| 44 virtual void OnIOCompleted(MessageLoopForIO::IOContext* context, | 43 virtual void OnIOCompleted(MessageLoopForIO::IOContext* context, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // problems. TODO(darin): make this unnecessary | 77 // problems. TODO(darin): make this unnecessary |
| 79 bool processing_incoming_; | 78 bool processing_incoming_; |
| 80 | 79 |
| 81 ScopedRunnableMethodFactory<ChannelImpl> factory_; | 80 ScopedRunnableMethodFactory<ChannelImpl> factory_; |
| 82 | 81 |
| 83 scoped_ptr<base::NonThreadSafe> thread_check_; | 82 scoped_ptr<base::NonThreadSafe> thread_check_; |
| 84 | 83 |
| 85 DISALLOW_COPY_AND_ASSIGN(ChannelImpl); | 84 DISALLOW_COPY_AND_ASSIGN(ChannelImpl); |
| 86 }; | 85 }; |
| 87 | 86 |
| 87 const std::wstring PipeNameFromChannelId(const std::string& channel_id); |
| 88 |
| 88 } // namespace IPC | 89 } // namespace IPC |
| 89 | 90 |
| 90 #endif // IPC_IPC_CHANNEL_WIN_H_ | 91 #endif // IPC_IPC_CHANNEL_WIN_H_ |
| OLD | NEW |