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

Unified Diff: content/renderer/media/audio_message_filter.cc

Issue 1896883002: Mojo interfaces needed for switching audio rendering stream creation and closing from IPC to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: All grunell comments resolved Created 4 years, 8 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/renderer/media/audio_message_filter.cc
diff --git a/content/renderer/media/audio_message_filter.cc b/content/renderer/media/audio_message_filter.cc
index 9e7322d128e65f0d5f9507a544c8cf01943e7d16..baaccf12f848e3ab6d65e58fe1ddcdb842ac68e0 100644
--- a/content/renderer/media/audio_message_filter.cc
+++ b/content/renderer/media/audio_message_filter.cc
@@ -10,6 +10,7 @@
#include "base/single_thread_task_runner.h"
#include "base/strings/stringprintf.h"
#include "content/common/media/audio_messages.h"
+#include "content/renderer/media/audio_output_client.h"
#include "content/renderer/media/webrtc_logging.h"
#include "content/renderer/render_thread_impl.h"
#include "ipc/ipc_logging.h"
@@ -105,9 +106,11 @@ void AudioMessageFilter::AudioOutputIPCImpl::CreateStream(
DCHECK(!stream_created_);
if (stream_id_ == kStreamIDNotSet)
stream_id_ = filter_->delegates_.Add(delegate);
-
- filter_->Send(
- new AudioHostMsg_CreateStream(stream_id_, render_frame_id_, params));
+ // TODO(rchtara): This is temporary and is going to be removed in future cls.
+ // The plan is to try to completely remove AudioMessageFilter and move all
Henrik Grunell 2016/04/22 08:23:04 You could put it as: "This is temporary. In soon u
rchtara 2016/04/29 12:54:46 Done.
+ // the logic inside it to AudioOutputClient.
+ filter_->audio_output_client_->CreateStream(stream_id_, render_frame_id_,
+ params);
stream_created_ = true;
}
@@ -124,7 +127,10 @@ void AudioMessageFilter::AudioOutputIPCImpl::PauseStream() {
void AudioMessageFilter::AudioOutputIPCImpl::CloseStream() {
DCHECK(filter_->io_task_runner_->BelongsToCurrentThread());
DCHECK_NE(stream_id_, kStreamIDNotSet);
- filter_->Send(new AudioHostMsg_CloseStream(stream_id_));
+ // TODO(rchtara): This is temporary and is going to be removed in future cls.
+ // The plan is to try to completely remove AudioMessageFilter and move all
+ // the logic inside it to AudioOutputClient.
+ filter_->audio_output_client_->CloseStream(stream_id_);
filter_->delegates_.Remove(stream_id_);
stream_id_ = kStreamIDNotSet;
stream_created_ = false;
@@ -149,7 +155,6 @@ bool AudioMessageFilter::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AudioMessageFilter, message)
IPC_MESSAGE_HANDLER(AudioMsg_NotifyDeviceAuthorized, OnDeviceAuthorized)
- IPC_MESSAGE_HANDLER(AudioMsg_NotifyStreamCreated, OnStreamCreated)
IPC_MESSAGE_HANDLER(AudioMsg_NotifyStreamStateChanged, OnStreamStateChanged)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()

Powered by Google App Engine
This is Rietveld 408576698