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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 base::AutoLock locker(mapping_table_lock_); | 493 base::AutoLock locker(mapping_table_lock_); |
494 result = mapping_table_.AddMapping(mapping.Pass()); | 494 result = mapping_table_.AddMapping(mapping.Pass()); |
495 } | 495 } |
496 if (result != MOJO_RESULT_OK) | 496 if (result != MOJO_RESULT_OK) |
497 return result; | 497 return result; |
498 | 498 |
499 buffer.Put(address); | 499 buffer.Put(address); |
500 return MOJO_RESULT_OK; | 500 return MOJO_RESULT_OK; |
501 } | 501 } |
502 | 502 |
503 MojoResult Core::UnmapBuffer(UserPointerValue<void> buffer) { | 503 MojoResult Core::UnmapBuffer(UserPointer<void> buffer) { |
504 base::AutoLock locker(mapping_table_lock_); | 504 base::AutoLock locker(mapping_table_lock_); |
505 return mapping_table_.RemoveMapping(buffer.GetValue()); | 505 return mapping_table_.RemoveMapping(buffer.GetPointerValue()); |
506 } | 506 } |
507 | 507 |
508 // Note: We allow |handles| to repeat the same handle multiple times, since | 508 // Note: We allow |handles| to repeat the same handle multiple times, since |
509 // different flags may be specified. | 509 // different flags may be specified. |
510 // TODO(vtl): This incurs a performance cost in |RemoveWaiter()|. Analyze this | 510 // TODO(vtl): This incurs a performance cost in |RemoveWaiter()|. Analyze this |
511 // more carefully and address it if necessary. | 511 // more carefully and address it if necessary. |
512 MojoResult Core::WaitManyInternal(const MojoHandle* handles, | 512 MojoResult Core::WaitManyInternal(const MojoHandle* handles, |
513 const MojoHandleSignals* signals, | 513 const MojoHandleSignals* signals, |
514 uint32_t num_handles, | 514 uint32_t num_handles, |
515 MojoDeadline deadline, | 515 MojoDeadline deadline, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be | 552 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be |
553 // destroyed, but this would still be required if the waiter were in TLS.) | 553 // destroyed, but this would still be required if the waiter were in TLS.) |
554 for (i = 0; i < num_added; i++) | 554 for (i = 0; i < num_added; i++) |
555 dispatchers[i]->RemoveWaiter(&waiter); | 555 dispatchers[i]->RemoveWaiter(&waiter); |
556 | 556 |
557 return rv; | 557 return rv; |
558 } | 558 } |
559 | 559 |
560 } // namespace system | 560 } // namespace system |
561 } // namespace mojo | 561 } // namespace mojo |
OLD | NEW |