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"
8 #include "base/message_loop_proxy.h"
9 #include "content/common/view_messages.h"
10 #include "content/renderer/render_thread_impl.h"
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
));
25 render_loop_
->PostTask(FROM_HERE
, base::Bind(
26 &RenderMediaLog::AddEvent
, this, base::Passed(&event
)));
30 RenderMediaLog::~RenderMediaLog() {}
32 } // namespace content