Replaced new with register for AccessibilityActor in browsing_context &
accessibility.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for NetworkEventActor in network_event.rs &
lib.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for BrowsingContextActor in
browsing_context.rs & lib.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for PerformanceActor in performance.rs &
root.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for ThreadActor in browsing_context,
thread.rs & lib.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for BreakpointListActor in breakpoint.rs &
watcher.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for CssPropertiesActor in browsing_context &
css_properties.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Replaced new with register for NetworkParentActor in network_parent.rs &
watcher.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for ReflowActor in browsing_context &
reflow.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Part of a larger refactor to name all actors and variables consistently,
#43800.
Testing: not necessary beyond `mach test-devtools` per #43800 / #43606
Fixes: `#43800` ((not linking because it's one of many PR's).
Signed-off-by: Martijn Gribnau <garm@ilumeo.com>
Replace new with register for ConsoleActor in console & lib.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replace new with register for DeviceActor in device & root.rs
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Replaced new with register for StyleSheetsActor in browsing_context &
stylesheets
Testing: No testing required, compiles successfully.
Fixes: Part of #43800
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Rename variables associated with `PropertyIteratorActor`
Testing: Tested locally with `mach test-devtools`
Fixes: A part of #43606
Signed-off-by: Niya Gupta <niyabits@disroot.org>
Before we had seperate parsing functions for preview and scopes. In this
change we merge them into one.
Testing: current tests are passing, also tested manually.
Fixes: #36027
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: eri <eri@igalia.com>
These were here 10 years ago.
1. All Actor names are already immutable:
- All actor implementations store a name: String field set at
construction and never mutate it.
- The name is only used as key by `ActorRegistry` to look up
2. There is no `register_later`
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Standardize variable naming in `WalkerActor` (`walker.rs`), renaming
`node` → `node_name` in `find_child` to follow the `{}_name` convention.
Testing: `./mach test-devtools`, all 60 tests pass.
Fixes: Part of #43606
Signed-off-by: Eli Bowman <asdfup@protonmail.com>
Changes `name` to `long_string_name`
`long_string` to `long_string_actor`
Testing: Tested locally with mach test-devtools
Fixes: A part of #43606
---------
Signed-off-by: Niya Gupta <niyabits@disroot.org>
Co-authored-by: Niya Gupta <niyabits@disroot.org>
Remove a duplicate `ObjectPreview` and use `ObjectActor::encode` for
serialization.
Testing: Ran mach test-devtools and manual tests.
Part of: #36027
Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Part of #43800 and #43606.
I removed the `new` method from `SourceActor` entirely, as it was only
used internally by `new_registered`. I renamed `new_registered` to
`register`, inlined the struct construction directly using `Self { ...
}`, and updated the registration call to use
`registry.register::<Self>(actor)` to match the standard pattern
established across other actors.
I also standardized variable names throughout `SourceActor` and its call
sites to follow the conventions set in #43606:
- Renamed `name` and `source` to `source_name` and `source_actor`
respectively in `SourceManager::find_source`
- Renamed `actor_name` to `source_name` in `SourceManager::source_forms`
- Renamed `actor_name` to `source_name` in
`handle_update_source_content` in lib.rs
Testing: Built with cargo and ran ./mach test-devtools. 59/60 tests
pass; the one failure (test_manual_pause) is a pre-existing intermittent
timeout unrelated to these changes.
Fixes: part of #43606 and #43800
Signed-off-by: CynthiaOketch <cynthiaoketch6@gmail.com>
- Changes `breakpoint_list` to `breakpoint_list_actor`
Testing: Tested locally with `mach test-devtools`
Fixes: A part of #43606
---------
Signed-off-by: Niya Gupta <niyabits@disroot.org>
Co-authored-by: Niya Gupta <niyabits@disroot.org>
- `PauseActor` is passed as a generic for only `new_name`
- Update the variable `pause` to `pause_name`
**Testing**: Tested locally with `mach test-devtools`
```
Ran 60 tests in 74.781s
OK (expected failures=6)
```
**Fixes**: A part of #43606
Signed-off-by: Niya Gupta <niyabits@disroot.org>
Co-authored-by: Niya Gupta <niyabits@disroot.org>
Renamed FrameActor variable names to match standards in thread & lib.rs
Testing: No testing required.
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed ThreadConfigurationActor variable names in watcher.rs.
Testing: No testing required.
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed InspectorActor variable names in browsing_context, inspector &
lib.rs
Testing: No testing required.
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed CssPropertiesActor variable names in browsing_context
Testing: No testing required.
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed HighlighterActor variable names in inspector.rs.
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed LayoutInspectorActor variable names in walker.rs
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed AccessibilityActor variable names in browsing_context
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed StyleSheetsActor variable names in browsing_context
Testing: Ran `./mach test-devtools` locally.
Fixes: Part of #43606
---------
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed NetworkEventActor variables in network_handler & lib.rs
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Renamed BrowsingContext in tab, network_event, watcher actors & lib.rs
Testing: No testing required - only renaming done
Fixes: Part o #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
The WebIDLs for values were duplicated in PropertyDescriptor and
EvalResultValue, with duplicated handlers across the code.
General cleanup of how debugger values are passed from debugger.js and
how the conversion from JS and to JSON happens.
There shouldn't be a behaviour change.
Testing: Existing devtools tests and manual testing
Part of: #36027
---------
Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Renamed WorkerActor variables in watcher, console, root and lib.rs
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
This update makes service workers properly show up in DevTools and
behave more like dedicated workers.
- Added an is_service_worker field to DevtoolsPageInfo so the devtools
server can tell service workers apart from dedicated workers
- Triggered a NewGlobal message when a service worker is created in
serviceworker_manager.rs, similar to what already happens for dedicated
workers
- Routed service workers to root.service_workers so they appear under
"Service Workers" in about:debugging instead of "Other Workers"
- Implemented listServiceWorkerRegistrations with the expected response
format (activeWorker, installingWorker, waitingWorker, evaluatingWorker)
to match Firefox’s LegacyServiceWorkersWatcher
- Added support for getPushSubscription in WorkerActor, currently
returning subscription: null
Enabled the service_worker target type in the watcher’s SessionContext
and handled watchTargets("service_worker")
Testing
Start Servo with:
`RUST_LOG="error,devtools=debug" ./mach run --
--pref=dom_serviceworker_enabled --devtools=6080
"https://mdn.github.io/dom-examples/service-worker/simple-service-worker/"
`
In Firefox, go to about:debugging and connect to localhost:6080
Confirm the service worker shows up under "Service Workers"
Fixes#43574
---------
Signed-off-by: CynthiaOketch <cynthiaoketch6@gmail.com>
Rename page_style in inspector .
Testing: ran `./mach test-devtools`.
Fixes: Part of #43606
Signed-off-by: Jayanta Pradhan <pradhanjayanta91@gmail.com>
Introduces a new type `DevtoolsConnection`, which implements the
`JsonPacketStream` trait with proper coordination of I/O across threads.
This replaces the implementation of `JsonPacketStream` for raw
`TcpStream`s, which was susceptible to interleaving writes when cloned
across threads.
`DevtoolsConnection` also defensively synchronizes read operations.
These are less likely to cause issues: in practice actors should never
independently pull incoming messages without centralized coordination.
Testing: No new tests, as interleaving writes are difficult to evoke
deterministically. Removing the `JsonPacketStream` implementation for
`TcpStream` should discourage regressions due to improper use of raw
streams.
---------
Signed-off-by: Brent Schroeter <contact@brentsch.com>
Co-authored-by: eri <eri@igalia.com>
Rename `DeviceActor` local variable in `root.rs` from `device` to
`device_actor` for naming consistency across the devtools crate.
This follows the convention discussed in #43557:
- `{}_actor` for variables holding the actor
- `{}_name` for variables holding the actor name string
The `device_actor` field in the `GlobalActors` struct was not renamed,
as it is part of a `#[derive(Serialize)]` struct used for devtools
message serialization.
Testing: `./mach test-devtools` all 60 tests pass (6 expected failures).
One unrelated flaky test
(`test_breakpoint_at_invalid_entry_point_does_not_crash`) occasionally
fails due to a race condition tracked separately. opened an isssue for
it at #43667
fixes part of #43606
Signed-off-by: staysafe020 <jambongralpher@gmail.com>
Renamed TabDescriptorActor variable names in browsing_context, root &
target_configuration
Cleaned up a few more names as suggested by eerii
Testing: No testing required
Fixes: Part of #43606
Signed-off-by: Sabb <sarafaabbas@gmail.com>
Rename NetworkParent in watcher actors.
Testing: ran `./mach test-devtools`.
Fixes: Part of #43606
---------
Signed-off-by: Jayanta Pradhan <pradhanjayanta91@gmail.com>