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

Unified Diff: ipc/mojo/ipc_mojo_handle_attachment.h

Issue 2047953002: Explicitly serialise platform file attachments instead of doing them implicitly as a mojo handle at… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/mojo/ipc_channel_mojo_unittest.cc ('k') | ipc/mojo/ipc_mojo_handle_attachment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_mojo_handle_attachment.h
diff --git a/ipc/mojo/ipc_mojo_handle_attachment.h b/ipc/mojo/ipc_mojo_handle_attachment.h
index 2d51879c7afadaa0470de22d80bf2ac027ba0caa..31d0107274ef3764756be157fee0de9ff234411a 100644
--- a/ipc/mojo/ipc_mojo_handle_attachment.h
+++ b/ipc/mojo/ipc_mojo_handle_attachment.h
@@ -17,12 +17,9 @@ namespace IPC {
namespace internal {
// A MessageAttachment that holds a MojoHandle.
-// * On the sending side, every Mojo handle is a MessagePipe. This is because
-// any platform files are wrapped by PlatformFileAttachment.
-// * On the receiving side, the handle can be either MessagePipe or wrapped
-// platform file: All files, not only MessagePipes are wrapped as a
-// MojoHandle. The message deserializer should know which type of the object
-// the handle wraps.
+// This can hold any type of transferrable Mojo handle (i.e. message pipe, data
+// pipe, etc), but the receiver is expected to know what type of handle to
+// expect.
class IPC_MOJO_EXPORT MojoHandleAttachment : public MessageAttachment {
public:
explicit MojoHandleAttachment(mojo::ScopedHandle handle);
@@ -30,9 +27,7 @@ class IPC_MOJO_EXPORT MojoHandleAttachment : public MessageAttachment {
Type GetType() const override;
#if defined(OS_POSIX)
- // Returns wrapped file if it wraps a file, or
- // an invalid fd otherwise. The ownership of handle
- // is passed to the caller.
+ // Should not be called.
base::PlatformFile TakePlatformFile() override;
#endif // OS_POSIX
« no previous file with comments | « ipc/mojo/ipc_channel_mojo_unittest.cc ('k') | ipc/mojo/ipc_mojo_handle_attachment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698