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

Unified Diff: ipc/mojo/ipc_channel_mojo_unittest.cc

Issue 583473002: IPC: Get rid of FileDescriptor usage from FileDescriptorSet and Message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_readers.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 2b9a954567fc32eb6d43149c6fa996794450253d..52d5e7a61f5464548d7bf8f891fbbbe1260ee0f4 100644
--- a/ipc/mojo/ipc_channel_mojo_unittest.cc
+++ b/ipc/mojo/ipc_channel_mojo_unittest.cc
@@ -281,10 +281,11 @@ class ListenerThatExpectsFile : public IPC::Listener {
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
PickleIterator iter(message);
- base::FileDescriptor desc;
- EXPECT_TRUE(message.ReadFileDescriptor(&iter, &desc));
+
+ base::ScopedFD fd;
+ EXPECT_TRUE(message.ReadFile(&iter, &fd));
+ base::File file(fd.release());
std::string content(GetSendingFileContent().size(), ' ');
- base::File file(desc.fd);
file.Read(0, &content[0], content.size());
EXPECT_EQ(content, GetSendingFileContent());
base::MessageLoop::current()->Quit();
@@ -313,8 +314,7 @@ class ListenerThatExpectsFile : public IPC::Listener {
file.Flush();
IPC::Message* message = new IPC::Message(
0, 2, IPC::Message::PRIORITY_NORMAL);
- message->WriteFileDescriptor(
- base::FileDescriptor(file.TakePlatformFile(), false));
+ message->WriteFile(base::ScopedFD(file.TakePlatformFile()));
ASSERT_TRUE(sender->Send(message));
}
« no previous file with comments | « ipc/mojo/ipc_channel_mojo_readers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698