diff options
author | xians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 18:01:49 +0000 |
---|---|---|
committer | xians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 18:01:49 +0000 |
commit | 1c08c84e93f7acbafe2b0990b4c23484c7667638 (patch) | |
tree | 1c0c4fb9e86134ea59ef48ef4ec94813faeada39 /media/base | |
parent | 2a55b57eeb6d081c8eb5a2ad5c0b92964c5c9b32 (diff) | |
download | chromium_src-1c08c84e93f7acbafe2b0990b4c23484c7667638.zip chromium_src-1c08c84e93f7acbafe2b0990b4c23484c7667638.tar.gz chromium_src-1c08c84e93f7acbafe2b0990b4c23484c7667638.tar.bz2 |
Do not pass the string device_id via IPC message to create an audio input stream.
Using a string device_id via IPC message from the render client to open the device is not very safe since IPC message is not trusted. Instead, we should just pass an int (session_id) to the browser, and we do the lookup on AudioInputDeviceManager in the browser to re-map the session_id to the device_id.
BUG=179597,216952
Review URL: https://chromiumcodereview.appspot.com/12440027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189342 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/audio_capturer_source.h | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/media/base/audio_capturer_source.h b/media/base/audio_capturer_source.h index 2f99b92..deae5e2 100644 --- a/media/base/audio_capturer_source.h +++ b/media/base/audio_capturer_source.h @@ -35,25 +35,15 @@ class AudioCapturerSource virtual ~CaptureCallback() {} }; - class CaptureEventHandler { - public: - // Notification to the client that the device with the specific |device_id| - // has been started. - virtual void OnDeviceStarted(const std::string& device_id) = 0; - - // Notification to the client that the device has been stopped. - virtual void OnDeviceStopped() = 0; - - protected: - virtual ~CaptureEventHandler() {} - }; - // Sets information about the audio stream format and the device // to be used. It must be called before any of the other methods. - // TODO(xians): Add |device_id| to this Initialize() function. + // The |session_id| is used by the browser to identify which input device to + // be used. For clients who do not care about device permission and device + // selection, pass |session_id| using + // AudioInputDeviceManager::kFakeOpenSessionId. virtual void Initialize(const AudioParameters& params, CaptureCallback* callback, - CaptureEventHandler* event_handler) = 0; + int session_id) = 0; // Starts the audio recording. virtual void Start() = 0; @@ -65,10 +55,6 @@ class AudioCapturerSource // Sets the capture volume, with range [0.0, 1.0] inclusive. virtual void SetVolume(double volume) = 0; - // Specifies the |session_id| to query which device to use. - // TODO(xians): Change the interface to SetDevice(const std::string&). - virtual void SetDevice(int session_id) = 0; - // Enables or disables the WebRtc AGC control. virtual void SetAutomaticGainControl(bool enable) = 0; |