/usr/include/thunderbird/mozilla/dom/RTCPeerConnectionBinding.h is in thunderbird-dev 1:52.8.0-1~deb8u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 | /* THIS FILE IS AUTOGENERATED FROM RTCPeerConnection.webidl BY Codegen.py - DO NOT EDIT */
#ifndef mozilla_dom_RTCPeerConnectionBinding_h
#define mozilla_dom_RTCPeerConnectionBinding_h
#include "RTCPeerConnectionBinding.h"
#include "js/RootingAPI.h"
#include "jspubtd.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/CallbackFunction.h"
#include "mozilla/dom/CallbackInterface.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/ToJSValue.h"
#include "nsWeakReference.h"
class nsIDOMDataChannel;
namespace mozilla {
class DOMMediaStream;
namespace dom {
class DOMError;
struct DeprecatedRTCOfferOptionsSet;
struct DeprecatedRTCOfferOptionsSetAtoms;
class EventHandlerNonNull;
class MediaStreamTrack;
struct NativePropertyHooks;
class ObjectOrString;
class OwningObjectOrString;
class Promise;
class ProtoAndIfaceCache;
struct RTCAnswerOptions;
struct RTCConfiguration;
struct RTCDataChannelInit;
struct RTCDataChannelInitAtoms;
class RTCIceCandidate;
struct RTCOfferOptions;
struct RTCOfferOptionsAtoms;
class RTCPeerConnection;
struct RTCPeerConnectionAtoms;
class RTCPeerConnectionErrorCallback;
class RTCRtpReceiver;
class RTCRtpSender;
class RTCSessionDescription;
class RTCSessionDescriptionCallback;
class RTCStatsCallback;
class RTCStatsReport;
class VoidFunction;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class RTCSignalingState : uint32_t {
Stable,
Have_local_offer,
Have_remote_offer,
Have_local_pranswer,
Have_remote_pranswer,
Closed,
EndGuard_
};
namespace RTCSignalingStateValues {
extern const EnumEntry strings[7];
} // namespace RTCSignalingStateValues
bool
ToJSValue(JSContext* aCx, RTCSignalingState aArgument, JS::MutableHandle<JS::Value> aValue);
enum class RTCIceGatheringState : uint32_t {
New,
Gathering,
Complete,
EndGuard_
};
namespace RTCIceGatheringStateValues {
extern const EnumEntry strings[4];
} // namespace RTCIceGatheringStateValues
bool
ToJSValue(JSContext* aCx, RTCIceGatheringState aArgument, JS::MutableHandle<JS::Value> aValue);
enum class RTCIceConnectionState : uint32_t {
New,
Checking,
Connected,
Completed,
Failed,
Disconnected,
Closed,
EndGuard_
};
namespace RTCIceConnectionStateValues {
extern const EnumEntry strings[8];
} // namespace RTCIceConnectionStateValues
bool
ToJSValue(JSContext* aCx, RTCIceConnectionState aArgument, JS::MutableHandle<JS::Value> aValue);
struct DeprecatedRTCOfferOptionsSet : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mMozBundleOnly;
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mMozDontOfferDataChannel;
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mOfferToReceiveAudio;
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mOfferToReceiveVideo;
DeprecatedRTCOfferOptionsSet();
explicit inline DeprecatedRTCOfferOptionsSet(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
explicit inline DeprecatedRTCOfferOptionsSet(const DeprecatedRTCOfferOptionsSet& aOther)
{
*this = aOther;
}
bool
Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(const nsAString& aJSON);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
bool
ToJSON(nsAString& aJSON) const;
void
TraceDictionary(JSTracer* trc);
void
operator=(const DeprecatedRTCOfferOptionsSet& aOther);
private:
static bool
InitIds(JSContext* cx, DeprecatedRTCOfferOptionsSetAtoms* atomsCache);
};
namespace binding_detail {
struct FastDeprecatedRTCOfferOptionsSet : public DeprecatedRTCOfferOptionsSet
{
inline FastDeprecatedRTCOfferOptionsSet()
: DeprecatedRTCOfferOptionsSet(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCDataChannelInit : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Nullable<uint16_t> mId;
MOZ_INIT_OUTSIDE_CTOR Optional<uint16_t> mMaxRetransmitNum;
MOZ_INIT_OUTSIDE_CTOR Nullable<uint16_t> mMaxRetransmitTime;
MOZ_INIT_OUTSIDE_CTOR Nullable<uint16_t> mMaxRetransmits;
MOZ_INIT_OUTSIDE_CTOR bool mNegotiated;
MOZ_INIT_OUTSIDE_CTOR bool mOrdered;
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mOutOfOrderAllowed;
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mPreset;
MOZ_INIT_OUTSIDE_CTOR nsString mProtocol;
MOZ_INIT_OUTSIDE_CTOR Optional<uint16_t> mStream;
RTCDataChannelInit();
explicit inline RTCDataChannelInit(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
explicit inline RTCDataChannelInit(const RTCDataChannelInit& aOther)
{
*this = aOther;
}
bool
Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(const nsAString& aJSON);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
bool
ToJSON(nsAString& aJSON) const;
void
TraceDictionary(JSTracer* trc);
void
operator=(const RTCDataChannelInit& aOther);
private:
static bool
InitIds(JSContext* cx, RTCDataChannelInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCDataChannelInit : public RTCDataChannelInit
{
inline FastRTCDataChannelInit()
: RTCDataChannelInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCOfferAnswerOptions : public DictionaryBase
{
RTCOfferAnswerOptions();
explicit inline RTCOfferAnswerOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
explicit inline RTCOfferAnswerOptions(const RTCOfferAnswerOptions& aOther)
{
*this = aOther;
}
bool
Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(const nsAString& aJSON);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
bool
ToJSON(nsAString& aJSON) const;
void
TraceDictionary(JSTracer* trc);
void
operator=(const RTCOfferAnswerOptions& aOther);
};
namespace binding_detail {
struct FastRTCOfferAnswerOptions : public RTCOfferAnswerOptions
{
inline FastRTCOfferAnswerOptions()
: RTCOfferAnswerOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCAnswerOptions : public RTCOfferAnswerOptions
{
RTCAnswerOptions();
explicit inline RTCAnswerOptions(const FastDictionaryInitializer& )
: RTCOfferAnswerOptions(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
explicit inline RTCAnswerOptions(const RTCAnswerOptions& aOther)
{
*this = aOther;
}
bool
Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(const nsAString& aJSON);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
bool
ToJSON(nsAString& aJSON) const;
void
TraceDictionary(JSTracer* trc);
void
operator=(const RTCAnswerOptions& aOther);
};
namespace binding_detail {
struct FastRTCAnswerOptions : public RTCAnswerOptions
{
inline FastRTCAnswerOptions()
: RTCAnswerOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCOfferOptions : public RTCOfferAnswerOptions
{
MOZ_INIT_OUTSIDE_CTOR bool mIceRestart;
MOZ_INIT_OUTSIDE_CTOR DeprecatedRTCOfferOptionsSet mMandatory;
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mMozBundleOnly;
MOZ_INIT_OUTSIDE_CTOR Optional<bool> mMozDontOfferDataChannel;
MOZ_INIT_OUTSIDE_CTOR Optional<int32_t> mOfferToReceiveAudio;
MOZ_INIT_OUTSIDE_CTOR Optional<int32_t> mOfferToReceiveVideo;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<DeprecatedRTCOfferOptionsSet>> mOptional;
RTCOfferOptions();
explicit inline RTCOfferOptions(const FastDictionaryInitializer& )
: RTCOfferAnswerOptions(FastDictionaryInitializer()),
mMandatory(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
explicit inline RTCOfferOptions(const RTCOfferOptions& aOther)
: mMandatory(FastDictionaryInitializer())
{
*this = aOther;
}
bool
Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(const nsAString& aJSON);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
bool
ToJSON(nsAString& aJSON) const;
void
TraceDictionary(JSTracer* trc);
void
operator=(const RTCOfferOptions& aOther);
private:
static bool
InitIds(JSContext* cx, RTCOfferOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCOfferOptions : public RTCOfferOptions
{
inline FastRTCOfferOptions()
: RTCOfferOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
class RTCSessionDescriptionCallback : public CallbackFunction
{
public:
explicit inline RTCSessionDescriptionCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline RTCSessionDescriptionCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCx, aCallback, aIncumbentGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline RTCSessionDescriptionCallback(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline RTCSessionDescriptionCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
inline void
Call(const T& thisVal, RTCSessionDescription& sdp, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JSCompartment* aCompartment = nullptr)
{
if (!aExecutionReason) {
aExecutionReason = "RTCSessionDescriptionCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aCompartment);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
return Call(s.GetContext(), thisValJS, sdp, aRv);
}
inline void
Call(RTCSessionDescription& sdp, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JSCompartment* aCompartment = nullptr)
{
if (!aExecutionReason) {
aExecutionReason = "RTCSessionDescriptionCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aCompartment);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return Call(s.GetContext(), JS::UndefinedHandleValue, sdp, aRv);
}
template <typename T>
inline void
Call(const T& thisVal, RTCSessionDescription& sdp, const char* aExecutionReason = nullptr)
{
IgnoredErrorResult rv;
return Call(thisVal, sdp, rv, aExecutionReason);
}
inline void
Call(RTCSessionDescription& sdp, const char* aExecutionReason = nullptr)
{
IgnoredErrorResult rv;
return Call(sdp, rv, aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const RTCSessionDescriptionCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
void Call(JSContext* cx, JS::Handle<JS::Value> aThisVal, RTCSessionDescription& sdp, ErrorResult& aRv);
};
class RTCPeerConnectionErrorCallback : public CallbackFunction
{
public:
explicit inline RTCPeerConnectionErrorCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline RTCPeerConnectionErrorCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCx, aCallback, aIncumbentGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline RTCPeerConnectionErrorCallback(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline RTCPeerConnectionErrorCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
inline void
Call(const T& thisVal, DOMError& error, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JSCompartment* aCompartment = nullptr)
{
if (!aExecutionReason) {
aExecutionReason = "RTCPeerConnectionErrorCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aCompartment);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
return Call(s.GetContext(), thisValJS, error, aRv);
}
inline void
Call(DOMError& error, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JSCompartment* aCompartment = nullptr)
{
if (!aExecutionReason) {
aExecutionReason = "RTCPeerConnectionErrorCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aCompartment);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return Call(s.GetContext(), JS::UndefinedHandleValue, error, aRv);
}
template <typename T>
inline void
Call(const T& thisVal, DOMError& error, const char* aExecutionReason = nullptr)
{
IgnoredErrorResult rv;
return Call(thisVal, error, rv, aExecutionReason);
}
inline void
Call(DOMError& error, const char* aExecutionReason = nullptr)
{
IgnoredErrorResult rv;
return Call(error, rv, aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const RTCPeerConnectionErrorCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
void Call(JSContext* cx, JS::Handle<JS::Value> aThisVal, DOMError& error, ErrorResult& aRv);
};
class VoidFunction : public CallbackFunction
{
public:
explicit inline VoidFunction(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline VoidFunction(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCx, aCallback, aIncumbentGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline VoidFunction(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline VoidFunction(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
inline void
Call(const T& thisVal, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JSCompartment* aCompartment = nullptr)
{
if (!aExecutionReason) {
aExecutionReason = "VoidFunction";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aCompartment);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
return Call(s.GetContext(), thisValJS, aRv);
}
inline void
Call(ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JSCompartment* aCompartment = nullptr)
{
if (!aExecutionReason) {
aExecutionReason = "VoidFunction";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aCompartment);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return Call(s.GetContext(), JS::UndefinedHandleValue, aRv);
}
template <typename T>
inline void
Call(const T& thisVal, const char* aExecutionReason = nullptr)
{
IgnoredErrorResult rv;
return Call(thisVal, rv, aExecutionReason);
}
inline void
Call(const char* aExecutionReason = nullptr)
{
IgnoredErrorResult rv;
return Call(rv, aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const VoidFunction& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
void Call(JSContext* cx, JS::Handle<JS::Value> aThisVal, ErrorResult& aRv);
};
class RTCStatsCallback : public CallbackFunction
{
public:
explicit inline RTCStatsCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline RTCStatsCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCx, aCallback, aIncumbentGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline RTCStatsCallback(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline RTCStatsCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
inline void
Call(const T& thisVal, RTCStatsReport& report, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JSCompartment* aCompartment = nullptr)
{
if (!aExecutionReason) {
aExecutionReason = "RTCStatsCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aCompartment);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
return Call(s.GetContext(), thisValJS, report, aRv);
}
inline void
Call(RTCStatsReport& report, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JSCompartment* aCompartment = nullptr)
{
if (!aExecutionReason) {
aExecutionReason = "RTCStatsCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aCompartment);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return Call(s.GetContext(), JS::UndefinedHandleValue, report, aRv);
}
template <typename T>
inline void
Call(const T& thisVal, RTCStatsReport& report, const char* aExecutionReason = nullptr)
{
IgnoredErrorResult rv;
return Call(thisVal, report, rv, aExecutionReason);
}
inline void
Call(RTCStatsReport& report, const char* aExecutionReason = nullptr)
{
IgnoredErrorResult rv;
return Call(report, rv, aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const RTCStatsCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
void Call(JSContext* cx, JS::Handle<JS::Value> aThisVal, RTCStatsReport& report, ErrorResult& aRv);
};
namespace binding_detail {
class FastRTCSessionDescriptionCallback : public RTCSessionDescriptionCallback
{
public:
explicit inline FastRTCSessionDescriptionCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
: RTCSessionDescriptionCallback(aCx, aCallback, aIncumbentGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
RTCSessionDescriptionCallback::Trace(aTracer);
}
inline void
HoldJSObjectsIfMoreThanOneOwner()
{
RTCSessionDescriptionCallback::HoldJSObjectsIfMoreThanOneOwner();
}
};
} // namespace binding_detail
namespace binding_detail {
class FastRTCPeerConnectionErrorCallback : public RTCPeerConnectionErrorCallback
{
public:
explicit inline FastRTCPeerConnectionErrorCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
: RTCPeerConnectionErrorCallback(aCx, aCallback, aIncumbentGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
RTCPeerConnectionErrorCallback::Trace(aTracer);
}
inline void
HoldJSObjectsIfMoreThanOneOwner()
{
RTCPeerConnectionErrorCallback::HoldJSObjectsIfMoreThanOneOwner();
}
};
} // namespace binding_detail
namespace binding_detail {
class FastVoidFunction : public VoidFunction
{
public:
explicit inline FastVoidFunction(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
: VoidFunction(aCx, aCallback, aIncumbentGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
VoidFunction::Trace(aTracer);
}
inline void
HoldJSObjectsIfMoreThanOneOwner()
{
VoidFunction::HoldJSObjectsIfMoreThanOneOwner();
}
};
} // namespace binding_detail
namespace binding_detail {
class FastRTCStatsCallback : public RTCStatsCallback
{
public:
explicit inline FastRTCStatsCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
: RTCStatsCallback(aCx, aCallback, aIncumbentGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
RTCStatsCallback::Trace(aTracer);
}
inline void
HoldJSObjectsIfMoreThanOneOwner()
{
RTCStatsCallback::HoldJSObjectsIfMoreThanOneOwner();
}
};
} // namespace binding_detail
namespace RTCPeerConnectionBinding {
typedef mozilla::dom::RTCPeerConnection NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
JSObject*
DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
const JSClass*
GetJSClass();
bool
Wrap(JSContext* aCx, mozilla::dom::RTCPeerConnection* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
// We declare this as an array so that retrieving a pointer to this
// binding's property hooks only requires compile/link-time resolvable
// address arithmetic. Declaring it as a pointer instead would require
// doing a run-time load to fetch a pointer to this binding's property
// hooks. And then structures which embedded a pointer to this structure
// would require a run-time load for proper initialization, which would
// then induce static constructors. Lots of static constructors.
extern const NativePropertyHooks sNativePropertyHooks[];
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
JS::Handle<JSObject*>
GetProtoObjectHandle(JSContext* aCx);
JSObject*
GetProtoObject(JSContext* aCx);
JS::Handle<JSObject*>
GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace RTCPeerConnectionBinding
class RTCPeerConnectionJSImpl : public CallbackInterface
{
public:
explicit inline RTCPeerConnectionJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
: CallbackInterface(aCx, aCallback, aIncumbentGlobal)
{
}
explicit inline RTCPeerConnectionJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal, const FastCallbackConstructor& )
: CallbackInterface(aCx, aCallback, aIncumbentGlobal, FastCallbackConstructor())
{
}
explicit inline RTCPeerConnectionJSImpl(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackInterface(aCallback, aAsyncStack, aIncumbentGlobal)
{
}
void SetIdentityProvider(const nsAString& provider, const Optional<nsAString>& protocol, const Optional<nsAString>& username, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> GetIdentityAssertion(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> CreateOffer(const RTCOfferOptions& options, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> CreateOffer(RTCSessionDescriptionCallback& successCallback, RTCPeerConnectionErrorCallback& failureCallback, const RTCOfferOptions& options, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> CreateAnswer(const RTCAnswerOptions& options, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> CreateAnswer(RTCSessionDescriptionCallback& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> SetLocalDescription(RTCSessionDescription& description, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> SetLocalDescription(RTCSessionDescription& description, VoidFunction& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> SetRemoteDescription(RTCSessionDescription& description, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> SetRemoteDescription(RTCSessionDescription& description, VoidFunction& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> AddIceCandidate(RTCIceCandidate& candidate, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> AddIceCandidate(RTCIceCandidate& candidate, VoidFunction& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetConfiguration(RTCConfiguration& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetLocalStreams(nsTArray<RefPtr<DOMMediaStream>>& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetRemoteStreams(nsTArray<RefPtr<DOMMediaStream>>& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<DOMMediaStream> GetStreamById(const nsAString& streamId, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void AddStream(DOMMediaStream& stream, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<RTCRtpSender> AddTrack(MediaStreamTrack& track, DOMMediaStream& stream, const nsTArray<OwningNonNull<DOMMediaStream>>& moreStreams, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void RemoveTrack(RTCRtpSender& sender, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetSenders(nsTArray<RefPtr<RTCRtpSender>>& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetReceivers(nsTArray<RefPtr<RTCRtpReceiver>>& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void MozSelectSsrc(RTCRtpReceiver& receiver, uint16_t ssrcIndex, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void Close(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> GetStats(const Optional<MediaStreamTrack*>& selector, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> GetStats(MediaStreamTrack* selector, RTCStatsCallback& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<nsIDOMDataChannel> CreateDataChannel(const nsAString& label, const RTCDataChannelInit& dataChannelDict, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void __Init(const RTCConfiguration& configuration, const Optional<JS::Handle<JSObject*>>& constraints, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
inline bool
operator==(const RTCPeerConnectionJSImpl& aOther) const
{
return CallbackInterface::operator==(aOther);
}
already_AddRefed<RTCSessionDescription> GetLocalDescription(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<RTCSessionDescription> GetRemoteDescription(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
RTCSignalingState GetSignalingState(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
Nullable<bool> GetCanTrickleIceCandidates(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
RTCIceGatheringState GetIceGatheringState(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
RTCIceConnectionState GetIceConnectionState(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<Promise> GetPeerIdentity(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetIdpLoginUrl(nsString& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetId(nsString& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnnegotiationneeded(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnicecandidate(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnsignalingstatechange(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnaddstream(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnaddtrack(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOntrack(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnremovestream(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOniceconnectionstatechange(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOndatachannel(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetId(const nsAString& arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetOnnegotiationneeded(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetOnicecandidate(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetOnsignalingstatechange(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetOnaddstream(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetOnaddtrack(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetOntrack(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetOnremovestream(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetOniceconnectionstatechange(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void SetOndatachannel(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
private:
static bool
InitIds(JSContext* cx, RTCPeerConnectionAtoms* atomsCache);
};
class RTCPeerConnection : public mozilla::DOMEventTargetHelper
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RTCPeerConnection, mozilla::DOMEventTargetHelper)
private:
RefPtr<RTCPeerConnectionJSImpl> mImpl;
nsCOMPtr<nsISupports> mParent;
public:
RTCPeerConnection(JS::Handle<JSObject*> aJSImplObject, nsIGlobalObject* aParent);
protected:
virtual ~RTCPeerConnection();
public:
nsISupports* GetParentObject() const;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
static already_AddRefed<RTCPeerConnection> Constructor(const GlobalObject& global, JSContext* cx, const RTCConfiguration& configuration, const Optional<JS::Handle<JSObject*>>& constraints, ErrorResult& aRv);
void SetIdentityProvider(const nsAString& provider, const Optional<nsAString>& protocol, const Optional<nsAString>& username, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> GetIdentityAssertion(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> CreateOffer(const RTCOfferOptions& options, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> CreateOffer(RTCSessionDescriptionCallback& successCallback, RTCPeerConnectionErrorCallback& failureCallback, const RTCOfferOptions& options, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> CreateAnswer(const RTCAnswerOptions& options, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> CreateAnswer(RTCSessionDescriptionCallback& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> SetLocalDescription(RTCSessionDescription& description, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> SetLocalDescription(RTCSessionDescription& description, VoidFunction& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> SetRemoteDescription(RTCSessionDescription& description, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> SetRemoteDescription(RTCSessionDescription& description, VoidFunction& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<RTCSessionDescription> GetLocalDescription(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<RTCSessionDescription> GetRemoteDescription(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
RTCSignalingState GetSignalingState(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> AddIceCandidate(RTCIceCandidate& candidate, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> AddIceCandidate(RTCIceCandidate& candidate, VoidFunction& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
Nullable<bool> GetCanTrickleIceCandidates(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
RTCIceGatheringState GetIceGatheringState(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
RTCIceConnectionState GetIceConnectionState(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> GetPeerIdentity(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void GetIdpLoginUrl(nsString& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void GetId(nsString& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetId(const nsAString& arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetConfiguration(RTCConfiguration& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetLocalStreams(nsTArray<RefPtr<DOMMediaStream>>& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetRemoteStreams(nsTArray<RefPtr<DOMMediaStream>>& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<DOMMediaStream> GetStreamById(const nsAString& streamId, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void AddStream(DOMMediaStream& stream, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<RTCRtpSender> AddTrack(MediaStreamTrack& track, DOMMediaStream& stream, const Sequence<OwningNonNull<DOMMediaStream>>& moreStreams, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void RemoveTrack(RTCRtpSender& sender, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetSenders(nsTArray<RefPtr<RTCRtpSender>>& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void GetReceivers(nsTArray<RefPtr<RTCRtpReceiver>>& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void MozSelectSsrc(RTCRtpReceiver& receiver, uint16_t ssrcIndex, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
void Close(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnnegotiationneeded(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetOnnegotiationneeded(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnicecandidate(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetOnicecandidate(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnsignalingstatechange(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetOnsignalingstatechange(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnaddstream(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetOnaddstream(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnaddtrack(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetOnaddtrack(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOntrack(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetOntrack(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOnremovestream(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetOnremovestream(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOniceconnectionstatechange(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetOniceconnectionstatechange(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> GetStats(const Optional<MediaStreamTrack*>& selector, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<Promise> GetStats(MediaStreamTrack* selector, RTCStatsCallback& successCallback, RTCPeerConnectionErrorCallback& failureCallback, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
already_AddRefed<nsIDOMDataChannel> CreateDataChannel(const nsAString& label, const RTCDataChannelInit& dataChannelDict, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
already_AddRefed<EventHandlerNonNull> GetOndatachannel(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
void SetOndatachannel(EventHandlerNonNull* arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
static bool
_Create(JSContext* cx, unsigned argc, JS::Value* vp);
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_RTCPeerConnectionBinding_h
|