Files
servo/components/script_bindings/webidls/ServoInternals.webidl
webbeef 1ad41dc15f script: Add a ServoInternals.garbageCollectAllContexts() (#42798)
This is useful in about:memory to measure memory usage after running the
GC.

The calling page sends a callback to the constellation that in turn wait
for all script threads to run the GC and report back.

Testing: Manual testing in `about:memory`

Before running GC:

<img width="2048" height="1480" alt="Screenshot from 2026-02-23
18-50-46"
src="https://github.com/user-attachments/assets/fd8399c1-fbc7-4f4c-886d-f29629ef8369"
/>

After running GC:

<img width="2048" height="1480" alt="Screenshot from 2026-02-23
18-51-00"
src="https://github.com/user-attachments/assets/82c793f7-8229-4de4-9cb5-47c94383b410"
/>

Signed-off-by: webbeef <me@webbeef.org>
2026-02-28 08:38:32 +00:00

32 lines
1.2 KiB
Plaintext

/* 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="ServoInternals::is_servo_internal"]
interface ServoInternals {
Promise<object> reportMemory();
undefined garbageCollectAllContexts();
sequence<USVString> preferenceList();
[Throws] USVString preferenceType(USVString name);
[Throws] any defaultPreferenceValue(USVString name);
[Throws] any getPreference(USVString name);
[Throws] USVString getStringPreference(USVString name);
[Throws] long long getIntPreference(USVString name);
[Throws] boolean getBoolPreference(USVString name);
undefined setStringPreference(USVString name, USVString value);
undefined setIntPreference(USVString name, long long value);
undefined setBoolPreference(USVString name, boolean value);
};
partial interface Navigator {
[Func="ServoInternals::is_servo_internal"]
readonly attribute ServoInternals servo;
};