1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IPC_IPC_MESSAGE_ATTACHMENT_H_
6 #define IPC_IPC_MESSAGE_ATTACHMENT_H_
8 #include "base/memory/ref_counted.h"
9 #include "ipc/ipc_export.h"
13 // Auxiliary data sent with |Message|. This can be a platform file descriptor
14 // or a mojo |MessagePipe|. |GetType()| returns the type of the subclass.
15 class IPC_EXPORT MessageAttachment
16 : public base::RefCounted
<MessageAttachment
> {
19 TYPE_PLATFORM_FILE
, // The instance is |PlatformFileAttachment|.
20 TYPE_MOJO_MESSAGE_PIPE
, // The instance is a mojo-based class.
23 virtual Type
GetType() const = 0;
26 friend class base::RefCounted
<MessageAttachment
>;
27 virtual ~MessageAttachment();
32 #endif // IPC_IPC_MESSAGE_ATTACHMENT_H_