summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2015-10-30 16:16:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-30 23:17:10 +0000
commitfa705362defe8ba29f7ba93570ea5cb8a5df0981 (patch)
tree803094a6c312c4333f7c71c88088b75eaea79c56 /ipc
parent09750216bef8bc9f2953e4eee9f66801bf034fa4 (diff)
downloadchromium_src-fa705362defe8ba29f7ba93570ea5cb8a5df0981.zip
chromium_src-fa705362defe8ba29f7ba93570ea5cb8a5df0981.tar.gz
chromium_src-fa705362defe8ba29f7ba93570ea5cb8a5df0981.tar.bz2
ipc: Make MessageAttachment inherit from RefCountedThreadSafe.
Previously, it inherited from RefCounted, which was wrong, since it's possible for multiple threads to simultaneously have scoped_ptr references to a single MessageAttachment. BUG=535711 Review URL: https://codereview.chromium.org/1408793008 Cr-Commit-Position: refs/heads/master@{#357216}
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_message_attachment.h4
-rw-r--r--ipc/mach_port_attachment_mac.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/ipc/ipc_message_attachment.h b/ipc/ipc_message_attachment.h
index e7553d2..5ed27ca 100644
--- a/ipc/ipc_message_attachment.h
+++ b/ipc/ipc_message_attachment.h
@@ -15,7 +15,7 @@ namespace IPC {
// Auxiliary data sent with |Message|. This can be a platform file descriptor
// or a mojo |MessagePipe|. |GetType()| returns the type of the subclass.
class IPC_EXPORT MessageAttachment
- : public base::RefCounted<MessageAttachment> {
+ : public base::RefCountedThreadSafe<MessageAttachment> {
public:
enum Type {
TYPE_PLATFORM_FILE, // The instance is |PlatformFileAttachment|.
@@ -30,7 +30,7 @@ class IPC_EXPORT MessageAttachment
#endif // OS_POSIX
protected:
- friend class base::RefCounted<MessageAttachment>;
+ friend class base::RefCountedThreadSafe<MessageAttachment>;
MessageAttachment();
virtual ~MessageAttachment();
diff --git a/ipc/mach_port_attachment_mac.h b/ipc/mach_port_attachment_mac.h
index 48dc9aa..7d8c4d5 100644
--- a/ipc/mach_port_attachment_mac.h
+++ b/ipc/mach_port_attachment_mac.h
@@ -67,7 +67,7 @@ class IPC_EXPORT MachPortAttachmentMac : public BrokerableAttachment {
private:
~MachPortAttachmentMac() override;
- mach_port_t mach_port_;
+ const mach_port_t mach_port_;
// In the sender process, the attachment owns the Mach port of a newly created
// message. The attachment broker will eventually take ownership, and set