mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Propagate CanGc
from Document::new()
(#33386)
* Add canGc as a parameter to autogenerated trait methods Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> * Propagate CanGc from Document::new() Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> --------- Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
This commit is contained in:
parent
10e5bb72d9
commit
e5150dbda1
41 changed files with 704 additions and 393 deletions
|
@ -28,6 +28,7 @@ use crate::dom::htmlmediaelement::HTMLMediaElement;
|
|||
use crate::dom::mediametadata::MediaMetadata;
|
||||
use crate::dom::window::Window;
|
||||
use crate::realms::{enter_realm, InRealm};
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct MediaSession {
|
||||
|
@ -67,7 +68,7 @@ impl MediaSession {
|
|||
self.media_instance.set(Some(media_instance));
|
||||
}
|
||||
|
||||
pub fn handle_action(&self, action: MediaSessionActionType) {
|
||||
pub fn handle_action(&self, action: MediaSessionActionType, can_gc: CanGc) {
|
||||
debug!("Handle media session action {:?}", action);
|
||||
|
||||
if let Some(handler) = self.action_handlers.borrow().get(&action) {
|
||||
|
@ -82,10 +83,10 @@ impl MediaSession {
|
|||
match action {
|
||||
MediaSessionActionType::Play => {
|
||||
let realm = enter_realm(self);
|
||||
media.Play(InRealm::Entered(&realm));
|
||||
media.Play(InRealm::Entered(&realm), can_gc);
|
||||
},
|
||||
MediaSessionActionType::Pause => {
|
||||
media.Pause();
|
||||
media.Pause(can_gc);
|
||||
},
|
||||
MediaSessionActionType::SeekBackward => {},
|
||||
MediaSessionActionType::SeekForward => {},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue