Index: ipc/brokerable_attachment.h |
diff --git a/ipc/brokerable_attachment.h b/ipc/brokerable_attachment.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9799cee29fb4631b0fc8655e7580d5b56dd0858f |
--- /dev/null |
+++ b/ipc/brokerable_attachment.h |
@@ -0,0 +1,41 @@ |
+// Copyright 2015 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. |
+ |
+#ifndef IPC_BROKERABLE_ATTACHMENT_H_ |
+#define IPC_BROKERABLE_ATTACHMENT_H_ |
+ |
+#include "ipc/ipc_export.h" |
+#include "ipc/ipc_message_attachment.h" |
+ |
+namespace IPC { |
+ |
+// An id uniquely identifies an attachment sent via a broker. |
+struct IPC_EXPORT BrokerableAttachmentId { |
+ uint32_t nonce[4]; |
+}; |
+ |
+namespace internal { |
+ |
+// This subclass of MessageAttachment requires an AttachmentBroker to be |
+// attached to a Chrome IPC message. |
+class IPC_EXPORT BrokerableAttachment : public MessageAttachment { |
+ public: |
+ BrokerableAttachment() {} |
+ |
+ // The identifier is unique across all Chrome processes. |
+ BrokerableAttachmentId GetIdentifier() { return id_; } |
+ |
+ protected: |
+ ~BrokerableAttachment() override{}; |
+ |
+ private: |
+ // This member uniquely identifier a BrokerableAttachment across all |
+ // processes. |
+ BrokerableAttachmentId id_; |
+}; |
+ |
+} // namespace internal |
+} // namespace IPC |
+ |
+#endif // IPC_BROKERABLE_ATTACHMENT_H_ |