The code came from chrome/browser/media, but was simplified to remove dependencies on other parts of chrome/ and to always allow the media stream request.