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

Unified Diff: ipc/mojo/ipc_channel_mojo.cc

Issue 883093003: IPC::Message Refactoring: Move POSIX specific bits to PlatformFileAttachment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing Windows build error Created 5 years, 11 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/ipc_platform_file_attachment_posix.cc ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_channel_mojo.cc
diff --git a/ipc/mojo/ipc_channel_mojo.cc b/ipc/mojo/ipc_channel_mojo.cc
index 419d8d5bf9b57068b73467afe0f117117f0a6d0a..d2d7fe5b7bd84089bd821bd3b030ac282c88f6a1 100644
--- a/ipc/mojo/ipc_channel_mojo.cc
+++ b/ipc/mojo/ipc_channel_mojo.cc
@@ -16,6 +16,10 @@
#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/error_handler.h"
+#if defined(OS_POSIX) && !defined(OS_NACL)
+#include "ipc/ipc_platform_file_attachment_posix.h"
+#endif
+
namespace IPC {
namespace {
@@ -352,8 +356,9 @@ MojoResult ChannelMojo::WriteToMessageAttachmentSet(
return unwrap_result;
}
- bool ok = message->attachment_set()->AddToOwn(
- base::ScopedFD(platform_handle.release().fd));
+ bool ok = message->attachment_set()->AddAttachment(
+ new internal::PlatformFileAttachment(
+ base::ScopedFD(platform_handle.release().fd)));
DCHECK(ok);
}
@@ -367,7 +372,7 @@ MojoResult ChannelMojo::ReadFromMessageAttachmentSet(
// We dup() the handles in IPC::Message to transmit.
// IPC::MessageAttachmentSet has intricate lifecycle semantics
// of FDs, so just to dup()-and-own them is the safest option.
- if (message->HasFileDescriptors()) {
+ if (message->HasAttachments()) {
MessageAttachmentSet* fdset = message->attachment_set();
std::vector<base::PlatformFile> fds_to_send(fdset->size());
fdset->PeekDescriptors(&fds_to_send[0]);
« no previous file with comments | « ipc/ipc_platform_file_attachment_posix.cc ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698