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_TimestampTimelineMarker_h_
8 : #define mozilla_TimestampTimelineMarker_h_
9 :
10 : #include "TimelineMarker.h"
11 : #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
12 :
13 : namespace mozilla {
14 :
15 0 : class TimestampTimelineMarker : public TimelineMarker
16 : {
17 : public:
18 0 : explicit TimestampTimelineMarker(const nsAString& aCause)
19 0 : : TimelineMarker("TimeStamp", MarkerTracingType::TIMESTAMP)
20 0 : , mCause(aCause)
21 0 : {}
22 :
23 0 : virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
24 : {
25 0 : TimelineMarker::AddDetails(aCx, aMarker);
26 :
27 0 : if (!mCause.IsEmpty()) {
28 0 : aMarker.mCauseName.Construct(mCause);
29 : }
30 0 : }
31 :
32 : private:
33 : nsString mCause;
34 : };
35 :
36 : } // namespace mozilla
37 :
38 : #endif // mozilla_TimestampTimelineMarker_h_
|