OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
viettrungluu
2016/02/02 00:07:36
This file could use a file-level comment, especial
Forrest Reiling
2016/02/10 20:16:09
Done.
| |
5 #include "base/logging.h" | |
6 #include "mojo/edk/embedder/embedder.h" | |
7 #include "mojo/platform_handle/platform_handle_functions.h" | |
8 | |
viettrungluu
2016/02/02 00:07:36
Probably the contents of this file should be in th
Forrest Reiling
2016/02/10 20:16:09
As discussed, doing this is problematic because th
| |
9 MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle, | |
10 MojoHandle* wrapper) { | |
11 mojo::platform::PlatformHandle platform_handle_wrapper(platform_handle); | |
viettrungluu
2016/02/02 00:07:36
I'd also add:
using mojo::platform::PlatformHandl
Forrest Reiling
2016/02/10 20:16:09
Done.
| |
12 mojo::platform::ScopedPlatformHandle scoped_platform_handle( | |
13 platform_handle_wrapper); | |
14 return mojo::embedder::CreatePlatformHandleWrapper( | |
15 scoped_platform_handle.Pass(), wrapper); | |
16 } | |
17 | |
18 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper, | |
19 MojoPlatformHandle* platform_handle) { | |
20 mojo::platform::ScopedPlatformHandle scoped_platform_handle; | |
21 MojoResult result = mojo::embedder::PassWrappedPlatformHandle( | |
22 wrapper, &scoped_platform_handle); | |
23 if (result != MOJO_RESULT_OK) | |
24 return result; | |
25 | |
26 DCHECK(scoped_platform_handle.is_valid()); | |
27 *platform_handle = scoped_platform_handle.release().fd; | |
28 return MOJO_RESULT_OK; | |
29 } | |
OLD | NEW |