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 // 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
| |
14 // that the filter is called on the right thread. | |
15 | |
16 WebRtcLoggingHandlerImpl::WebRtcLoggingHandlerImpl( | |
17 const scoped_refptr<WebRtcLoggingMessageFilter>& message_filter, | |
18 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) | |
19 : message_filter_(message_filter), | |
20 io_message_loop_(io_message_loop) { | |
21 } | |
22 | |
23 WebRtcLoggingHandlerImpl::~WebRtcLoggingHandlerImpl() { | |
24 } | |
25 | |
26 void WebRtcLoggingHandlerImpl::OnFilterRemoved() { | |
27 message_filter_ = NULL; | |
28 } | |
29 | |
30 void WebRtcLoggingHandlerImpl::OpenLog() { | |
31 DCHECK(io_message_loop_->BelongsToCurrentThread()); | |
32 // TODO(grunell): Check if already opened. (Could have been opened by another | |
33 // render view.) | |
34 if (message_filter_) | |
35 message_filter_->OpenLog(); | |
36 } | |
37 | |
38 void WebRtcLoggingHandlerImpl::OnLogOpened( | |
39 base::SharedMemoryHandle handle, | |
40 uint32 length) { | |
41 DCHECK(io_message_loop_->BelongsToCurrentThread()); | |
42 // TODO(grunell): Setup stuff. | |
43 } | |
44 | |
45 void WebRtcLoggingHandlerImpl::OnOpenLogFailed() { | |
46 DCHECK(io_message_loop_->BelongsToCurrentThread()); | |
47 LOG(ERROR) << "Could not open log."; | |
48 // TODO(grunell): Handle error. | |
49 } | |
50 | |
51 } // namespace content | |
OLD | NEW |