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 12 matching lines...) Expand all Loading... |
23 class Channel::ChannelImpl : public MessageLoopForIO::IOHandler { | 23 class Channel::ChannelImpl : public MessageLoopForIO::IOHandler { |
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 static bool IsNamedServerInitialized(const std::string& channel_id); |
33 private: | 34 private: |
34 const std::wstring PipeName(const std::string& channel_id) const; | 35 static const std::wstring PipeName(const std::string& channel_id); |
35 bool CreatePipe(const IPC::ChannelHandle &channel_handle, Mode mode); | 36 bool CreatePipe(const IPC::ChannelHandle &channel_handle, Mode mode); |
36 | 37 |
37 bool ProcessConnection(); | 38 bool ProcessConnection(); |
38 bool ProcessIncomingMessages(MessageLoopForIO::IOContext* context, | 39 bool ProcessIncomingMessages(MessageLoopForIO::IOContext* context, |
39 DWORD bytes_read); | 40 DWORD bytes_read); |
40 bool ProcessOutgoingMessages(MessageLoopForIO::IOContext* context, | 41 bool ProcessOutgoingMessages(MessageLoopForIO::IOContext* context, |
41 DWORD bytes_written); | 42 DWORD bytes_written); |
42 | 43 |
43 // MessageLoop::IOHandler implementation. | 44 // MessageLoop::IOHandler implementation. |
44 virtual void OnIOCompleted(MessageLoopForIO::IOContext* context, | 45 virtual void OnIOCompleted(MessageLoopForIO::IOContext* context, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 ScopedRunnableMethodFactory<ChannelImpl> factory_; | 82 ScopedRunnableMethodFactory<ChannelImpl> factory_; |
82 | 83 |
83 scoped_ptr<base::NonThreadSafe> thread_check_; | 84 scoped_ptr<base::NonThreadSafe> thread_check_; |
84 | 85 |
85 DISALLOW_COPY_AND_ASSIGN(ChannelImpl); | 86 DISALLOW_COPY_AND_ASSIGN(ChannelImpl); |
86 }; | 87 }; |
87 | 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 |