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

Side by Side Diff: ipc/ipc_message_attachment.h

Issue 866223005: IPC: Add MojoHandleAttachment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing windows build again... Created 5 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « ipc/ipc_message.cc ('k') | ipc/ipc_message_attachment_set.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IPC_IPC_MESSAGE_ATTACHMENT_H_ 5 #ifndef IPC_IPC_MESSAGE_ATTACHMENT_H_
6 #define IPC_IPC_MESSAGE_ATTACHMENT_H_ 6 #define IPC_IPC_MESSAGE_ATTACHMENT_H_
7 7
8 #include "base/files/file.h" 8 #include "base/files/file.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "ipc/ipc_export.h" 11 #include "ipc/ipc_export.h"
12 12
13 namespace IPC { 13 namespace IPC {
14 14
15 // Auxiliary data sent with |Message|. This can be a platform file descriptor 15 // Auxiliary data sent with |Message|. This can be a platform file descriptor
16 // or a mojo |MessagePipe|. |GetType()| returns the type of the subclass. 16 // or a mojo |MessagePipe|. |GetType()| returns the type of the subclass.
17 class IPC_EXPORT MessageAttachment 17 class IPC_EXPORT MessageAttachment
18 : public base::RefCounted<MessageAttachment> { 18 : public base::RefCounted<MessageAttachment> {
19 public: 19 public:
20 enum Type { 20 enum Type {
21 TYPE_PLATFORM_FILE, // The instance is |PlatformFileAttachment|. 21 TYPE_PLATFORM_FILE, // The instance is |PlatformFileAttachment|.
22 TYPE_MOJO_MESSAGE_PIPE, // The instance is a mojo-based class. 22 TYPE_MOJO_HANDLE, // The instance is |MojoHandleAttachment|.
23 }; 23 };
24 24
25 virtual Type GetType() const = 0; 25 virtual Type GetType() const = 0;
26
27 #if defined(OS_POSIX)
26 virtual base::PlatformFile TakePlatformFile() = 0; 28 virtual base::PlatformFile TakePlatformFile() = 0;
29 #endif // OS_POSIX
27 30
28 protected: 31 protected:
29 friend class base::RefCounted<MessageAttachment>; 32 friend class base::RefCounted<MessageAttachment>;
30 MessageAttachment(); 33 MessageAttachment();
31 virtual ~MessageAttachment(); 34 virtual ~MessageAttachment();
32 35
33 DISALLOW_COPY_AND_ASSIGN(MessageAttachment); 36 DISALLOW_COPY_AND_ASSIGN(MessageAttachment);
34 }; 37 };
35 38
36 } // namespace IPC 39 } // namespace IPC
37 40
38 #endif // IPC_IPC_MESSAGE_ATTACHMENT_H_ 41 #endif // IPC_IPC_MESSAGE_ATTACHMENT_H_
OLDNEW
« no previous file with comments | « ipc/ipc_message.cc ('k') | ipc/ipc_message_attachment_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698