OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 13 matching lines...) Expand all Loading... |
24 // MediaStreamDispatcherHost is a delegate for Media Stream API messages used by | 24 // MediaStreamDispatcherHost is a delegate for Media Stream API messages used by |
25 // MediaStreamImpl. It's the complement of MediaStreamDispatcher | 25 // MediaStreamImpl. It's the complement of MediaStreamDispatcher |
26 // (owned by RenderView). | 26 // (owned by RenderView). |
27 class CONTENT_EXPORT MediaStreamDispatcherHost | 27 class CONTENT_EXPORT MediaStreamDispatcherHost |
28 : public content::BrowserMessageFilter, | 28 : public content::BrowserMessageFilter, |
29 public MediaStreamRequester { | 29 public MediaStreamRequester { |
30 public: | 30 public: |
31 MediaStreamDispatcherHost(content::ResourceContext* resource_context, | 31 MediaStreamDispatcherHost(content::ResourceContext* resource_context, |
32 int render_process_id, | 32 int render_process_id, |
33 media::AudioManager* audio_manager); | 33 media::AudioManager* audio_manager); |
34 virtual ~MediaStreamDispatcherHost(); | |
35 | 34 |
36 // MediaStreamRequester implementation. | 35 // MediaStreamRequester implementation. |
37 virtual void StreamGenerated( | 36 virtual void StreamGenerated( |
38 const std::string& label, | 37 const std::string& label, |
39 const StreamDeviceInfoArray& audio_devices, | 38 const StreamDeviceInfoArray& audio_devices, |
40 const StreamDeviceInfoArray& video_devices) OVERRIDE; | 39 const StreamDeviceInfoArray& video_devices) OVERRIDE; |
41 virtual void StreamGenerationFailed(const std::string& label) OVERRIDE; | 40 virtual void StreamGenerationFailed(const std::string& label) OVERRIDE; |
42 virtual void AudioDeviceFailed(const std::string& label, int index) OVERRIDE; | 41 virtual void AudioDeviceFailed(const std::string& label, int index) OVERRIDE; |
43 virtual void VideoDeviceFailed(const std::string& label, int index) OVERRIDE; | 42 virtual void VideoDeviceFailed(const std::string& label, int index) OVERRIDE; |
44 virtual void DevicesEnumerated(const std::string& label, | 43 virtual void DevicesEnumerated(const std::string& label, |
45 const StreamDeviceInfoArray& devices) OVERRIDE; | 44 const StreamDeviceInfoArray& devices) OVERRIDE; |
46 virtual void DevicesEnumerationFailed(const std::string& label) OVERRIDE; | 45 virtual void DevicesEnumerationFailed(const std::string& label) OVERRIDE; |
47 virtual void DeviceOpened(const std::string& label, | 46 virtual void DeviceOpened(const std::string& label, |
48 const StreamDeviceInfo& video_device) OVERRIDE; | 47 const StreamDeviceInfo& video_device) OVERRIDE; |
49 virtual void DeviceOpenFailed(const std::string& label) OVERRIDE; | 48 virtual void DeviceOpenFailed(const std::string& label) OVERRIDE; |
50 | 49 |
51 // content::BrowserMessageFilter implementation. | 50 // content::BrowserMessageFilter implementation. |
52 virtual bool OnMessageReceived(const IPC::Message& message, | 51 virtual bool OnMessageReceived(const IPC::Message& message, |
53 bool* message_was_ok) OVERRIDE; | 52 bool* message_was_ok) OVERRIDE; |
54 virtual void OnChannelClosing() OVERRIDE; | 53 virtual void OnChannelClosing() OVERRIDE; |
55 | 54 |
| 55 protected: |
| 56 virtual ~MediaStreamDispatcherHost(); |
| 57 |
56 private: | 58 private: |
57 friend class MockMediaStreamDispatcherHost; | 59 friend class MockMediaStreamDispatcherHost; |
58 | 60 |
59 void OnGenerateStream(int render_view_id, | 61 void OnGenerateStream(int render_view_id, |
60 int page_request_id, | 62 int page_request_id, |
61 const StreamOptions& components, | 63 const StreamOptions& components, |
62 const std::string& security_origin); | 64 const std::string& security_origin); |
63 | 65 |
64 void OnStopGeneratedStream(int render_view_id, const std::string& label); | 66 void OnStopGeneratedStream(int render_view_id, const std::string& label); |
65 | 67 |
(...skipping 20 matching lines...) Expand all Loading... |
86 typedef std::map<std::string, StreamRequest> StreamMap; | 88 typedef std::map<std::string, StreamRequest> StreamMap; |
87 // Streams generated for this host. | 89 // Streams generated for this host. |
88 StreamMap streams_; | 90 StreamMap streams_; |
89 | 91 |
90 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); | 92 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); |
91 }; | 93 }; |
92 | 94 |
93 } // namespace media_stream | 95 } // namespace media_stream |
94 | 96 |
95 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 97 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
OLD | NEW |