OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 15 matching lines...) Expand all Loading... |
26 // (owned by RenderView). | 26 // (owned by RenderView). |
27 class CONTENT_EXPORT MediaStreamDispatcherHost | 27 class CONTENT_EXPORT MediaStreamDispatcherHost |
28 : public BrowserMessageFilter, | 28 : public BrowserMessageFilter, |
29 public MediaStreamRequester { | 29 public MediaStreamRequester { |
30 public: | 30 public: |
31 MediaStreamDispatcherHost(const content::ResourceContext* resource_context, | 31 MediaStreamDispatcherHost(const content::ResourceContext* resource_context, |
32 int render_process_id); | 32 int render_process_id); |
33 virtual ~MediaStreamDispatcherHost(); | 33 virtual ~MediaStreamDispatcherHost(); |
34 | 34 |
35 // MediaStreamRequester implementation. | 35 // MediaStreamRequester implementation. |
36 virtual void StreamGenerated(const std::string& label, | 36 virtual void StreamGenerated( |
37 const StreamDeviceInfoArray& audio_devices, | 37 const std::string& label, |
38 const StreamDeviceInfoArray& video_devices); | 38 const StreamDeviceInfoArray& audio_devices, |
| 39 const StreamDeviceInfoArray& video_devices) OVERRIDE; |
39 | 40 |
40 virtual void StreamGenerationFailed(const std::string& label); | 41 virtual void StreamGenerationFailed(const std::string& label) OVERRIDE; |
41 virtual void AudioDeviceFailed(const std::string& label, int index); | 42 virtual void AudioDeviceFailed(const std::string& label, int index) OVERRIDE; |
42 virtual void VideoDeviceFailed(const std::string& label, int index); | 43 virtual void VideoDeviceFailed(const std::string& label, int index) OVERRIDE; |
43 | 44 |
44 // BrowserMessageFilter implementation. | 45 // BrowserMessageFilter implementation. |
45 virtual bool OnMessageReceived(const IPC::Message& message, | 46 virtual bool OnMessageReceived(const IPC::Message& message, |
46 bool* message_was_ok); | 47 bool* message_was_ok) OVERRIDE; |
47 virtual void OnChannelClosing(); | 48 virtual void OnChannelClosing() OVERRIDE; |
48 | 49 |
49 private: | 50 private: |
50 friend class MockMediaStreamDispatcherHost; | 51 friend class MockMediaStreamDispatcherHost; |
51 | 52 |
52 void OnGenerateStream(int render_view_id, | 53 void OnGenerateStream(int render_view_id, |
53 int page_request_id, | 54 int page_request_id, |
54 const StreamOptions& components, | 55 const StreamOptions& components, |
55 const std::string& security_origin); | 56 const std::string& security_origin); |
56 | 57 |
57 void OnStopGeneratedStream(int render_view_id, const std::string& label); | 58 void OnStopGeneratedStream(int render_view_id, const std::string& label); |
58 | 59 |
59 // Returns the media stream manager to forward events to, | 60 // Returns the media stream manager to forward events to, |
60 // creating one if needed. | 61 // creating one if needed. |
61 MediaStreamManager* manager(); | 62 MediaStreamManager* manager(); |
62 | 63 |
63 const content::ResourceContext* resource_context_; | 64 const content::ResourceContext* resource_context_; |
64 int render_process_id_; | 65 int render_process_id_; |
65 | 66 |
66 struct StreamRequest; | 67 struct StreamRequest; |
67 typedef std::map<std::string, StreamRequest> StreamMap; | 68 typedef std::map<std::string, StreamRequest> StreamMap; |
68 // Streams generated for this host. | 69 // Streams generated for this host. |
69 StreamMap streams_; | 70 StreamMap streams_; |
70 | 71 |
71 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); | 72 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); |
72 }; | 73 }; |
73 | 74 |
74 } // namespace media_stream | 75 } // namespace media_stream |
75 | 76 |
76 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 77 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
OLD | NEW |