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

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

Issue 416203002: Convert BeginReadData...() to use the new user pointer handling (see r285350). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 405
406 MojoResult Core::BeginReadData(MojoHandle data_pipe_consumer_handle, 406 MojoResult Core::BeginReadData(MojoHandle data_pipe_consumer_handle,
407 UserPointer<const void*> buffer, 407 UserPointer<const void*> buffer,
408 UserPointer<uint32_t> buffer_num_bytes, 408 UserPointer<uint32_t> buffer_num_bytes,
409 MojoReadDataFlags flags) { 409 MojoReadDataFlags flags) {
410 scoped_refptr<Dispatcher> dispatcher( 410 scoped_refptr<Dispatcher> dispatcher(
411 GetDispatcher(data_pipe_consumer_handle)); 411 GetDispatcher(data_pipe_consumer_handle));
412 if (!dispatcher) 412 if (!dispatcher)
413 return MOJO_RESULT_INVALID_ARGUMENT; 413 return MOJO_RESULT_INVALID_ARGUMENT;
414 414
415 return dispatcher->BeginReadData(buffer.GetPointerUnsafe(), 415 return dispatcher->BeginReadData(buffer, buffer_num_bytes, flags);
416 buffer_num_bytes.GetPointerUnsafe(), flags);
417 } 416 }
418 417
419 MojoResult Core::EndReadData(MojoHandle data_pipe_consumer_handle, 418 MojoResult Core::EndReadData(MojoHandle data_pipe_consumer_handle,
420 uint32_t num_bytes_read) { 419 uint32_t num_bytes_read) {
421 scoped_refptr<Dispatcher> dispatcher( 420 scoped_refptr<Dispatcher> dispatcher(
422 GetDispatcher(data_pipe_consumer_handle)); 421 GetDispatcher(data_pipe_consumer_handle));
423 if (!dispatcher) 422 if (!dispatcher)
424 return MOJO_RESULT_INVALID_ARGUMENT; 423 return MOJO_RESULT_INVALID_ARGUMENT;
425 424
426 return dispatcher->EndReadData(num_bytes_read); 425 return dispatcher->EndReadData(num_bytes_read);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be 561 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be
563 // destroyed, but this would still be required if the waiter were in TLS.) 562 // destroyed, but this would still be required if the waiter were in TLS.)
564 for (i = 0; i < num_added; i++) 563 for (i = 0; i < num_added; i++)
565 dispatchers[i]->RemoveWaiter(&waiter); 564 dispatchers[i]->RemoveWaiter(&waiter);
566 565
567 return rv; 566 return rv;
568 } 567 }
569 568
570 } // namespace system 569 } // namespace system
571 } // namespace mojo 570 } // 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