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

Issue 920713002: Add Maplike<> utility mixin class for implementing maplike interfaces (Closed)

Created:
5 years, 10 months ago by Jens Widell
Modified:
5 years, 10 months ago
Reviewers:
haraken, jrummell, yhirano
CC:
blink-reviews, philipj_slow, feature-media-reviews_chromium.org, sof, eae+blinkwatch, eric.carlson_apple.com, blink-reviews-dom_chromium.org, dglazkov+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@idl-iterable-etc-typedefs
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Add Maplike<> utility mixin class for implementing maplike interfaces This utility class inherits PairIterable<> and currently implements has() and get() based on a single virtual getMapEntry() function that a sub-class needs to implement. It takes care of the slight complication that get() should return undefined if the requested key is not in the map, which is somewhat impractical to implement (requires constructing a ScriptValue to return.) Update the maplike implementations MIDIPortMap and MediaKeyStatusMap to inherit Maplike<> instead of its base-class PairIterable<>, and remove their has()/get() implementations. BUG=432683 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=190113

Patch Set 1 #

Total comments: 6

Patch Set 2 : drop some includes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -70 lines) Patch
A Source/core/dom/Maplike.h View 1 chunk +37 lines, -0 lines 0 comments Download
M Source/modules/encryptedmedia/MediaKeyStatusMap.h View 3 chunks +4 lines, -4 lines 0 comments Download
M Source/modules/encryptedmedia/MediaKeyStatusMap.cpp View 1 6 chunks +16 lines, -21 lines 0 comments Download
M Source/modules/encryptedmedia/MediaKeyStatusMap.idl View 1 chunk +0 lines, -5 lines 0 comments Download
M Source/modules/webmidi/MIDIInputMap.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/modules/webmidi/MIDIInputMap.cpp View 1 2 chunks +0 lines, -9 lines 0 comments Download
M Source/modules/webmidi/MIDIInputMap.idl View 1 chunk +0 lines, -3 lines 0 comments Download
M Source/modules/webmidi/MIDIOutputMap.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/modules/webmidi/MIDIOutputMap.cpp View 1 2 chunks +0 lines, -9 lines 0 comments Download
M Source/modules/webmidi/MIDIOutputMap.idl View 1 chunk +0 lines, -3 lines 0 comments Download
M Source/modules/webmidi/MIDIPortMap.h View 1 4 chunks +10 lines, -12 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
Jens Widell
PTAL
5 years, 10 months ago (2015-02-12 13:22:29 UTC) #2
haraken
https://codereview.chromium.org/920713002/diff/1/Source/core/dom/Maplike.h File Source/core/dom/Maplike.h (right): https://codereview.chromium.org/920713002/diff/1/Source/core/dom/Maplike.h#newcode20 Source/core/dom/Maplike.h:20: return getMapEntry(scriptState, key, value, exceptionState); It's a bit inefficient ...
5 years, 10 months ago (2015-02-12 13:39:39 UTC) #3
haraken
https://codereview.chromium.org/920713002/diff/1/Source/core/dom/Maplike.h File Source/core/dom/Maplike.h (right): https://codereview.chromium.org/920713002/diff/1/Source/core/dom/Maplike.h#newcode10 Source/core/dom/Maplike.h:10: #include "core/dom/Iterable.h" Nit: Would core/dom/ be a right place ...
5 years, 10 months ago (2015-02-12 13:41:36 UTC) #4
Jens Widell
https://codereview.chromium.org/920713002/diff/1/Source/core/dom/Maplike.h File Source/core/dom/Maplike.h (right): https://codereview.chromium.org/920713002/diff/1/Source/core/dom/Maplike.h#newcode10 Source/core/dom/Maplike.h:10: #include "core/dom/Iterable.h" On 2015/02/12 13:41:36, haraken wrote: > > ...
5 years, 10 months ago (2015-02-12 13:50:49 UTC) #5
haraken
LGTM https://codereview.chromium.org/920713002/diff/1/Source/core/dom/Maplike.h File Source/core/dom/Maplike.h (right): https://codereview.chromium.org/920713002/diff/1/Source/core/dom/Maplike.h#newcode10 Source/core/dom/Maplike.h:10: #include "core/dom/Iterable.h" On 2015/02/12 13:50:47, Jens Widell wrote: ...
5 years, 10 months ago (2015-02-12 13:56:50 UTC) #6
jrummell
I like it. modules/encryptedmedia lgtm.
5 years, 10 months ago (2015-02-12 18:18:10 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/920713002/20001
5 years, 10 months ago (2015-02-13 06:11:15 UTC) #10
commit-bot: I haz the power
5 years, 10 months ago (2015-02-13 06:13:53 UTC) #11
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=190113

Powered by Google App Engine
This is Rietveld 408576698