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

Side by Side Diff: mojo/edk/system/endpoint_relayer.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/dispatcher.cc ('k') | mojo/edk/system/endpoint_relayer.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_ENDPOINT_RELAYER_H_ 5 #ifndef MOJO_EDK_SYSTEM_ENDPOINT_RELAYER_H_
6 #define MOJO_EDK_SYSTEM_ENDPOINT_RELAYER_H_ 6 #define MOJO_EDK_SYSTEM_ENDPOINT_RELAYER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "mojo/edk/system/channel_endpoint_client.h" 10 #include "mojo/edk/system/channel_endpoint_client.h"
11 #include "mojo/edk/system/mutex.h" 11 #include "mojo/edk/util/mutex.h"
12 #include "mojo/edk/util/ref_ptr.h" 12 #include "mojo/edk/util/ref_ptr.h"
13 #include "mojo/edk/util/thread_annotations.h"
13 #include "mojo/public/cpp/system/macros.h" 14 #include "mojo/public/cpp/system/macros.h"
14 15
15 namespace mojo { 16 namespace mojo {
16 namespace system { 17 namespace system {
17 18
18 class ChannelEndpoint; 19 class ChannelEndpoint;
19 20
20 // This is a simple |ChannelEndpointClient| that just relays messages between 21 // This is a simple |ChannelEndpointClient| that just relays messages between
21 // two |ChannelEndpoint|s (without the overhead of |MessagePipe|). 22 // two |ChannelEndpoint|s (without the overhead of |MessagePipe|).
22 class EndpointRelayer final : public ChannelEndpointClient { 23 class EndpointRelayer final : public ChannelEndpointClient {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // |ChannelEndpointClient| methods: 78 // |ChannelEndpointClient| methods:
78 bool OnReadMessage(unsigned port, MessageInTransit* message) override; 79 bool OnReadMessage(unsigned port, MessageInTransit* message) override;
79 void OnDetachFromChannel(unsigned port) override; 80 void OnDetachFromChannel(unsigned port) override;
80 81
81 private: 82 private:
82 FRIEND_MAKE_REF_COUNTED(EndpointRelayer); 83 FRIEND_MAKE_REF_COUNTED(EndpointRelayer);
83 84
84 EndpointRelayer(); 85 EndpointRelayer();
85 ~EndpointRelayer() override; 86 ~EndpointRelayer() override;
86 87
87 Mutex mutex_; 88 util::Mutex mutex_;
88 util::RefPtr<ChannelEndpoint> endpoints_[2] MOJO_GUARDED_BY(mutex_); 89 util::RefPtr<ChannelEndpoint> endpoints_[2] MOJO_GUARDED_BY(mutex_);
89 std::unique_ptr<Filter> filter_ MOJO_GUARDED_BY(mutex_); 90 std::unique_ptr<Filter> filter_ MOJO_GUARDED_BY(mutex_);
90 91
91 MOJO_DISALLOW_COPY_AND_ASSIGN(EndpointRelayer); 92 MOJO_DISALLOW_COPY_AND_ASSIGN(EndpointRelayer);
92 }; 93 };
93 94
94 } // namespace system 95 } // namespace system
95 } // namespace mojo 96 } // namespace mojo
96 97
97 #endif // MOJO_EDK_SYSTEM_ENDPOINT_RELAYER_H_ 98 #endif // MOJO_EDK_SYSTEM_ENDPOINT_RELAYER_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/dispatcher.cc ('k') | mojo/edk/system/endpoint_relayer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698