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

Side by Side Diff: mojo/public/cpp/bindings/lib/validation_util.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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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_VALIDATION_UTIL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_UTIL_H_
7
8 #include <stdint.h>
9
10 #include <string>
11
12 #include "mojo/public/cpp/bindings/lib/bounds_checker.h"
13 #include "mojo/public/cpp/bindings/lib/validation_errors.h"
14
15 namespace mojo {
16 namespace internal {
17
18 // Checks whether decoding the pointer will overflow and produce a pointer
19 // smaller than |offset|.
20 bool ValidateEncodedPointer(const uint64_t* offset);
21
22 // Validates that |data| contains a valid struct header, in terms of alignment
23 // and size (i.e., the |num_bytes| field of the header is sufficient for storing
24 // the header itself). Besides, it checks that the memory range
25 // [data, data + num_bytes) is not marked as occupied by other objects in
26 // |bounds_checker|. On success, the memory range is marked as occupied.
27 // Note: Does not verify |version| or that |num_bytes| is correct for the
28 // claimed version.
29 ValidationError ValidateStructHeaderAndClaimMemory(
30 const void* data,
31 BoundsChecker* bounds_checker,
32 std::string* err);
33
34 } // namespace internal
35 } // namespace mojo
36
37 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_UTIL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_errors.cc ('k') | mojo/public/cpp/bindings/lib/validation_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698