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

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: Rebasing onto http://codereview.chromium.org/7491048 prior to (hopefully) relanding. 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 #include "base/atomic_sequence_num.h"
8 #include "base/logging.h"
9
10 namespace media {
11
12 // A count of all MediaLogs created on this render process.
13 // Used to generate unique ids.
14 static base::AtomicSequenceNumber media_log_count(base::LINKER_INITIALIZED);
15
16 const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) {
17 switch (type) {
18 case MediaLogEvent::CREATING:
19 return "CREATING";
20 case MediaLogEvent::DESTROYING:
21 return "DESTROYING";
22 case MediaLogEvent::LOAD:
23 return "LOAD";
24 case MediaLogEvent::PLAY:
25 return "PLAY";
26 case MediaLogEvent::PAUSE:
27 return "PAUSE";
28 }
29 NOTREACHED();
30 return NULL;
31 }
32
33 MediaLog::MediaLog() {
34 id_ = media_log_count.GetNext();
35 }
36
37 MediaLog::~MediaLog() {}
38
39 void MediaLog::Load(const std::string& url) {
40 MediaLogEvent* event = CreateEvent(MediaLogEvent::LOAD);
41 event->params.SetString("url", url);
42 AddEvent(event);
43 }
44
45 void MediaLog::AddEventOfType(MediaLogEvent::Type type) {
46 MediaLogEvent* event = CreateEvent(type);
47 AddEvent(event);
48 }
49
50 MediaLogEvent* MediaLog::CreateEvent(MediaLogEvent::Type type) {
51 MediaLogEvent* event = new MediaLogEvent;
52 event->id = id_;
53 event->type = type;
54 event->time = base::Time::Now();
55 return event;
56 }
57
58 void MediaLog::AddEvent(MediaLogEvent* event) {}
59
60 } //namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698