| 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_EDK_SYSTEM_CORE_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CORE_H_ |
| 6 #define MOJO_EDK_SYSTEM_CORE_H_ | 6 #define MOJO_EDK_SYSTEM_CORE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/synchronization/lock.h" |
| 13 #include "mojo/edk/system/handle_table.h" | 14 #include "mojo/edk/system/handle_table.h" |
| 14 #include "mojo/edk/system/mapping_table.h" | 15 #include "mojo/edk/system/mapping_table.h" |
| 15 #include "mojo/edk/system/memory.h" | 16 #include "mojo/edk/system/memory.h" |
| 16 #include "mojo/edk/system/mutex.h" | |
| 17 #include "mojo/edk/system/system_impl_export.h" | 17 #include "mojo/edk/system/system_impl_export.h" |
| 18 #include "mojo/public/c/system/buffer.h" | 18 #include "mojo/public/c/system/buffer.h" |
| 19 #include "mojo/public/c/system/data_pipe.h" | 19 #include "mojo/public/c/system/data_pipe.h" |
| 20 #include "mojo/public/c/system/message_pipe.h" | 20 #include "mojo/public/c/system/message_pipe.h" |
| 21 #include "mojo/public/c/system/types.h" | 21 #include "mojo/public/c/system/types.h" |
| 22 #include "mojo/public/cpp/system/macros.h" | 22 #include "mojo/public/cpp/system/macros.h" |
| 23 | 23 |
| 24 namespace mojo { | 24 namespace mojo { |
| 25 | 25 |
| 26 namespace embedder { | 26 namespace embedder { |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // preinitialized to |static_cast<uint32_t>(-1)|. | 168 // preinitialized to |static_cast<uint32_t>(-1)|. |
| 169 MojoResult WaitManyInternal(const MojoHandle* handles, | 169 MojoResult WaitManyInternal(const MojoHandle* handles, |
| 170 const MojoHandleSignals* signals, | 170 const MojoHandleSignals* signals, |
| 171 uint32_t num_handles, | 171 uint32_t num_handles, |
| 172 MojoDeadline deadline, | 172 MojoDeadline deadline, |
| 173 uint32_t* result_index, | 173 uint32_t* result_index, |
| 174 HandleSignalsState* signals_states); | 174 HandleSignalsState* signals_states); |
| 175 | 175 |
| 176 embedder::PlatformSupport* const platform_support_; | 176 embedder::PlatformSupport* const platform_support_; |
| 177 | 177 |
| 178 // TODO(vtl): |handle_table_mutex_| should be a reader-writer lock (if only we | 178 // TODO(vtl): |handle_table_lock_| should be a reader-writer lock (if only we |
| 179 // had them). | 179 // had them). |
| 180 Mutex handle_table_mutex_; | 180 base::Lock handle_table_lock_; // Protects |handle_table_|. |
| 181 HandleTable handle_table_ MOJO_GUARDED_BY(handle_table_mutex_); | 181 HandleTable handle_table_; |
| 182 | 182 |
| 183 Mutex mapping_table_mutex_; | 183 base::Lock mapping_table_lock_; // Protects |mapping_table_|. |
| 184 MappingTable mapping_table_ MOJO_GUARDED_BY(mapping_table_mutex_); | 184 MappingTable mapping_table_; |
| 185 | 185 |
| 186 MOJO_DISALLOW_COPY_AND_ASSIGN(Core); | 186 MOJO_DISALLOW_COPY_AND_ASSIGN(Core); |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace system | 189 } // namespace system |
| 190 } // namespace mojo | 190 } // namespace mojo |
| 191 | 191 |
| 192 #endif // MOJO_EDK_SYSTEM_CORE_H_ | 192 #endif // MOJO_EDK_SYSTEM_CORE_H_ |
| OLD | NEW |