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_SIMPLE_PLATFORM_SUPPORT_H_ | 5 #ifndef MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SUPPORT_H_ |
6 #define MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SUPPORT_H_ | 6 #define MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SUPPORT_H_ |
7 | 7 |
8 #include "mojo/edk/embedder/platform_support.h" | 8 #include "mojo/edk/embedder/platform_support.h" |
9 #include "mojo/edk/system/system_impl_export.h" | 9 #include "mojo/edk/system/system_impl_export.h" |
10 #include "mojo/public/cpp/system/macros.h" | 10 #include "third_party/mojo/src/mojo/public/cpp/system/macros.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 namespace edk { | 13 namespace edk { |
14 | 14 |
15 // A simple implementation of |PlatformSupport|, when sandboxing and | 15 // A simple implementation of |PlatformSupport|, when sandboxing and |
16 // multiprocess support are not issues (e.g., in most tests). Note: This class | 16 // multiprocess support are not issues (e.g., in most tests). Note: This class |
17 // has no state, and different instances of |SimplePlatformSupport| are mutually | 17 // has no state, and different instances of |SimplePlatformSupport| are mutually |
18 // compatible (i.e., you don't need to use a single instance of it everywhere -- | 18 // compatible (i.e., you don't need to use a single instance of it everywhere -- |
19 // you may simply create one whenever/wherever you need it). | 19 // you may simply create one whenever/wherever you need it). |
20 class MOJO_SYSTEM_IMPL_EXPORT SimplePlatformSupport final | 20 class MOJO_SYSTEM_IMPL_EXPORT SimplePlatformSupport final |
21 : public PlatformSupport { | 21 : public PlatformSupport { |
22 public: | 22 public: |
23 SimplePlatformSupport() {} | 23 SimplePlatformSupport() {} |
24 ~SimplePlatformSupport() override {} | 24 ~SimplePlatformSupport() override {} |
25 | 25 |
26 void GetCryptoRandomBytes(void* bytes, size_t num_bytes) override; | 26 void GetCryptoRandomBytes(void* bytes, size_t num_bytes) override; |
27 PlatformSharedBuffer* CreateSharedBuffer(size_t num_bytes) override; | 27 PlatformSharedBuffer* CreateSharedBuffer(size_t num_bytes) override; |
28 PlatformSharedBuffer* CreateSharedBufferFromHandle( | 28 PlatformSharedBuffer* CreateSharedBufferFromHandle( |
29 size_t num_bytes, | 29 size_t num_bytes, |
30 ScopedPlatformHandle platform_handle) override; | 30 ScopedPlatformHandle platform_handle) override; |
31 | 31 |
32 private: | 32 private: |
33 MOJO_DISALLOW_COPY_AND_ASSIGN(SimplePlatformSupport); | 33 MOJO_DISALLOW_COPY_AND_ASSIGN(SimplePlatformSupport); |
34 }; | 34 }; |
35 | 35 |
36 } // namespace edk | 36 } // namespace edk |
37 } // namespace mojo | 37 } // namespace mojo |
38 | 38 |
39 #endif // MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SUPPORT_H_ | 39 #endif // MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SUPPORT_H_ |
OLD | NEW |