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

Unified Diff: chrome/renderer/media/webrtc_logging_message_filter.cc

Issue 1123733002: [chrome/renderer/media] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding changes Created 5 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: chrome/renderer/media/webrtc_logging_message_filter.cc
diff --git a/chrome/renderer/media/webrtc_logging_message_filter.cc b/chrome/renderer/media/webrtc_logging_message_filter.cc
index 4669df0a2dadd8cc3e186219c9371e8998e5fad6..c3ffee4ca982836cc8eabc8d369f52dd4e5eb5ca 100644
--- a/chrome/renderer/media/webrtc_logging_message_filter.cc
+++ b/chrome/renderer/media/webrtc_logging_message_filter.cc
@@ -5,19 +5,19 @@
#include "chrome/renderer/media/webrtc_logging_message_filter.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
#include "chrome/common/media/webrtc_logging_messages.h"
#include "chrome/renderer/media/chrome_webrtc_log_message_delegate.h"
#include "ipc/ipc_logging.h"
WebRtcLoggingMessageFilter::WebRtcLoggingMessageFilter(
- const scoped_refptr<base::MessageLoopProxy>& io_message_loop)
- : io_message_loop_(io_message_loop),
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner)
+ : io_task_runner_(io_task_runner),
log_message_delegate_(NULL),
sender_(NULL) {
// May be null in a browsertest using MockRenderThread.
- if (io_message_loop_.get()) {
- io_message_loop_->PostTask(
+ if (io_task_runner_.get()) {
+ io_task_runner_->PostTask(
FROM_HERE, base::Bind(
&WebRtcLoggingMessageFilter::CreateLoggingHandler,
base::Unretained(this)));
@@ -29,7 +29,7 @@ WebRtcLoggingMessageFilter::~WebRtcLoggingMessageFilter() {
bool WebRtcLoggingMessageFilter::OnMessageReceived(
const IPC::Message& message) {
- DCHECK(io_message_loop_->BelongsToCurrentThread());
+ DCHECK(io_task_runner_->BelongsToCurrentThread());
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebRtcLoggingMessageFilter, message)
IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_StartLogging, OnStartLogging)
@@ -40,51 +40,51 @@ bool WebRtcLoggingMessageFilter::OnMessageReceived(
}
void WebRtcLoggingMessageFilter::OnFilterAdded(IPC::Sender* sender) {
- DCHECK(!io_message_loop_.get() || io_message_loop_->BelongsToCurrentThread());
+ DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread());
sender_ = sender;
}
void WebRtcLoggingMessageFilter::OnFilterRemoved() {
- DCHECK(!io_message_loop_.get() || io_message_loop_->BelongsToCurrentThread());
+ DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread());
sender_ = NULL;
log_message_delegate_->OnFilterRemoved();
}
void WebRtcLoggingMessageFilter::OnChannelClosing() {
- DCHECK(!io_message_loop_.get() || io_message_loop_->BelongsToCurrentThread());
+ DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread());
sender_ = NULL;
log_message_delegate_->OnFilterRemoved();
}
void WebRtcLoggingMessageFilter::AddLogMessages(
const std::vector<WebRtcLoggingMessageData>& messages) {
- DCHECK(io_message_loop_->BelongsToCurrentThread());
+ DCHECK(io_task_runner_->BelongsToCurrentThread());
Send(new WebRtcLoggingMsg_AddLogMessages(messages));
}
void WebRtcLoggingMessageFilter::LoggingStopped() {
- DCHECK(!io_message_loop_.get() || io_message_loop_->BelongsToCurrentThread());
+ DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread());
Send(new WebRtcLoggingMsg_LoggingStopped());
}
void WebRtcLoggingMessageFilter::CreateLoggingHandler() {
- DCHECK(!io_message_loop_.get() || io_message_loop_->BelongsToCurrentThread());
+ DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread());
log_message_delegate_ =
- new ChromeWebRtcLogMessageDelegate(io_message_loop_, this);
+ new ChromeWebRtcLogMessageDelegate(io_task_runner_, this);
}
void WebRtcLoggingMessageFilter::OnStartLogging() {
- DCHECK(!io_message_loop_.get() || io_message_loop_->BelongsToCurrentThread());
+ DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread());
log_message_delegate_->OnStartLogging();
}
void WebRtcLoggingMessageFilter::OnStopLogging() {
- DCHECK(!io_message_loop_.get() || io_message_loop_->BelongsToCurrentThread());
+ DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread());
log_message_delegate_->OnStopLogging();
}
void WebRtcLoggingMessageFilter::Send(IPC::Message* message) {
- DCHECK(!io_message_loop_.get() || io_message_loop_->BelongsToCurrentThread());
+ DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread());
if (!sender_) {
DLOG(ERROR) << "IPC sender not available.";
delete message;

Powered by Google App Engine
This is Rietveld 408576698