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

Side by Side Diff: base/process/process_handle_fuchsia.cc

Issue 2941283002: fuchsia: Use new, qualified error names, disable old names. (Closed)
Patch Set: don have Created 3 years, 6 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 | « base/process/process_fuchsia.cc ('k') | base/process/process_util_unittest.cc » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "base/process/process_handle.h" 5 #include "base/process/process_handle.h"
6 6
7 #include <magenta/process.h> 7 #include <magenta/process.h>
8 #include <magenta/syscalls.h> 8 #include <magenta/syscalls.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 11
12 namespace base { 12 namespace base {
13 13
14 ProcessId GetCurrentProcId() { 14 ProcessId GetCurrentProcId() {
15 return GetProcId(GetCurrentProcessHandle()); 15 return GetProcId(GetCurrentProcessHandle());
16 } 16 }
17 17
18 ProcessHandle GetCurrentProcessHandle() { 18 ProcessHandle GetCurrentProcessHandle() {
19 // Note that mx_process_self() returns a real handle, and ownership is not 19 // Note that mx_process_self() returns a real handle, and ownership is not
20 // transferred to the caller (i.e. this should never be closed). 20 // transferred to the caller (i.e. this should never be closed).
21 return mx_process_self(); 21 return mx_process_self();
22 } 22 }
23 23
24 ProcessId GetProcId(ProcessHandle process) { 24 ProcessId GetProcId(ProcessHandle process) {
25 mx_info_handle_basic_t basic; 25 mx_info_handle_basic_t basic;
26 mx_status_t status = mx_object_get_info(process, MX_INFO_HANDLE_BASIC, &basic, 26 mx_status_t status = mx_object_get_info(process, MX_INFO_HANDLE_BASIC, &basic,
27 sizeof(basic), nullptr, nullptr); 27 sizeof(basic), nullptr, nullptr);
28 if (status != NO_ERROR) { 28 if (status != MX_OK) {
29 DLOG(ERROR) << "mx_object_get_info failed: " << status; 29 DLOG(ERROR) << "mx_object_get_info failed: " << status;
30 return MX_KOID_INVALID; 30 return MX_KOID_INVALID;
31 } 31 }
32 return basic.koid; 32 return basic.koid;
33 } 33 }
34 34
35 } // namespace base 35 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process_fuchsia.cc ('k') | base/process/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698