Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: content/browser/renderer_host/media/media_stream_dispatcher_host.h

Issue 54863002: Implement a salt for MediaSource IDs that can be cleared by a user. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed jois nit. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 DeviceStopped(int render_view_id, 39 virtual void DeviceStopped(int render_view_id,
37 const std::string& label, 40 const std::string& label,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 92
90 void OnCloseDevice(int render_view_id, 93 void OnCloseDevice(int render_view_id,
91 const std::string& label); 94 const std::string& label);
92 95
93 void StoreRequest(int render_view_id, 96 void StoreRequest(int render_view_id,
94 int page_request_id, 97 int page_request_id,
95 const std::string& label); 98 const std::string& label);
96 StreamRequest PopRequest(const std::string& label); 99 StreamRequest PopRequest(const std::string& label);
97 100
98 int render_process_id_; 101 int render_process_id_;
102 ResourceContext* resource_context_;
99 MediaStreamManager* media_stream_manager_; 103 MediaStreamManager* media_stream_manager_;
100 104
101 // Active requests. When the MediaStreamManager responds to a a request the 105 // Active requests. When the MediaStreamManager responds to a a request the
102 // request is removed from this map. 106 // request is removed from this map.
103 StreamMap streams_; 107 StreamMap streams_;
104 108
105 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); 109 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost);
106 }; 110 };
107 111
108 } // namespace content 112 } // namespace content
109 113
110 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ 114 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698