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

Issue 2715153004: Mojo: Support enums as map keys in WTF (Closed)

Created:
3 years, 9 months ago by tibell
Modified:
3 years, 9 months ago
Reviewers:
yzshen1
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mojo: Support enums as map keys in WTF Since WTF::HashMap requires two special tombstone values ("empty" and "deleted") we pick two values unlikely to be used in an enum and add a static check if they ever are used. Also fix hashing for StructPtr, which was broken during a clean-up. BUG=696858 Review-Url: https://codereview.chromium.org/2715153004 Cr-Commit-Position: refs/heads/master@{#454805} Committed: https://chromium.googlesource.com/chromium/src/+/3bb4fdb452973721bd26d6adbcf00c9adacede4b

Patch Set 1 #

Patch Set 2 : Merge #

Patch Set 3 : Don't generate DefaultHash for native enums #

Patch Set 4 : Minor tidy-ups #

Patch Set 5 : Qualify name of generated hash fn #

Total comments: 2

Patch Set 6 : Address yzshen's review comments #

Patch Set 7 : Re-add broken tests #

Patch Set 8 : Merge #

Patch Set 9 : Fix merge mistake #

Total comments: 4

Patch Set 10 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+214 lines, -12 lines) Patch
M mojo/public/cpp/bindings/struct_ptr.h View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/public/cpp/bindings/tests/BUILD.gn View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -0 lines 0 comments Download
A mojo/public/cpp/bindings/tests/map_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +46 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/wtf_hash_unittest.cc View 1 2 3 4 5 6 2 chunks +24 lines, -0 lines 0 comments Download
A mojo/public/cpp/bindings/tests/wtf_map_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +41 lines, -0 lines 0 comments Download
M mojo/public/interfaces/bindings/tests/test_wtf_types.mojom View 1 chunk +13 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/blink_bindings_configuration.gni View 1 2 3 4 5 1 chunk +1 line, -5 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl View 1 2 3 4 1 chunk +47 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/mojom_cpp_generator.py View 1 2 3 4 5 6 4 chunks +27 lines, -4 lines 0 comments Download
M mojo/public/tools/bindings/pylib/mojom/generate/module.py View 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 53 (38 generated)
tibell
Since WTF::HashMap requires tombstone values we end up having to pick some, which feels unclean. ...
3 years, 9 months ago (2017-02-28 02:58:04 UTC) #6
tibell
Merge
3 years, 9 months ago (2017-02-28 03:54:29 UTC) #9
yzshen1
Can the following TODO removed? https://cs.chromium.org/chromium/src/mojo/public/tools/bindings/blink_bindings_configuration.gni?rcl=161c9a742555daaabaca73d24dafecfc14e2ba99&l=34 https://codereview.chromium.org/2715153004/diff/80001/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl File mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl (right): https://codereview.chromium.org/2715153004/diff/80001/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl#newcode93 mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl:93: {%- for enum ...
3 years, 9 months ago (2017-02-28 18:48:35 UTC) #20
tibell
PTAL Also removed the TODO/blacklist. https://codereview.chromium.org/2715153004/diff/80001/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl File mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl (right): https://codereview.chromium.org/2715153004/diff/80001/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl#newcode93 mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl:93: {%- for enum in ...
3 years, 9 months ago (2017-03-01 23:08:40 UTC) #22
yzshen1
LGTM Thanks!
3 years, 9 months ago (2017-03-01 23:13:27 UTC) #24
tibell
Re-add broken tests
3 years, 9 months ago (2017-03-02 00:51:54 UTC) #27
tibell
Merge
3 years, 9 months ago (2017-03-02 01:40:54 UTC) #32
tibell
Fix merge mistake
3 years, 9 months ago (2017-03-02 01:46:03 UTC) #35
tibell
PTAL In removing the blacklist I found that using StructPtrs as keys had been broken ...
3 years, 9 months ago (2017-03-02 01:47:08 UTC) #38
yzshen1
LGTM++ https://codereview.chromium.org/2715153004/diff/160001/mojo/public/cpp/bindings/tests/map_unittest.cc File mojo/public/cpp/bindings/tests/map_unittest.cc (right): https://codereview.chromium.org/2715153004/diff/160001/mojo/public/cpp/bindings/tests/map_unittest.cc#newcode1 mojo/public/cpp/bindings/tests/map_unittest.cc:1: // Copyright 2014 The Chromium Authors. All rights ...
3 years, 9 months ago (2017-03-02 17:25:03 UTC) #42
tibell
The one test failure looks like a flake. Will submit. https://codereview.chromium.org/2715153004/diff/160001/mojo/public/cpp/bindings/tests/map_unittest.cc File mojo/public/cpp/bindings/tests/map_unittest.cc (right): https://codereview.chromium.org/2715153004/diff/160001/mojo/public/cpp/bindings/tests/map_unittest.cc#newcode1 ...
3 years, 9 months ago (2017-03-02 23:16:50 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2715153004/180001
3 years, 9 months ago (2017-03-02 23:17:51 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/376250)
3 years, 9 months ago (2017-03-03 01:22:02 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2715153004/180001
3 years, 9 months ago (2017-03-05 23:11:48 UTC) #50
commit-bot: I haz the power
3 years, 9 months ago (2017-03-06 00:50:20 UTC) #53
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/3bb4fdb452973721bd26d6adbcf0...

Powered by Google App Engine
This is Rietveld 408576698