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

Side by Side Diff: chrome/common/mach_ipc_mac.mm

Issue 504068: Revert 34994, maybe it regressed startup perf - Fix cpu/memory measurements o... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/mach_ipc_mac.h ('k') | chrome/test/chrome_process_util.h » ('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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/common/mach_ipc_mac.h" 5 #include "chrome/common/mach_ipc_mac.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include <stdio.h> 9 #include <stdio.h>
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 ReceivePort::ReceivePort() { 206 ReceivePort::ReceivePort() {
207 mach_port_t current_task = mach_task_self(); 207 mach_port_t current_task = mach_task_self();
208 208
209 init_result_ = mach_port_allocate(current_task, 209 init_result_ = mach_port_allocate(current_task,
210 MACH_PORT_RIGHT_RECEIVE, 210 MACH_PORT_RIGHT_RECEIVE,
211 &port_); 211 &port_);
212 212
213 if (init_result_ != KERN_SUCCESS) 213 if (init_result_ != KERN_SUCCESS)
214 return; 214 return;
215 215
216 init_result_ = mach_port_insert_right(current_task, 216 init_result_ = mach_port_insert_right(current_task,
217 port_, 217 port_,
218 port_, 218 port_,
219 MACH_MSG_TYPE_MAKE_SEND); 219 MACH_MSG_TYPE_MAKE_SEND);
220 } 220 }
221 221
222 //============================================================================== 222 //==============================================================================
223 // Given an already existing mach port, use it. We take ownership of the 223 // Given an already existing mach port, use it. We take ownership of the
224 // port and deallocate it in our destructor. 224 // port and deallocate it in our destructor.
225 ReceivePort::ReceivePort(mach_port_t receive_port) 225 ReceivePort::ReceivePort(mach_port_t receive_port)
226 : port_(receive_port), 226 : port_(receive_port),
227 init_result_(KERN_SUCCESS) { 227 init_result_(KERN_SUCCESS) {
228 } 228 }
229 229
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 kern_return_t result = mach_msg(message.Head(), 299 kern_return_t result = mach_msg(message.Head(),
300 MACH_SEND_MSG | MACH_SEND_TIMEOUT, 300 MACH_SEND_MSG | MACH_SEND_TIMEOUT,
301 message.Head()->msgh_size, 301 message.Head()->msgh_size,
302 0, 302 0,
303 MACH_PORT_NULL, 303 MACH_PORT_NULL,
304 timeout, // timeout in ms 304 timeout, // timeout in ms
305 MACH_PORT_NULL); 305 MACH_PORT_NULL);
306 306
307 return result; 307 return result;
308 } 308 }
OLDNEW
« no previous file with comments | « chrome/common/mach_ipc_mac.h ('k') | chrome/test/chrome_process_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698