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

Side by Side Diff: mojo/public/cpp/bindings/message.h

Issue 2276043002: Support custom message filtering on Mojo binding objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 3 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/public/cpp/bindings/lib/router.cc ('k') | mojo/public/cpp/bindings/message_filter.h » ('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 2014 The Chromium Authors. All rights reserved. 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 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_PUBLIC_CPP_BINDINGS_MESSAGE_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // |responder| and will delete it after calling |responder->Accept| or upon 193 // |responder| and will delete it after calling |responder->Accept| or upon
194 // its own destruction. 194 // its own destruction.
195 // 195 //
196 // TODO(yzshen): consider changing |responder| to 196 // TODO(yzshen): consider changing |responder| to
197 // std::unique_ptr<MessageReceiver>. 197 // std::unique_ptr<MessageReceiver>.
198 virtual bool AcceptWithResponder(Message* message, 198 virtual bool AcceptWithResponder(Message* message,
199 MessageReceiverWithStatus* responder) 199 MessageReceiverWithStatus* responder)
200 WARN_UNUSED_RESULT = 0; 200 WARN_UNUSED_RESULT = 0;
201 }; 201 };
202 202
203 class PassThroughFilter : public MessageReceiver {
204 public:
205 PassThroughFilter();
206 ~PassThroughFilter() override;
207
208 // MessageReceiver:
209 bool Accept(Message* message) override;
210
211 private:
212 DISALLOW_COPY_AND_ASSIGN(PassThroughFilter);
213 };
214
203 namespace internal { 215 namespace internal {
204 class SyncMessageResponseSetup; 216 class SyncMessageResponseSetup;
205 } 217 }
206 218
207 // An object which should be constructed on the stack immediately before making 219 // An object which should be constructed on the stack immediately before making
208 // a sync request for which the caller wishes to perform custom validation of 220 // a sync request for which the caller wishes to perform custom validation of
209 // the response value(s). It is illegal to make more than one sync call during 221 // the response value(s). It is illegal to make more than one sync call during
210 // the lifetime of the topmost SyncMessageResponseContext, but it is legal to 222 // the lifetime of the topmost SyncMessageResponseContext, but it is legal to
211 // nest contexts to support reentrancy. 223 // nest contexts to support reentrancy.
212 // 224 //
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // Acquires a callback which may be run to report the currently dispatching 269 // Acquires a callback which may be run to report the currently dispatching
258 // Message as bad. Note that this is only legal to call from directly within the 270 // Message as bad. Note that this is only legal to call from directly within the
259 // stack frame of a message dispatch, but the returned callback may be called 271 // stack frame of a message dispatch, but the returned callback may be called
260 // exactly once any time thereafter to report the message as bad. This may only 272 // exactly once any time thereafter to report the message as bad. This may only
261 // be called once per message. 273 // be called once per message.
262 ReportBadMessageCallback GetBadMessageCallback(); 274 ReportBadMessageCallback GetBadMessageCallback();
263 275
264 } // namespace mojo 276 } // namespace mojo
265 277
266 #endif // MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_ 278 #endif // MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/router.cc ('k') | mojo/public/cpp/bindings/message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698