OLD | NEW |
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_LIB_MESSAGE_HEADER_VALIDATOR_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_HEADER_VALIDATOR_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_HEADER_VALIDATOR_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_HEADER_VALIDATOR_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "mojo/public/cpp/bindings/message.h" | 10 #include "mojo/public/cpp/bindings/message.h" |
9 #include "mojo/public/cpp/bindings/message_filter.h" | 11 #include "mojo/public/cpp/bindings/message_filter.h" |
10 | 12 |
11 namespace mojo { | 13 namespace mojo { |
12 namespace internal { | 14 namespace internal { |
13 | 15 |
14 class MessageHeaderValidator : public MessageFilter { | 16 class MessageHeaderValidator : public MessageFilter { |
15 public: | 17 public: |
16 explicit MessageHeaderValidator(MessageReceiver* sink = nullptr); | 18 explicit MessageHeaderValidator(MessageReceiver* sink = nullptr); |
| 19 MessageHeaderValidator(MessageReceiver* sink, const std::string& debug_info); |
17 | 20 |
18 bool Accept(Message* message) override; | 21 void set_debug_info(const std::string& debug_info) { |
| 22 debug_info_ = debug_info; |
| 23 } |
| 24 |
| 25 Result Accept(Message* message) override; |
| 26 |
| 27 private: |
| 28 std::string debug_info_; |
19 }; | 29 }; |
20 | 30 |
21 } // namespace internal | 31 } // namespace internal |
22 } // namespace mojo | 32 } // namespace mojo |
23 | 33 |
24 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_HEADER_VALIDATOR_H_ | 34 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_HEADER_VALIDATOR_H_ |
OLD | NEW |