Skip to content
Permalink
Browse files

Add a new RPC call for getting a child browsing context ID

  • Loading branch information
KiChjang committed Apr 30, 2018
1 parent 847115b commit 4383b3053b40cebaaef8bfbfd32152a22c313bf1
Showing with 11 additions and 0 deletions.
  1. +9 −0 components/constellation/constellation.rs
  2. +2 −0 components/script_traits/script_msg.rs
@@ -1231,6 +1231,15 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
warn!("Sending reply to get parent info failed ({:?}).", e);
}
}
FromScriptMsg::GetChildBrowsingContextId(browsing_context_id, index, sender) => {
// We increment here because the 0th element is the parent browsing context itself
let result = self.all_descendant_browsing_contexts_iter(browsing_context_id)
.nth(index + 1)
.map(|bc| bc.id);
if let Err(e) = sender.send(result) {
warn!("Sending reply to get child browsing context ID failed ({:?}).", e);
}
}
FromScriptMsg::RegisterServiceWorker(scope_things, scope) => {
debug!("constellation got store registration scope message");
self.handle_register_serviceworker(scope_things, scope);
@@ -90,6 +90,8 @@ pub enum ScriptMsg {
GetBrowsingContextId(PipelineId, IpcSender<Option<BrowsingContextId>>),
/// Get the parent info for a given pipeline.
GetParentInfo(PipelineId, IpcSender<Option<PipelineId>>),
/// Get the nth child browsing context ID for a given browsing context, sorted in tree order.
GetChildBrowsingContextId(BrowsingContextId, usize, IpcSender<Option<BrowsingContextId>>),
/// <head> tag finished parsing
HeadParsed,
/// All pending loads are complete, and the `load` event for this pipeline

0 comments on commit 4383b30

Please sign in to comment.
You can’t perform that action at this time.