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

Side by Side Diff: mojo/platform_handle/platform_handle_functions.cc

Issue 1554443003: Stop linking in the old Mojo EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and fix new flaky test Created 4 years, 11 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
« no previous file with comments | « mojo/platform_handle/BUILD.gn ('k') | mojo/public/c/system/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 2015 The Chromium Authors. All rights reserved. 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 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/platform_handle/platform_handle_functions.h" 5 #include "mojo/platform_handle/platform_handle_functions.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" 9 #include "mojo/edk/embedder/embedder.h"
10 #include "mojo/edk/embedder/scoped_platform_handle.h"
10 11
11 extern "C" { 12 extern "C" {
12 13
13 MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle, 14 MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle,
14 MojoHandle* wrapper) { 15 MojoHandle* wrapper) {
15 mojo::embedder::PlatformHandle platform_handle_wrapper(platform_handle); 16 mojo::edk::PlatformHandle platform_handle_wrapper(platform_handle);
16 mojo::embedder::ScopedPlatformHandle scoped_platform_handle( 17 mojo::edk::ScopedPlatformHandle scoped_platform_handle(
17 platform_handle_wrapper); 18 platform_handle_wrapper);
18 return mojo::embedder::CreatePlatformHandleWrapper( 19 return mojo::edk::CreatePlatformHandleWrapper(
19 std::move(scoped_platform_handle), wrapper); 20 std::move(scoped_platform_handle), wrapper);
20 } 21 }
21 22
22 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper, 23 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper,
23 MojoPlatformHandle* platform_handle) { 24 MojoPlatformHandle* platform_handle) {
24 mojo::embedder::ScopedPlatformHandle scoped_platform_handle; 25 mojo::edk::ScopedPlatformHandle scoped_platform_handle;
25 MojoResult result = mojo::embedder::PassWrappedPlatformHandle( 26 MojoResult result = mojo::edk::PassWrappedPlatformHandle(
26 wrapper, &scoped_platform_handle); 27 wrapper, &scoped_platform_handle);
27 if (result != MOJO_RESULT_OK) 28 if (result != MOJO_RESULT_OK)
28 return result; 29 return result;
29 30
30 DCHECK(scoped_platform_handle.is_valid()); 31 DCHECK(scoped_platform_handle.is_valid());
31 #if defined(OS_POSIX)
32 *platform_handle = scoped_platform_handle.release().fd;
33 #elif defined(OS_WIN)
34 *platform_handle = scoped_platform_handle.release().handle; 32 *platform_handle = scoped_platform_handle.release().handle;
35 #else
36 #error "Platform not yet supported."
37 #endif
38 return MOJO_RESULT_OK; 33 return MOJO_RESULT_OK;
39 } 34 }
40 35
41 } // extern "C" 36 } // extern "C"
OLDNEW
« no previous file with comments | « mojo/platform_handle/BUILD.gn ('k') | mojo/public/c/system/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698