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

Side by Side Diff: mojo/system/proxy_message_pipe_endpoint.h

Issue 147983009: Mojo: Refactor some message pipe stuff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « mojo/system/message_pipe_endpoint.h ('k') | mojo/system/proxy_message_pipe_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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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_SYSTEM_PROXY_MESSAGE_PIPE_ENDPOINT_H_ 5 #ifndef MOJO_SYSTEM_PROXY_MESSAGE_PIPE_ENDPOINT_H_
6 #define MOJO_SYSTEM_PROXY_MESSAGE_PIPE_ENDPOINT_H_ 6 #define MOJO_SYSTEM_PROXY_MESSAGE_PIPE_ENDPOINT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 28 matching lines...) Expand all
39 // run, it gets a remote ID. 39 // run, it gets a remote ID.
40 class MOJO_SYSTEM_IMPL_EXPORT ProxyMessagePipeEndpoint 40 class MOJO_SYSTEM_IMPL_EXPORT ProxyMessagePipeEndpoint
41 : public MessagePipeEndpoint { 41 : public MessagePipeEndpoint {
42 public: 42 public:
43 ProxyMessagePipeEndpoint(); 43 ProxyMessagePipeEndpoint();
44 virtual ~ProxyMessagePipeEndpoint(); 44 virtual ~ProxyMessagePipeEndpoint();
45 45
46 // |MessagePipeEndpoint| implementation: 46 // |MessagePipeEndpoint| implementation:
47 virtual void Close() OVERRIDE; 47 virtual void Close() OVERRIDE;
48 virtual void OnPeerClose() OVERRIDE; 48 virtual void OnPeerClose() OVERRIDE;
49 virtual MojoResult CanEnqueueMessage( 49 virtual MojoResult EnqueueMessage(
50 const MessageInTransit* message, 50 MessageInTransit* message,
51 const std::vector<Dispatcher*>* dispatchers) OVERRIDE; 51 const std::vector<Dispatcher*>* dispatchers) OVERRIDE;
52 virtual void EnqueueMessage(
53 MessageInTransit* message,
54 std::vector<scoped_refptr<Dispatcher> >* dispatchers) OVERRIDE;
55 virtual void Attach(scoped_refptr<Channel> channel, 52 virtual void Attach(scoped_refptr<Channel> channel,
56 MessageInTransit::EndpointId local_id) OVERRIDE; 53 MessageInTransit::EndpointId local_id) OVERRIDE;
57 virtual void Run(MessageInTransit::EndpointId remote_id) OVERRIDE; 54 virtual void Run(MessageInTransit::EndpointId remote_id) OVERRIDE;
58 55
59 private: 56 private:
60 bool is_attached() const { 57 bool is_attached() const {
61 return !!channel_.get(); 58 return !!channel_.get();
62 } 59 }
63 60
64 bool is_running() const { 61 bool is_running() const {
65 return remote_id_ != MessageInTransit::kInvalidEndpointId; 62 return remote_id_ != MessageInTransit::kInvalidEndpointId;
66 } 63 }
67 64
65 MojoResult CanEnqueueDispatchers(const std::vector<Dispatcher*>* dispatchers);
66 // |dispatchers| should be non-null only if it's nonempty, in which case the
67 // dispatchers should have been preflighted by |CanEnqueueDispatchers()|.
68 void EnqueueMessageInternal(MessageInTransit* message,
69 const std::vector<Dispatcher*>* dispatchers);
70
68 #ifdef NDEBUG 71 #ifdef NDEBUG
69 void AssertConsistentState() const {} 72 void AssertConsistentState() const {}
70 #else 73 #else
71 void AssertConsistentState() const; 74 void AssertConsistentState() const;
72 #endif 75 #endif
73 76
74 // This should only be set if we're attached. 77 // This should only be set if we're attached.
75 scoped_refptr<Channel> channel_; 78 scoped_refptr<Channel> channel_;
76 79
77 // |local_id_| should be set to something other than 80 // |local_id_| should be set to something other than
(...skipping 13 matching lines...) Expand all
91 // not ready to send them yet. 94 // not ready to send them yet.
92 std::deque<MessageInTransit*> paused_message_queue_; 95 std::deque<MessageInTransit*> paused_message_queue_;
93 96
94 DISALLOW_COPY_AND_ASSIGN(ProxyMessagePipeEndpoint); 97 DISALLOW_COPY_AND_ASSIGN(ProxyMessagePipeEndpoint);
95 }; 98 };
96 99
97 } // namespace system 100 } // namespace system
98 } // namespace mojo 101 } // namespace mojo
99 102
100 #endif // MOJO_SYSTEM_PROXY_MESSAGE_PIPE_ENDPOINT_H_ 103 #endif // MOJO_SYSTEM_PROXY_MESSAGE_PIPE_ENDPOINT_H_
OLDNEW
« no previous file with comments | « mojo/system/message_pipe_endpoint.h ('k') | mojo/system/proxy_message_pipe_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698