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

Side by Side Diff: mojo/edk/system/test_channel_endpoint_client.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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_TEST_CHANNEL_ENDPOINT_CLIENT_H_ 5 #ifndef MOJO_EDK_SYSTEM_TEST_CHANNEL_ENDPOINT_CLIENT_H_
6 #define MOJO_EDK_SYSTEM_TEST_CHANNEL_ENDPOINT_CLIENT_H_ 6 #define MOJO_EDK_SYSTEM_TEST_CHANNEL_ENDPOINT_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "mojo/edk/system/channel_endpoint.h" 10 #include "mojo/edk/system/channel_endpoint.h"
11 #include "mojo/edk/system/channel_endpoint_client.h" 11 #include "mojo/edk/system/channel_endpoint_client.h"
12 #include "mojo/edk/system/message_in_transit_queue.h" 12 #include "mojo/edk/system/message_in_transit_queue.h"
13 #include "mojo/edk/system/mutex.h" 13 #include "mojo/edk/util/mutex.h"
14 #include "mojo/edk/util/ref_ptr.h" 14 #include "mojo/edk/util/ref_ptr.h"
15 #include "mojo/edk/util/thread_annotations.h"
15 #include "mojo/public/cpp/system/macros.h" 16 #include "mojo/public/cpp/system/macros.h"
16 17
17 namespace mojo { 18 namespace mojo {
18 namespace system { 19 namespace system {
19 20
20 class ManualResetWaitableEvent; 21 class ManualResetWaitableEvent;
21 22
22 namespace test { 23 namespace test {
23 24
24 class TestChannelEndpointClient final : public ChannelEndpointClient { 25 class TestChannelEndpointClient final : public ChannelEndpointClient {
(...skipping 20 matching lines...) Expand all
45 // |ChannelEndpointClient| implementation: 46 // |ChannelEndpointClient| implementation:
46 bool OnReadMessage(unsigned port, MessageInTransit* message) override; 47 bool OnReadMessage(unsigned port, MessageInTransit* message) override;
47 void OnDetachFromChannel(unsigned port) override; 48 void OnDetachFromChannel(unsigned port) override;
48 49
49 private: 50 private:
50 FRIEND_MAKE_REF_COUNTED(TestChannelEndpointClient); 51 FRIEND_MAKE_REF_COUNTED(TestChannelEndpointClient);
51 52
52 TestChannelEndpointClient(); 53 TestChannelEndpointClient();
53 ~TestChannelEndpointClient() override; 54 ~TestChannelEndpointClient() override;
54 55
55 mutable Mutex mutex_; 56 mutable util::Mutex mutex_;
56 57
57 unsigned port_ MOJO_GUARDED_BY(mutex_); 58 unsigned port_ MOJO_GUARDED_BY(mutex_);
58 util::RefPtr<ChannelEndpoint> endpoint_ MOJO_GUARDED_BY(mutex_); 59 util::RefPtr<ChannelEndpoint> endpoint_ MOJO_GUARDED_BY(mutex_);
59 60
60 MessageInTransitQueue messages_ MOJO_GUARDED_BY(mutex_); 61 MessageInTransitQueue messages_ MOJO_GUARDED_BY(mutex_);
61 62
62 // Event to trigger if we read a message (may be null). 63 // Event to trigger if we read a message (may be null).
63 ManualResetWaitableEvent* read_event_ MOJO_GUARDED_BY(mutex_); 64 ManualResetWaitableEvent* read_event_ MOJO_GUARDED_BY(mutex_);
64 65
65 MOJO_DISALLOW_COPY_AND_ASSIGN(TestChannelEndpointClient); 66 MOJO_DISALLOW_COPY_AND_ASSIGN(TestChannelEndpointClient);
66 }; 67 };
67 68
68 } // namespace test 69 } // namespace test
69 } // namespace system 70 } // namespace system
70 } // namespace mojo 71 } // namespace mojo
71 72
72 #endif // MOJO_EDK_SYSTEM_TEST_CHANNEL_ENDPOINT_CLIENT_H_ 73 #endif // MOJO_EDK_SYSTEM_TEST_CHANNEL_ENDPOINT_CLIENT_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/slave_connection_manager.cc ('k') | mojo/edk/system/test_channel_endpoint_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698