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

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

Issue 227383006: Mojo: Allow dispatchers to attach PlatformHandles to the MessageInTransit on serialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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_in_transit.cc ('k') | mojo/system/message_pipe_dispatcher.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_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 <utility> 8 #include <utility>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 virtual MojoResult ReadMessageImplNoLock( 69 virtual MojoResult ReadMessageImplNoLock(
70 void* bytes, 70 void* bytes,
71 uint32_t* num_bytes, 71 uint32_t* num_bytes,
72 std::vector<scoped_refptr<Dispatcher> >* dispatchers, 72 std::vector<scoped_refptr<Dispatcher> >* dispatchers,
73 uint32_t* num_dispatchers, 73 uint32_t* num_dispatchers,
74 MojoReadMessageFlags flags) OVERRIDE; 74 MojoReadMessageFlags flags) OVERRIDE;
75 virtual MojoResult AddWaiterImplNoLock(Waiter* waiter, 75 virtual MojoResult AddWaiterImplNoLock(Waiter* waiter,
76 MojoWaitFlags flags, 76 MojoWaitFlags flags,
77 MojoResult wake_result) OVERRIDE; 77 MojoResult wake_result) OVERRIDE;
78 virtual void RemoveWaiterImplNoLock(Waiter* waiter) OVERRIDE; 78 virtual void RemoveWaiterImplNoLock(Waiter* waiter) OVERRIDE;
79 virtual size_t GetMaximumSerializedSizeImplNoLock( 79 virtual void StartSerializeImplNoLock(Channel* channel,
80 const Channel* channel) const OVERRIDE; 80 size_t* max_size,
81 virtual bool SerializeAndCloseImplNoLock(Channel* channel, 81 size_t* max_platform_handles) OVERRIDE;
82 void* destination, 82 virtual bool EndSerializeAndCloseImplNoLock(
83 size_t* actual_size) OVERRIDE; 83 Channel* channel,
84 void* destination,
85 size_t* actual_size,
86 std::vector<embedder::PlatformHandle>* platform_handles) OVERRIDE;
84 87
85 // Protected by |lock()|: 88 // Protected by |lock()|:
86 scoped_refptr<MessagePipe> message_pipe_; // This will be null if closed. 89 scoped_refptr<MessagePipe> message_pipe_; // This will be null if closed.
87 unsigned port_; 90 unsigned port_;
88 91
89 DISALLOW_COPY_AND_ASSIGN(MessagePipeDispatcher); 92 DISALLOW_COPY_AND_ASSIGN(MessagePipeDispatcher);
90 }; 93 };
91 94
92 class MessagePipeDispatcherTransport : public DispatcherTransport { 95 class MessagePipeDispatcherTransport : public DispatcherTransport {
93 public: 96 public:
94 explicit MessagePipeDispatcherTransport(DispatcherTransport transport); 97 explicit MessagePipeDispatcherTransport(DispatcherTransport transport);
95 98
96 MessagePipe* GetMessagePipe() { 99 MessagePipe* GetMessagePipe() {
97 return message_pipe_dispatcher()->GetMessagePipeNoLock(); 100 return message_pipe_dispatcher()->GetMessagePipeNoLock();
98 } 101 }
99 unsigned GetPort() { return message_pipe_dispatcher()->GetPortNoLock(); } 102 unsigned GetPort() { return message_pipe_dispatcher()->GetPortNoLock(); }
100 103
101 private: 104 private:
102 MessagePipeDispatcher* message_pipe_dispatcher() { 105 MessagePipeDispatcher* message_pipe_dispatcher() {
103 return static_cast<MessagePipeDispatcher*>(dispatcher()); 106 return static_cast<MessagePipeDispatcher*>(dispatcher());
104 } 107 }
105 108
106 // Copy and assign allowed. 109 // Copy and assign allowed.
107 }; 110 };
108 111
109 } // namespace system 112 } // namespace system
110 } // namespace mojo 113 } // namespace mojo
111 114
112 #endif // MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ 115 #endif // MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_
OLDNEW
« no previous file with comments | « mojo/system/message_in_transit.cc ('k') | mojo/system/message_pipe_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698