OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MOJO_PUBLIC_SYSTEM_CORE_PRIVATE_H_ | 5 #ifndef MOJO_PUBLIC_SYSTEM_CORE_PRIVATE_H_ |
6 #define MOJO_PUBLIC_SYSTEM_CORE_PRIVATE_H_ | 6 #define MOJO_PUBLIC_SYSTEM_CORE_PRIVATE_H_ |
7 | 7 |
8 #include "mojo/public/system/core.h" | 8 #include "mojo/public/system/core.h" |
9 | 9 |
10 namespace mojo { | 10 namespace mojo { |
11 | 11 |
12 // Implementors of the core APIs can use this interface to install their | 12 // Implementors of the core APIs can use this interface to install their |
13 // implementation into the mojo_system dynamic library. Mojo clients should not | 13 // implementation into the mojo_system dynamic library. Mojo clients should not |
14 // call these functions directly. | 14 // call these functions directly. |
15 class MOJO_SYSTEM_EXPORT Core { | 15 class MOJO_SYSTEM_EXPORT Core { |
16 public: | 16 public: |
17 virtual ~Core(); | 17 virtual ~Core(); |
18 | 18 |
19 static void Init(Core* core); | 19 static void Init(Core* core); |
| 20 static Core* Get(); |
| 21 static void Reset(); |
20 | 22 |
21 virtual MojoTimeTicks GetTimeTicksNow() = 0; | 23 virtual MojoTimeTicks GetTimeTicksNow() = 0; |
22 virtual MojoResult Close(MojoHandle handle) = 0; | 24 virtual MojoResult Close(MojoHandle handle) = 0; |
23 virtual MojoResult Wait(MojoHandle handle, | 25 virtual MojoResult Wait(MojoHandle handle, |
24 MojoWaitFlags flags, | 26 MojoWaitFlags flags, |
25 MojoDeadline deadline) = 0; | 27 MojoDeadline deadline) = 0; |
26 virtual MojoResult WaitMany(const MojoHandle* handles, | 28 virtual MojoResult WaitMany(const MojoHandle* handles, |
27 const MojoWaitFlags* flags, | 29 const MojoWaitFlags* flags, |
28 uint32_t num_handles, | 30 uint32_t num_handles, |
29 MojoDeadline deadline) = 0; | 31 MojoDeadline deadline) = 0; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const void** buffer, | 64 const void** buffer, |
63 uint32_t* buffer_num_elements, | 65 uint32_t* buffer_num_elements, |
64 MojoReadDataFlags flags) = 0; | 66 MojoReadDataFlags flags) = 0; |
65 virtual MojoResult EndReadData(MojoHandle data_pipe_consumer_handle, | 67 virtual MojoResult EndReadData(MojoHandle data_pipe_consumer_handle, |
66 uint32_t num_elements_read) = 0; | 68 uint32_t num_elements_read) = 0; |
67 }; | 69 }; |
68 | 70 |
69 } // namespace mojo | 71 } // namespace mojo |
70 | 72 |
71 #endif // MOJO_PUBLIC_SYSTEM_CORE_PRIVATE_H_ | 73 #endif // MOJO_PUBLIC_SYSTEM_CORE_PRIVATE_H_ |
OLD | NEW |