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

Side by Side Diff: shell/platform_handle_impl.cc

Issue 1578423002: Added PlatformHandle thunks. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Renamed platform_handle_apptests to platform_handle_private_apptests Created 4 years, 9 months 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
OLDNEW
(Empty)
1 // Copyright 2016 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
5 // This file contains implementations for the platform handle thunks
6 // (see //mojo/public/platform/native/platform_handle_private.h)
7
8 #include "base/logging.h"
9 #include "mojo/edk/embedder/embedder.h"
10 #include "mojo/public/platform/native/platform_handle_private.h"
11
12 using mojo::platform::PlatformHandle;
13 using mojo::platform::ScopedPlatformHandle;
14
15 MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle,
16 MojoHandle* wrapper) {
17 PlatformHandle platform_handle_wrapper(platform_handle);
18 ScopedPlatformHandle scoped_platform_handle(platform_handle_wrapper);
19 return mojo::embedder::CreatePlatformHandleWrapper(
20 scoped_platform_handle.Pass(), wrapper);
21 }
22
23 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper,
24 MojoPlatformHandle* platform_handle) {
25 ScopedPlatformHandle scoped_platform_handle;
26 MojoResult result = mojo::embedder::PassWrappedPlatformHandle(
27 wrapper, &scoped_platform_handle);
28 if (result != MOJO_RESULT_OK)
29 return result;
30
31 DCHECK(scoped_platform_handle.is_valid());
32 *platform_handle = scoped_platform_handle.release().fd;
33 return MOJO_RESULT_OK;
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698