Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/renderer/webrtc_logging_handler_impl.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "base/message_loop_proxy.h" | |
| 9 #include "content/renderer/webrtc_logging_message_filter.h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 WebRtcLoggingHandlerImpl::WebRtcLoggingHandlerImpl( | |
| 14 const scoped_refptr<WebRtcLoggingMessageFilter>& message_filter, | |
| 15 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) | |
| 16 : message_filter_(message_filter), | |
| 17 io_message_loop_(io_message_loop) { | |
| 18 } | |
| 19 | |
| 20 WebRtcLoggingHandlerImpl::~WebRtcLoggingHandlerImpl() { | |
| 21 } | |
| 22 | |
| 23 void WebRtcLoggingHandlerImpl::OnFilterRemoved() { | |
| 24 message_filter_ = NULL; | |
| 25 } | |
| 26 | |
| 27 void WebRtcLoggingHandlerImpl::OpenLog() { | |
| 28 if(!io_message_loop_->BelongsToCurrentThread()) { | |
|
brettw
2013/04/05 19:59:05
I'm usually kind of worried when I see functions w
Henrik Grunell
2013/04/08 09:15:39
This will be called from libjingle. Should libjing
Henrik Grunell
2013/04/12 12:23:41
Adding reply by brettw:
"I'm definitely in favor o
| |
| 29 io_message_loop_->PostTask( | |
| 30 FROM_HERE, | |
| 31 base::Bind(&WebRtcLoggingHandlerImpl::OpenLog, this)); | |
| 32 } | |
| 33 // TODO(grunell): Check if already opened. (Could have been opened by another | |
| 34 // render view.) | |
| 35 if (message_filter_) | |
| 36 message_filter_->OpenLog(); | |
| 37 } | |
| 38 | |
| 39 void WebRtcLoggingHandlerImpl::OnLogOpened( | |
| 40 base::SharedMemoryHandle handle, | |
| 41 uint32 length) { | |
| 42 DCHECK(io_message_loop_->BelongsToCurrentThread()); | |
| 43 // TODO(grunell): Implement. | |
| 44 NOTIMPLEMENTED(); | |
| 45 } | |
| 46 | |
| 47 void WebRtcLoggingHandlerImpl::OnOpenLogFailed() { | |
| 48 DCHECK(io_message_loop_->BelongsToCurrentThread()); | |
| 49 LOG(ERROR) << "Could not open log."; | |
|
brettw
2013/04/05 19:59:05
Does this need to be non-debug logging? Since this
Henrik Grunell
2013/04/08 09:15:39
DLOG is fine with me. Changed.
| |
| 50 // TODO(grunell): Implement. | |
| 51 NOTIMPLEMENTED(); | |
| 52 } | |
| 53 | |
| 54 } // namespace content | |
| OLD | NEW |