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

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

Issue 7327034: Commits http://codereview.chromium.org/7157001/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Removed chrome dependencices in content/renderer Created 9 years, 5 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_input_message_filter.cc
===================================================================
--- content/renderer/media/audio_input_message_filter.cc (revision 92002)
+++ content/renderer/media/audio_input_message_filter.cc (working copy)
@@ -6,43 +6,38 @@
#include "base/message_loop.h"
#include "base/time.h"
+#include "content/common/child_process.h"
#include "content/common/media/audio_messages.h"
#include "ipc/ipc_logging.h"
-AudioInputMessageFilter::AudioInputMessageFilter(int32 route_id)
- : channel_(NULL),
- route_id_(route_id),
- message_loop_(NULL) {
- VLOG(1) << "AudioInputMessageFilter(route_id=" << route_id << ")";
+AudioInputMessageFilter::AudioInputMessageFilter()
+ : channel_(NULL) {
+ VLOG(1) << "AudioInputMessageFilter()";
}
-AudioInputMessageFilter::~AudioInputMessageFilter() {}
+AudioInputMessageFilter::~AudioInputMessageFilter() {
+ VLOG(1) << "AudioInputMessageFilter::~AudioInputMessageFilter()";
+}
-// Called on the IPC thread.
bool AudioInputMessageFilter::Send(IPC::Message* message) {
if (!channel_) {
delete message;
return false;
}
- if (MessageLoop::current() != message_loop_) {
+ if (MessageLoop::current() != ChildProcess::current()->io_message_loop()) {
// Can only access the IPC::Channel on the IPC thread since it's not thread
// safe.
- message_loop_->PostTask(
- FROM_HERE, NewRunnableMethod(this,
- &AudioInputMessageFilter::Send,
- message));
+ ChildProcess::current()->io_message_loop()->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(this, &AudioInputMessageFilter::Send, message));
return true;
}
- message->set_routing_id(route_id_);
return channel_->Send(message);
}
bool AudioInputMessageFilter::OnMessageReceived(const IPC::Message& message) {
- if (message.routing_id() != route_id_)
- return false;
-
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AudioInputMessageFilter, message)
IPC_MESSAGE_HANDLER(AudioInputMsg_NotifyLowLatencyStreamCreated,
@@ -55,8 +50,7 @@
void AudioInputMessageFilter::OnFilterAdded(IPC::Channel* channel) {
VLOG(1) << "AudioInputMessageFilter::OnFilterAdded()";
- // Captures the message loop for IPC.
- message_loop_ = MessageLoop::current();
+ // Captures the channel for IPC.
channel_ = channel;
}

Powered by Google App Engine
This is Rietveld 408576698