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

Unified Diff: mojo/public/cpp/bindings/message_validator.h

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/bindings/message.h ('k') | mojo/public/cpp/bindings/no_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/message_validator.h
diff --git a/mojo/public/cpp/bindings/message_validator.h b/mojo/public/cpp/bindings/message_validator.h
deleted file mode 100644
index 35efecc60ed77488d4b35c262bee853abc8d5db4..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/bindings/message_validator.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_VALIDATOR_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_VALIDATOR_H_
-
-#include <string>
-#include <vector>
-
-#include "mojo/public/cpp/bindings/lib/validation_errors.h"
-#include "mojo/public/cpp/bindings/message.h"
-#include "mojo/public/cpp/system/macros.h"
-
-namespace mojo {
-namespace internal {
-
-// This class is the base class for message validators. Subclasses should
-// implement the pure virtual method Validate() to validate messages.
-class MessageValidator {
- public:
- virtual ~MessageValidator() {}
- // Validates the message and returns ValidationError::NONE if valid.
- // Otherwise returns a different value, and sets the |err| string if it is not
- // null.
- virtual ValidationError Validate(const Message* message,
- std::string* err) = 0;
-};
-
-// A message validator that does nothing, and always returns a non-error.
-class PassThroughValidator final : public MessageValidator {
- public:
- ValidationError Validate(const Message* message, std::string* err) override;
-};
-
-using MessageValidatorList = std::vector<std::unique_ptr<MessageValidator>>;
-
-// Iterates through |validators| and tries to validate the given |message| until
-// a validator fails. If a validator fails, a |ValidationError| is returned and
-// the supplied |err| is set if it is not null. |ValidationError::NONE| is
-// returned if the supplied |message| passes all the |validators|.
-ValidationError RunValidatorsOnMessage(const MessageValidatorList& validators,
- const Message* message,
- std::string* err);
-
-} // namespace internal
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_VALIDATOR_H_
« no previous file with comments | « mojo/public/cpp/bindings/message.h ('k') | mojo/public/cpp/bindings/no_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698