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 #ifndef MOJO_EDK_EMBEDDER_PLATFORM_SUPPORT_H_ | 5 #ifndef MOJO_EDK_EMBEDDER_PLATFORM_SUPPORT_H_ |
6 #define MOJO_EDK_EMBEDDER_PLATFORM_SUPPORT_H_ | 6 #define MOJO_EDK_EMBEDDER_PLATFORM_SUPPORT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "mojo/edk/embedder/scoped_platform_handle.h" | 10 #include "mojo/edk/platform/scoped_platform_handle.h" |
11 #include "mojo/edk/util/ref_ptr.h" | 11 #include "mojo/edk/util/ref_ptr.h" |
12 #include "mojo/public/c/system/types.h" | 12 #include "mojo/public/c/system/types.h" |
13 #include "mojo/public/cpp/system/macros.h" | 13 #include "mojo/public/cpp/system/macros.h" |
14 | 14 |
15 namespace mojo { | 15 namespace mojo { |
16 namespace embedder { | 16 namespace embedder { |
17 | 17 |
18 class PlatformSharedBuffer; | 18 class PlatformSharedBuffer; |
19 | 19 |
20 // This class is provided by the embedder to implement (typically | 20 // This class is provided by the embedder to implement (typically |
(...skipping 19 matching lines...) Expand all Loading... |
40 // if there were only a single |PlatformSupport|). | 40 // if there were only a single |PlatformSupport|). |
41 virtual MojoTimeTicks GetTimeTicksNow() = 0; | 41 virtual MojoTimeTicks GetTimeTicksNow() = 0; |
42 | 42 |
43 // Gets cryptographically-secure (pseudo)random bytes. | 43 // Gets cryptographically-secure (pseudo)random bytes. |
44 virtual void GetCryptoRandomBytes(void* bytes, size_t num_bytes) = 0; | 44 virtual void GetCryptoRandomBytes(void* bytes, size_t num_bytes) = 0; |
45 | 45 |
46 virtual util::RefPtr<PlatformSharedBuffer> CreateSharedBuffer( | 46 virtual util::RefPtr<PlatformSharedBuffer> CreateSharedBuffer( |
47 size_t num_bytes) = 0; | 47 size_t num_bytes) = 0; |
48 virtual util::RefPtr<PlatformSharedBuffer> CreateSharedBufferFromHandle( | 48 virtual util::RefPtr<PlatformSharedBuffer> CreateSharedBufferFromHandle( |
49 size_t num_bytes, | 49 size_t num_bytes, |
50 ScopedPlatformHandle platform_handle) = 0; | 50 platform::ScopedPlatformHandle platform_handle) = 0; |
51 | 51 |
52 protected: | 52 protected: |
53 PlatformSupport() {} | 53 PlatformSupport() {} |
54 | 54 |
55 private: | 55 private: |
56 MOJO_DISALLOW_COPY_AND_ASSIGN(PlatformSupport); | 56 MOJO_DISALLOW_COPY_AND_ASSIGN(PlatformSupport); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace embedder | 59 } // namespace embedder |
60 } // namespace mojo | 60 } // namespace mojo |
61 | 61 |
62 #endif // MOJO_EDK_EMBEDDER_PLATFORM_SUPPORT_H_ | 62 #endif // MOJO_EDK_EMBEDDER_PLATFORM_SUPPORT_H_ |
OLD | NEW |