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

Unified Diff: mojo/public/c/bindings/lib/util.h

Issue 2232833003: Change the canonical way to include the C bindings headers to <mojo/bindings/*.h>. (Closed) Base URL: https://github.com/domokit/mojo.git@work791_mojo_tests
Patch Set: rebased 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/c/bindings/lib/union.c ('k') | mojo/public/c/bindings/map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/bindings/lib/util.h
diff --git a/mojo/public/c/bindings/lib/util.h b/mojo/public/c/bindings/lib/util.h
deleted file mode 100644
index 9232d2fa545caac4c54e6bfe3da489a8c1adb377..0000000000000000000000000000000000000000
--- a/mojo/public/c/bindings/lib/util.h
+++ /dev/null
@@ -1,37 +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_C_BINDINGS_LIB_UTIL_H_
-#define MOJO_PUBLIC_C_BINDINGS_LIB_UTIL_H_
-
-#include <mojo/macros.h>
-
-// Rounds-up |num| to 8. The result is undefined if this results in an overflow.
-#define MOJOM_INTERNAL_ROUND_TO_8(num) (((num) + 7) & ~7)
-
-// Represents the memory layout of a mojom pointer; it is a |ptr| (pointer to
-// some memory) when unencoded, and refers to a relative |offset| when encoded.
-union MojomPointer {
- void* ptr;
- uint64_t offset;
-};
-MOJO_STATIC_ASSERT(sizeof(union MojomPointer) == 8,
- "union MojomPointer must be 8 bytes");
-
-// This struct represents the state we need to keep when validating an encoded
-// mojom type.
-struct MojomValidationContext {
- // |next_handle_index| is a counter that represents the next-available index
- // into the handle array. Previous indices have already been used up. This
- // counter is non-decreasing as it is used throughout validation.
- uint32_t next_handle_index;
-
- // As we validate, we keep track of the point where pointers can point to,
- // since two pointers may not point to the same memory region.
- char* next_pointer;
-
- // TODO(vardhan): Include an error string? How big should it be?
-};
-
-#endif // MOJO_PUBLIC_C_BINDINGS_LIB_UTIL_H_
« no previous file with comments | « mojo/public/c/bindings/lib/union.c ('k') | mojo/public/c/bindings/map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698