| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/renderer/media/webrtc_logging_message_filter.h" | 5 #include "chrome/renderer/media/webrtc_logging_message_filter.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "chrome/common/media/webrtc_logging_messages.h" | 9 #include "chrome/common/media/webrtc_logging_messages.h" |
| 10 #include "chrome/renderer/media/chrome_webrtc_log_message_delegate.h" | 10 #include "chrome/renderer/media/chrome_webrtc_log_message_delegate.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 32 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 33 bool handled = true; | 33 bool handled = true; |
| 34 IPC_BEGIN_MESSAGE_MAP(WebRtcLoggingMessageFilter, message) | 34 IPC_BEGIN_MESSAGE_MAP(WebRtcLoggingMessageFilter, message) |
| 35 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_StartLogging, OnStartLogging) | 35 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_StartLogging, OnStartLogging) |
| 36 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_StopLogging, OnStopLogging) | 36 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_StopLogging, OnStopLogging) |
| 37 IPC_MESSAGE_UNHANDLED(handled = false) | 37 IPC_MESSAGE_UNHANDLED(handled = false) |
| 38 IPC_END_MESSAGE_MAP() | 38 IPC_END_MESSAGE_MAP() |
| 39 return handled; | 39 return handled; |
| 40 } | 40 } |
| 41 | 41 |
| 42 void WebRtcLoggingMessageFilter::OnFilterAdded(IPC::Sender* sender) { | 42 void WebRtcLoggingMessageFilter::OnFilterAdded(IPC::Channel* channel) { |
| 43 DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread()); | 43 DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread()); |
| 44 sender_ = sender; | 44 sender_ = channel; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void WebRtcLoggingMessageFilter::OnFilterRemoved() { | 47 void WebRtcLoggingMessageFilter::OnFilterRemoved() { |
| 48 DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread()); | 48 DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread()); |
| 49 sender_ = NULL; | 49 sender_ = NULL; |
| 50 log_message_delegate_->OnFilterRemoved(); | 50 log_message_delegate_->OnFilterRemoved(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void WebRtcLoggingMessageFilter::OnChannelClosing() { | 53 void WebRtcLoggingMessageFilter::OnChannelClosing() { |
| 54 DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread()); | 54 DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread()); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 85 | 85 |
| 86 void WebRtcLoggingMessageFilter::Send(IPC::Message* message) { | 86 void WebRtcLoggingMessageFilter::Send(IPC::Message* message) { |
| 87 DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread()); | 87 DCHECK(!io_task_runner_.get() || io_task_runner_->BelongsToCurrentThread()); |
| 88 if (!sender_) { | 88 if (!sender_) { |
| 89 DLOG(ERROR) << "IPC sender not available."; | 89 DLOG(ERROR) << "IPC sender not available."; |
| 90 delete message; | 90 delete message; |
| 91 } else { | 91 } else { |
| 92 sender_->Send(message); | 92 sender_->Send(message); |
| 93 } | 93 } |
| 94 } | 94 } |
| OLD | NEW |