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

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

Issue 1426343002: EDK: Move mutex.*, cond_var.*, and thread_annotations.h to //mojo/edk/util. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oops Created 5 years, 1 month 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
« no previous file with comments | « mojo/edk/system/channel_endpoint.cc ('k') | mojo/edk/system/channel_manager.cc » ('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 #ifndef MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_ 5 #ifndef MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_
6 #define MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_ 6 #define MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <unordered_map> 10 #include <unordered_map>
11 11
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "mojo/edk/embedder/platform_task_runner.h" 13 #include "mojo/edk/embedder/platform_task_runner.h"
14 #include "mojo/edk/embedder/scoped_platform_handle.h" 14 #include "mojo/edk/embedder/scoped_platform_handle.h"
15 #include "mojo/edk/system/channel_id.h" 15 #include "mojo/edk/system/channel_id.h"
16 #include "mojo/edk/system/mutex.h" 16 #include "mojo/edk/util/mutex.h"
17 #include "mojo/edk/util/ref_ptr.h" 17 #include "mojo/edk/util/ref_ptr.h"
18 #include "mojo/edk/util/thread_annotations.h"
18 #include "mojo/public/cpp/system/macros.h" 19 #include "mojo/public/cpp/system/macros.h"
19 20
20 namespace base { 21 namespace base {
21 class TaskRunner; 22 class TaskRunner;
22 } 23 }
23 24
24 namespace mojo { 25 namespace mojo {
25 26
26 namespace embedder { 27 namespace embedder {
27 class PlatformSupport; 28 class PlatformSupport;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 146
146 // Note: These must not be used after shutdown. 147 // Note: These must not be used after shutdown.
147 embedder::PlatformSupport* const platform_support_; 148 embedder::PlatformSupport* const platform_support_;
148 const embedder::PlatformTaskRunnerRefPtr io_thread_task_runner_; 149 const embedder::PlatformTaskRunnerRefPtr io_thread_task_runner_;
149 ConnectionManager* const connection_manager_; 150 ConnectionManager* const connection_manager_;
150 151
151 // Note: |Channel| methods should not be called under |mutex_|. 152 // Note: |Channel| methods should not be called under |mutex_|.
152 // TODO(vtl): Annotate the above rule using |MOJO_ACQUIRED_{BEFORE,AFTER}()|, 153 // TODO(vtl): Annotate the above rule using |MOJO_ACQUIRED_{BEFORE,AFTER}()|,
153 // once clang actually checks such annotations. 154 // once clang actually checks such annotations.
154 // https://github.com/domokit/mojo/issues/313 155 // https://github.com/domokit/mojo/issues/313
155 mutable Mutex mutex_; 156 mutable util::Mutex mutex_;
156 157
157 using ChannelIdToChannelMap = 158 using ChannelIdToChannelMap =
158 std::unordered_map<ChannelId, util::RefPtr<Channel>>; 159 std::unordered_map<ChannelId, util::RefPtr<Channel>>;
159 ChannelIdToChannelMap channels_ MOJO_GUARDED_BY(mutex_); 160 ChannelIdToChannelMap channels_ MOJO_GUARDED_BY(mutex_);
160 161
161 MOJO_DISALLOW_COPY_AND_ASSIGN(ChannelManager); 162 MOJO_DISALLOW_COPY_AND_ASSIGN(ChannelManager);
162 }; 163 };
163 164
164 } // namespace system 165 } // namespace system
165 } // namespace mojo 166 } // namespace mojo
166 167
167 #endif // MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_ 168 #endif // MOJO_EDK_SYSTEM_CHANNEL_MANAGER_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/channel_endpoint.cc ('k') | mojo/edk/system/channel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698