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

Side by Side Diff: mojo/system/core.cc

Issue 417113010: Convert ReadData...() to use the new user pointer handling (see r285350). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | mojo/system/core_test_base.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/system/core.h" 5 #include "mojo/system/core.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 MojoResult Core::ReadData(MojoHandle data_pipe_consumer_handle, 389 MojoResult Core::ReadData(MojoHandle data_pipe_consumer_handle,
390 UserPointer<void> elements, 390 UserPointer<void> elements,
391 UserPointer<uint32_t> num_bytes, 391 UserPointer<uint32_t> num_bytes,
392 MojoReadDataFlags flags) { 392 MojoReadDataFlags flags) {
393 scoped_refptr<Dispatcher> dispatcher( 393 scoped_refptr<Dispatcher> dispatcher(
394 GetDispatcher(data_pipe_consumer_handle)); 394 GetDispatcher(data_pipe_consumer_handle));
395 if (!dispatcher) 395 if (!dispatcher)
396 return MOJO_RESULT_INVALID_ARGUMENT; 396 return MOJO_RESULT_INVALID_ARGUMENT;
397 397
398 return dispatcher->ReadData(elements.GetPointerUnsafe(), 398 return dispatcher->ReadData(elements, num_bytes, flags);
399 num_bytes.GetPointerUnsafe(), flags);
400 } 399 }
401 400
402 MojoResult Core::BeginReadData(MojoHandle data_pipe_consumer_handle, 401 MojoResult Core::BeginReadData(MojoHandle data_pipe_consumer_handle,
403 UserPointer<const void*> buffer, 402 UserPointer<const void*> buffer,
404 UserPointer<uint32_t> buffer_num_bytes, 403 UserPointer<uint32_t> buffer_num_bytes,
405 MojoReadDataFlags flags) { 404 MojoReadDataFlags flags) {
406 scoped_refptr<Dispatcher> dispatcher( 405 scoped_refptr<Dispatcher> dispatcher(
407 GetDispatcher(data_pipe_consumer_handle)); 406 GetDispatcher(data_pipe_consumer_handle));
408 if (!dispatcher) 407 if (!dispatcher)
409 return MOJO_RESULT_INVALID_ARGUMENT; 408 return MOJO_RESULT_INVALID_ARGUMENT;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be 556 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be
558 // destroyed, but this would still be required if the waiter were in TLS.) 557 // destroyed, but this would still be required if the waiter were in TLS.)
559 for (i = 0; i < num_added; i++) 558 for (i = 0; i < num_added; i++)
560 dispatchers[i]->RemoveWaiter(&waiter); 559 dispatchers[i]->RemoveWaiter(&waiter);
561 560
562 return rv; 561 return rv;
563 } 562 }
564 563
565 } // namespace system 564 } // namespace system
566 } // namespace mojo 565 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/system/core_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698