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

Unified Diff: chrome/browser/mach_broker_mac.cc

Issue 466088: Revert 34146 - A place to store the pid>mach_port_t mapping.... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/mach_broker_mac.h ('k') | chrome/browser/mach_broker_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/mach_broker_mac.cc
===================================================================
--- chrome/browser/mach_broker_mac.cc (revision 34146)
+++ chrome/browser/mach_broker_mac.cc (working copy)
@@ -1,47 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/mach_broker_mac.h"
-
-#include "base/logging.h"
-
-// Constructor.
-MachBroker::MachBroker() {}
-
-// Returns the global MachBroker.
-MachBroker* MachBroker::instance() {
- return Singleton<MachBroker>::get();
-}
-
-// Returns the mach task belonging to |pid|.
-mach_port_t MachBroker::MachTaskForPid(base::ProcessHandle pid) const {
- AutoLock lock(lock_);
- MachBroker::MachMap::const_iterator it = mach_map_.find(pid);
- if (it == mach_map_.end())
- return 0;
- return it->second.mach_task_;
-}
-
-// Returns the mach host belonging to |pid|.
-mach_port_t MachBroker::MachHostForPid(base::ProcessHandle pid) const {
- AutoLock lock(lock_);
- MachMap::const_iterator it = mach_map_.find(pid);
- if (it == mach_map_.end())
- return 0;
- return it->second.mach_host_;
-}
-
-// Adds mach info for a given pid.
-void MachBroker::RegisterPid(
- base::ProcessHandle pid, const MachInfo& mach_info) {
- AutoLock lock(lock_);
- DCHECK(mach_map_.count(pid) == 0);
- mach_map_[pid] = mach_info;
-}
-
-// Removes all mappings belonging to |pid| from the broker.
-void MachBroker::Invalidate(base::ProcessHandle pid) {
- AutoLock lock(lock_);
- mach_map_.erase(pid);
-}
« no previous file with comments | « chrome/browser/mach_broker_mac.h ('k') | chrome/browser/mach_broker_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698