mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Location type
Co-authored-by: atbrakhi <atbrakhi@igalia.com> Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
parent
e0f3679d55
commit
5578b9abd2
1 changed files with 30 additions and 1 deletions
|
@ -4,8 +4,9 @@
|
|||
|
||||
use std::net::TcpStream;
|
||||
|
||||
use serde::Serialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{Map, Value};
|
||||
use servo_url::ServoUrl;
|
||||
|
||||
use super::source::{SourceManager, SourcesReply};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
|
@ -64,6 +65,34 @@ impl ThreadActor {
|
|||
}
|
||||
}
|
||||
|
||||
/// Location inside a source.
|
||||
///
|
||||
/// This can be in the code for the source itself, or the code of an `eval()` or `new Function()`
|
||||
/// called from that source.
|
||||
///
|
||||
/// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#source-locations>
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum Location {
|
||||
Url {
|
||||
url: ServoUrl,
|
||||
line: usize,
|
||||
column: usize,
|
||||
},
|
||||
Eval {
|
||||
eval: Box<Location>,
|
||||
id: String,
|
||||
line: usize,
|
||||
column: usize,
|
||||
},
|
||||
Function {
|
||||
function: Box<Location>,
|
||||
id: String,
|
||||
line: usize,
|
||||
column: usize,
|
||||
},
|
||||
}
|
||||
|
||||
impl Actor for ThreadActor {
|
||||
fn name(&self) -> String {
|
||||
self.name.clone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue