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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // to send IPC::Messages as an IPC::Sender. | 43 // to send IPC::Messages as an IPC::Sender. |
44 // | 44 // |
45 // TODO(morrita): Extract handle creation part of IPC::Channel into | 45 // TODO(morrita): Extract handle creation part of IPC::Channel into |
46 // separate class to clarify what ChannelMojo relies | 46 // separate class to clarify what ChannelMojo relies |
47 // on. | 47 // on. |
48 // TODO(morrita): Add APIs to create extra MessagePipes to let | 48 // TODO(morrita): Add APIs to create extra MessagePipes to let |
49 // Mojo-based objects talk over this Channel. | 49 // Mojo-based objects talk over this Channel. |
50 // | 50 // |
51 class IPC_MOJO_EXPORT ChannelMojo : public Channel { | 51 class IPC_MOJO_EXPORT ChannelMojo : public Channel { |
52 public: | 52 public: |
53 // Create ChannelMojo on top of given |bootstrap| channel. | |
54 static scoped_ptr<ChannelMojo> Create( | |
55 scoped_ptr<Channel> bootstrap, Mode mode, Listener* listener, | |
56 scoped_refptr<base::TaskRunner> io_thread_task_runner); | |
57 | |
58 // Create ChannelMojo. A bootstrap channel is created as well. | 53 // Create ChannelMojo. A bootstrap channel is created as well. |
59 static scoped_ptr<ChannelMojo> Create( | 54 static scoped_ptr<ChannelMojo> Create( |
60 const ChannelHandle &channel_handle, Mode mode, Listener* listener, | 55 const ChannelHandle &channel_handle, Mode mode, Listener* listener, |
61 scoped_refptr<base::TaskRunner> io_thread_task_runner); | 56 scoped_refptr<base::TaskRunner> io_thread_task_runner); |
62 | 57 |
63 // Create a factory object for ChannelMojo. | 58 // Create a factory object for ChannelMojo. |
64 // The factory is used to create Mojo-based ChannelProxy family. | 59 // The factory is used to create Mojo-based ChannelProxy family. |
65 static scoped_ptr<ChannelFactory> CreateFactory( | 60 static scoped_ptr<ChannelFactory> CreateFactory( |
66 const ChannelHandle &channel_handle, Mode mode, | 61 const ChannelHandle &channel_handle, Mode mode, |
67 scoped_refptr<base::TaskRunner> io_thread_task_runner); | 62 scoped_refptr<base::TaskRunner> io_thread_task_runner); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 ScopedVector<Message> pending_messages_; | 115 ScopedVector<Message> pending_messages_; |
121 | 116 |
122 base::WeakPtrFactory<ChannelMojo> weak_factory_; | 117 base::WeakPtrFactory<ChannelMojo> weak_factory_; |
123 | 118 |
124 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); | 119 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); |
125 }; | 120 }; |
126 | 121 |
127 } // namespace IPC | 122 } // namespace IPC |
128 | 123 |
129 #endif // IPC_IPC_CHANNEL_MOJO_H_ | 124 #endif // IPC_IPC_CHANNEL_MOJO_H_ |
OLD | NEW |