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

Side by Side Diff: ipc/ipc_message_attachment.h

Issue 1659003003: IPC::Message -> base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more mac fix Created 4 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_utils.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 "base/pickle.h"
11 #include "build/build_config.h" 12 #include "build/build_config.h"
12 #include "ipc/ipc_export.h" 13 #include "ipc/ipc_export.h"
13 14
14 namespace IPC { 15 namespace IPC {
15 16
16 // Auxiliary data sent with |Message|. This can be a platform file descriptor 17 // Auxiliary data sent with |Message|. This can be a platform file descriptor
17 // or a mojo |MessagePipe|. |GetType()| returns the type of the subclass. 18 // or a mojo |MessagePipe|. |GetType()| returns the type of the subclass.
18 class IPC_EXPORT MessageAttachment 19 class IPC_EXPORT MessageAttachment : public base::Pickle::Attachment {
19 : public base::RefCountedThreadSafe<MessageAttachment> {
20 public: 20 public:
21 enum Type { 21 enum Type {
22 TYPE_PLATFORM_FILE, // The instance is |PlatformFileAttachment|. 22 TYPE_PLATFORM_FILE, // The instance is |PlatformFileAttachment|.
23 TYPE_MOJO_HANDLE, // The instance is |MojoHandleAttachment|. 23 TYPE_MOJO_HANDLE, // The instance is |MojoHandleAttachment|.
24 TYPE_BROKERABLE_ATTACHMENT, // The instance is |BrokerableAttachment|. 24 TYPE_BROKERABLE_ATTACHMENT, // The instance is |BrokerableAttachment|.
25 }; 25 };
26 26
27 virtual Type GetType() const = 0; 27 virtual Type GetType() const = 0;
28 28
29 #if defined(OS_POSIX) 29 #if defined(OS_POSIX)
30 virtual base::PlatformFile TakePlatformFile() = 0; 30 virtual base::PlatformFile TakePlatformFile() = 0;
31 #endif // OS_POSIX 31 #endif // OS_POSIX
32 32
33 protected: 33 protected:
34 friend class base::RefCountedThreadSafe<MessageAttachment>; 34 friend class base::RefCountedThreadSafe<MessageAttachment>;
35 MessageAttachment(); 35 MessageAttachment();
36 virtual ~MessageAttachment(); 36 ~MessageAttachment() override;
37 37
38 DISALLOW_COPY_AND_ASSIGN(MessageAttachment); 38 DISALLOW_COPY_AND_ASSIGN(MessageAttachment);
39 }; 39 };
40 40
41 } // namespace IPC 41 } // namespace IPC
42 42
43 #endif // IPC_IPC_MESSAGE_ATTACHMENT_H_ 43 #endif // IPC_IPC_MESSAGE_ATTACHMENT_H_
OLDNEW
« no previous file with comments | « ipc/ipc_message.cc ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698