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

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: unique_ptr for Binding 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..f335c057c7f4977ab6e67f035d1a4e287c13b6d6
--- /dev/null
+++ b/content/browser/media/audio_output_stream_impl.cc
@@ -0,0 +1,28 @@
+// 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(
+ int stream_id,
+ AudioOutputImpl* audio_output_impl,
+ media::mojom::AudioOutputStreamRequest request)
+ : stream_id_(stream_id), audio_output_impl_(audio_output_impl) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ binding_.reset(new mojo::Binding<media::mojom::AudioOutputStream>(
+ this, std::move(request)));
+}
+
+AudioOutputStreamImpl::~AudioOutputStreamImpl() {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+}
+
+void AudioOutputStreamImpl::Close() {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ audio_output_impl_->CloseStream(stream_id_);
+}
+
+} // namespace content
« no previous file with comments | « content/browser/media/audio_output_stream_impl.h ('k') | content/browser/media/audio_output_stream_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698