| 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_NACL_H_ | 5 #ifndef IPC_IPC_CHANNEL_NACL_H_ |
| 6 #define IPC_IPC_CHANNEL_NACL_H_ | 6 #define IPC_IPC_CHANNEL_NACL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 class ChannelNacl : public Channel, | 34 class ChannelNacl : public Channel, |
| 35 public internal::ChannelReader { | 35 public internal::ChannelReader { |
| 36 public: | 36 public: |
| 37 // Mirror methods of Channel, see ipc_channel.h for description. | 37 // Mirror methods of Channel, see ipc_channel.h for description. |
| 38 ChannelNacl(const IPC::ChannelHandle& channel_handle, | 38 ChannelNacl(const IPC::ChannelHandle& channel_handle, |
| 39 Mode mode, | 39 Mode mode, |
| 40 Listener* listener); | 40 Listener* listener); |
| 41 virtual ~ChannelNacl(); | 41 virtual ~ChannelNacl(); |
| 42 | 42 |
| 43 // Channel implementation. | 43 // Channel implementation. |
| 44 virtual base::ProcessId GetPeerPID() const OVERRIDE; | 44 virtual base::ProcessId GetPeerPID() const override; |
| 45 virtual base::ProcessId GetSelfPID() const OVERRIDE; | 45 virtual base::ProcessId GetSelfPID() const override; |
| 46 virtual bool Connect() OVERRIDE; | 46 virtual bool Connect() override; |
| 47 virtual void Close() OVERRIDE; | 47 virtual void Close() override; |
| 48 virtual bool Send(Message* message) OVERRIDE; | 48 virtual bool Send(Message* message) override; |
| 49 | 49 |
| 50 // Posted to the main thread by ReaderThreadRunner. | 50 // Posted to the main thread by ReaderThreadRunner. |
| 51 void DidRecvMsg(scoped_ptr<MessageContents> contents); | 51 void DidRecvMsg(scoped_ptr<MessageContents> contents); |
| 52 void ReadDidFail(); | 52 void ReadDidFail(); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 class ReaderThreadRunner; | 55 class ReaderThreadRunner; |
| 56 | 56 |
| 57 bool CreatePipe(const IPC::ChannelHandle& channel_handle); | 57 bool CreatePipe(const IPC::ChannelHandle& channel_handle); |
| 58 bool ProcessOutgoingMessages(); | 58 bool ProcessOutgoingMessages(); |
| 59 void CallOnChannelConnected(); | 59 void CallOnChannelConnected(); |
| 60 | 60 |
| 61 // ChannelReader implementation. | 61 // ChannelReader implementation. |
| 62 virtual ReadState ReadData(char* buffer, | 62 virtual ReadState ReadData(char* buffer, |
| 63 int buffer_len, | 63 int buffer_len, |
| 64 int* bytes_read) OVERRIDE; | 64 int* bytes_read) override; |
| 65 virtual bool WillDispatchInputMessage(Message* msg) OVERRIDE; | 65 virtual bool WillDispatchInputMessage(Message* msg) override; |
| 66 virtual bool DidEmptyInputBuffers() OVERRIDE; | 66 virtual bool DidEmptyInputBuffers() override; |
| 67 virtual void HandleInternalMessage(const Message& msg) OVERRIDE; | 67 virtual void HandleInternalMessage(const Message& msg) override; |
| 68 | 68 |
| 69 Mode mode_; | 69 Mode mode_; |
| 70 bool waiting_connect_; | 70 bool waiting_connect_; |
| 71 | 71 |
| 72 // The pipe used for communication. | 72 // The pipe used for communication. |
| 73 int pipe_; | 73 int pipe_; |
| 74 | 74 |
| 75 // The "name" of our pipe. On Windows this is the global identifier for | 75 // The "name" of our pipe. On Windows this is the global identifier for |
| 76 // the pipe. On POSIX it's used as a key in a local map of file descriptors. | 76 // the pipe. On POSIX it's used as a key in a local map of file descriptors. |
| 77 // For NaCl, we don't actually support looking up file descriptors by name, | 77 // For NaCl, we don't actually support looking up file descriptors by name, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 std::deque<linked_ptr<Message> > output_queue_; | 113 std::deque<linked_ptr<Message> > output_queue_; |
| 114 | 114 |
| 115 base::WeakPtrFactory<ChannelNacl> weak_ptr_factory_; | 115 base::WeakPtrFactory<ChannelNacl> weak_ptr_factory_; |
| 116 | 116 |
| 117 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelNacl); | 117 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelNacl); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace IPC | 120 } // namespace IPC |
| 121 | 121 |
| 122 #endif // IPC_IPC_CHANNEL_NACL_H_ | 122 #endif // IPC_IPC_CHANNEL_NACL_H_ |
| OLD | NEW |