Chromium Code Reviews| Index: content/browser/mach_broker_mac.h |
| diff --git a/content/browser/mach_broker_mac.h b/content/browser/mach_broker_mac.h |
| index 9088ca70265491cc76ae9826c6ecc05c99fa4832..12347918f1c8ee2dfa2824175161dfe34e639ac3 100644 |
| --- a/content/browser/mach_broker_mac.h |
| +++ b/content/browser/mach_broker_mac.h |
| @@ -5,11 +5,11 @@ |
| #ifndef CONTENT_BROWSER_MACH_BROKER_MAC_H_ |
| #define CONTENT_BROWSER_MACH_BROKER_MAC_H_ |
| +#include <mach/mach.h> |
| + |
| #include <map> |
| #include <string> |
| -#include <mach/mach.h> |
| - |
| #include "base/memory/singleton.h" |
| #include "base/process/process_handle.h" |
| #include "base/process/process_metrics.h" |
| @@ -61,7 +61,7 @@ class CONTENT_EXPORT MachBroker : public base::ProcessMetrics::PortProvider, |
| // Callers are expected to later update the port with FinalizePid(). Callers |
| // MUST acquire the lock given by GetLock() before calling this method (and |
| // release the lock afterwards). |
| - void AddPlaceholderForPid(base::ProcessHandle pid); |
| + void AddPlaceholderForPid(base::ProcessHandle pid, int child_process_id); |
| // Implement |ProcessMetrics::PortProvider|. |
| mach_port_t TaskForPid(base::ProcessHandle process) const override; |
| @@ -90,8 +90,8 @@ class CONTENT_EXPORT MachBroker : public base::ProcessMetrics::PortProvider, |
| // this method (and release the lock afterwards). |
| void FinalizePid(base::ProcessHandle pid, mach_port_t task_port); |
| - // Removes all mappings belonging to |pid| from the broker. |
| - void InvalidatePid(base::ProcessHandle pid); |
| + // Removes all mappings belonging to |child_process_id| from the broker. |
| + void InvalidateChildProcessId(int child_process_id); |
| // Returns the Mach port name to use when sending or receiving messages. |
| // Does the Right Thing in the browser and in child processes. |
| @@ -110,6 +110,11 @@ class CONTENT_EXPORT MachBroker : public base::ProcessMetrics::PortProvider, |
| typedef std::map<base::ProcessHandle, mach_port_t> MachMap; |
| MachMap mach_map_; |
| + // Stores the Child process unique id (RenderProcessHost ID) for every |
| + // process. |
| + typedef std::map<int, base::ProcessHandle> ChildProcessIdMap; |
| + ChildProcessIdMap child_process_id_map_; |
| + |
| // Mutex that guards |mach_map_|. |
|
Mark Mentovai
2014/11/17 19:17:46
It also guards child_process_id_map_.
sramajay
2014/11/18 14:15:19
Done.
|
| mutable base::Lock lock_; |