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

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

Issue 1856113002: EDK: Add implementation of data pipe consumer read threshold stuff. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/edk/system/core_unittest.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/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
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
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
OLDNEW
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/edk/system/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698