Fix build break
[chromium-blink-merge.git] / content / renderer / media / render_media_log.cc
blob23ea4eef636d9a38e9328bbf88de0b1fe989f385
1 // Copyright (c) 2012 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.
5 #include "content/renderer/media/render_media_log.h"
7 #include "base/bind.h"
8 #include "base/message_loop_proxy.h"
9 #include "content/common/view_messages.h"
10 #include "content/renderer/render_thread_impl.h"
12 namespace content {
14 RenderMediaLog::RenderMediaLog()
15 : render_loop_(base::MessageLoopProxy::current()) {
16 DCHECK(RenderThreadImpl::current()) <<
17 "RenderMediaLog must be constructed on the render thread";
20 void RenderMediaLog::AddEvent(scoped_ptr<media::MediaLogEvent> event) {
21 if (RenderThreadImpl::current()) {
22 RenderThreadImpl::current()->Send(
23 new ViewHostMsg_MediaLogEvent(*event));
24 } else {
25 render_loop_->PostTask(FROM_HERE, base::Bind(
26 &RenderMediaLog::AddEvent, this, base::Passed(&event)));
30 RenderMediaLog::~RenderMediaLog() {}
32 } // namespace content