update chrome shim (#390)
update chrome shim (#390)

* chrome shim: move getStats

this moves getStats so it overrides on the prototype, not as
part of the constructor.

* chrome shim: dont override RTCPeerConnection

dont override the unprefixed RTCPeerConnection if it exists.

* chrome shim: dont shim promises on unprefixed PC

dont attempt to shim promises using callbacks if we have
support for native promises.

* chrome shim: fix generateCertificate bug

this restores the old (and correct) logic of checking for
webkitRTCPeerConnection.generateCertificate

* chrome: return spec stats when supported

this returns spec-stats when they are supported. Support
is determined by checking for the length of
  RTCPeerConnection.prototype.getStats.length
which is 2 for the Chrome legacy API and 0 if the new
getStats implementation is available.

This is a breaking change, the types and contents of those
statistics will be different.

* Revert "chrome shim: dont shim promises on unprefixed PC"

This reverts commit 1693dede08f7910e5aa8778f60e0149e62c39ad2.

* chrome: only promisfy createOffer/Answer < M52

promisifys createOffer and createAnswer only in
Chrome < M52. This is due to
  https://bugs.chromium.org/p/chromium/issues/detail?id=619289
which was discovered a bit late.

* chrome: add hyphen in stats type

This adds the hyphen in a number of stats types.
See https://github.com/w3c/webrtc-stats/issues/5 for
the details.

* chrome: remove object stats behaviour

removes iterating over the Map with Object.keys()

xdumaine/adapter,webrtc/adapter,xdumaine/adapter,Acidburn0zzz/adapter,webrtc/adapter,jan-ivar/adapter,Acidburn0zzz/adapter,Acidburn0zzz/adapter,jan-ivar/adapter