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

Unified Diff: ipc/brokerable_attachment.h

Issue 2504063002: Revert of Remove IPC::BrokerableAttachment. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « ipc/BUILD.gn ('k') | ipc/brokerable_attachment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/brokerable_attachment.h
diff --git a/ipc/brokerable_attachment.h b/ipc/brokerable_attachment.h
new file mode 100644
index 0000000000000000000000000000000000000000..a926d5bfe67089b3d98f262e44705283f3c71c01
--- /dev/null
+++ b/ipc/brokerable_attachment.h
@@ -0,0 +1,54 @@
+// 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 <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
+
+#include "base/macros.h"
+#include "build/build_config.h"
+#include "ipc/ipc_export.h"
+#include "ipc/ipc_message_attachment.h"
+
+namespace IPC {
+
+// This subclass of MessageAttachment requires an AttachmentBroker to be
+// attached to a Chrome IPC message.
+class IPC_EXPORT BrokerableAttachment : public MessageAttachment {
+ public:
+ enum BrokerableType {
+ PLACEHOLDER,
+ WIN_HANDLE,
+ MACH_PORT,
+ };
+
+ // Whether the attachment still needs information from the broker before it
+ // can be used.
+ bool NeedsBrokering() const;
+
+ // Returns TYPE_BROKERABLE_ATTACHMENT
+ Type GetType() const override;
+
+ virtual BrokerableType GetBrokerableType() const = 0;
+
+// MessageAttachment override.
+#if defined(OS_POSIX)
+ base::PlatformFile TakePlatformFile() override;
+#endif // OS_POSIX
+
+ protected:
+ BrokerableAttachment();
+ ~BrokerableAttachment() override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BrokerableAttachment);
+};
+
+} // namespace IPC
+
+#endif // IPC_BROKERABLE_ATTACHMENT_H_
« no previous file with comments | « ipc/BUILD.gn ('k') | ipc/brokerable_attachment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698