Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Side by Side Diff: content/renderer/media/content_media_log.cc

Issue 7480032: Plumb media data from renderers up to MediaInternals in the browser process. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Much cleanup and making MediaLog thread safe. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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/media/content_media_log.h"
6
7 #include "base/message_loop.h"
8 #include "content/common/media/media_log_messages.h"
9 #include "content/renderer/render_thread.h"
10
11 ContentMediaLog::ContentMediaLog() : render_loop_(MessageLoop::current()) {
12 DCHECK(RenderThread::current()) <<
13 "ContentMediaLog must be constructed on the render thread";
14 }
15
16 void ContentMediaLog::AddEvent(Event* event) {
17 scoped_ptr<Event> e(event);
18
19 if (MessageLoop::current() == render_loop_) {
jam 2011/07/29 16:08:55 you don't need to store the message loop pointer.
Scott Franklin 2011/07/29 22:30:25 Right, but I then have no way of posting the task
jam 2011/08/01 06:03:25 of course, nm them :) although please use MessageL
Scott Franklin 2011/08/01 18:41:04 Done.
20 RenderThread::current()->Send(new MediaLogMsg_MediaEvent(*e));
21 } else {
22 render_loop_->PostTask(FROM_HERE,
23 NewRunnableMethod(this, &ContentMediaLog::AddEvent, e.release()));
24 }
25 }
26
27 ContentMediaLog::~ContentMediaLog() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698