1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
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 #ifndef mozilla_MessagePortTimelineMarker_h_
8 #define mozilla_MessagePortTimelineMarker_h_
10 #include "TimelineMarker.h"
11 #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
15 class MessagePortTimelineMarker
: public TimelineMarker
{
17 MessagePortTimelineMarker(
18 dom::ProfileTimelineMessagePortOperationType aOperationType
,
19 MarkerTracingType aTracingType
)
20 : TimelineMarker("MessagePort", aTracingType
,
21 MarkerStackRequest::NO_STACK
),
22 mOperationType(aOperationType
) {}
24 virtual UniquePtr
<AbstractTimelineMarker
> Clone() override
{
25 MessagePortTimelineMarker
* clone
=
26 new MessagePortTimelineMarker(mOperationType
, GetTracingType());
27 clone
->SetCustomTime(GetTime());
28 return UniquePtr
<AbstractTimelineMarker
>(clone
);
31 virtual void AddDetails(JSContext
* aCx
,
32 dom::ProfileTimelineMarker
& aMarker
) override
{
33 TimelineMarker::AddDetails(aCx
, aMarker
);
35 if (GetTracingType() == MarkerTracingType::START
) {
36 aMarker
.mMessagePortOperation
.Construct(mOperationType
);
41 dom::ProfileTimelineMessagePortOperationType mOperationType
;
44 } // namespace mozilla
46 #endif /* mozilla_MessagePortTimelineMarker_h_ */