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 <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 bool GetNonBrokeredAttachments(Message* msg) override; | 65 bool GetNonBrokeredAttachments(Message* msg) override; |
66 bool DidEmptyInputBuffers() override; | 66 bool DidEmptyInputBuffers() override; |
67 void HandleInternalMessage(const Message& msg) override; | 67 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 | |
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, | |
78 // and it's only used for debug information. | |
79 std::string pipe_name_; | |
80 | |
81 // We use a thread for reading, so that we can simply block on reading and | 75 // We use a thread for reading, so that we can simply block on reading and |
82 // post the received data back to the main thread to be properly interleaved | 76 // post the received data back to the main thread to be properly interleaved |
83 // with other tasks in the MessagePump. | 77 // with other tasks in the MessagePump. |
84 // | 78 // |
85 // imc_recvmsg supports non-blocking reads, but there's no easy way to be | 79 // imc_recvmsg supports non-blocking reads, but there's no easy way to be |
86 // informed when a write or read can be done without blocking (this is handled | 80 // informed when a write or read can be done without blocking (this is handled |
87 // by libevent in Posix). | 81 // by libevent in Posix). |
88 std::unique_ptr<ReaderThreadRunner> reader_thread_runner_; | 82 std::unique_ptr<ReaderThreadRunner> reader_thread_runner_; |
89 std::unique_ptr<base::DelegateSimpleThread> reader_thread_; | 83 std::unique_ptr<base::DelegateSimpleThread> reader_thread_; |
90 | 84 |
(...skipping 22 matching lines...) Expand all Loading... |
113 std::deque<linked_ptr<Message> > output_queue_; | 107 std::deque<linked_ptr<Message> > output_queue_; |
114 | 108 |
115 base::WeakPtrFactory<ChannelNacl> weak_ptr_factory_; | 109 base::WeakPtrFactory<ChannelNacl> weak_ptr_factory_; |
116 | 110 |
117 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelNacl); | 111 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelNacl); |
118 }; | 112 }; |
119 | 113 |
120 } // namespace IPC | 114 } // namespace IPC |
121 | 115 |
122 #endif // IPC_IPC_CHANNEL_NACL_H_ | 116 #endif // IPC_IPC_CHANNEL_NACL_H_ |
OLD | NEW |