mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Add empty RTCSessionDescription interface
This commit is contained in:
parent
2dd69d0cb0
commit
f8b3bac757
3 changed files with 67 additions and 0 deletions
41
components/script/dom/rtcsessiondescription.rs
Normal file
41
components/script/dom/rtcsessiondescription.rs
Normal file
|
@ -0,0 +1,41 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::RTCSessionDescriptionBinding;
|
||||
use crate::dom::bindings::codegen::Bindings::RTCSessionDescriptionBinding::RTCSessionDescriptionInit;
|
||||
use crate::dom::bindings::error::Fallible;
|
||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||
use crate::dom::bindings::reflector::{DomObject, Reflector};
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::window::Window;
|
||||
use dom_struct::dom_struct;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct RTCSessionDescription {
|
||||
reflector: Reflector,
|
||||
}
|
||||
|
||||
impl RTCSessionDescription {
|
||||
pub fn new_inherited() -> RTCSessionDescription {
|
||||
RTCSessionDescription {
|
||||
reflector: Reflector::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(global: &GlobalScope) -> DomRoot<RTCSessionDescription> {
|
||||
reflect_dom_object(
|
||||
Box::new(RTCSessionDescription::new_inherited()),
|
||||
global,
|
||||
RTCSessionDescriptionBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn Constructor(
|
||||
window: &Window,
|
||||
_config: &RTCSessionDescriptionInit,
|
||||
) -> Fallible<DomRoot<RTCSessionDescription>> {
|
||||
Ok(RTCSessionDescription::new(&window.global()))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue