summaryrefslogtreecommitdiffstats
path: root/ipc/placeholder_brokerable_attachment.h
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2015-08-21 17:26:36 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-22 00:27:24 +0000
commit37a2e0b682555bf35852d707dbd74b68f345841f (patch)
tree3d08086581676e7c7b86410b2b6cc5cd8bc305d1 /ipc/placeholder_brokerable_attachment.h
parentf98cee5f50d3aaa4cd30d40a96a2ab7968260e0e (diff)
downloadchromium_src-37a2e0b682555bf35852d707dbd74b68f345841f.zip
chromium_src-37a2e0b682555bf35852d707dbd74b68f345841f.tar.gz
chromium_src-37a2e0b682555bf35852d707dbd74b68f345841f.tar.bz2
Reland #1: IPC: Add attachment brokering support to the message header.
This reland fixes a race condition in the unit test SendHandleTwice that caused the test to flakily fail, mostly on XP machines. This reland also updates switch statements to contain a block for the newly added enum BrokerableAttachment::PLACEHOLDER, which was causing problems with the clang Windows build. > Message dispatch happens before message translation, and message dispatch > requires that all brokered attachments have been received. This means that > attachment brokering needs to function without message translation. This is > accomplished by modifying the message header to include a new field > num_brokered_attachments, and writing the attachment ids into the IPC Channel > immediately following the pickled message itself. > > AttachmentBrokerPrivilegedWinUnittest was expanded to test ChannelReader in the > receiving process. It is now a fully functional end-to-end test of attachment > brokering. > > BUG=493414 TBR=tsepez@chromium.org BUG=493414 Review URL: https://codereview.chromium.org/1303103002 Cr-Commit-Position: refs/heads/master@{#344933}
Diffstat (limited to 'ipc/placeholder_brokerable_attachment.h')
-rw-r--r--ipc/placeholder_brokerable_attachment.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/ipc/placeholder_brokerable_attachment.h b/ipc/placeholder_brokerable_attachment.h
new file mode 100644
index 0000000..7a63c72
--- /dev/null
+++ b/ipc/placeholder_brokerable_attachment.h
@@ -0,0 +1,28 @@
+// 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_PLACEHOLDER_BROKERABLE_ATTACHMENT_H_
+#define IPC_PLACEHOLDER_BROKERABLE_ATTACHMENT_H_
+
+#include "ipc/brokerable_attachment.h"
+#include "ipc/ipc_export.h"
+
+namespace IPC {
+
+// This subclass of BrokerableAttachment has an AttachmentId, and nothing else.
+// It is intended to be replaced by the attachment broker.
+class IPC_EXPORT PlaceholderBrokerableAttachment : public BrokerableAttachment {
+ public:
+ PlaceholderBrokerableAttachment(const AttachmentId& id)
+ : BrokerableAttachment(id){};
+ BrokerableType GetBrokerableType() const override;
+
+ protected:
+ ~PlaceholderBrokerableAttachment() override{};
+ DISALLOW_COPY_AND_ASSIGN(PlaceholderBrokerableAttachment);
+};
+
+} // namespace IPC
+
+#endif // IPC_PLACEHOLDER_BROKERABLE_ATTACHMENT_H_