| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |