| 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 #ifndef MOJO_SYSTEM_CORE_H_ | 5 #ifndef MOJO_SYSTEM_CORE_H_ |
| 6 #define MOJO_SYSTEM_CORE_H_ | 6 #define MOJO_SYSTEM_CORE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 uint64_t offset, | 101 uint64_t offset, |
| 102 uint64_t num_bytes, | 102 uint64_t num_bytes, |
| 103 UserPointer<void*> buffer, | 103 UserPointer<void*> buffer, |
| 104 MojoMapBufferFlags flags); | 104 MojoMapBufferFlags flags); |
| 105 MojoResult UnmapBuffer(UserPointerValue<void> buffer); | 105 MojoResult UnmapBuffer(UserPointerValue<void> buffer); |
| 106 | 106 |
| 107 private: | 107 private: |
| 108 friend bool internal::ShutdownCheckNoLeaks(Core*); | 108 friend bool internal::ShutdownCheckNoLeaks(Core*); |
| 109 | 109 |
| 110 // Internal implementation of |Wait()| and |WaitMany()|; doesn't do basic | 110 // Internal implementation of |Wait()| and |WaitMany()|; doesn't do basic |
| 111 // validation of arguments. | 111 // validation of arguments. |*result_index| is only set if the result (whether |
| 112 // success or failure) applies to a specific handle, so its value should be |
| 113 // preinitialized to |static_cast<uint32_t>(-1)|. |
| 112 MojoResult WaitManyInternal(const MojoHandle* handles, | 114 MojoResult WaitManyInternal(const MojoHandle* handles, |
| 113 const MojoHandleSignals* signals, | 115 const MojoHandleSignals* signals, |
| 114 uint32_t num_handles, | 116 uint32_t num_handles, |
| 115 MojoDeadline deadline); | 117 MojoDeadline deadline, |
| 118 uint32_t* result_index); |
| 116 | 119 |
| 117 // --------------------------------------------------------------------------- | 120 // --------------------------------------------------------------------------- |
| 118 | 121 |
| 119 // TODO(vtl): |handle_table_lock_| should be a reader-writer lock (if only we | 122 // TODO(vtl): |handle_table_lock_| should be a reader-writer lock (if only we |
| 120 // had them). | 123 // had them). |
| 121 base::Lock handle_table_lock_; // Protects |handle_table_|. | 124 base::Lock handle_table_lock_; // Protects |handle_table_|. |
| 122 HandleTable handle_table_; | 125 HandleTable handle_table_; |
| 123 | 126 |
| 124 base::Lock mapping_table_lock_; // Protects |mapping_table_|. | 127 base::Lock mapping_table_lock_; // Protects |mapping_table_|. |
| 125 MappingTable mapping_table_; | 128 MappingTable mapping_table_; |
| 126 | 129 |
| 127 // --------------------------------------------------------------------------- | 130 // --------------------------------------------------------------------------- |
| 128 | 131 |
| 129 DISALLOW_COPY_AND_ASSIGN(Core); | 132 DISALLOW_COPY_AND_ASSIGN(Core); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace system | 135 } // namespace system |
| 133 } // namespace mojo | 136 } // namespace mojo |
| 134 | 137 |
| 135 #endif // MOJO_SYSTEM_CORE_H_ | 138 #endif // MOJO_SYSTEM_CORE_H_ |
| OLD | NEW |