# 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 http://mozilla.org/MPL/2.0/.
import importlib.util import os import subprocess import tempfile from pathlib import Path
from mach.decorators import Command, CommandArgument
# Ensure RenderDoc is available (download into ~/.mozbuild/renderdoc if not).
version = renderdoc_version or bootstrap.DEFAULT_VERSION
lib_path, bin_dir = bootstrap.ensure(version, log=log)
renderdoc_root = str(Path(bin_dir).parent)
firefox_proc = None
profile_dir = None ifnot no_firefox:
firefox = Path(topobjdir) / "dist" / "bin" / "firefox" ifnot firefox.exists():
command_context.log( 40, "wrshell", {}, f"Firefox binary not found at {firefox}; run `./mach build` first."
) return1
# A fresh, disposable profile with the GPU process disabled so WebRender # renders (and is captured) in the parent process.
profile_dir = tempfile.mkdtemp(prefix="wrshell-profile-") with open(os.path.join(profile_dir, "user.js"), "w") as fh:
fh.write('user_pref("layers.gpu-process.enabled", false);\n')
try: # Build and run wrshell, telling it where to find qrenderdoc.
manifest = os.path.join(topsrcdir, "gfx", "wr", "wrshell", "Cargo.toml")
wrshell_env = dict(os.environ)
wrshell_env["WR_RENDERDOC_DIR"] = renderdoc_root
mode = "gui"if gui else"repl"
log(f"Starting wrshell ({mode}); close it to shut down.") return subprocess.call(
["cargo", "run", "--manifest-path", manifest, "--", mode],
env=wrshell_env,
) finally: # Tear down only the Firefox instance we launched. if firefox_proc isnotNoneand firefox_proc.poll() isNone:
firefox_proc.terminate() try:
firefox_proc.wait(timeout=5) except subprocess.TimeoutExpired:
firefox_proc.kill()
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.