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

Unified Diff: ipc/mojo/ipc_channel_mojo.cc

Issue 835873004: IPC: Generalize FileDescriptorSet to MessageAttachmentSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing 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/mojo/ipc_channel_mojo.h ('k') | ipc/mojo/ipc_message_pipe_reader.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 0b63eac6cbbe8d956fce2640ef10ca1aa1f160b8..1f3e3c44561b905eea3fa2752ec7c4d17ba11b70 100644
--- a/ipc/mojo/ipc_channel_mojo.cc
+++ b/ipc/mojo/ipc_channel_mojo.cc
@@ -9,16 +9,13 @@
#include "base/lazy_instance.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_logging.h"
+#include "ipc/ipc_message_attachment_set.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/mojo/client_channel.mojom.h"
#include "ipc/mojo/ipc_mojo_bootstrap.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/public/cpp/bindings/error_handler.h"
-#if defined(OS_POSIX) && !defined(OS_NACL)
-#include "ipc/file_descriptor_set_posix.h"
-#endif
-
namespace IPC {
namespace {
@@ -342,7 +339,7 @@ base::ScopedFD ChannelMojo::TakeClientFileDescriptor() {
}
// static
-MojoResult ChannelMojo::WriteToFileDescriptorSet(
+MojoResult ChannelMojo::WriteToMessageAttachmentSet(
const std::vector<MojoHandle>& handle_buffer,
Message* message) {
for (size_t i = 0; i < handle_buffer.size(); ++i) {
@@ -355,7 +352,7 @@ MojoResult ChannelMojo::WriteToFileDescriptorSet(
return unwrap_result;
}
- bool ok = message->file_descriptor_set()->AddToOwn(
+ bool ok = message->attachment_set()->AddToOwn(
base::ScopedFD(platform_handle.release().fd));
DCHECK(ok);
}
@@ -364,14 +361,14 @@ MojoResult ChannelMojo::WriteToFileDescriptorSet(
}
// static
-MojoResult ChannelMojo::ReadFromFileDescriptorSet(
+MojoResult ChannelMojo::ReadFromMessageAttachmentSet(
Message* message,
std::vector<MojoHandle>* handles) {
// We dup() the handles in IPC::Message to transmit.
- // IPC::FileDescriptorSet has intricate lifecycle semantics
+ // IPC::MessageAttachmentSet has intricate lifecycle semantics
// of FDs, so just to dup()-and-own them is the safest option.
if (message->HasFileDescriptors()) {
- FileDescriptorSet* fdset = message->file_descriptor_set();
+ MessageAttachmentSet* fdset = message->attachment_set();
std::vector<base::PlatformFile> fds_to_send(fdset->size());
fdset->PeekDescriptors(&fds_to_send[0]);
for (size_t i = 0; i < fds_to_send.size(); ++i) {
« no previous file with comments | « ipc/mojo/ipc_channel_mojo.h ('k') | ipc/mojo/ipc_message_pipe_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698