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> |
11 | 11 |
12 #include "content/browser/renderer_host/media/media_stream_manager.h" | 12 #include "content/browser/renderer_host/media/media_stream_manager.h" |
13 #include "content/browser/renderer_host/media/media_stream_requester.h" | 13 #include "content/browser/renderer_host/media/media_stream_requester.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/common/media/media_stream_options.h" | 15 #include "content/common/media/media_stream_options.h" |
16 #include "content/public/browser/browser_message_filter.h" | 16 #include "content/public/browser/browser_message_filter.h" |
| 17 #include "content/public/browser/resource_context.h" |
17 | 18 |
18 namespace content { | 19 namespace content { |
| 20 |
19 class MediaStreamManager; | 21 class MediaStreamManager; |
20 | 22 |
21 // MediaStreamDispatcherHost is a delegate for Media Stream API messages used by | 23 // MediaStreamDispatcherHost is a delegate for Media Stream API messages used by |
22 // MediaStreamImpl. It's the complement of MediaStreamDispatcher | 24 // MediaStreamImpl. It's the complement of MediaStreamDispatcher |
23 // (owned by RenderView). | 25 // (owned by RenderView). |
24 class CONTENT_EXPORT MediaStreamDispatcherHost : public BrowserMessageFilter, | 26 class CONTENT_EXPORT MediaStreamDispatcherHost : public BrowserMessageFilter, |
25 public MediaStreamRequester { | 27 public MediaStreamRequester { |
26 public: | 28 public: |
27 MediaStreamDispatcherHost(int render_process_id, | 29 MediaStreamDispatcherHost(int render_process_id, |
| 30 ResourceContext* resource_context, |
28 MediaStreamManager* media_stream_manager); | 31 MediaStreamManager* media_stream_manager); |
29 | 32 |
30 // MediaStreamRequester implementation. | 33 // MediaStreamRequester implementation. |
31 virtual void StreamGenerated( | 34 virtual void StreamGenerated( |
32 const std::string& label, | 35 const std::string& label, |
33 const StreamDeviceInfoArray& audio_devices, | 36 const StreamDeviceInfoArray& audio_devices, |
34 const StreamDeviceInfoArray& video_devices) OVERRIDE; | 37 const StreamDeviceInfoArray& video_devices) OVERRIDE; |
35 virtual void StreamGenerationFailed(const std::string& label) OVERRIDE; | 38 virtual void StreamGenerationFailed(const std::string& label) OVERRIDE; |
36 virtual void StopGeneratedStream(int render_view_id, | 39 virtual void StopGeneratedStream(int render_view_id, |
37 const std::string& label) OVERRIDE; | 40 const std::string& label) OVERRIDE; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 91 |
89 void OnCloseDevice(int render_view_id, | 92 void OnCloseDevice(int render_view_id, |
90 const std::string& label); | 93 const std::string& label); |
91 | 94 |
92 void StoreRequest(int render_view_id, | 95 void StoreRequest(int render_view_id, |
93 int page_request_id, | 96 int page_request_id, |
94 const std::string& label); | 97 const std::string& label); |
95 StreamRequest PopRequest(const std::string& label); | 98 StreamRequest PopRequest(const std::string& label); |
96 | 99 |
97 int render_process_id_; | 100 int render_process_id_; |
| 101 ResourceContext* resource_context_; |
98 MediaStreamManager* media_stream_manager_; | 102 MediaStreamManager* media_stream_manager_; |
99 | 103 |
100 // Active requests. When the MediaStreamManager responds to a a request the | 104 // Active requests. When the MediaStreamManager responds to a a request the |
101 // request is removed from this map. | 105 // request is removed from this map. |
102 StreamMap streams_; | 106 StreamMap streams_; |
103 | 107 |
104 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); | 108 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); |
105 }; | 109 }; |
106 | 110 |
107 } // namespace content | 111 } // namespace content |
108 | 112 |
109 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 113 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
OLD | NEW |