Chromium Code Reviews| Index: content/browser/media/audio_output_stream_impl.cc |
| diff --git a/content/browser/media/audio_output_stream_impl.cc b/content/browser/media/audio_output_stream_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..85dc00b0ea4a0dbeb13cf3559eab3bd50ee93764 |
| --- /dev/null |
| +++ b/content/browser/media/audio_output_stream_impl.cc |
| @@ -0,0 +1,45 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/browser/media/audio_output_stream_impl.h" |
| + |
| +namespace content { |
| + |
| +AudioOutputStreamImpl::AudioOutputStreamImpl( |
| + media::mojom::AudioOutputStreamRequest request, |
| + int stream_id, |
| + int renderer_frame_id, |
| + AudioRendererHost* audio_renderer_host) |
| + : binding_(this, std::move(request)), |
| + stream_id_(stream_id), |
| + renderer_frame_id_(renderer_frame_id), |
| + audio_renderer_host_(audio_renderer_host) { |
| + DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| + LOG(ERROR) << "stream_id" << stream_id_; |
| +} |
| + |
| +AudioOutputStreamImpl::~AudioOutputStreamImpl() { |
| + LOG(ERROR) << "~AudioOutputStreamImpl" << stream_id_; |
| + // DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| +} |
| + |
| +void AudioOutputStreamImpl::Close() { |
|
Henrik Grunell
2016/05/20 13:35:40
Do we do the same as here for all AudioOutputStrea
rchtara
2016/05/27 15:24:37
yes
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| + audio_renderer_host_->CloseStream(stream_id_); |
| + audio_renderer_host_->get_audio_output_impl(renderer_frame_id_) |
|
Henrik Grunell
2016/05/20 13:35:40
Same comment as in AudioOutputImpl: could the Audi
rchtara
2016/05/27 15:24:37
discussed offline about this
|
| + ->RemoveStream(stream_id_); |
| + LOG(ERROR) << "AudioOutputStreamImplClose" << stream_id_; |
| +} |
| + |
| +// static |
| +AudioOutputStreamImpl* AudioOutputStreamFactory::Factory( |
| + media::mojom::AudioOutputStreamRequest request, |
| + int stream_id, |
| + int renderer_frame_id, |
| + AudioRendererHost* audio_renderer_host) { |
| + return new AudioOutputStreamImpl(std::move(request), stream_id, |
| + renderer_frame_id, audio_renderer_host); |
| +} |
| + |
| +} // namespace content |