Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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/mojo/common/mojo_media_log_service.h" | |
| 6 | |
| 7 #include <memory> | |
| 8 | |
| 9 #include "base/logging.h" | |
| 10 #include "base/memory/ptr_util.h" | |
| 11 #include "media/base/media_log_event.h" | |
| 12 | |
| 13 namespace media { | |
| 14 | |
| 15 MojoMediaLogService::MojoMediaLogService(media::MediaLog* media_log) | |
| 16 : media_log_(media_log) { | |
| 17 DVLOG(1) << __func__; | |
| 18 DCHECK(media_log_); | |
| 19 | |
| 20 std::unique_ptr<media::MediaLogEvent> event = | |
| 21 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED); | |
| 22 id_ = event->id; | |
|
xhwang
2017/06/30 16:24:57
How about adding an access to get the ID from |med
sandersd (OOO until July 31)
2017/06/30 17:44:30
I did this by exposing a getter, since MediaLog ca
| |
| 23 } | |
| 24 | |
| 25 MojoMediaLogService::~MojoMediaLogService() { | |
| 26 DVLOG(1) << __func__; | |
| 27 } | |
| 28 | |
| 29 void MojoMediaLogService::AddEvent(const media::MediaLogEvent& event) { | |
| 30 DVLOG(1) << __func__; | |
| 31 std::unique_ptr<media::MediaLogEvent> modified_event = | |
| 32 base::MakeUnique<media::MediaLogEvent>(event); | |
| 33 modified_event->id = id_; | |
|
xhwang
2017/06/30 16:24:57
This worth some comment (e.g. the ID is per proces
sandersd (OOO until July 31)
2017/06/30 17:44:30
Done.
| |
| 34 media_log_->AddEvent(std::move(modified_event)); | |
| 35 } | |
| 36 | |
| 37 } // namespace media | |
| OLD | NEW |