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

Unified Diff: content/browser/media/audio_output_stream_impl.cc

Issue 1930393002: Switch stream creation and closing in Chrome audio rendering from IPC to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use of process_ instead of audio_renderer_host Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698