Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: mojo/edk/embedder/simple_platform_support.cc

Issue 1483823004: EDK: Move {platform_handle,scoped_platform_handle}.* to //mojo/edk/platform. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/edk/embedder/simple_platform_support.h ('k') | mojo/edk/platform/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/time/time.h" 10 #include "base/time/time.h"
9 #include "mojo/edk/embedder/simple_platform_shared_buffer.h" 11 #include "mojo/edk/embedder/simple_platform_shared_buffer.h"
10 12
13 using mojo::platform::ScopedPlatformHandle;
11 using mojo::util::RefPtr; 14 using mojo::util::RefPtr;
12 15
13 namespace mojo { 16 namespace mojo {
14 namespace embedder { 17 namespace embedder {
15 18
16 MojoTimeTicks SimplePlatformSupport::GetTimeTicksNow() { 19 MojoTimeTicks SimplePlatformSupport::GetTimeTicksNow() {
17 return base::TimeTicks::Now().ToInternalValue(); 20 return base::TimeTicks::Now().ToInternalValue();
18 } 21 }
19 22
20 void SimplePlatformSupport::GetCryptoRandomBytes(void* bytes, 23 void SimplePlatformSupport::GetCryptoRandomBytes(void* bytes,
21 size_t num_bytes) { 24 size_t num_bytes) {
22 base::RandBytes(bytes, num_bytes); 25 base::RandBytes(bytes, num_bytes);
23 } 26 }
24 27
25 RefPtr<PlatformSharedBuffer> SimplePlatformSupport::CreateSharedBuffer( 28 RefPtr<PlatformSharedBuffer> SimplePlatformSupport::CreateSharedBuffer(
26 size_t num_bytes) { 29 size_t num_bytes) {
27 return SimplePlatformSharedBuffer::Create(num_bytes); 30 return SimplePlatformSharedBuffer::Create(num_bytes);
28 } 31 }
29 32
30 RefPtr<PlatformSharedBuffer> 33 RefPtr<PlatformSharedBuffer>
31 SimplePlatformSupport::CreateSharedBufferFromHandle( 34 SimplePlatformSupport::CreateSharedBufferFromHandle(
32 size_t num_bytes, 35 size_t num_bytes,
33 ScopedPlatformHandle platform_handle) { 36 ScopedPlatformHandle platform_handle) {
34 return SimplePlatformSharedBuffer::CreateFromPlatformHandle( 37 return SimplePlatformSharedBuffer::CreateFromPlatformHandle(
35 num_bytes, platform_handle.Pass()); 38 num_bytes, std::move(platform_handle));
36 } 39 }
37 40
38 } // namespace embedder 41 } // namespace embedder
39 } // namespace mojo 42 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/embedder/simple_platform_support.h ('k') | mojo/edk/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698