aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/serviceworker_manager.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move `ScriptToConstellationMsg` to `constellation_traits` (#36364)Martin Robinson2025-04-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the last big change necessary to create the `constellation_traits` crate. This moves the data structure for messages that originate from the `ScriptThread` and are sent to the `Contellation` to `constellation_traits`, effectively splitting `script_traits` in half. Before, `script_traits` was responsible for exposing the API of both the `ScriptThread` and the `Constellation` to the rest of Servo. - Data structures that are used by `ScriptToConstellationMsg` are moved to `constellation_traits`. The dependency graph looks a bit like this: `script_layout_interface` depends on `script_traits` depends on `constellation_traits` depends on `embedder_traits`. - Data structures that are used in the embedding layer (`UntrustedNodeAddress`, `CompositorHitTestResult`, `TouchEventResult` and `AnimationState`) are moved to embedder_traits, to avoid a dependency cycle between `webrender_traits` and `constellation_traits`. - Types dealing with MessagePorts and serialization are moved to `constellation_traits::message_port`. Testing: This is covered by existing tests as it just moves types around. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Check all ancestor navigable trustworthiness for mixed content (#36157)Sebastian C2025-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Propagate through documents a flag that represents if any of the ancestor navigables has a potentially trustworthy origin. The "potentially trustworthy origin" concept appears to have gotten confused in a couple of places and we were instead testing if a URL had "potentially trustworthy" properties. The main test for the ancestor navigables is [mixed-content/nested-iframes](https://github.com/web-platform-tests/wpt/blob/master/mixed-content/nested-iframes.window.js) --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #36108 <!-- Either: --> - [X] There are tests for these changes --------- Signed-off-by: Sebastian C <sebsebmc@gmail.com>
* Make DOMPoint and DOMPointReadOnly serializable (#35989)Josh Matthews2025-03-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | * script: Make DOMPointReadOnly serializable. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make DOMPoint serializable. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Shrink worker script event. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Update components/script/dom/dompoint.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-031-2/+2
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* api: Flatten and simplify Servo preferences (#34966)Martin Robinson2025-01-141-1/+1
| | | | | | | | | | | | | | | | | | | Flatten and simplify Servo's preferences code. In addition, have both preferences and options passed in as arguments to `Servo::new()` and make sure not to use the globally set preferences in `servoshell` (as much as possible now). Instead of a complex procedural macro to generate preferences, just expose a very simple derive macro that adds string based getters and setters. - All command-line parsing is moved to servoshell. - There is no longer the concept of a missing preference. - Preferences no longer have to be part of the resources bundle because they now have reasonable default values. - servoshell specific preferences are no longer part of the preferences exposed by the Servo API. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Limit public exports. (#34915)Josh Matthews2025-01-101-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Prevent moving CanGc values between threads/tasks (#33902)Josh Matthews2024-10-181-17/+9
| | | | | | | | | | | | | * Make CanGc non-sendable, and add documentation. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Update CanGc usage to fix usages that were moved between threads/tasks. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* use `ThreadSafeJSContext` instead of `ContextForRequestInterrupt` (#33769)Samson2024-10-101-5/+5
| | | | | | | | | | | | | * use `ThreadSafeJSContext` instead of `ContextForRequestInterrupt` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * use servo/mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Fix large enum variant warning in serviceworker_manager.rs (#33707)chickenleaf2024-10-081-3/+3
| | | Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Make CanGc derive Copy and Clone (#33407)Taym Haddadi2024-09-121-2/+2
| | | Signed-off-by: Taym <haddadi.taym@gmail.com>
* Propagate `CanGc` from `Document::new()` (#33386)Andriy Sultanov2024-09-091-9/+17
| | | | | | | | | | | | | * Add canGc as a parameter to autogenerated trait methods Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> * Propagate CanGc from Document::new() Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> --------- Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* clippy: fix warnings in components/script (#32023)Azhar Ismagulova2024-04-091-9/+10
|
* clippy: Fix redundant field names warnings (#31793)Oluwatobi Sofela2024-03-201-1/+1
|
* clippy: Fix unneeded return statement warnings (#31776)Oluwatobi Sofela2024-03-201-1/+0
|
* clippy: Fix many warnings in `components/script` (#31717)Richard Dushime2024-03-191-1/+1
| | | | | | | | | | | | | | | | | * Fix Several clippy warnings * Fix Build errors * Fix Unused import * Fix requested changes * Fix rustfmt * Minor fixes --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-5/+5
| | | | This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-14/+14
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-1/+1
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* feat: shorten thread namesyvt2021-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux kernel imposes a 15-byte limit on thread names[1]. This means information that does not fit in this limit, e.g., the pipeline ID of layout and script threads, is lost in a debugger and profiler (see the first column of the table below). This commit shortens the thread names used in Servo to maximize the amount of information conveyed. It also rectifies some inconsistencies in the names. | Before | After | |-------------------|-------------------| | `BluetoothThread` | `Bluetooth` | | `CanvasThread` | `Canvas` | | `display alert d` | `AlertDialog` | | `FontCacheThread` | `FontCache` | | `GLPlayerThread` | `GLPlayer` | | `HTML Parser` | `Parse:www.examp` | | `LayoutThread Pi` | `Layout(1,1)` | | `Memory profiler` | `MemoryProfiler` | | `Memory profiler` | `MemoryProfTimer` | | `OfflineAudioCon` | `OfflineACResolv` | | `PullTimelineMar` | `PullTimelineDat` | | `ScriptThread Pi` | `Script(1,1)` | | `WebWorker for h` | `WW:www.example.` | | `ServiceWorker f` | `SW:www.example.` | | `ServiceWorkerMa` | `SvcWorkerManage` | | `Time profiler t` | `TimeProfTimer` | | `Time profiler` | `TimeProfiler` | | `WebGL thread` | `WebGL` | | `Choose a device` | `DevicePicker` | | `Pick a file` | `FilePicker` | | `Pick files` | `FilePicker` | [1]: https://stackoverflow.com/questions/5026531/thread-name-longer-than-15-chars
* ensure clean shutdown of all threads running JSGregory Terzian2020-06-301-2/+40
|
* add a control chan to workers, use to signal shutdownGregory Terzian2020-06-031-7/+48
|
* add mechanism to join on service- and dedicated-worker threadsGregory Terzian2020-05-291-5/+30
|
* serviceworker: turn-off event-loop, don't assume current scope, clear ↵Gregory Terzian2020-05-211-1/+3
| | | | runtime on shutdown
* serviceworker: make job queue unique per originGregory Terzian2020-05-211-84/+284
|
* Support connecting to worker globals from remote devtools.Josh Matthews2020-04-281-18/+1
|
* Support navigating browsing contexts in the devtools.Josh Matthews2020-04-261-1/+5
| | | | | | | | | | | | | Break the association between pipelines and browsing context actors. Now there is one browsing context actor per actual browsing context, and individual actors keep track of known pipelines as necessary. There is also one console/performance/timeline/inspector/etc. actor per browsing context. This also centralizes more information in the browsing context actor. Rather than duplicating state for the active pipeline in actors that need to use it, each actor now remembers the name of its associated browsing context actor and obtains that state whenever it's necessary.
* allow for a service worker network mediator per originGregory Terzian2020-04-051-2/+2
|
* allow for a service worker manager per originGregory Terzian2020-04-051-22/+42
|
* continue messageport, transferable, postmessage optionsGregory Terzian2019-10-191-2/+0
|
* begin messageport, transferable objects, implKeith Yeung2019-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accept transfer argument for StructuredCloneData::write Allow structured clone reads to return a boolean Add Transferable trait Add basic skeletons to MessagePort Implement transfer and transfer-receiving steps on MessagePort Use transfer and transfer_receive in StructuredClone callbacks Implement MessageChannel Freeze the array object for the MessageEvent ports attribute Implement transfer argument on window.postMessage Use ReentrantMutex instead for MessagePortInternal Accept origin as a parameter in dispatch_jsval Fix BorrowMut crash with pending_port_message Detach port on closure and check for detached during transfer Enable webmessaging tests fix webidl fix
* #8539 Config preferences backend restructurePeter Hall2019-03-201-5/+2
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Update crossbeam-channel to 0.3Bastien Orivel2018-11-181-8/+9
|
* Reorder importsPyfisch2018-11-061-3/+3
|
* Format remaining filesPyfisch2018-11-061-1/+2
|
* Sort `use` statementsSimon Sapin2018-11-061-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-4/+4
|
* Format script componentchansuke2018-09-191-36/+51
|
* Replace mpsc with crossbeam/servo channel, update ipc-channelSimon Sapin2018-09-121-11/+7
| | | | Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
* remove extra spaces after keywordsPavel Sergeev2017-07-201-1/+1
|
* Removed util.Alan Jeffrey2016-12-141-4/+4
|
* Urlmageddon: Use refcounted urls more often.Emilio Cobos Álvarez2016-11-171-5/+5
|
* Remove ScopeThings::pipeline_idAnthony Ramine2016-10-041-1/+1
| | | | It can be retrieved through its init field.
* make structured clone an enumRahul Sharma2016-09-151-2/+2
|
* store senders instead of buffering messagesRahul Sharma2016-09-071-62/+70
|
* Make service workers talk to their serviceworkerglobalscopesRahul Sharma2016-09-071-9/+25
|
* Remove unnecessary clone from ServiceWorkerManager::prepare_activationChiu-Hsiang Hsu2016-08-271-2/+2
|
* Make the service worker send custom responseRahul Sharma2016-07-261-10/+20
|
* Remove expect calls in service worker manager threadRahul Sharma2016-07-211-22/+25
|