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

Side by Side Diff: media/base/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 "media/base/media_log.h"
6
7 namespace media {
8
9 // A count of all MediaLogs created on this render process.
10 // Used to generate unique ids.
11 static int32 mediaLogCount = 0;
12
13 const char* MediaLog::EventTypeToString(EventType type) {
14 switch (type) {
15 #define EVENT(type) case type: return #type;
16 #include "media_event_types.h"
17 #undef EVENT
18 }
19 return NULL;
20 }
21
22 MediaLog::MediaLog() {
23 id_ = mediaLogCount;
24 mediaLogCount++;
25 }
26
27 MediaLog::~MediaLog() {}
28
29 void MediaLog::Load(const std::string& url) {
30 Event* event = CreateEvent(LOAD);
31 event->params.SetString("url", url);
32 AddEvent(event);
33 }
34
35 void MediaLog::AddEventOfType(EventType type) {
36 Event* event = CreateEvent(type);
37 AddEvent(event);
38 }
39
40 MediaLog::Event* MediaLog::CreateEvent(EventType type) {
41 Event* event = new Event;
42 event->renderer = base::Process::Current().pid();
43 event->id = id_;
44 event->type = type;
45 event->time = base::Time::Now();
46 return event;
47 }
48
49 void MediaLog::AddEvent(Event* event) {}
50
51 } //namespace media
OLDNEW
« media/base/media_log.h ('K') | « media/base/media_log.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698