script/dom/performance/
performancemark.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::PerformanceMarkBinding::PerformanceMarkMethods;
10use crate::script_runtime::JSContext;
11
12impl_performance_entry_struct!(
13    PerformanceMarkBinding,
14    PerformanceMark, EntryType::Mark,
15    {
16        #[ignore_malloc_size_of = "Defined in rust-mozjs"]
17        detail: Heap<JSVal>,
18    }
19);
20
21impl PerformanceMarkMethods<crate::DomTypeHolder> for PerformanceMark {
22    fn Detail(&self, _cx: JSContext, mut retval: MutableHandleValue) {
23        retval.set(self.detail.get())
24    }
25}