Line data Source code
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/. */
6 :
7 : #ifndef mozilla_EventTimelineMarker_h_
8 : #define mozilla_EventTimelineMarker_h_
9 :
10 : #include "TimelineMarker.h"
11 : #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
12 :
13 : namespace mozilla {
14 :
15 0 : class EventTimelineMarker : public TimelineMarker
16 : {
17 : public:
18 0 : EventTimelineMarker(const nsAString& aType,
19 : uint16_t aPhase,
20 : MarkerTracingType aTracingType)
21 0 : : TimelineMarker("DOMEvent", aTracingType)
22 : , mType(aType)
23 0 : , mPhase(aPhase)
24 0 : {}
25 :
26 0 : virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
27 : {
28 0 : TimelineMarker::AddDetails(aCx, aMarker);
29 :
30 0 : if (GetTracingType() == MarkerTracingType::START) {
31 0 : aMarker.mType.Construct(mType);
32 0 : aMarker.mEventPhase.Construct(mPhase);
33 : }
34 0 : }
35 :
36 : private:
37 : nsString mType;
38 : uint16_t mPhase;
39 : };
40 :
41 : } // namespace mozilla
42 :
43 : #endif // mozilla_EventTimelineMarker_h_
|