OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_ | |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_ | |
7 | |
8 #include <memory> | |
9 #include <string> | |
10 #include <vector> | |
11 | |
12 #include "content/browser/renderer_host/media/audio_output_authorization_handler .h" | |
13 #include "content/browser/renderer_host/media/audio_output_delegate.h" | |
14 #include "content/common/content_export.h" | |
15 #include "media/mojo/interfaces/audio_output.mojom.h" | |
16 #include "mojo/public/cpp/bindings/interface_request.h" | |
17 | |
18 namespace media { | |
19 class AudioManager; | |
20 | |
21 namespace mojom { | |
22 class AudioOutputService; | |
23 } // namespace mojom | |
24 } // namespace media | |
25 | |
26 namespace content { | |
27 | |
28 class AudioMirroringManager; | |
29 class AudioOutputServiceImpl; | |
30 class MediaStreamManager; | |
31 | |
32 class CONTENT_EXPORT AudioOutputServiceContext { | |
33 public: | |
34 AudioOutputServiceContext(int render_process_id, | |
35 media::AudioManager* audio_manager, | |
36 MediaStreamManager* media_stream_manager, | |
37 AudioMirroringManager* mirroring_manager, | |
38 const std::string& salt); | |
39 ~AudioOutputServiceContext(); | |
40 | |
41 void CreateService( | |
42 int frame_host_id, | |
43 mojo::InterfaceRequest<media::mojom::AudioOutputService> request); | |
44 | |
45 void ServiceHadConnectionError(AudioOutputServiceImpl* service); | |
46 | |
47 // Accessors for data common to all AudioOutputServiceImpls for a single | |
48 // render process. | |
49 int render_process_id() const { return render_process_id_; } | |
50 | |
51 const AudioOutputAuthorizationHandler* authorization_handler() const { | |
52 return &authorization_handler_; | |
53 } | |
54 | |
55 const std::string& salt() const { return salt_; } | |
56 | |
57 AudioOutputDelegate::UniquePtr CreateDelegate( | |
58 const std::string& unique_device_id, | |
59 int render_frame_id, | |
60 AudioOutputDelegate::EventHandler* handler, | |
61 const media::AudioParameters& params); | |
62 | |
63 private: | |
64 const int render_process_id_; | |
65 media::AudioManager* const audio_manager_; | |
o1ka
2017/01/25 15:15:21
It would be great to avoid duplications between Au
| |
66 MediaStreamManager* const media_stream_manager_; | |
67 AudioMirroringManager* const mirroring_manager_; | |
68 const std::string salt_; | |
69 AudioOutputAuthorizationHandler authorization_handler_; | |
70 int next_stream_id_ = 0; | |
71 | |
72 std::vector<std::unique_ptr<AudioOutputServiceImpl>> services_; | |
o1ka
2017/01/25 15:15:21
Can't you manage it with StrongBindingSet instead?
| |
73 }; | |
74 | |
75 } // namespace content | |
76 | |
77 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_SERVICE_CONTEXT_H_ | |
OLD | NEW |