| 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/edk/system/core.h" | 5 #include "mojo/edk/system/core.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 MojoResult Core::EndWriteData(MojoHandle data_pipe_producer_handle, | 432 MojoResult Core::EndWriteData(MojoHandle data_pipe_producer_handle, |
| 433 uint32_t num_bytes_written) { | 433 uint32_t num_bytes_written) { |
| 434 RefPtr<Dispatcher> dispatcher; | 434 RefPtr<Dispatcher> dispatcher; |
| 435 MojoResult result = GetDispatcher(data_pipe_producer_handle, &dispatcher); | 435 MojoResult result = GetDispatcher(data_pipe_producer_handle, &dispatcher); |
| 436 if (result != MOJO_RESULT_OK) | 436 if (result != MOJO_RESULT_OK) |
| 437 return result; | 437 return result; |
| 438 | 438 |
| 439 return dispatcher->EndWriteData(num_bytes_written); | 439 return dispatcher->EndWriteData(num_bytes_written); |
| 440 } | 440 } |
| 441 | 441 |
| 442 MojoResult Core::SetDataPipeConsumerOptions( |
| 443 MojoHandle data_pipe_consumer_handle, |
| 444 UserPointer<const MojoDataPipeConsumerOptions> options) { |
| 445 RefPtr<Dispatcher> dispatcher; |
| 446 MojoResult result = GetDispatcher(data_pipe_consumer_handle, &dispatcher); |
| 447 if (result != MOJO_RESULT_OK) |
| 448 return result; |
| 449 |
| 450 return dispatcher->SetDataPipeConsumerOptions(options); |
| 451 } |
| 452 |
| 453 MojoResult Core::GetDataPipeConsumerOptions( |
| 454 MojoHandle data_pipe_consumer_handle, |
| 455 UserPointer<MojoDataPipeConsumerOptions> options, |
| 456 uint32_t options_num_bytes) { |
| 457 RefPtr<Dispatcher> dispatcher; |
| 458 MojoResult result = GetDispatcher(data_pipe_consumer_handle, &dispatcher); |
| 459 if (result != MOJO_RESULT_OK) |
| 460 return result; |
| 461 |
| 462 return dispatcher->GetDataPipeConsumerOptions(options, options_num_bytes); |
| 463 } |
| 464 |
| 442 MojoResult Core::ReadData(MojoHandle data_pipe_consumer_handle, | 465 MojoResult Core::ReadData(MojoHandle data_pipe_consumer_handle, |
| 443 UserPointer<void> elements, | 466 UserPointer<void> elements, |
| 444 UserPointer<uint32_t> num_bytes, | 467 UserPointer<uint32_t> num_bytes, |
| 445 MojoReadDataFlags flags) { | 468 MojoReadDataFlags flags) { |
| 446 RefPtr<Dispatcher> dispatcher; | 469 RefPtr<Dispatcher> dispatcher; |
| 447 MojoResult result = GetDispatcher(data_pipe_consumer_handle, &dispatcher); | 470 MojoResult result = GetDispatcher(data_pipe_consumer_handle, &dispatcher); |
| 448 if (result != MOJO_RESULT_OK) | 471 if (result != MOJO_RESULT_OK) |
| 449 return result; | 472 return result; |
| 450 | 473 |
| 451 return dispatcher->ReadData(elements, num_bytes, flags); | 474 return dispatcher->ReadData(elements, num_bytes, flags); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 if (signals_states) { | 659 if (signals_states) { |
| 637 for (; i < num_handles; i++) | 660 for (; i < num_handles; i++) |
| 638 signals_states[i] = dispatchers[i]->GetHandleSignalsState(); | 661 signals_states[i] = dispatchers[i]->GetHandleSignalsState(); |
| 639 } | 662 } |
| 640 | 663 |
| 641 return result; | 664 return result; |
| 642 } | 665 } |
| 643 | 666 |
| 644 } // namespace system | 667 } // namespace system |
| 645 } // namespace mojo | 668 } // namespace mojo |
| OLD | NEW |