OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
6 #define MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 6 #define MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "mojo/edk/system/dispatcher.h" | 9 #include "mojo/edk/system/dispatcher.h" |
10 #include "mojo/edk/system/memory.h" | 10 #include "mojo/edk/system/memory.h" |
11 #include "mojo/edk/system/system_impl_export.h" | |
12 #include "mojo/public/cpp/system/macros.h" | 11 #include "mojo/public/cpp/system/macros.h" |
13 | 12 |
14 namespace mojo { | 13 namespace mojo { |
15 namespace system { | 14 namespace system { |
16 | 15 |
17 class ChannelEndpoint; | 16 class ChannelEndpoint; |
18 class MessagePipe; | 17 class MessagePipe; |
19 class MessagePipeDispatcherTransport; | 18 class MessagePipeDispatcherTransport; |
20 | 19 |
21 // This is the |Dispatcher| implementation for message pipes (created by the | 20 // This is the |Dispatcher| implementation for message pipes (created by the |
22 // Mojo primitive |MojoCreateMessagePipe()|). This class is thread-safe. | 21 // Mojo primitive |MojoCreateMessagePipe()|). This class is thread-safe. |
23 class MOJO_SYSTEM_IMPL_EXPORT MessagePipeDispatcher final : public Dispatcher { | 22 class MessagePipeDispatcher final : public Dispatcher { |
24 public: | 23 public: |
25 // The default options to use for |MojoCreateMessagePipe()|. (Real uses | 24 // The default options to use for |MojoCreateMessagePipe()|. (Real uses |
26 // should obtain this via |ValidateCreateOptions()| with a null |in_options|; | 25 // should obtain this via |ValidateCreateOptions()| with a null |in_options|; |
27 // this is exposed directly for testing convenience.) | 26 // this is exposed directly for testing convenience.) |
28 static const MojoCreateMessagePipeOptions kDefaultCreateOptions; | 27 static const MojoCreateMessagePipeOptions kDefaultCreateOptions; |
29 | 28 |
30 static scoped_refptr<MessagePipeDispatcher> Create( | 29 static scoped_refptr<MessagePipeDispatcher> Create( |
31 const MojoCreateMessagePipeOptions& /*validated_options*/) { | 30 const MojoCreateMessagePipeOptions& /*validated_options*/) { |
32 return make_scoped_refptr(new MessagePipeDispatcher()); | 31 return make_scoped_refptr(new MessagePipeDispatcher()); |
33 } | 32 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 return static_cast<MessagePipeDispatcher*>(dispatcher()); | 129 return static_cast<MessagePipeDispatcher*>(dispatcher()); |
131 } | 130 } |
132 | 131 |
133 // Copy and assign allowed. | 132 // Copy and assign allowed. |
134 }; | 133 }; |
135 | 134 |
136 } // namespace system | 135 } // namespace system |
137 } // namespace mojo | 136 } // namespace mojo |
138 | 137 |
139 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 138 #endif // MOJO_EDK_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
OLD | NEW |