aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/rtcicecandidate.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2019-01-26 09:28:07 -0800
committerManish Goregaokar <manishsmail@gmail.com>2019-01-28 22:21:42 -0800
commit69931934ace93479bb4da422e346387779bbf847 (patch)
treeb800cdeaca99714292fe4982559953967d2ab517 /components/script/dom/rtcicecandidate.rs
parentf8b3bac7570bb669bb2d1555cfc0bd3a7ab2175d (diff)
downloadservo-69931934ace93479bb4da422e346387779bbf847.tar.gz
servo-69931934ace93479bb4da422e346387779bbf847.zip
Add empty RTCIceCandidate interface
Diffstat (limited to 'components/script/dom/rtcicecandidate.rs')
-rw-r--r--components/script/dom/rtcicecandidate.rs41
1 files changed, 41 insertions, 0 deletions
diff --git a/components/script/dom/rtcicecandidate.rs b/components/script/dom/rtcicecandidate.rs
new file mode 100644
index 00000000000..89a525294c2
--- /dev/null
+++ b/components/script/dom/rtcicecandidate.rs
@@ -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::RTCIceCandidateBinding;
+use crate::dom::bindings::codegen::Bindings::RTCIceCandidateBinding::RTCIceCandidateInit;
+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 RTCIceCandidate {
+ reflector: Reflector,
+}
+
+impl RTCIceCandidate {
+ pub fn new_inherited() -> RTCIceCandidate {
+ RTCIceCandidate {
+ reflector: Reflector::new(),
+ }
+ }
+
+ pub fn new(global: &GlobalScope) -> DomRoot<RTCIceCandidate> {
+ reflect_dom_object(
+ Box::new(RTCIceCandidate::new_inherited()),
+ global,
+ RTCIceCandidateBinding::Wrap,
+ )
+ }
+
+ pub fn Constructor(
+ window: &Window,
+ _config: &RTCIceCandidateInit,
+ ) -> Fallible<DomRoot<RTCIceCandidate>> {
+ Ok(RTCIceCandidate::new(&window.global()))
+ }
+}