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

Unified Diff: ipc/mojo/ipc_channel_mojo_unittest.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/mojo/ipc_channel_mojo.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_channel_mojo_unittest.cc
diff --git a/ipc/mojo/ipc_channel_mojo_unittest.cc b/ipc/mojo/ipc_channel_mojo_unittest.cc
index 47e72fc0e5ea45d44d31d8e718ec12884b25d002..6ebaa73ee10b0b037a590a64f2c0443bd6d58e8b 100644
--- a/ipc/mojo/ipc_channel_mojo_unittest.cc
+++ b/ipc/mojo/ipc_channel_mojo_unittest.cc
@@ -17,6 +17,7 @@
#if defined(OS_POSIX)
#include "base/file_descriptor_posix.h"
+#include "ipc/ipc_platform_file_attachment_posix.h"
#endif
namespace {
@@ -328,8 +329,9 @@ class ListenerThatExpectsFile : public IPC::Listener {
PickleIterator iter(message);
base::ScopedFD fd;
- EXPECT_TRUE(message.ReadFile(&iter, &fd));
- base::File file(fd.release());
+ scoped_refptr<IPC::MessageAttachment> attachment;
+ EXPECT_TRUE(message.ReadAttachment(&iter, &attachment));
+ base::File file(attachment->TakePlatformFile());
std::string content(GetSendingFileContent().size(), ' ');
file.Read(0, &content[0], content.size());
EXPECT_EQ(content, GetSendingFileContent());
@@ -359,7 +361,8 @@ class ListenerThatExpectsFile : public IPC::Listener {
file.Flush();
IPC::Message* message = new IPC::Message(
0, 2, IPC::Message::PRIORITY_NORMAL);
- message->WriteFile(base::ScopedFD(file.TakePlatformFile()));
+ message->WriteAttachment(new IPC::internal::PlatformFileAttachment(
+ base::ScopedFD(file.TakePlatformFile())));
ASSERT_TRUE(sender->Send(message));
}
« no previous file with comments | « ipc/mojo/ipc_channel_mojo.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698