Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Side by Side Diff: mojo/system/handle_table.cc

Issue 231353002: Make mojo_system static and mojo_system_impl a component, never use both (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the mac loader path dependencies Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/system/handle_table.h ('k') | mojo/system/mapping_table.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/system/handle_table.h" 5 #include "mojo/system/handle_table.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "mojo/system/constants.h" 9 #include "mojo/system/constants.h"
10 #include "mojo/system/dispatcher.h" 10 #include "mojo/system/dispatcher.h"
(...skipping 13 matching lines...) Expand all
24 HandleTable::Entry::~Entry() { 24 HandleTable::Entry::~Entry() {
25 DCHECK(!busy); 25 DCHECK(!busy);
26 } 26 }
27 27
28 HandleTable::HandleTable() 28 HandleTable::HandleTable()
29 : next_handle_(MOJO_HANDLE_INVALID + 1) { 29 : next_handle_(MOJO_HANDLE_INVALID + 1) {
30 } 30 }
31 31
32 HandleTable::~HandleTable() { 32 HandleTable::~HandleTable() {
33 // This should usually not be reached (the only instance should be owned by 33 // This should usually not be reached (the only instance should be owned by
34 // the singleton |CoreImpl|, which lives forever), except in tests. 34 // the singleton |Core|, which lives forever), except in tests.
35 } 35 }
36 36
37 Dispatcher* HandleTable::GetDispatcher(MojoHandle handle) { 37 Dispatcher* HandleTable::GetDispatcher(MojoHandle handle) {
38 DCHECK_NE(handle, MOJO_HANDLE_INVALID); 38 DCHECK_NE(handle, MOJO_HANDLE_INVALID);
39 39
40 HandleToEntryMap::iterator it = handle_to_entry_map_.find(handle); 40 HandleToEntryMap::iterator it = handle_to_entry_map_.find(handle);
41 if (it == handle_to_entry_map_.end()) 41 if (it == handle_to_entry_map_.end())
42 return NULL; 42 return NULL;
43 return it->second.dispatcher; 43 return it->second.dispatcher;
44 } 44 }
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 for (uint32_t i = 0; i < num_handles; i++) { 228 for (uint32_t i = 0; i < num_handles; i++) {
229 HandleToEntryMap::iterator it = handle_to_entry_map_.find(handles[i]); 229 HandleToEntryMap::iterator it = handle_to_entry_map_.find(handles[i]);
230 DCHECK(it != handle_to_entry_map_.end()); 230 DCHECK(it != handle_to_entry_map_.end());
231 DCHECK(it->second.busy); 231 DCHECK(it->second.busy);
232 it->second.busy = false; 232 it->second.busy = false;
233 } 233 }
234 } 234 }
235 235
236 } // namespace system 236 } // namespace system
237 } // namespace mojo 237 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/handle_table.h ('k') | mojo/system/mapping_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698