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

Unified Diff: mojo/public/c/bindings/lib/map.c

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/buffer.c ('k') | mojo/public/c/bindings/lib/message.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/bindings/lib/map.c
diff --git a/mojo/public/c/bindings/lib/map.c b/mojo/public/c/bindings/lib/map.c
deleted file mode 100644
index 19faa8f8ff6640a6263c47547b2b5282d0cba3bc..0000000000000000000000000000000000000000
--- a/mojo/public/c/bindings/lib/map.c
+++ /dev/null
@@ -1,36 +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.
-
-#include "mojo/public/c/bindings/map.h"
-
-struct MojomMapLayout {
- struct MojomStructHeader header_;
- union MojomArrayHeaderPtr keys;
- union MojomArrayHeaderPtr values;
-};
-MOJO_STATIC_ASSERT(sizeof(struct MojomMapLayout) == 24u,
- "MojomMapLayout is an invalid size.");
-
-MojomValidationResult MojomMap_Validate(
- const struct MojomTypeDescriptorStruct* in_type_desc,
- const struct MojomStructHeader* in_struct,
- uint32_t in_buf_size,
- uint32_t in_num_handles,
- struct MojomValidationContext* inout_context) {
- // A mojom map consists of 2 arrays (pointers), both of equal size.
- const struct MojomMapLayout* map = (const struct MojomMapLayout*)in_struct;
- struct MojomArrayHeader* keys_arr =
- (struct MojomArrayHeader*)((char*)map +
- (offsetof(struct MojomMapLayout, keys) +
- map->keys.offset));
- struct MojomArrayHeader* values_arr =
- (struct MojomArrayHeader*)((char*)map +
- (offsetof(struct MojomMapLayout, values) +
- map->values.offset));
-
- if (keys_arr->num_elements != values_arr->num_elements)
- return MOJOM_VALIDATION_DIFFERENT_SIZED_ARRAYS_IN_MAP;
-
- return MOJOM_VALIDATION_ERROR_NONE;
-}
« no previous file with comments | « mojo/public/c/bindings/lib/buffer.c ('k') | mojo/public/c/bindings/lib/message.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698