mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add an about:memory page (#35728)
This patch exposes a servo internal DOM API that is only made available to about: pages on the navigator object to request memory reports. The about:memory page itself is loaded like other html resources (eg. bad cert, net error) and makes use of this new API. On the implementation side, notable changes: - components/script/routed_promise.rs abstracts the setup used to fulfill a promise when the work needs to be routed through the constellation. The goal is to migrate other similar promise APIs in followup (eg. dom/webgpu/gpu.rs, bluetooth.rs). - a new message is added to request a report from the memory reporter, and the memory reporter creates a json representation of the set of memory reports. - the post-processing of memory reports is done in Javascript in the about-memory.html page, providing the same results as the current Rust code that outputs to stdout. We can decide later if we want to remove the current output. Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
1864ebfb35
commit
139774e6b5
17 changed files with 425 additions and 1 deletions
|
@ -498,6 +498,11 @@ DOMInterfaces = {
|
|||
'canGc': ['Register'],
|
||||
},
|
||||
|
||||
'ServoInternals': {
|
||||
'inRealms': ['ReportMemory'],
|
||||
'canGc': ['ReportMemory'],
|
||||
},
|
||||
|
||||
'ShadowRoot': {
|
||||
'canGc': ['ElementFromPoint', 'ElementsFromPoint', 'SetInnerHTML'],
|
||||
},
|
||||
|
|
19
components/script_bindings/webidls/ServoInternals.webidl
Normal file
19
components/script_bindings/webidls/ServoInternals.webidl
Normal file
|
@ -0,0 +1,19 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Private interfaces that are only used for internal Servo usage
|
||||
// like about: pages.
|
||||
|
||||
// This interface is entirely internal to Servo, and should not be accessible to
|
||||
// web pages.
|
||||
[Exposed=Window,
|
||||
Func="dom::bindings::interface::is_servo_internal"]
|
||||
interface ServoInternals {
|
||||
Promise<object> reportMemory();
|
||||
};
|
||||
|
||||
partial interface Navigator {
|
||||
[Func="dom::bindings::interface::is_servo_internal"]
|
||||
readonly attribute ServoInternals servo;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue