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

Unified Diff: ipc/ipc_message.h

Issue 1262543003: ipc: Create an unforgeable mechanism to get the process id of the sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dchecks. Created 5 years, 5 months 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 | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message.h
diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h
index 878784718dd5c969ce0cebfb3f69bac6b4a18d06..73a5165aed219c70cadb7428f19fb1315db7e883 100644
--- a/ipc/ipc_message.h
+++ b/ipc/ipc_message.h
@@ -184,6 +184,9 @@ class IPC_EXPORT Message : public base::Pickle {
// Whether the message has any brokerable attachments.
bool HasBrokerableAttachments() const;
+ void set_sender_pid(base::ProcessId id) { sender_pid_ = id; }
+ base::ProcessId get_sender_pid() const { return sender_pid_; }
+
#ifdef IPC_MESSAGE_LOG_ENABLED
// Adds the outgoing time from Time::Now() at the end of the message and sets
// a bit to indicate that it's been added.
@@ -263,6 +266,10 @@ class IPC_EXPORT Message : public base::Pickle {
return attachment_set_.get();
}
+ // The process id of the sender of the message. This member is populated with
+ // a valid value for every message dispatched to listeners.
+ base::ProcessId sender_pid_;
+
#ifdef IPC_MESSAGE_LOG_ENABLED
// Used for logging.
mutable int64 received_time_;
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698