| 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/system/channel_id.h" | |
| 15 | |
| 16 namespace base { | 14 namespace base { |
| 17 class TaskRunner; | 15 class TaskRunner; |
| 18 } | 16 } |
| 19 | 17 |
| 20 namespace mojo { | 18 namespace mojo { |
| 21 | 19 |
| 22 namespace system { | 20 namespace edk { |
| 23 | 21 |
| 24 class ChannelManager; | |
| 25 class Core; | 22 class Core; |
| 26 class IPCSupport; | |
| 27 | |
| 28 } // namespace system | |
| 29 | |
| 30 namespace embedder { | |
| 31 | |
| 32 class PlatformSupport; | 23 class PlatformSupport; |
| 33 class ProcessDelegate; | 24 class ProcessDelegate; |
| 34 | 25 |
| 35 // This is a type that's opaque to users of the embedder API (which only | |
| 36 // gives/takes |ChannelInfo*|s). We make it a struct to make it | |
| 37 // template-friendly. | |
| 38 struct ChannelInfo { | |
| 39 explicit ChannelInfo(system::ChannelId channel_id = 0) | |
| 40 : channel_id(channel_id) {} | |
| 41 | |
| 42 system::ChannelId channel_id; | |
| 43 }; | |
| 44 | |
| 45 namespace internal { | 26 namespace internal { |
| 46 | 27 |
| 47 // Instance of |PlatformSupport| to use. | 28 // Instance of |PlatformSupport| to use. |
| 48 extern PlatformSupport* g_platform_support; | 29 extern PlatformSupport* g_platform_support; |
| 49 | 30 |
| 50 // Instance of |Core| used by the system functions (|Mojo...()|). | 31 // Instance of |Core| used by the system functions (|Mojo...()|). |
| 51 extern system::Core* g_core; | 32 extern Core* g_core; |
| 33 extern base::TaskRunner* g_delegate_thread_task_runner; |
| 34 extern ProcessDelegate* g_process_delegate; |
| 35 extern base::TaskRunner* g_io_thread_task_runner; |
| 52 | 36 |
| 53 // Instance of |IPCSupport|, initialized by |InitIPCSupport()| and reset by | 37 // Called on the IO thread. |
| 54 // |ShutdownIPCSupport()|. This is declared here so that | 38 void ChannelStarted(); |
| 55 // |mojo::embedder::test::Shutdown()| can check that it's only called after | 39 void ChannelShutdown(); |
| 56 // |ShutdownIPCSupport()|. | |
| 57 extern system::IPCSupport* g_ipc_support; | |
| 58 | |
| 59 } // namespace internal | 40 } // namespace internal |
| 60 | 41 |
| 61 } // namepace embedder | 42 } // namepace edk |
| 62 | 43 |
| 63 } // namespace mojo | 44 } // namespace mojo |
| 64 | 45 |
| 65 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ | 46 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ |
| OLD | NEW |