Add an extension override bubble and warning box for proxy extensions. (2nd attempt...
[chromium-blink-merge.git] / mojo / system / local_message_pipe_endpoint.h
blobfdc32114abc8322f2f5a959955f29b1cb8bdd0ab
1 // Copyright 2013 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.
5 #ifndef MOJO_SYSTEM_LOCAL_MESSAGE_PIPE_ENDPOINT_H_
6 #define MOJO_SYSTEM_LOCAL_MESSAGE_PIPE_ENDPOINT_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "mojo/system/message_in_transit_queue.h"
11 #include "mojo/system/message_pipe_endpoint.h"
12 #include "mojo/system/system_impl_export.h"
13 #include "mojo/system/waiter_list.h"
15 namespace mojo {
16 namespace system {
18 class MOJO_SYSTEM_IMPL_EXPORT LocalMessagePipeEndpoint
19 : public MessagePipeEndpoint {
20 public:
21 LocalMessagePipeEndpoint();
22 virtual ~LocalMessagePipeEndpoint();
24 // |MessagePipeEndpoint| implementation:
25 virtual Type GetType() const OVERRIDE;
26 virtual bool OnPeerClose() OVERRIDE;
27 virtual void EnqueueMessage(scoped_ptr<MessageInTransit> message) OVERRIDE;
29 // There's a dispatcher for |LocalMessagePipeEndpoint|s, so we have to
30 // implement/override these:
31 virtual void Close() OVERRIDE;
32 virtual void CancelAllWaiters() OVERRIDE;
33 virtual MojoResult ReadMessage(void* bytes,
34 uint32_t* num_bytes,
35 DispatcherVector* dispatchers,
36 uint32_t* num_dispatchers,
37 MojoReadMessageFlags flags) OVERRIDE;
38 virtual MojoResult AddWaiter(Waiter* waiter,
39 MojoWaitFlags flags,
40 MojoResult wake_result) OVERRIDE;
41 virtual void RemoveWaiter(Waiter* waiter) OVERRIDE;
43 // This is only to be used by |ProxyMessagePipeEndpoint|:
44 MessageInTransitQueue* message_queue() { return &message_queue_; }
46 private:
47 MojoWaitFlags SatisfiedFlags();
48 MojoWaitFlags SatisfiableFlags();
50 bool is_open_;
51 bool is_peer_open_;
53 // Queue of incoming messages.
54 MessageInTransitQueue message_queue_;
55 WaiterList waiter_list_;
57 DISALLOW_COPY_AND_ASSIGN(LocalMessagePipeEndpoint);
60 } // namespace system
61 } // namespace mojo
63 #endif // MOJO_SYSTEM_LOCAL_MESSAGE_PIPE_ENDPOINT_H_