OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 "chrome/common/media/webrtc_logging_message_data.h" |
| 6 |
| 7 #include "base/strings/stringprintf.h" |
| 8 |
| 9 WebRtcLoggingMessageData::WebRtcLoggingMessageData() {} |
| 10 |
| 11 WebRtcLoggingMessageData::WebRtcLoggingMessageData(const base::Time& time, |
| 12 const std::string& message) |
| 13 : timestamp(time), message(message) {} |
| 14 |
| 15 std::string |
| 16 WebRtcLoggingMessageData::Format(const base::Time& start_time) const { |
| 17 uint64 interval_ms = (timestamp - start_time).InMilliseconds(); |
| 18 |
| 19 std::string result = base::StringPrintf("[%03ld:%03ld] %s", |
| 20 interval_ms / 1000, |
| 21 interval_ms % 1000, |
| 22 message.c_str()); |
| 23 return result; |
| 24 } |
OLD | NEW |