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

Review URL: https://codereview.chromium.org/920713002

git-svn-id: svn://svn.chromium.org/blink/trunk@190113 bbb929c8-8fbe-4397-9dbb-9b2b20218538
11 files changed
tree: 871986429085b3c6589ac663259a2b79418dfd9e
  1. third_party/