mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
refactor: propagate CanGc arguments through callers (#35591)
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
This commit is contained in:
parent
02199520f2
commit
b0b0289014
74 changed files with 403 additions and 275 deletions
|
@ -272,7 +272,7 @@ impl NotificationMethods<crate::DomTypeHolder> for Notification {
|
|||
|
||||
// TODO: Step 3: Run these steps in parallel:
|
||||
// Step 3.1: Let permissionState be the result of requesting permission to use "notifications".
|
||||
let notification_permission = request_notification_permission(global);
|
||||
let notification_permission = request_notification_permission(global, can_gc);
|
||||
|
||||
// Step 3.2: Queue a global task on the DOM manipulation task source given global to run these steps:
|
||||
let trusted_promise = TrustedPromise::new(promise.clone());
|
||||
|
@ -542,13 +542,13 @@ fn get_notifications_permission_state(global: &GlobalScope) -> NotificationPermi
|
|||
}
|
||||
}
|
||||
|
||||
fn request_notification_permission(global: &GlobalScope) -> NotificationPermission {
|
||||
fn request_notification_permission(global: &GlobalScope, can_gc: CanGc) -> NotificationPermission {
|
||||
let cx = GlobalScope::get_cx();
|
||||
let promise = &Promise::new(global, CanGc::note());
|
||||
let promise = &Promise::new(global, can_gc);
|
||||
let descriptor = PermissionDescriptor {
|
||||
name: PermissionName::Notifications,
|
||||
};
|
||||
let status = PermissionStatus::new(global, &descriptor, CanGc::note());
|
||||
let status = PermissionStatus::new(global, &descriptor, can_gc);
|
||||
|
||||
// The implementation of `request_notification_permission` seemed to be synchronous
|
||||
Permissions::permission_request(cx, promise, &descriptor, &status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue