mirror of
https://github.com/servo/servo.git
synced 2025-07-25 08:10:21 +01:00
feat(script): use GlobalScope::origin
when creating a principals object
The concrete types of `[Global]` DOM interfaces have `origin` methods, which were used before this commit. Some of them just delegate to `GlobalScope::origin` while others are implemented differently. This commit changes the created principals objects' associated origins in the following way: - `DedicatedWorkerGlobalScope` - was `WorkerGlobalScope::worker_url` - `DissimilarOriginWindow` - no change - `PaintWorkletGlobalScope` - no change - `ServiceWorkerGlobalScope` - was `ServiceWorkerGlobalScope::scope_url` - `TestWorkletGlobalScope` - no change - `Window` - no change
This commit is contained in:
parent
3550270cd0
commit
c3de9b72a6
1 changed files with 2 additions and 2 deletions
|
@ -2912,7 +2912,7 @@ class CGWrapGlobalMethod(CGAbstractMethod):
|
|||
|
||||
return CGGeneric("""\
|
||||
let raw = Root::new(MaybeUnreflectedDom::from_box(object));
|
||||
let origin = (*raw.as_ptr()).origin(); // `MutableOrigin` or `&MutableOrigin`
|
||||
let origin = (*raw.as_ptr()).upcast::<GlobalScope>().origin();
|
||||
|
||||
rooted!(in(*cx) let mut obj = ptr::null_mut::<JSObject>());
|
||||
create_global_object(
|
||||
|
@ -2921,7 +2921,7 @@ create_global_object(
|
|||
raw.as_ptr() as *const %(concreteType)s as *const libc::c_void,
|
||||
_trace,
|
||||
obj.handle_mut(),
|
||||
&origin);
|
||||
origin);
|
||||
assert!(!obj.is_null());
|
||||
|
||||
let root = raw.reflect_with(obj.get());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue