Repository: servo/servo
File: components/devtools/lib.rs (Rust)

Code before:
            .and_then(|id| self.browsing_contexts.get(id))
        else {
            return;
        };

        let browsing_context = actors.find::<BrowsingContextActor>(browsing_context);
        let thread = actors.find::<ThreadActor>(&browsing_context.thread);

        // Find the source actor for this URL
        let source = match thread.source_manager.find_source(actors, &frame.url) {
            Some(source) => source.name(),
            None => {
                warn!("No source actor found for URL: {}", frame.url);
                return;
            },
        };

        let pause = actors.new_name::<PauseActor>();
        actors.register(PauseActor {
            name: pause.clone(),
        });

        let frame = FrameActor::register(actors, source, frame);
        thread.frames.borrow_mut().insert(frame.clone());

        // https://searchfox.org/firefox-main/source/devtools/server/actors/thread.js#1662
        let why = if is_breakpoint {
            WhyMsg {
                type_: "breakpoint".into(),
                on_next: None,
            }
        } else {
            WhyMsg {
                type_: "interrupted".into(),
                on_next: Some(true),
            }
        };

        let msg = ThreadInterruptedReply {
            from: thread.name(),
            type_: "paused".to_owned(),
            actor: pause,
            frame: actors.encode::<FrameActor, _>(&frame),
            why,
        };

        for stream in self.connections.lock().unwrap().values_mut() {
            let _ = stream.write_json_packet(&msg);
        }
    }
}

Review comment (suggestion):
```suggestion
        // <https://searchfox.org/firefox-main/source/devtools/server/actors/thread.js#1662>
```

Code after:
            .and_then(|id| self.browsing_contexts.get(id))
        else {
            return;
        };

        let browsing_context = actors.find::<BrowsingContextActor>(browsing_context);
        let thread = actors.find::<ThreadActor>(&browsing_context.thread);

        // Find the source actor for this URL
        let source = match thread.source_manager.find_source(actors, &frame.url) {
            Some(source) => source.name(),
            None => {
                warn!("No source actor found for URL: {}", frame.url);
                return;
            },
        };

        let pause = actors.new_name::<PauseActor>();
        actors.register(PauseActor {
            name: pause.clone(),
        });

        let frame = FrameActor::register(actors, source, frame);
        thread.frames.borrow_mut().insert(frame.clone());

        // <https://searchfox.org/firefox-main/source/devtools/server/actors/thread.js#1662>
        let why = if is_breakpoint {
            WhyMsg {
                type_: "breakpoint".into(),
                on_next: None,
            }
        } else {
            WhyMsg {
                type_: "interrupted".into(),
                on_next: Some(true),
            }
        };

        let msg = ThreadInterruptedReply {
            from: thread.name(),
            type_: "paused".to_owned(),
            actor: pause,
            frame: actors.encode::<FrameActor, _>(&frame),
            why,
        };

        for stream in self.connections.lock().unwrap().values_mut() {
            let _ = stream.write_json_packet(&msg);
        }
    }
}