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

Side by Side Diff: mojo/edk/system/handle_table.h

Issue 1154903003: "typedef Foo Bar" -> "using Bar = Foo" in //mojo/edk/.... (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
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 #ifndef MOJO_EDK_SYSTEM_HANDLE_TABLE_H_ 5 #ifndef MOJO_EDK_SYSTEM_HANDLE_TABLE_H_
6 #define MOJO_EDK_SYSTEM_HANDLE_TABLE_H_ 6 #define MOJO_EDK_SYSTEM_HANDLE_TABLE_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/containers/hash_tables.h" 11 #include "base/containers/hash_tables.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "mojo/edk/system/system_impl_export.h" 14 #include "mojo/edk/system/system_impl_export.h"
15 #include "mojo/public/c/system/types.h" 15 #include "mojo/public/c/system/types.h"
16 16
17 namespace mojo { 17 namespace mojo {
18 namespace system { 18 namespace system {
19 19
20 class Core; 20 class Core;
21 class Dispatcher; 21 class Dispatcher;
22 class DispatcherTransport; 22 class DispatcherTransport;
23 23
24 typedef std::vector<scoped_refptr<Dispatcher>> DispatcherVector; 24 using DispatcherVector = std::vector<scoped_refptr<Dispatcher>>;
25 25
26 // Test-only function (defined/used in embedder/test_embedder.cc). Declared here 26 // Test-only function (defined/used in embedder/test_embedder.cc). Declared here
27 // so it can be friended. 27 // so it can be friended.
28 namespace internal { 28 namespace internal {
29 bool ShutdownCheckNoLeaks(Core*); 29 bool ShutdownCheckNoLeaks(Core*);
30 } 30 }
31 31
32 // This class provides the (global) handle table (owned by |Core|), which maps 32 // This class provides the (global) handle table (owned by |Core|), which maps
33 // (valid) |MojoHandle|s to |Dispatcher|s. This is abstracted so that, e.g., 33 // (valid) |MojoHandle|s to |Dispatcher|s. This is abstracted so that, e.g.,
34 // caching may be added. 34 // caching may be added.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // This prevents |Core::WriteMessage()| from sending a handle that has been 119 // This prevents |Core::WriteMessage()| from sending a handle that has been
120 // closed (or learning about this too late). 120 // closed (or learning about this too late).
121 struct Entry { 121 struct Entry {
122 Entry(); 122 Entry();
123 explicit Entry(const scoped_refptr<Dispatcher>& dispatcher); 123 explicit Entry(const scoped_refptr<Dispatcher>& dispatcher);
124 ~Entry(); 124 ~Entry();
125 125
126 scoped_refptr<Dispatcher> dispatcher; 126 scoped_refptr<Dispatcher> dispatcher;
127 bool busy; 127 bool busy;
128 }; 128 };
129 typedef base::hash_map<MojoHandle, Entry> HandleToEntryMap; 129 using HandleToEntryMap = base::hash_map<MojoHandle, Entry>;
130 130
131 // Adds the given dispatcher to the handle table, not doing any size checks. 131 // Adds the given dispatcher to the handle table, not doing any size checks.
132 MojoHandle AddDispatcherNoSizeCheck( 132 MojoHandle AddDispatcherNoSizeCheck(
133 const scoped_refptr<Dispatcher>& dispatcher); 133 const scoped_refptr<Dispatcher>& dispatcher);
134 134
135 HandleToEntryMap handle_to_entry_map_; 135 HandleToEntryMap handle_to_entry_map_;
136 MojoHandle next_handle_; // Invariant: never |MOJO_HANDLE_INVALID|. 136 MojoHandle next_handle_; // Invariant: never |MOJO_HANDLE_INVALID|.
137 137
138 DISALLOW_COPY_AND_ASSIGN(HandleTable); 138 DISALLOW_COPY_AND_ASSIGN(HandleTable);
139 }; 139 };
140 140
141 } // namespace system 141 } // namespace system
142 } // namespace mojo 142 } // namespace mojo
143 143
144 #endif // MOJO_EDK_SYSTEM_HANDLE_TABLE_H_ 144 #endif // MOJO_EDK_SYSTEM_HANDLE_TABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698