aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/devtools.rs
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2016-10-12 12:56:23 -0500
committerAlan Jeffrey <ajeffrey@mozilla.com>2016-10-12 12:56:23 -0500
commita6d83a38e56fa953be4cd7353ca948010a52a0e7 (patch)
tree753d06f175c8ed51db11a73d028a787495f62e02 /components/script/devtools.rs
parentf584003191cc125b181bb8c555d8fae6eccd0e70 (diff)
downloadservo-a6d83a38e56fa953be4cd7353ca948010a52a0e7.tar.gz
servo-a6d83a38e56fa953be4cd7353ca948010a52a0e7.zip
Setting a devtools timeline marker may fail, due to pipeline lookup failure.
Diffstat (limited to 'components/script/devtools.rs')
-rw-r--r--components/script/devtools.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/components/script/devtools.rs b/components/script/devtools.rs
index f8517ae0dba..4163ee426ed 100644
--- a/components/script/devtools.rs
+++ b/components/script/devtools.rs
@@ -250,16 +250,21 @@ pub fn handle_wants_live_notifications(global: &GlobalScope, send_notifications:
}
pub fn handle_set_timeline_markers(context: &BrowsingContext,
+ pipeline: PipelineId,
marker_types: Vec<TimelineMarkerType>,
- reply: IpcSender<TimelineMarker>) {
- let window = context.active_window();
- window.set_devtools_timeline_markers(marker_types, reply);
+ reply: IpcSender<Option<TimelineMarker>>) {
+ match context.find(pipeline) {
+ None => reply.send(None).unwrap(),
+ Some(context) => context.active_window().set_devtools_timeline_markers(marker_types, reply),
+ }
}
pub fn handle_drop_timeline_markers(context: &BrowsingContext,
+ pipeline: PipelineId,
marker_types: Vec<TimelineMarkerType>) {
- let window = context.active_window();
- window.drop_devtools_timeline_markers(marker_types);
+ if let Some(context) = context.find(pipeline) {
+ context.active_window().drop_devtools_timeline_markers(marker_types);
+ }
}
pub fn handle_request_animation_frame(context: &BrowsingContext,