Chromium Code Reviews| Index: content/renderer/webrtc_logging_handler_impl.cc |
| diff --git a/content/renderer/webrtc_logging_handler_impl.cc b/content/renderer/webrtc_logging_handler_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d94656428f8404f3472d33b270c6996b392b52ec |
| --- /dev/null |
| +++ b/content/renderer/webrtc_logging_handler_impl.cc |
| @@ -0,0 +1,51 @@ |
| +// Copyright (c) 2013 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/renderer/webrtc_logging_handler_impl.h" |
| + |
| +#include "base/logging.h" |
| +#include "base/message_loop_proxy.h" |
| +#include "content/renderer/webrtc_logging_message_filter.h" |
| + |
| +namespace content { |
| + |
| +// TODO(grunell): Probably skip the thread dchecks and make sure here instead |
|
tommi (sloooow) - chröme
2013/03/28 11:00:10
I like the thread dchecks :)
Henrik Grunell
2013/04/02 10:06:40
Me too. But there's also dchecks in the filter. An
|
| +// that the filter is called on the right thread. |
| + |
| +WebRtcLoggingHandlerImpl::WebRtcLoggingHandlerImpl( |
| + const scoped_refptr<WebRtcLoggingMessageFilter>& message_filter, |
| + const scoped_refptr<base::MessageLoopProxy>& io_message_loop) |
| + : message_filter_(message_filter), |
| + io_message_loop_(io_message_loop) { |
| +} |
| + |
| +WebRtcLoggingHandlerImpl::~WebRtcLoggingHandlerImpl() { |
| +} |
| + |
| +void WebRtcLoggingHandlerImpl::OnFilterRemoved() { |
| + message_filter_ = NULL; |
| +} |
| + |
| +void WebRtcLoggingHandlerImpl::OpenLog() { |
| + DCHECK(io_message_loop_->BelongsToCurrentThread()); |
| + // TODO(grunell): Check if already opened. (Could have been opened by another |
| + // render view.) |
| + if (message_filter_) |
| + message_filter_->OpenLog(); |
| +} |
| + |
| +void WebRtcLoggingHandlerImpl::OnLogOpened( |
| + base::SharedMemoryHandle handle, |
| + uint32 length) { |
| + DCHECK(io_message_loop_->BelongsToCurrentThread()); |
| + // TODO(grunell): Setup stuff. |
| +} |
| + |
| +void WebRtcLoggingHandlerImpl::OnOpenLogFailed() { |
| + DCHECK(io_message_loop_->BelongsToCurrentThread()); |
| + LOG(ERROR) << "Could not open log."; |
| + // TODO(grunell): Handle error. |
| +} |
| + |
| +} // namespace content |