| 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 namespace mojo { | 14 namespace mojo { |
| 15 | 15 |
| 16 namespace system { | 16 namespace system { |
| 17 | 17 |
| 18 class ChannelManager; | 18 class ChannelManager; |
| 19 class Core; | 19 class Core; |
| 20 | 20 |
| 21 // Repeat a typedef in mojo/edk/system/channel_manager.h, to avoid including it. | 21 // Repeat a typedef in mojo/edk/system/channel_manager.h, to avoid including it. |
| 22 typedef uint64_t ChannelId; | 22 typedef uint64_t ChannelId; |
| 23 | 23 |
| 24 } // namespace system | 24 } // namespace system |
| 25 | 25 |
| 26 namespace embedder { | 26 namespace embedder { |
| 27 | 27 |
| 28 class PlatformSupport; |
| 29 |
| 28 // This is a type that's opaque to users of the embedder API (which only | 30 // This is a type that's opaque to users of the embedder API (which only |
| 29 // gives/takes |ChannelInfo*|s). We make it a struct to make it | 31 // gives/takes |ChannelInfo*|s). We make it a struct to make it |
| 30 // template-friendly. | 32 // template-friendly. |
| 31 struct ChannelInfo { | 33 struct ChannelInfo { |
| 32 explicit ChannelInfo(system::ChannelId channel_id = 0) | 34 explicit ChannelInfo(system::ChannelId channel_id = 0) |
| 33 : channel_id(channel_id) {} | 35 : channel_id(channel_id) {} |
| 34 | 36 |
| 35 system::ChannelId channel_id; | 37 system::ChannelId channel_id; |
| 36 }; | 38 }; |
| 37 | 39 |
| 38 namespace internal { | 40 namespace internal { |
| 39 | 41 |
| 42 // Instance of |PlatformSupport| to use. |
| 43 extern PlatformSupport* g_platform_support; |
| 44 |
| 40 // Instance of |Core| used by the system functions (|Mojo...()|). | 45 // Instance of |Core| used by the system functions (|Mojo...()|). |
| 41 extern system::Core* g_core; | 46 extern system::Core* g_core; |
| 42 | 47 |
| 43 // Instance of |ChannelManager| used by the channel management functions | 48 // Instance of |ChannelManager| used by the channel management functions |
| 44 // (|mojo::embedder::CreateChannel()|, etc.). | 49 // (|mojo::embedder::CreateChannel()|, etc.). |
| 45 extern system::ChannelManager* g_channel_manager; | 50 extern system::ChannelManager* g_channel_manager; |
| 46 | 51 |
| 47 } // namespace internal | 52 } // namespace internal |
| 48 | 53 |
| 49 } // namepace embedder | 54 } // namepace embedder |
| 50 | 55 |
| 51 } // namespace mojo | 56 } // namespace mojo |
| 52 | 57 |
| 53 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ | 58 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ |
| OLD | NEW |