OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 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 |
| 7 // the embedder API). |
| 8 |
| 9 #ifndef MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ |
| 10 #define MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ |
| 11 |
| 12 #include <stdint.h> |
| 13 |
| 14 namespace mojo { |
| 15 |
| 16 namespace system { |
| 17 |
| 18 class ChannelManager; |
| 19 class Core; |
| 20 |
| 21 // Repeat a typedef in mojo/edk/system/channel_manager.h, to avoid including it. |
| 22 typedef uintptr_t ChannelId; |
| 23 |
| 24 } // namespace system |
| 25 |
| 26 namespace embedder { |
| 27 |
| 28 // 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 |
| 30 // template-friendly. |
| 31 struct ChannelInfo { |
| 32 explicit ChannelInfo(system::ChannelId channel_id = 0) |
| 33 : channel_id(channel_id) {} |
| 34 |
| 35 system::ChannelId channel_id; |
| 36 }; |
| 37 |
| 38 namespace internal { |
| 39 |
| 40 // Instance of |Core| used by the system functions (|Mojo...()|). |
| 41 extern system::Core* g_core; |
| 42 |
| 43 // Instance of |ChannelManager| used by the channel management functions |
| 44 // (|mojo::embedder::CreateChannel()|, etc.). |
| 45 extern system::ChannelManager* g_channel_manager; |
| 46 |
| 47 } // namespace internal |
| 48 |
| 49 } // namepace embedder |
| 50 |
| 51 } // namespace mojo |
| 52 |
| 53 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_INTERNAL_H_ |
OLD | NEW |