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

Side by Side Diff: ipc/mojo/ipc_channel_mojo_readers.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 unified diff | Download patch
« no previous file with comments | « ipc/mojo/ipc_channel_mojo.cc ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/mojo/ipc_channel_mojo_readers.h" 5 #include "ipc/mojo/ipc_channel_mojo_readers.h"
6 6
7 #include "ipc/mojo/ipc_channel_mojo.h" 7 #include "ipc/mojo/ipc_channel_mojo.h"
8 #include "mojo/embedder/embedder.h" 8 #include "mojo/embedder/embedder.h"
9 9
10 #if defined(OS_POSIX) && !defined(OS_NACL) 10 #if defined(OS_POSIX) && !defined(OS_NACL)
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 owner_->OnPipeError(this); 131 owner_->OnPipeError(this);
132 } 132 }
133 133
134 bool MessageReader::Send(scoped_ptr<Message> message) { 134 bool MessageReader::Send(scoped_ptr<Message> message) {
135 DCHECK(IsValid()); 135 DCHECK(IsValid());
136 136
137 message->TraceMessageBegin(); 137 message->TraceMessageBegin();
138 std::vector<MojoHandle> handles; 138 std::vector<MojoHandle> handles;
139 #if defined(OS_POSIX) && !defined(OS_NACL) 139 #if defined(OS_POSIX) && !defined(OS_NACL)
140 MojoResult read_result = 140 MojoResult read_result =
141 ChannelMojo::ReadFromFileDescriptorSet(*message, &handles); 141 ChannelMojo::ReadFromFileDescriptorSet(message.get(), &handles);
142 if (read_result != MOJO_RESULT_OK) { 142 if (read_result != MOJO_RESULT_OK) {
143 std::for_each(handles.begin(), handles.end(), &MojoClose); 143 std::for_each(handles.begin(), handles.end(), &MojoClose);
144 CloseWithError(read_result); 144 CloseWithError(read_result);
145 return false; 145 return false;
146 } 146 }
147 #endif 147 #endif
148 MojoResult write_result = 148 MojoResult write_result =
149 MojoWriteMessage(handle(), 149 MojoWriteMessage(handle(),
150 message->data(), 150 message->data(),
151 static_cast<uint32>(message->size()), 151 static_cast<uint32>(message->size()),
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 MojoResult result = RespondHelloRequest(handle_buffer[0]); 313 MojoResult result = RespondHelloRequest(handle_buffer[0]);
314 if (result != MOJO_RESULT_OK) { 314 if (result != MOJO_RESULT_OK) {
315 DLOG(ERROR) << "Failed to respond Hello request. Closing: " << result; 315 DLOG(ERROR) << "Failed to respond Hello request. Closing: " << result;
316 CloseWithError(result); 316 CloseWithError(result);
317 } 317 }
318 } 318 }
319 319
320 } // namespace internal 320 } // namespace internal
321 } // namespace IPC 321 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/mojo/ipc_channel_mojo.cc ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698