OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_VALIDATOR_H_ | |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_VALIDATOR_H_ | |
7 | |
8 #include "mojo/public/cpp/bindings/message.h" | |
9 #include "mojo/public/cpp/system/macros.h" | |
10 | |
11 namespace mojo { | |
12 namespace internal { | |
13 | |
14 // This class is the base class for message validators. Subclasses should | |
15 // implement the pure virtual method Accept() inherited from MessageReceiver. | |
16 class MessageValidator : public MessageReceiver { | |
darin (slow to review)
2014/05/12 17:28:26
Hmm... there's nothing about this class that makes
yzshen1
2014/05/12 21:59:58
I like the name of MessageFilter!
| |
17 public: | |
18 // Doesn't take ownership of |next|. Therefore |next| has to stay alive while | |
19 // this object is alive. If |next| is NULL, set_next() has to be called before | |
20 // this object can be used to validate messages. | |
21 explicit MessageValidator(MessageReceiver* next = NULL); | |
22 virtual ~MessageValidator(); | |
23 | |
24 void set_next(MessageReceiver* next) { next_ = next; } | |
25 | |
26 protected: | |
27 MessageReceiver* next_; | |
28 | |
29 private: | |
30 // MessageReceiver method that shouldn't be reached. | |
31 virtual bool AcceptWithResponder(Message* message, | |
32 MessageReceiver* responder) MOJO_OVERRIDE; | |
33 }; | |
34 | |
35 } // namespace internal | |
36 } // namespace mojo | |
37 | |
38 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_VALIDATOR_H_ | |
OLD | NEW |