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_CHANNEL_MOJO_H_ | 5 #ifndef IPC_IPC_CHANNEL_MOJO_H_ |
6 #define IPC_IPC_CHANNEL_MOJO_H_ | 6 #define IPC_IPC_CHANNEL_MOJO_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 20 matching lines...) Expand all Loading... |
31 // channel. | 31 // channel. |
32 // | 32 // |
33 // TODO(morrita): Add APIs to create extra MessagePipes to let | 33 // TODO(morrita): Add APIs to create extra MessagePipes to let |
34 // Mojo-based objects talk over this Channel. | 34 // Mojo-based objects talk over this Channel. |
35 // | 35 // |
36 class IPC_MOJO_EXPORT ChannelMojo | 36 class IPC_MOJO_EXPORT ChannelMojo |
37 : public Channel, | 37 : public Channel, |
38 public MojoBootstrap::Delegate, | 38 public MojoBootstrap::Delegate, |
39 public NON_EXPORTED_BASE(internal::MessagePipeReader::Delegate) { | 39 public NON_EXPORTED_BASE(internal::MessagePipeReader::Delegate) { |
40 public: | 40 public: |
41 // True if ChannelMojo should be used regardless of the flag. | |
42 static bool ShouldBeUsed(); | |
43 | |
44 // Creates a ChannelMojo. | 41 // Creates a ChannelMojo. |
45 static scoped_ptr<ChannelMojo> Create(mojo::ScopedMessagePipeHandle handle, | 42 static scoped_ptr<ChannelMojo> Create(mojo::ScopedMessagePipeHandle handle, |
46 Mode mode, | 43 Mode mode, |
47 Listener* listener); | 44 Listener* listener); |
48 | 45 |
49 // Create a factory object for ChannelMojo. | 46 // Create a factory object for ChannelMojo. |
50 // The factory is used to create Mojo-based ChannelProxy family. | 47 // The factory is used to create Mojo-based ChannelProxy family. |
51 // |host| must not be null. | 48 // |host| must not be null. |
52 static scoped_ptr<ChannelFactory> CreateServerFactory( | 49 static scoped_ptr<ChannelFactory> CreateServerFactory( |
53 mojo::ScopedMessagePipeHandle handle); | 50 mojo::ScopedMessagePipeHandle handle); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 bool waiting_connect_; | 108 bool waiting_connect_; |
112 | 109 |
113 base::WeakPtrFactory<ChannelMojo> weak_factory_; | 110 base::WeakPtrFactory<ChannelMojo> weak_factory_; |
114 | 111 |
115 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); | 112 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); |
116 }; | 113 }; |
117 | 114 |
118 } // namespace IPC | 115 } // namespace IPC |
119 | 116 |
120 #endif // IPC_IPC_CHANNEL_MOJO_H_ | 117 #endif // IPC_IPC_CHANNEL_MOJO_H_ |
OLD | NEW |