| 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 353 |
| 354 MojoResult Core::WriteData(MojoHandle data_pipe_producer_handle, | 354 MojoResult Core::WriteData(MojoHandle data_pipe_producer_handle, |
| 355 UserPointer<const void> elements, | 355 UserPointer<const void> elements, |
| 356 UserPointer<uint32_t> num_bytes, | 356 UserPointer<uint32_t> num_bytes, |
| 357 MojoWriteDataFlags flags) { | 357 MojoWriteDataFlags flags) { |
| 358 scoped_refptr<Dispatcher> dispatcher( | 358 scoped_refptr<Dispatcher> dispatcher( |
| 359 GetDispatcher(data_pipe_producer_handle)); | 359 GetDispatcher(data_pipe_producer_handle)); |
| 360 if (!dispatcher) | 360 if (!dispatcher) |
| 361 return MOJO_RESULT_INVALID_ARGUMENT; | 361 return MOJO_RESULT_INVALID_ARGUMENT; |
| 362 | 362 |
| 363 return dispatcher->WriteData(elements.GetPointerUnsafe(), | 363 return dispatcher->WriteData(elements, num_bytes, flags); |
| 364 num_bytes.GetPointerUnsafe(), flags); | |
| 365 } | 364 } |
| 366 | 365 |
| 367 MojoResult Core::BeginWriteData(MojoHandle data_pipe_producer_handle, | 366 MojoResult Core::BeginWriteData(MojoHandle data_pipe_producer_handle, |
| 368 UserPointer<void*> buffer, | 367 UserPointer<void*> buffer, |
| 369 UserPointer<uint32_t> buffer_num_bytes, | 368 UserPointer<uint32_t> buffer_num_bytes, |
| 370 MojoWriteDataFlags flags) { | 369 MojoWriteDataFlags flags) { |
| 371 scoped_refptr<Dispatcher> dispatcher( | 370 scoped_refptr<Dispatcher> dispatcher( |
| 372 GetDispatcher(data_pipe_producer_handle)); | 371 GetDispatcher(data_pipe_producer_handle)); |
| 373 if (!dispatcher) | 372 if (!dispatcher) |
| 374 return MOJO_RESULT_INVALID_ARGUMENT; | 373 return MOJO_RESULT_INVALID_ARGUMENT; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be | 555 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be |
| 557 // destroyed, but this would still be required if the waiter were in TLS.) | 556 // destroyed, but this would still be required if the waiter were in TLS.) |
| 558 for (i = 0; i < num_added; i++) | 557 for (i = 0; i < num_added; i++) |
| 559 dispatchers[i]->RemoveWaiter(&waiter); | 558 dispatchers[i]->RemoveWaiter(&waiter); |
| 560 | 559 |
| 561 return rv; | 560 return rv; |
| 562 } | 561 } |
| 563 | 562 |
| 564 } // namespace system | 563 } // namespace system |
| 565 } // namespace mojo | 564 } // namespace mojo |
| OLD | NEW |