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 // This header contains internal details for the *implementation* of the | 5 // This header contains internal details for the *implementation* of the |
6 // embedder API. It should not be included by any public header (nor by users of | 6 // embedder API. It should not be included by any public header (nor by users of |
7 // the embedder API). | 7 // the embedder API). |
8 | 8 |
9 #ifndef MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ | 9 #ifndef MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ |
10 #define MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ | 10 #define MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ |
11 | 11 |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
| 14 #include "mojo/edk/embedder/process_type.h" |
| 15 |
| 16 namespace base { |
| 17 class TaskRunner; |
| 18 } |
| 19 |
14 namespace mojo { | 20 namespace mojo { |
15 | 21 |
16 namespace system { | 22 namespace system { |
17 | 23 |
18 class ChannelManager; | 24 class ChannelManager; |
19 class Core; | 25 class Core; |
20 | 26 |
21 // Repeat a typedef in mojo/edk/system/channel_manager.h, to avoid including it. | 27 // Repeat a typedef in mojo/edk/system/channel_manager.h, to avoid including it. |
22 typedef uint64_t ChannelId; | 28 typedef uint64_t ChannelId; |
23 | 29 |
24 } // namespace system | 30 } // namespace system |
25 | 31 |
26 namespace embedder { | 32 namespace embedder { |
27 | 33 |
28 class PlatformSupport; | 34 class PlatformSupport; |
29 // TODO(vtl): Remove these (see below). | 35 class ProcessDelegate; |
30 class MasterProcessDelegate; | |
31 class SlaveProcessDelegate; | |
32 | 36 |
33 // This is a type that's opaque to users of the embedder API (which only | 37 // This is a type that's opaque to users of the embedder API (which only |
34 // gives/takes |ChannelInfo*|s). We make it a struct to make it | 38 // gives/takes |ChannelInfo*|s). We make it a struct to make it |
35 // template-friendly. | 39 // template-friendly. |
36 struct ChannelInfo { | 40 struct ChannelInfo { |
37 explicit ChannelInfo(system::ChannelId channel_id = 0) | 41 explicit ChannelInfo(system::ChannelId channel_id = 0) |
38 : channel_id(channel_id) {} | 42 : channel_id(channel_id) {} |
39 | 43 |
40 system::ChannelId channel_id; | 44 system::ChannelId channel_id; |
41 }; | 45 }; |
42 | 46 |
43 namespace internal { | 47 namespace internal { |
44 | 48 |
45 // Instance of |PlatformSupport| to use. | 49 // Instance of |PlatformSupport| to use. |
46 extern PlatformSupport* g_platform_support; | 50 extern PlatformSupport* g_platform_support; |
47 | 51 |
48 // Instance of |Core| used by the system functions (|Mojo...()|). | 52 // Instance of |Core| used by the system functions (|Mojo...()|). |
49 extern system::Core* g_core; | 53 extern system::Core* g_core; |
50 | 54 |
51 // Instance of |ChannelManager| used by the channel management functions | 55 // Type of process initialized in |InitIPCSupport()| (set to |UNINITIALIZED| if |
52 // (|mojo::embedder::CreateChannel()|, etc.). | 56 // "outside" |InitIPCSupport()|/|ShutdownIPCSupport()|). This is declared here |
53 extern system::ChannelManager* g_channel_manager; | 57 // so that |mojo::embedder::test::Shutdown()| can check that it's only called |
54 | 58 // after |ShutdownIPCSupport()|. |
55 // TODO(vtl): Remove these: We'll eventually really want to hold on to a | 59 extern ProcessType g_process_type; |
56 // |MasterConnectionManager*| or a |SlaveConnectionManager*|. For now, keep | |
57 // these around as globals to avoid triggering leak detectors. | |
58 extern MasterProcessDelegate* g_master_process_delegate; | |
59 extern SlaveProcessDelegate* g_slave_process_delegate; | |
60 | 60 |
61 } // namespace internal | 61 } // namespace internal |
62 | 62 |
63 } // namepace embedder | 63 } // namepace embedder |
64 | 64 |
65 } // namespace mojo | 65 } // namespace mojo |
66 | 66 |
67 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ | 67 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ |
OLD | NEW |