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

Side by Side Diff: ipc/test_util_mac.cc

Issue 1397023002: ipc: Write end-to-end tests for SharedMemoryHandle brokering on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More Win compile errors. Created 5 years, 2 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 | « ipc/test_util_mac.h ('k') | no next file » | 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 "ipc/test_util_mac.h" 5 #include "ipc/test_util_mac.h"
6 6
7 #include <servers/bootstrap.h> 7 #include <servers/bootstrap.h>
8 8
9 #include "base/mac/mach_logging.h" 9 #include "base/mac/mach_logging.h"
10 #include "base/mac/scoped_mach_port.h" 10 #include "base/mac/scoped_mach_port.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 mach_port_name_array_t name_array; 93 mach_port_name_array_t name_array;
94 mach_msg_type_number_t names_count; 94 mach_msg_type_number_t names_count;
95 mach_port_type_array_t type_array; 95 mach_port_type_array_t type_array;
96 mach_msg_type_number_t types_count; 96 mach_msg_type_number_t types_count;
97 kern_return_t kr = mach_port_names(mach_task_self(), &name_array, 97 kern_return_t kr = mach_port_names(mach_task_self(), &name_array,
98 &names_count, &type_array, &types_count); 98 &names_count, &type_array, &types_count);
99 MACH_CHECK(kr == KERN_SUCCESS, kr) << "GetActiveNameCount"; 99 MACH_CHECK(kr == KERN_SUCCESS, kr) << "GetActiveNameCount";
100 return names_count; 100 return names_count;
101 } 101 }
102 102
103 mach_port_urefs_t GetMachRefCount(mach_port_name_t name,
104 mach_port_right_t right) {
105 mach_port_urefs_t ref_count;
106 kern_return_t kr = mach_port_get_refs(mach_task_self(), name,
107 MACH_PORT_RIGHT_SEND, &ref_count);
108 MACH_CHECK(kr == KERN_SUCCESS, kr) << "GetRefCount";
109 return ref_count;
110 }
111
103 void IncrementMachRefCount(mach_port_name_t name, mach_port_right_t right) { 112 void IncrementMachRefCount(mach_port_name_t name, mach_port_right_t right) {
104 kern_return_t kr = mach_port_mod_refs(mach_task_self(), name, right, 1); 113 kern_return_t kr = mach_port_mod_refs(mach_task_self(), name, right, 1);
105 MACH_CHECK(kr == KERN_SUCCESS, kr) << "GetRefCount"; 114 MACH_CHECK(kr == KERN_SUCCESS, kr) << "GetRefCount";
106 } 115 }
107 116
108 } // namespace IPC 117 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/test_util_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698