summaryrefslogtreecommitdiffstats
path: root/content/renderer/webrtc_logging_handler_impl.cc
blob: 595e490037ddd6273cc4432b36b98b57ca13ff22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// 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 {

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): Implement.
  NOTIMPLEMENTED();
}

void WebRtcLoggingHandlerImpl::OnOpenLogFailed() {
  DCHECK(io_message_loop_->BelongsToCurrentThread());
  DLOG(ERROR) << "Could not open log.";
  // TODO(grunell): Implement.
  NOTIMPLEMENTED();
}

}  // namespace content