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

Unified Diff: content/browser/mach_broker_mac.h

Issue 681733003: Removed the ProcessHandle from the RendererClosedDetails payload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed mac issues Created 6 years, 1 month 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
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..369a331f8191a818e77697db43c3a23329eeeab4 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;
@@ -92,6 +92,8 @@ class CONTENT_EXPORT MachBroker : public base::ProcessMetrics::PortProvider,
// 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 +112,10 @@ 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<base::ProcessHandle, int> ChildProcessIdMap;
+ ChildProcessIdMap child_process_id_map_;
+
// Mutex that guards |mach_map_|.
mutable base::Lock lock_;

Powered by Google App Engine
This is Rietveld 408576698