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

Side by Side Diff: base/process_util.h

Issue 501138: Mac: Create a pid->task_t mapping in the browser process. (Closed)
Patch Set: trunglify 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
« no previous file with comments | « no previous file | base/process_util_mac.mm » ('j') | chrome/browser/mach_broker_mac.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // This file/namespace contains utility functions for enumerating, ending and 5 // This file/namespace contains utility functions for enumerating, ending and
6 // computing statistics of processes. 6 // computing statistics of processes.
7 7
8 #ifndef BASE_PROCESS_UTIL_H_ 8 #ifndef BASE_PROCESS_UTIL_H_
9 #define BASE_PROCESS_UTIL_H_ 9 #define BASE_PROCESS_UTIL_H_
10 10
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 // methods. 362 // methods.
363 class ProcessMetrics { 363 class ProcessMetrics {
364 public: 364 public:
365 // Creates a ProcessMetrics for the specified process. 365 // Creates a ProcessMetrics for the specified process.
366 // The caller owns the returned object. 366 // The caller owns the returned object.
367 #if !defined(OS_MACOSX) 367 #if !defined(OS_MACOSX)
368 static ProcessMetrics* CreateProcessMetrics(ProcessHandle process); 368 static ProcessMetrics* CreateProcessMetrics(ProcessHandle process);
369 #else 369 #else
370 class PortProvider { 370 class PortProvider {
371 public: 371 public:
372 // Should return the mach task for |process| if possible, or else 0. Only 372 // Should return the mach task for |process| if possible, or else
373 // processes that this returns tasks for will have metrics on OS X (except 373 // |MACH_PORT_NULL|. Only processes that this returns tasks for will have
374 // for the current process, which always gets metrics). 374 // metrics on OS X (except for the current process, which always gets
375 // metrics).
375 virtual mach_port_t TaskForPid(ProcessHandle process) const = 0; 376 virtual mach_port_t TaskForPid(ProcessHandle process) const = 0;
376 }; 377 };
377 378
378 // The port provider needs to outlive the ProcessMetrics object returned by 379 // The port provider needs to outlive the ProcessMetrics object returned by
379 // this function. If NULL is passed as provider, the returned object 380 // this function. If NULL is passed as provider, the returned object
380 // only returns valid metrics if |process| is the current process. 381 // only returns valid metrics if |process| is the current process.
381 static ProcessMetrics* CreateProcessMetrics(ProcessHandle process, 382 static ProcessMetrics* CreateProcessMetrics(ProcessHandle process,
382 PortProvider* port_provider); 383 PortProvider* port_provider);
383 #endif 384 #endif
384 385
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 // instance running inside the parent. The parent's Breakpad instance should 499 // instance running inside the parent. The parent's Breakpad instance should
499 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler 500 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler
500 // in the child after forking will restore the standard exception handler. 501 // in the child after forking will restore the standard exception handler.
501 // See http://crbug.com/20371/ for more details. 502 // See http://crbug.com/20371/ for more details.
502 void RestoreDefaultExceptionHandler(); 503 void RestoreDefaultExceptionHandler();
503 #endif 504 #endif
504 505
505 } // namespace base 506 } // namespace base
506 507
507 #endif // BASE_PROCESS_UTIL_H_ 508 #endif // BASE_PROCESS_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/process_util_mac.mm » ('j') | chrome/browser/mach_broker_mac.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698