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_MOJO_IPC_MOJO_BOOTSTRAP_H_ | 5 #ifndef IPC_IPC_MOJO_BOOTSTRAP_H_ |
6 #define IPC_MOJO_IPC_MOJO_BOOTSTRAP_H_ | 6 #define IPC_IPC_MOJO_BOOTSTRAP_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/process/process_handle.h" | 13 #include "base/process/process_handle.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "ipc/ipc.mojom.h" |
15 #include "ipc/ipc_channel.h" | 16 #include "ipc/ipc_channel.h" |
16 #include "ipc/ipc_listener.h" | 17 #include "ipc/ipc_listener.h" |
17 #include "ipc/mojo/ipc.mojom.h" | |
18 #include "mojo/public/cpp/system/message_pipe.h" | 18 #include "mojo/public/cpp/system/message_pipe.h" |
19 | 19 |
20 namespace IPC { | 20 namespace IPC { |
21 | 21 |
22 // MojoBootstrap establishes a pair of associated interfaces between two | 22 // MojoBootstrap establishes a pair of associated interfaces between two |
23 // processes in Chrome. | 23 // processes in Chrome. |
24 // | 24 // |
25 // Clients should implement MojoBootstrap::Delegate to get the associated pipes | 25 // Clients should implement MojoBootstrap::Delegate to get the associated pipes |
26 // from MojoBootstrap object. | 26 // from MojoBootstrap object. |
27 // | 27 // |
28 // This lives on IO thread other than Create(), which can be called from | 28 // This lives on IO thread other than Create(), which can be called from |
29 // UI thread as Channel::Create() can be. | 29 // UI thread as Channel::Create() can be. |
30 class IPC_MOJO_EXPORT MojoBootstrap { | 30 class IPC_EXPORT MojoBootstrap { |
31 public: | 31 public: |
32 class Delegate { | 32 class Delegate { |
33 public: | 33 public: |
34 virtual void OnPipesAvailable( | 34 virtual void OnPipesAvailable( |
35 mojom::ChannelAssociatedPtrInfo send_channel, | 35 mojom::ChannelAssociatedPtrInfo send_channel, |
36 mojom::ChannelAssociatedRequest receive_channel, | 36 mojom::ChannelAssociatedRequest receive_channel, |
37 int32_t peer_pid) = 0; | 37 int32_t peer_pid) = 0; |
38 virtual void OnBootstrapError() = 0; | 38 virtual void OnBootstrapError() = 0; |
39 }; | 39 }; |
40 | 40 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 mojo::ScopedMessagePipeHandle handle_; | 75 mojo::ScopedMessagePipeHandle handle_; |
76 Delegate* delegate_; | 76 Delegate* delegate_; |
77 State state_; | 77 State state_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(MojoBootstrap); | 79 DISALLOW_COPY_AND_ASSIGN(MojoBootstrap); |
80 }; | 80 }; |
81 | 81 |
82 } // namespace IPC | 82 } // namespace IPC |
83 | 83 |
84 #endif // IPC_MOJO_IPC_MOJO_BOOTSTRAP_H_ | 84 #endif // IPC_IPC_MOJO_BOOTSTRAP_H_ |
OLD | NEW |