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

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

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/c/lib/bindings/buffer.c ('k') | mojo/public/c/lib/bindings/message.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/lib/bindings/map.c
diff --git a/mojo/public/c/lib/bindings/map.c b/mojo/public/c/lib/bindings/map.c
deleted file mode 100644
index 86bc3d2c9f589a3e6cdda45d5c8e9719b0bbb4e4..0000000000000000000000000000000000000000
--- a/mojo/public/c/lib/bindings/map.c
+++ /dev/null
@@ -1,38 +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/bindings/map.h>
-
-#include <mojo/macros.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/lib/bindings/buffer.c ('k') | mojo/public/c/lib/bindings/message.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698