Index: base/enum_validation.h |
diff --git a/base/enum_validation.h b/base/enum_validation.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4d4e3f30e76a73bff899d902b2f0352b8275ebee |
--- /dev/null |
+++ b/base/enum_validation.h |
@@ -0,0 +1,13 @@ |
+// Copyright (c) 2012 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 BASE_ENUM_VALIDATION_H |
+#define BASE_ENUM_VALIDATION_H |
+ |
+// Defines a function template which enum authors can specialize to perform |
+// validation upon an untrusted value prior to its being cast to their enum |
+// type. Intended mainly for use by (generated) unmarshalling code. |
+template <typename T> inline bool IsIntValidForEnum(int x) { return true; } |
+ |
+#endif // BASE_ENUM_VALIDATION_H |