OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MESSAGE_PIPE_READER_H_ | 5 #ifndef IPC_IPC_MESSAGE_PIPE_READER_H_ |
6 #define IPC_IPC_MESSAGE_PIPE_READER_H_ | 6 #define IPC_IPC_MESSAGE_PIPE_READER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/atomicops.h" | 13 #include "base/atomicops.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/process/process_handle.h" | 16 #include "base/process/process_handle.h" |
17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
18 #include "ipc/ipc.mojom.h" | 18 #include "ipc/ipc.mojom.h" |
19 #include "ipc/ipc_export.h" | 19 #include "ipc/ipc_export.h" |
20 #include "ipc/ipc_message.h" | 20 #include "ipc/ipc_message.h" |
21 #include "mojo/public/cpp/bindings/associated_binding.h" | 21 #include "mojo/public/cpp/bindings/associated_binding.h" |
22 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" | 22 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" |
23 #include "mojo/public/cpp/system/core.h" | 23 #include "mojo/public/cpp/system/core.h" |
24 #include "mojo/public/cpp/system/message_pipe.h" | 24 #include "mojo/public/cpp/system/message_pipe.h" |
25 | 25 |
26 namespace IPC { | 26 namespace IPC { |
27 namespace internal { | 27 namespace internal { |
28 | 28 |
29 class AsyncHandleWaiter; | |
30 | |
31 // A helper class to handle bytestream directly over mojo::MessagePipe | 29 // A helper class to handle bytestream directly over mojo::MessagePipe |
32 // in template-method pattern. MessagePipeReader manages the lifetime | 30 // in template-method pattern. MessagePipeReader manages the lifetime |
33 // of given MessagePipe and participates the event loop, and | 31 // of given MessagePipe and participates the event loop, and |
34 // read the stream and call the client when it is ready. | 32 // read the stream and call the client when it is ready. |
35 // | 33 // |
36 // Each client has to: | 34 // Each client has to: |
37 // | 35 // |
38 // * Provide a subclass implemenation of a specific use of a MessagePipe | 36 // * Provide a subclass implemenation of a specific use of a MessagePipe |
39 // and implement callbacks. | 37 // and implement callbacks. |
40 // * Create the subclass instance with a MessagePipeHandle. | 38 // * Create the subclass instance with a MessagePipeHandle. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 mojo::AssociatedBinding<mojom::Channel> binding_; | 106 mojo::AssociatedBinding<mojom::Channel> binding_; |
109 base::ThreadChecker thread_checker_; | 107 base::ThreadChecker thread_checker_; |
110 | 108 |
111 DISALLOW_COPY_AND_ASSIGN(MessagePipeReader); | 109 DISALLOW_COPY_AND_ASSIGN(MessagePipeReader); |
112 }; | 110 }; |
113 | 111 |
114 } // namespace internal | 112 } // namespace internal |
115 } // namespace IPC | 113 } // namespace IPC |
116 | 114 |
117 #endif // IPC_IPC_MESSAGE_PIPE_READER_H_ | 115 #endif // IPC_IPC_MESSAGE_PIPE_READER_H_ |
OLD | NEW |