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

Side by Side Diff: mojo/public/cpp/bindings/lib/message_header_validator.h

Issue 2064903002: Mojo: Report bindings validation errors via MojoNotifyBadMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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
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_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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698