This was originally reviewed https://codereview.webrtc.org/2559953002/ It was reverted due to a bug in the original CL, see https://codereview.webrtc.org/2631703002/ This CL is to fix and reland. BUG=webrtc:6845 Review-Url: https://codereview.webrtc.org/2644863002 Cr-Commit-Position: refs/heads/master@{#16242}