mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
fixes dereferencing on an immutable reference (#31864)
This commit is contained in:
parent
585e0d69cd
commit
f7669b5238
32 changed files with 76 additions and 77 deletions
|
@ -41,13 +41,13 @@ impl From<&WindowProxyOrMessagePortOrServiceWorker> for SrcObject {
|
|||
fn from(src_object: &WindowProxyOrMessagePortOrServiceWorker) -> SrcObject {
|
||||
match src_object {
|
||||
WindowProxyOrMessagePortOrServiceWorker::WindowProxy(blob) => {
|
||||
SrcObject::WindowProxy(Dom::from_ref(&*blob))
|
||||
SrcObject::WindowProxy(Dom::from_ref(blob))
|
||||
},
|
||||
WindowProxyOrMessagePortOrServiceWorker::MessagePort(stream) => {
|
||||
SrcObject::MessagePort(Dom::from_ref(&*stream))
|
||||
SrcObject::MessagePort(Dom::from_ref(stream))
|
||||
},
|
||||
WindowProxyOrMessagePortOrServiceWorker::ServiceWorker(stream) => {
|
||||
SrcObject::ServiceWorker(Dom::from_ref(&*stream))
|
||||
SrcObject::ServiceWorker(Dom::from_ref(stream))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -258,13 +258,13 @@ impl MessageEventMethods for MessageEvent {
|
|||
fn GetSource(&self) -> Option<WindowProxyOrMessagePortOrServiceWorker> {
|
||||
match &*self.source.borrow() {
|
||||
Some(SrcObject::WindowProxy(i)) => Some(
|
||||
WindowProxyOrMessagePortOrServiceWorker::WindowProxy(DomRoot::from_ref(&*i)),
|
||||
WindowProxyOrMessagePortOrServiceWorker::WindowProxy(DomRoot::from_ref(i)),
|
||||
),
|
||||
Some(SrcObject::MessagePort(i)) => Some(
|
||||
WindowProxyOrMessagePortOrServiceWorker::MessagePort(DomRoot::from_ref(&*i)),
|
||||
WindowProxyOrMessagePortOrServiceWorker::MessagePort(DomRoot::from_ref(i)),
|
||||
),
|
||||
Some(SrcObject::ServiceWorker(i)) => Some(
|
||||
WindowProxyOrMessagePortOrServiceWorker::ServiceWorker(DomRoot::from_ref(&*i)),
|
||||
WindowProxyOrMessagePortOrServiceWorker::ServiceWorker(DomRoot::from_ref(i)),
|
||||
),
|
||||
None => None,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue