| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PerformanceServerTiming_h | 5 #ifndef PerformanceServerTiming_h |
| 6 #define PerformanceServerTiming_h | 6 #define PerformanceServerTiming_h |
| 7 | 7 |
| 8 #include "core/timing/PerformanceEntry.h" | 8 #include "bindings/core/v8/V8ObjectBuilder.h" |
| 9 #include "platform/bindings/ScriptWrappable.h" |
| 9 | 10 |
| 10 namespace blink { | 11 namespace blink { |
| 11 | 12 |
| 12 class CORE_EXPORT PerformanceServerTiming : public PerformanceEntry { | 13 class CORE_EXPORT PerformanceServerTiming final |
| 14 : public GarbageCollectedFinalized<PerformanceServerTiming>, |
| 15 public ScriptWrappable { |
| 13 DEFINE_WRAPPERTYPEINFO(); | 16 DEFINE_WRAPPERTYPEINFO(); |
| 14 | 17 |
| 15 public: | 18 public: |
| 16 ~PerformanceServerTiming() override; | 19 PerformanceServerTiming(const String& metric, |
| 17 | 20 double value, |
| 18 static PerformanceServerTiming* create(const String& name, | 21 const String& description, |
| 19 const String& metric, | 22 bool allow_timing_details); |
| 20 double duration, | 23 ~PerformanceServerTiming(); |
| 21 const String& description) { | |
| 22 return new PerformanceServerTiming(name, metric, duration, description); | |
| 23 } | |
| 24 | 24 |
| 25 String metric() const; | 25 String metric() const; |
| 26 double value() const; |
| 26 String description() const; | 27 String description() const; |
| 27 | 28 |
| 29 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 30 |
| 28 protected: | 31 protected: |
| 29 void BuildJSONValue(V8ObjectBuilder&) const override; | 32 void BuildJSONValue(V8ObjectBuilder&) const; |
| 30 | 33 |
| 31 private: | 34 private: |
| 32 PerformanceServerTiming(const String& name, | |
| 33 const String& metric, | |
| 34 double duration, | |
| 35 const String& description); | |
| 36 | |
| 37 const String metric_; | 35 const String metric_; |
| 36 double value_; |
| 38 const String description_; | 37 const String description_; |
| 38 bool allow_timing_details_; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace blink | 41 } // namespace blink |
| 42 | 42 |
| 43 #endif // PerformanceServerTiming_h | 43 #endif // PerformanceServerTiming_h |
| OLD | NEW |