This is a reland of https://codereview.webrtc.org/1737593002/ minus the added missing headers in webrtc/{BUILD.gn,webrtc.gyp} and webrtc/common.gyp that breaks GN in Chromium since it's using the --check flag (which we should support). BUG=webrtc:4243, webrtc:5589 TESTED=Tried generating GN files with --check in a Chromium checkout with this patch applied, successfully. TBR=pbos@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, tommi@webrtc.org Review URL: https://codereview.webrtc.org/1740873003 . Cr-Commit-Position: refs/heads/master@{#11794}