Bug 1685822 [wpt PR 27117] - [Import Maps] Add tests for rejecting multiple import...
[gecko.git] / dom / media / doctor / DDLogMessage.cpp
blob488c39216acfc587d50ec7207e2a7938cc2f1b21
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "DDLogMessage.h"
9 #include "DDLifetimes.h"
11 namespace mozilla {
13 nsCString DDLogMessage::Print() const {
14 nsCString str;
15 str.AppendPrintf("%" PRImi " | %f | %s[%p] | %s | %s | ", mIndex.Value(),
16 ToSeconds(mTimeStamp), mObject.TypeName(), mObject.Pointer(),
17 ToShortString(mCategory), mLabel);
18 AppendToString(mValue, str);
19 return str;
22 nsCString DDLogMessage::Print(const DDLifetimes& aLifetimes) const {
23 nsCString str;
24 const DDLifetime* lifetime = aLifetimes.FindLifetime(mObject, mIndex);
25 str.AppendPrintf("%" PRImi " | %f | ", mIndex.Value(), ToSeconds(mTimeStamp));
26 lifetime->AppendPrintf(str);
27 str.AppendPrintf(" | %s | %s | ", ToShortString(mCategory), mLabel);
28 if (!mValue.is<DDLogObject>()) {
29 AppendToString(mValue, str);
30 } else {
31 const DDLifetime* lifetime2 =
32 aLifetimes.FindLifetime(mValue.as<DDLogObject>(), mIndex);
33 if (lifetime2) {
34 lifetime2->AppendPrintf(str);
35 } else {
36 AppendToString(mValue, str);
39 return str;
42 } // namespace mozilla