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 #include "content/renderer/media/renderer_webaudiodevice_impl.h" | 5 #include "content/renderer/media/renderer_webaudiodevice_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 86 matching lines...) Loading... | |
97 int session_id, | 97 int session_id, |
98 const std::string& device_id, | 98 const std::string& device_id, |
99 const url::Origin& security_origin) { | 99 const url::Origin& security_origin) { |
100 return AudioDeviceFactory::GetOutputDeviceInfo(frame_id, session_id, | 100 return AudioDeviceFactory::GetOutputDeviceInfo(frame_id, session_id, |
101 device_id, security_origin) | 101 device_id, security_origin) |
102 .output_params(); | 102 .output_params(); |
103 } | 103 } |
104 | 104 |
105 } // namespace | 105 } // namespace |
106 | 106 |
107 RendererWebAudioDeviceImpl* RendererWebAudioDeviceImpl::Create( | 107 std::unique_ptr<RendererWebAudioDeviceImpl> RendererWebAudioDeviceImpl::Create( |
108 media::ChannelLayout layout, | 108 media::ChannelLayout layout, |
109 int channels, | 109 int channels, |
110 const blink::WebAudioLatencyHint& latency_hint, | 110 const blink::WebAudioLatencyHint& latency_hint, |
111 WebAudioDevice::RenderCallback* callback, | 111 WebAudioDevice::RenderCallback* callback, |
112 int session_id, | 112 int session_id, |
113 const url::Origin& security_origin) { | 113 const url::Origin& security_origin) { |
114 return new RendererWebAudioDeviceImpl(layout, channels, latency_hint, | 114 return std::unique_ptr<RendererWebAudioDeviceImpl>( |
clamy
2017/04/27 12:00:18
Could we use base::MakeUnique?
altimin
2017/04/27 12:06:30
RendererWebAudioDeviceImpl's constructor is privat
clamy
2017/04/27 12:12:48
Acknowledged.
| |
115 callback, session_id, security_origin, | 115 new RendererWebAudioDeviceImpl(layout, channels, latency_hint, callback, |
116 base::Bind(&GetOutputDeviceParameters), | 116 session_id, security_origin, |
117 base::Bind(&FrameIdFromCurrentContext)); | 117 base::Bind(&GetOutputDeviceParameters), |
118 base::Bind(&FrameIdFromCurrentContext))); | |
118 } | 119 } |
119 | 120 |
120 RendererWebAudioDeviceImpl::RendererWebAudioDeviceImpl( | 121 RendererWebAudioDeviceImpl::RendererWebAudioDeviceImpl( |
121 media::ChannelLayout layout, | 122 media::ChannelLayout layout, |
122 int channels, | 123 int channels, |
123 const blink::WebAudioLatencyHint& latency_hint, | 124 const blink::WebAudioLatencyHint& latency_hint, |
124 WebAudioDevice::RenderCallback* callback, | 125 WebAudioDevice::RenderCallback* callback, |
125 int session_id, | 126 int session_id, |
126 const url::Origin& security_origin, | 127 const url::Origin& security_origin, |
127 const OutputDeviceParamsCallback& device_params_cb, | 128 const OutputDeviceParamsCallback& device_params_cb, |
(...skipping 112 matching lines...) Loading... | |
240 const scoped_refptr<base::SingleThreadTaskRunner>& | 241 const scoped_refptr<base::SingleThreadTaskRunner>& |
241 RendererWebAudioDeviceImpl::GetMediaTaskRunner() { | 242 RendererWebAudioDeviceImpl::GetMediaTaskRunner() { |
242 if (!media_task_runner_) { | 243 if (!media_task_runner_) { |
243 media_task_runner_ = | 244 media_task_runner_ = |
244 RenderThreadImpl::current()->GetMediaThreadTaskRunner(); | 245 RenderThreadImpl::current()->GetMediaThreadTaskRunner(); |
245 } | 246 } |
246 return media_task_runner_; | 247 return media_task_runner_; |
247 } | 248 } |
248 | 249 |
249 } // namespace content | 250 } // namespace content |
OLD | NEW |