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

Side by Side Diff: ipc/ipc_channel_nacl.cc

Issue 1206093002: Update ChannelReader to use AttachmentBroker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachment_broker3_listener
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ipc_channel_nacl.h" 5 #include "ipc/ipc_channel_nacl.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 10
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 // the code simple). 343 // the code simple).
344 std::copy(vec->begin(), vec->begin() + bytes_to_read, 344 std::copy(vec->begin(), vec->begin() + bytes_to_read,
345 buffer + *bytes_read); 345 buffer + *bytes_read);
346 vec->erase(vec->begin(), vec->begin() + bytes_to_read); 346 vec->erase(vec->begin(), vec->begin() + bytes_to_read);
347 *bytes_read += bytes_to_read; 347 *bytes_read += bytes_to_read;
348 } 348 }
349 } 349 }
350 return READ_SUCCEEDED; 350 return READ_SUCCEEDED;
351 } 351 }
352 352
353 bool ChannelNacl::WillDispatchInputMessage(Message* msg) { 353 bool ChannelNacl::ShouldDispatchInputMessage(Message* msg) {
354 return true;
355 }
356
357 bool ChannelNacl::GetNonBrokeredAttachments(Message* msg) {
354 uint16 header_fds = msg->header()->num_fds; 358 uint16 header_fds = msg->header()->num_fds;
355 CHECK(header_fds == input_fds_.size()); 359 CHECK(header_fds == input_fds_.size());
356 if (header_fds == 0) 360 if (header_fds == 0)
357 return true; // Nothing to do. 361 return true; // Nothing to do.
358 362
359 // The shenaniganery below with &foo.front() requires input_fds_ to have 363 // The shenaniganery below with &foo.front() requires input_fds_ to have
360 // contiguous underlying storage (such as a simple array or a std::vector). 364 // contiguous underlying storage (such as a simple array or a std::vector).
361 // This is why the header warns not to make input_fds_ a deque<>. 365 // This is why the header warns not to make input_fds_ a deque<>.
362 msg->attachment_set()->AddDescriptorsToOwn(&input_fds_.front(), header_fds); 366 msg->attachment_set()->AddDescriptorsToOwn(&input_fds_.front(), header_fds);
363 input_fds_.clear(); 367 input_fds_.clear();
(...skipping 16 matching lines...) Expand all
380 // static 384 // static
381 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle, 385 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle,
382 Mode mode, 386 Mode mode,
383 Listener* listener, 387 Listener* listener,
384 AttachmentBroker* broker) { 388 AttachmentBroker* broker) {
385 return scoped_ptr<Channel>( 389 return scoped_ptr<Channel>(
386 new ChannelNacl(channel_handle, mode, listener, broker)); 390 new ChannelNacl(channel_handle, mode, listener, broker));
387 } 391 }
388 392
389 } // namespace IPC 393 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698