| 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 #include "mojo/edk/embedder/simple_platform_support.h" | 5 #include "mojo/edk/embedder/simple_platform_support.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include <utility> | 9 #include <utility> |
| 8 | 10 |
| 9 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
| 10 #include "mojo/edk/embedder/simple_platform_shared_buffer.h" | 12 #include "mojo/edk/embedder/simple_platform_shared_buffer.h" |
| 11 | 13 |
| 12 namespace mojo { | 14 namespace mojo { |
| 13 namespace edk { | 15 namespace edk { |
| 14 | 16 |
| 15 void SimplePlatformSupport::GetCryptoRandomBytes(void* bytes, | 17 void SimplePlatformSupport::GetCryptoRandomBytes(void* bytes, |
| 16 size_t num_bytes) { | 18 size_t num_bytes) { |
| 17 base::RandBytes(bytes, num_bytes); | 19 base::RandBytes(bytes, num_bytes); |
| 18 } | 20 } |
| 19 | 21 |
| 20 PlatformSharedBuffer* SimplePlatformSupport::CreateSharedBuffer( | 22 PlatformSharedBuffer* SimplePlatformSupport::CreateSharedBuffer( |
| 21 size_t num_bytes) { | 23 size_t num_bytes) { |
| 22 return SimplePlatformSharedBuffer::Create(num_bytes); | 24 return SimplePlatformSharedBuffer::Create(num_bytes); |
| 23 } | 25 } |
| 24 | 26 |
| 25 PlatformSharedBuffer* SimplePlatformSupport::CreateSharedBufferFromHandle( | 27 PlatformSharedBuffer* SimplePlatformSupport::CreateSharedBufferFromHandle( |
| 26 size_t num_bytes, | 28 size_t num_bytes, |
| 27 ScopedPlatformHandle platform_handle) { | 29 ScopedPlatformHandle platform_handle) { |
| 28 return SimplePlatformSharedBuffer::CreateFromPlatformHandle( | 30 return SimplePlatformSharedBuffer::CreateFromPlatformHandle( |
| 29 num_bytes, std::move(platform_handle)); | 31 num_bytes, std::move(platform_handle)); |
| 30 } | 32 } |
| 31 | 33 |
| 32 } // namespace edk | 34 } // namespace edk |
| 33 } // namespace mojo | 35 } // namespace mojo |
| OLD | NEW |