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

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

Issue 1538823002: Convert Pass()→std::move() in mojo/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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
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>
8
7 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" 9 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
8 10
9 extern "C" { 11 extern "C" {
10 12
11 MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle, 13 MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle,
12 MojoHandle* wrapper) { 14 MojoHandle* wrapper) {
13 mojo::embedder::PlatformHandle platform_handle_wrapper(platform_handle); 15 mojo::embedder::PlatformHandle platform_handle_wrapper(platform_handle);
14 mojo::embedder::ScopedPlatformHandle scoped_platform_handle( 16 mojo::embedder::ScopedPlatformHandle scoped_platform_handle(
15 platform_handle_wrapper); 17 platform_handle_wrapper);
16 return mojo::embedder::CreatePlatformHandleWrapper( 18 return mojo::embedder::CreatePlatformHandleWrapper(
17 scoped_platform_handle.Pass(), wrapper); 19 std::move(scoped_platform_handle), wrapper);
18 } 20 }
19 21
20 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper, 22 MojoResult MojoExtractPlatformHandle(MojoHandle wrapper,
21 MojoPlatformHandle* platform_handle) { 23 MojoPlatformHandle* platform_handle) {
22 mojo::embedder::ScopedPlatformHandle scoped_platform_handle; 24 mojo::embedder::ScopedPlatformHandle scoped_platform_handle;
23 MojoResult result = mojo::embedder::PassWrappedPlatformHandle( 25 MojoResult result = mojo::embedder::PassWrappedPlatformHandle(
24 wrapper, &scoped_platform_handle); 26 wrapper, &scoped_platform_handle);
25 if (result != MOJO_RESULT_OK) 27 if (result != MOJO_RESULT_OK)
26 return result; 28 return result;
27 29
28 DCHECK(scoped_platform_handle.is_valid()); 30 DCHECK(scoped_platform_handle.is_valid());
29 #if defined(OS_POSIX) 31 #if defined(OS_POSIX)
30 *platform_handle = scoped_platform_handle.release().fd; 32 *platform_handle = scoped_platform_handle.release().fd;
31 #elif defined(OS_WIN) 33 #elif defined(OS_WIN)
32 *platform_handle = scoped_platform_handle.release().handle; 34 *platform_handle = scoped_platform_handle.release().handle;
33 #else 35 #else
34 #error "Platform not yet supported." 36 #error "Platform not yet supported."
35 #endif 37 #endif
36 return MOJO_RESULT_OK; 38 return MOJO_RESULT_OK;
37 } 39 }
38 40
39 } // extern "C" 41 } // extern "C"
OLDNEW
« no previous file with comments | « mojo/package_manager/package_manager_impl.cc ('k') | mojo/runner/child/native_apptest_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698