| 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 #include "core/timing/PerformanceServerTiming.h" | 5 #include "core/timing/PerformanceServerTiming.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8ObjectBuilder.h" | 7 #include "bindings/core/v8/V8ObjectBuilder.h" |
| 8 #include "core/timing/PerformanceBase.h" | 8 #include "core/timing/PerformanceBase.h" |
| 9 #include "platform/wtf/text/WTFString.h" | 9 #include "platform/wtf/text/WTFString.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 PerformanceServerTiming::PerformanceServerTiming(const String& name, | 13 PerformanceServerTiming::PerformanceServerTiming(const String& name, |
| 14 const String& metric, | 14 const String& metric, |
| 15 double duration, | 15 double duration, |
| 16 const String& description) | 16 const String& description) |
| 17 : PerformanceEntry(name, "server", 0.0, duration), | 17 : PerformanceEntry(name, "server", 0.0, duration), |
| 18 m_metric(metric), | 18 metric_(metric), |
| 19 m_description(description) {} | 19 description_(description) {} |
| 20 | 20 |
| 21 PerformanceServerTiming::~PerformanceServerTiming() {} | 21 PerformanceServerTiming::~PerformanceServerTiming() {} |
| 22 | 22 |
| 23 String PerformanceServerTiming::metric() const { | 23 String PerformanceServerTiming::metric() const { |
| 24 return m_metric; | 24 return metric_; |
| 25 } | 25 } |
| 26 | 26 |
| 27 String PerformanceServerTiming::description() const { | 27 String PerformanceServerTiming::description() const { |
| 28 return m_description; | 28 return description_; |
| 29 } | 29 } |
| 30 | 30 |
| 31 void PerformanceServerTiming::BuildJSONValue(V8ObjectBuilder& builder) const { | 31 void PerformanceServerTiming::BuildJSONValue(V8ObjectBuilder& builder) const { |
| 32 PerformanceEntry::BuildJSONValue(builder); | 32 PerformanceEntry::BuildJSONValue(builder); |
| 33 builder.AddString("metric", metric()); | 33 builder.AddString("metric", metric()); |
| 34 builder.AddString("description", description()); | 34 builder.AddString("description", description()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace blink | 37 } // namespace blink |
| OLD | NEW |