OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_COMMON_MOJO_CHANNEL_INIT_H_ | |
6 #define CONTENT_COMMON_MOJO_CHANNEL_INIT_H_ | |
7 | |
8 #include "base/files/file.h" | |
9 #include "base/macros.h" | |
10 #include "base/memory/ref_counted.h" | |
11 #include "content/common/content_export.h" | |
12 #include "mojo/public/cpp/system/message_pipe.h" | |
13 | |
14 namespace base { | |
15 class TaskRunner; | |
16 } | |
17 | |
18 namespace content { | |
19 | |
20 // ChannelInit handles creation and destruction of the Mojo channel. It is not | |
21 // thread-safe, but may be used on any single thread with a MessageLoop. | |
22 // | |
23 // TODO(rockot): Get rid of this class ASAP (i.e. once the patch which includes | |
24 // this TODO has stuck for a bit) since it's no longer necessary. | |
25 class CONTENT_EXPORT ChannelInit { | |
26 public: | |
27 ChannelInit(); | |
28 ~ChannelInit(); | |
29 | |
30 // Initializes the channel. This takes ownership of |file|. | |
31 mojo::ScopedMessagePipeHandle Init( | |
32 base::PlatformFile file, | |
33 scoped_refptr<base::TaskRunner> io_thread_task_runner); | |
34 | |
35 private: | |
36 DISALLOW_COPY_AND_ASSIGN(ChannelInit); | |
37 }; | |
38 | |
39 } // namespace content | |
40 | |
41 #endif // CONTENT_COMMON_MOJO_CHANNEL_INIT_H_ | |
OLD | NEW |