Chromium Code Reviews| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 public MojoBootstrap::Delegate { | 60 public MojoBootstrap::Delegate { |
| 61 public: | 61 public: |
| 62 class Delegate { | 62 class Delegate { |
| 63 public: | 63 public: |
| 64 virtual ~Delegate() {} | 64 virtual ~Delegate() {} |
| 65 virtual base::WeakPtr<Delegate> ToWeakPtr() = 0; | 65 virtual base::WeakPtr<Delegate> ToWeakPtr() = 0; |
| 66 virtual scoped_refptr<base::TaskRunner> GetIOTaskRunner() = 0; | 66 virtual scoped_refptr<base::TaskRunner> GetIOTaskRunner() = 0; |
| 67 virtual void OnChannelCreated(base::WeakPtr<ChannelMojo> channel) = 0; | 67 virtual void OnChannelCreated(base::WeakPtr<ChannelMojo> channel) = 0; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 // True if ChannelMojo is ready to use for th e underlying platform. | |
|
viettrungluu
2014/10/20 21:50:11
"ready to use" -> "can be used"
"th e" -> "the"
Hajime Morrita
2014/10/20 23:06:50
Done.
| |
| 71 static bool CanBeUsed(); | |
| 72 | |
| 70 // Create ChannelMojo. A bootstrap channel is created as well. | 73 // Create ChannelMojo. A bootstrap channel is created as well. |
| 71 // |host| must not be null for server channels. | 74 // |host| must not be null for server channels. |
| 72 static scoped_ptr<ChannelMojo> Create(Delegate* delegate, | 75 static scoped_ptr<ChannelMojo> Create(Delegate* delegate, |
| 73 const ChannelHandle& channel_handle, | 76 const ChannelHandle& channel_handle, |
| 74 Mode mode, | 77 Mode mode, |
| 75 Listener* listener); | 78 Listener* listener); |
| 76 | 79 |
| 77 // Create a factory object for ChannelMojo. | 80 // Create a factory object for ChannelMojo. |
| 78 // The factory is used to create Mojo-based ChannelProxy family. | 81 // The factory is used to create Mojo-based ChannelProxy family. |
| 79 // |host| must not be null. | 82 // |host| must not be null. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 ScopedVector<Message> pending_messages_; | 157 ScopedVector<Message> pending_messages_; |
| 155 | 158 |
| 156 base::WeakPtrFactory<ChannelMojo> weak_factory_; | 159 base::WeakPtrFactory<ChannelMojo> weak_factory_; |
| 157 | 160 |
| 158 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); | 161 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); |
| 159 }; | 162 }; |
| 160 | 163 |
| 161 } // namespace IPC | 164 } // namespace IPC |
| 162 | 165 |
| 163 #endif // IPC_IPC_CHANNEL_MOJO_H_ | 166 #endif // IPC_IPC_CHANNEL_MOJO_H_ |
| OLD | NEW |