DevTools: Move Source related code to dedicated source.rs file (#36667)

Currently Source related code exists in watcher.rs and thread.rs. This
change moves source-related code to a dedicated source.rs file. This is
in preparation for adding support for showing source code in the
Debugger > Source panel.

- [x] Testing: These changes should not affect current functionality as
it only moves the existing code
- [x] Fixes: part of https://github.com/servo/servo/issues/36027

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
atbrakhi 2025-04-24 09:50:56 +02:00 committed by GitHub
parent d661d4a620
commit c16d86f7a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 62 additions and 38 deletions

View file

@ -19,7 +19,7 @@ use std::net::{Shutdown, TcpListener, TcpStream};
use std::sync::{Arc, Mutex};
use std::thread;
use actors::thread::Source;
use actors::source::SourceData;
use base::id::{BrowsingContextId, PipelineId, WebViewId};
use crossbeam_channel::{Receiver, Sender, unbounded};
use devtools_traits::{
@ -66,6 +66,7 @@ mod actors {
pub mod process;
pub mod reflow;
pub mod root;
pub mod source;
pub mod stylesheets;
pub mod tab;
pub mod thread;
@ -525,9 +526,11 @@ impl DevtoolsInstance {
.clone();
let thread_actor = actors.find_mut::<ThreadActor>(&thread_actor_name);
thread_actor.add_source(source_info.url.clone());
thread_actor
.source_manager
.add_source(source_info.url.clone());
let source = Source {
let source = SourceData {
actor: thread_actor_name.clone(),
url: source_info.url.to_string(),
is_black_boxed: false,