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

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

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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
« no previous file with comments | « mojo/edk/system/handle_table.cc ('k') | mojo/edk/system/incoming_endpoint.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_
6 #define MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/synchronization/lock.h"
11 #include "mojo/edk/system/channel_endpoint_client.h"
12 #include "mojo/edk/system/message_in_transit_queue.h"
13 #include "mojo/edk/system/system_impl_export.h"
14
15 namespace mojo {
16 namespace system {
17
18 class ChannelEndpoint;
19 class MessagePipe;
20
21 // This is a simple |ChannelEndpointClient| that only receives messages. It's
22 // used for endpoints that are "received" by |Channel|, but not yet turned into
23 // |MessagePipe|s.
24 class MOJO_SYSTEM_IMPL_EXPORT IncomingEndpoint : public ChannelEndpointClient {
25 public:
26 IncomingEndpoint();
27
28 // Must be called before any other method.
29 scoped_refptr<ChannelEndpoint> Init();
30
31 scoped_refptr<MessagePipe> ConvertToMessagePipe();
32
33 // Must be called before destroying this object if |ConvertToMessagePipe()|
34 // wasn't called (but |Init()| was).
35 void Close();
36
37 // |ChannelEndpointClient| methods:
38 bool OnReadMessage(unsigned port, MessageInTransit* message) override;
39 void OnDetachFromChannel(unsigned port) override;
40
41 private:
42 ~IncomingEndpoint() override;
43
44 base::Lock lock_; // Protects the following members.
45 scoped_refptr<ChannelEndpoint> endpoint_;
46 MessageInTransitQueue message_queue_;
47
48 DISALLOW_COPY_AND_ASSIGN(IncomingEndpoint);
49 };
50
51 } // namespace system
52 } // namespace mojo
53
54 #endif // MOJO_EDK_SYSTEM_INCOMING_ENDPOINT_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/handle_table.cc ('k') | mojo/edk/system/incoming_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698