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

Side by Side Diff: chrome/common/media/webrtc_logging_message_data.cc

Issue 218403004: Fix the timestamp generation for webrtc native log. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tommi's comments Created 6 years, 8 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
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698