script/dom/performance/
performancemeasure.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use js::jsapi::Heap;
6use js::jsval::JSVal;
7use js::rust::MutableHandleValue;
8
9use crate::dom::bindings::codegen::Bindings::PerformanceMeasureBinding::PerformanceMeasureMethods;
10use crate::script_runtime::JSContext;
11
12impl_performance_entry_struct!(
13    PerformanceMeasureBinding,
14    PerformanceMeasure,
15    EntryType::Measure,
16    {
17        #[ignore_malloc_size_of = "Defined in rust-mozjs"]
18        detail: Heap<JSVal>,
19    }
20);
21
22impl PerformanceMeasureMethods<crate::DomTypeHolder> for PerformanceMeasure {
23    fn Detail(&self, _cx: JSContext, mut retval: MutableHandleValue) {
24        retval.set(self.detail.get())
25    }
26}