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

Side by Side Diff: mojo/runner/platform_handle_impl.cc

Issue 1113393002: Adds thunks for getting platform handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 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
5 #include "mojo/platform_handle/platform_handle.h"
6 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
7
8 extern "C" {
9
10 bool MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle,
11 MojoHandle* wrapper) {
12 mojo::embedder::PlatformHandle platform_handle_wrapper(platform_handle);
13 mojo::embedder::ScopedPlatformHandle scoped_platform_handle(
14 platform_handle_wrapper);
15 return mojo::embedder::CreatePlatformHandleWrapper(
16 scoped_platform_handle.Pass(), wrapper) == MOJO_RESULT_OK;
17 }
18
19 bool MojoExtractPlatformHandle(MojoHandle wrapper,
20 MojoPlatformHandle* platform_handle) {
21 mojo::embedder::ScopedPlatformHandle scoped_platform_handle;
22 if (mojo::embedder::PassWrappedPlatformHandle(
23 wrapper, &scoped_platform_handle) != MOJO_RESULT_OK)
24 return false;
25
26 DCHECK(scoped_platform_handle.is_valid());
27 #if defined(OS_POSIX)
28 *platform_handle = scoped_platform_handle.release().fd;
29 #elif defined(OS_WIN)
30 *platform_handle = scoped_platform_handle.release().handle;
31 #else
32 #error "Platform not yet supported."
33 #endif
34 return true;
35 }
36
37 } // extern "C"
OLDNEW
« mojo/platform_handle/platform_handle_thunks.h ('K') | « mojo/runner/native_application_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698