OLD | NEW |
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_MESSAGE_PIPE_DISPATCHER_H_ | 5 #ifndef MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
6 #define MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 6 #define MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 void Init(scoped_refptr<MessagePipe> message_pipe, unsigned port); | 26 void Init(scoped_refptr<MessagePipe> message_pipe, unsigned port); |
27 | 27 |
28 private: | 28 private: |
29 friend class base::RefCountedThreadSafe<MessagePipeDispatcher>; | 29 friend class base::RefCountedThreadSafe<MessagePipeDispatcher>; |
30 virtual ~MessagePipeDispatcher(); | 30 virtual ~MessagePipeDispatcher(); |
31 | 31 |
32 // |Dispatcher| implementation/overrides: | 32 // |Dispatcher| implementation/overrides: |
33 virtual void CancelAllWaitersNoLock() OVERRIDE; | 33 virtual void CancelAllWaitersNoLock() OVERRIDE; |
34 virtual MojoResult CloseImplNoLock() OVERRIDE; | 34 virtual MojoResult CloseImplNoLock() OVERRIDE; |
35 virtual MojoResult WriteMessageImplNoLock( | 35 virtual MojoResult WriteMessageImplNoLock( |
36 const void* bytes, | 36 const void* bytes, uint32_t num_bytes, |
37 uint32_t num_bytes, | 37 const std::vector<Dispatcher*>* dispatchers, |
38 const MojoHandle* handles, | |
39 uint32_t num_handles, | |
40 MojoWriteMessageFlags flags) OVERRIDE; | 38 MojoWriteMessageFlags flags) OVERRIDE; |
41 virtual MojoResult ReadMessageImplNoLock( | 39 virtual MojoResult ReadMessageImplNoLock( |
42 void* bytes, | 40 void* bytes, uint32_t* num_bytes, |
43 uint32_t* num_bytes, | 41 uint32_t max_num_dispatchers, |
44 MojoHandle* handles, | 42 std::vector<scoped_refptr<Dispatcher> >* dispatchers, |
45 uint32_t* num_handles, | |
46 MojoReadMessageFlags flags) OVERRIDE; | 43 MojoReadMessageFlags flags) OVERRIDE; |
47 virtual MojoResult AddWaiterImplNoLock(Waiter* waiter, | 44 virtual MojoResult AddWaiterImplNoLock(Waiter* waiter, |
48 MojoWaitFlags flags, | 45 MojoWaitFlags flags, |
49 MojoResult wake_result) OVERRIDE; | 46 MojoResult wake_result) OVERRIDE; |
50 virtual void RemoveWaiterImplNoLock(Waiter* waiter) OVERRIDE; | 47 virtual void RemoveWaiterImplNoLock(Waiter* waiter) OVERRIDE; |
51 | 48 |
52 // Protected by |lock()|: | 49 // Protected by |lock()|: |
53 scoped_refptr<MessagePipe> message_pipe_; // This will be null if closed. | 50 scoped_refptr<MessagePipe> message_pipe_; // This will be null if closed. |
54 unsigned port_; | 51 unsigned port_; |
55 | 52 |
56 DISALLOW_COPY_AND_ASSIGN(MessagePipeDispatcher); | 53 DISALLOW_COPY_AND_ASSIGN(MessagePipeDispatcher); |
57 }; | 54 }; |
58 | 55 |
59 } // namespace system | 56 } // namespace system |
60 } // namespace mojo | 57 } // namespace mojo |
61 | 58 |
62 #endif // MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 59 #endif // MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
OLD | NEW |