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