OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/handle_table.h" | 5 #include "mojo/edk/system/handle_table.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "mojo/edk/system/configuration.h" | 11 #include "mojo/edk/system/configuration.h" |
12 #include "mojo/edk/system/dispatcher.h" | 12 #include "mojo/edk/system/dispatcher.h" |
| 13 #include "mojo/edk/system/handle_transport.h" |
13 | 14 |
14 using mojo::util::RefPtr; | 15 using mojo::util::RefPtr; |
15 | 16 |
16 namespace mojo { | 17 namespace mojo { |
17 namespace system { | 18 namespace system { |
18 | 19 |
19 HandleTable::Entry::Entry() : busy(false) { | 20 HandleTable::Entry::Entry() : busy(false) {} |
20 } | |
21 | 21 |
22 HandleTable::Entry::Entry(Handle&& handle) | 22 HandleTable::Entry::Entry(Handle&& handle) |
23 : handle(std::move(handle)), busy(false) {} | 23 : handle(std::move(handle)), busy(false) {} |
24 | 24 |
25 HandleTable::Entry::~Entry() { | 25 HandleTable::Entry::~Entry() { |
26 DCHECK(!busy); | 26 DCHECK(!busy); |
27 } | 27 } |
28 | 28 |
29 HandleTable::HandleTable(size_t max_handle_table_size) | 29 HandleTable::HandleTable(size_t max_handle_table_size) |
30 : max_handle_table_size_(max_handle_table_size), | 30 : max_handle_table_size_(max_handle_table_size), |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 for (uint32_t i = 0; i < num_handles; i++) { | 241 for (uint32_t i = 0; i < num_handles; i++) { |
242 HandleToEntryMap::iterator it = handle_to_entry_map_.find(handle_values[i]); | 242 HandleToEntryMap::iterator it = handle_to_entry_map_.find(handle_values[i]); |
243 DCHECK(it != handle_to_entry_map_.end()); | 243 DCHECK(it != handle_to_entry_map_.end()); |
244 DCHECK(it->second.busy); | 244 DCHECK(it->second.busy); |
245 it->second.busy = false; | 245 it->second.busy = false; |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 } // namespace system | 249 } // namespace system |
250 } // namespace mojo | 250 } // namespace mojo |
OLD | NEW |