mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Implement client-side logic for WebGPU id recycling
This commit is contained in:
parent
94063d67a8
commit
39f336b527
10 changed files with 118 additions and 19 deletions
|
@ -2209,17 +2209,14 @@ where
|
|||
Some(bc) => &bc.bc_group_id,
|
||||
None => return warn!("Browsing context not found"),
|
||||
};
|
||||
let host = match self
|
||||
.pipelines
|
||||
.get(&source_pipeline_id)
|
||||
.map(|pipeline| &pipeline.url)
|
||||
{
|
||||
Some(ref url) => match reg_host(&url) {
|
||||
Some(host) => host,
|
||||
None => return warn!("Invalid host url"),
|
||||
},
|
||||
let source_pipeline = match self.pipelines.get(&source_pipeline_id) {
|
||||
Some(pipeline) => pipeline,
|
||||
None => return warn!("ScriptMsg from closed pipeline {:?}.", source_pipeline_id),
|
||||
};
|
||||
let host = match reg_host(&source_pipeline.url) {
|
||||
Some(host) => host,
|
||||
None => return warn!("Invalid host url"),
|
||||
};
|
||||
match self
|
||||
.browsing_context_group_set
|
||||
.get_mut(&browsing_context_group_id)
|
||||
|
@ -2238,7 +2235,16 @@ where
|
|||
let send = match browsing_context_group.webgpus.entry(host) {
|
||||
Entry::Vacant(v) => v
|
||||
.insert(match WebGPU::new() {
|
||||
Some(webgpu) => webgpu,
|
||||
Some(webgpu) => {
|
||||
let msg = ConstellationControlMsg::SetWebGPUPort(webgpu.1);
|
||||
if let Err(e) = source_pipeline.event_loop.send(msg) {
|
||||
warn!(
|
||||
"Failed to send SetWebGPUPort to pipeline {} ({:?})",
|
||||
source_pipeline_id, e
|
||||
);
|
||||
}
|
||||
webgpu.0
|
||||
},
|
||||
None => return warn!("Failed to create new WebGPU thread"),
|
||||
})
|
||||
.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue