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 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241
// // DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIXPConnect.idl // /// `interface nsIXPConnectJSObjectHolder : nsISupports` /// /// ```text /// /***************************************************************************/ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPConnectJSObjectHolder { vtable: *const nsIXPConnectJSObjectHolderVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPConnectJSObjectHolder. unsafe impl XpCom for nsIXPConnectJSObjectHolder { const IID: nsIID = nsID(0x73e6ff4a, 0xab99, 0x4d99, [0xac, 0x00, 0xba, 0x39, 0xcc, 0xb8, 0xe4, 0xd7]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPConnectJSObjectHolder { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPConnectJSObjectHolder. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPConnectJSObjectHolderCoerce { /// Cheaply cast a value of this type from a `nsIXPConnectJSObjectHolder`. fn coerce_from(v: &nsIXPConnectJSObjectHolder) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPConnectJSObjectHolderCoerce for nsIXPConnectJSObjectHolder { #[inline] fn coerce_from(v: &nsIXPConnectJSObjectHolder) -> &Self { v } } impl nsIXPConnectJSObjectHolder { /// Cast this `nsIXPConnectJSObjectHolder` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPConnectJSObjectHolderCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPConnectJSObjectHolder { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPConnectJSObjectHolderCoerce for T { #[inline] fn coerce_from(v: &nsIXPConnectJSObjectHolder) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPConnectJSObjectHolder // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPConnectJSObjectHolderVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* [nostdcall,notxpcom] JSObjectPtr GetJSObject (); */ /// Unable to generate binding because `nostdcall is unsupported` pub GetJSObject: *const ::libc::c_void, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPConnectJSObjectHolder { /// `[nostdcall,notxpcom] JSObjectPtr GetJSObject ();` const _GetJSObject: () = (); } /// `interface nsIXPConnectWrappedNative : nsIXPConnectJSObjectHolder` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPConnectWrappedNative { vtable: *const nsIXPConnectWrappedNativeVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPConnectWrappedNative. unsafe impl XpCom for nsIXPConnectWrappedNative { const IID: nsIID = nsID(0xe787be29, 0xdb5d, 0x4a45, [0xa3, 0xd6, 0x1d, 0xe1, 0xd6, 0xb8, 0x5c, 0x30]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPConnectWrappedNative { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPConnectWrappedNative. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPConnectWrappedNativeCoerce { /// Cheaply cast a value of this type from a `nsIXPConnectWrappedNative`. fn coerce_from(v: &nsIXPConnectWrappedNative) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPConnectWrappedNativeCoerce for nsIXPConnectWrappedNative { #[inline] fn coerce_from(v: &nsIXPConnectWrappedNative) -> &Self { v } } impl nsIXPConnectWrappedNative { /// Cast this `nsIXPConnectWrappedNative` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPConnectWrappedNativeCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPConnectWrappedNative { type Target = nsIXPConnectJSObjectHolder; #[inline] fn deref(&self) -> &nsIXPConnectJSObjectHolder { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsIXPConnectJSObjectHolderCoerce> nsIXPConnectWrappedNativeCoerce for T { #[inline] fn coerce_from(v: &nsIXPConnectWrappedNative) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPConnectWrappedNative // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPConnectWrappedNativeVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsIXPConnectJSObjectHolderVTable, /* void debugDump (in short depth); */ pub DebugDump: unsafe extern "system" fn (this: *const nsIXPConnectWrappedNative, depth: libc::int16_t) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPConnectWrappedNative { /// `void debugDump (in short depth);` #[inline] pub unsafe fn DebugDump(&self, depth: libc::int16_t) -> nsresult { ((*self.vtable).DebugDump)(self, depth) } } /// `interface nsIXPConnectWrappedJS : nsIXPConnectJSObjectHolder` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPConnectWrappedJS { vtable: *const nsIXPConnectWrappedJSVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPConnectWrappedJS. unsafe impl XpCom for nsIXPConnectWrappedJS { const IID: nsIID = nsID(0x3a01b0d6, 0x074b, 0x49ed, [0xba, 0xc3, 0x08, 0xc7, 0x63, 0x66, 0xca, 0xe4]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPConnectWrappedJS { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPConnectWrappedJS. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPConnectWrappedJSCoerce { /// Cheaply cast a value of this type from a `nsIXPConnectWrappedJS`. fn coerce_from(v: &nsIXPConnectWrappedJS) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPConnectWrappedJSCoerce for nsIXPConnectWrappedJS { #[inline] fn coerce_from(v: &nsIXPConnectWrappedJS) -> &Self { v } } impl nsIXPConnectWrappedJS { /// Cast this `nsIXPConnectWrappedJS` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPConnectWrappedJSCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPConnectWrappedJS { type Target = nsIXPConnectJSObjectHolder; #[inline] fn deref(&self) -> &nsIXPConnectJSObjectHolder { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsIXPConnectJSObjectHolderCoerce> nsIXPConnectWrappedJSCoerce for T { #[inline] fn coerce_from(v: &nsIXPConnectWrappedJS) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPConnectWrappedJS // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPConnectWrappedJSVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsIXPConnectJSObjectHolderVTable, /* readonly attribute nsIInterfaceInfo InterfaceInfo; */ pub GetInterfaceInfo: unsafe extern "system" fn (this: *const nsIXPConnectWrappedJS, aInterfaceInfo: *mut *const nsIInterfaceInfo) -> nsresult, /* readonly attribute nsIIDPtr InterfaceIID; */ pub GetInterfaceIID: unsafe extern "system" fn (this: *const nsIXPConnectWrappedJS, aInterfaceIID: *mut *mut nsIID) -> nsresult, /* void debugDump (in short depth); */ pub DebugDump: unsafe extern "system" fn (this: *const nsIXPConnectWrappedJS, depth: libc::int16_t) -> nsresult, /* void aggregatedQueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */ pub AggregatedQueryInterface: unsafe extern "system" fn (this: *const nsIXPConnectWrappedJS, uuid: &nsIID, result: *mut *mut libc::c_void) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPConnectWrappedJS { /// `readonly attribute nsIInterfaceInfo InterfaceInfo;` #[inline] pub unsafe fn GetInterfaceInfo(&self, aInterfaceInfo: *mut *const nsIInterfaceInfo) -> nsresult { ((*self.vtable).GetInterfaceInfo)(self, aInterfaceInfo) } /// `readonly attribute nsIIDPtr InterfaceIID;` #[inline] pub unsafe fn GetInterfaceIID(&self, aInterfaceIID: *mut *mut nsIID) -> nsresult { ((*self.vtable).GetInterfaceIID)(self, aInterfaceIID) } /// `void debugDump (in short depth);` #[inline] pub unsafe fn DebugDump(&self, depth: libc::int16_t) -> nsresult { ((*self.vtable).DebugDump)(self, depth) } /// `void aggregatedQueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);` #[inline] pub unsafe fn AggregatedQueryInterface(&self, uuid: &nsIID, result: *mut *mut libc::c_void) -> nsresult { ((*self.vtable).AggregatedQueryInterface)(self, uuid, result) } } /// `interface nsIXPConnectWrappedJSUnmarkGray : nsIXPConnectWrappedJS` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPConnectWrappedJSUnmarkGray { vtable: *const nsIXPConnectWrappedJSUnmarkGrayVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPConnectWrappedJSUnmarkGray. unsafe impl XpCom for nsIXPConnectWrappedJSUnmarkGray { const IID: nsIID = nsID(0xc02a0ce6, 0x275f, 0x4ea1, [0x9c, 0x23, 0x08, 0x49, 0x48, 0x98, 0xb0, 0x70]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPConnectWrappedJSUnmarkGray { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPConnectWrappedJSUnmarkGray. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPConnectWrappedJSUnmarkGrayCoerce { /// Cheaply cast a value of this type from a `nsIXPConnectWrappedJSUnmarkGray`. fn coerce_from(v: &nsIXPConnectWrappedJSUnmarkGray) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPConnectWrappedJSUnmarkGrayCoerce for nsIXPConnectWrappedJSUnmarkGray { #[inline] fn coerce_from(v: &nsIXPConnectWrappedJSUnmarkGray) -> &Self { v } } impl nsIXPConnectWrappedJSUnmarkGray { /// Cast this `nsIXPConnectWrappedJSUnmarkGray` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPConnectWrappedJSUnmarkGrayCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPConnectWrappedJSUnmarkGray { type Target = nsIXPConnectWrappedJS; #[inline] fn deref(&self) -> &nsIXPConnectWrappedJS { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsIXPConnectWrappedJSCoerce> nsIXPConnectWrappedJSUnmarkGrayCoerce for T { #[inline] fn coerce_from(v: &nsIXPConnectWrappedJSUnmarkGray) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPConnectWrappedJSUnmarkGray // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPConnectWrappedJSUnmarkGrayVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsIXPConnectWrappedJSVTable, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPConnectWrappedJSUnmarkGray { } /// `interface nsIXPCWrappedJSObjectGetter : nsISupports` /// /// ```text /// /***************************************************************************/ /// /** /// * This is a sort of a placeholder interface. It is not intended to be /// * implemented. It exists to give the nsIXPCSecurityManager an iid on /// * which to gate a specific activity in XPConnect. /// * /// * That activity is... /// * /// * When JavaScript code uses a component that is itself implemented in /// * JavaScript then XPConnect will build a wrapper rather than directly /// * expose the JSObject of the component. This allows components implemented /// * in JavaScript to 'look' just like any other xpcom component (from the /// * perspective of the JavaScript caller). This insulates the component from /// * the caller and hides any properties or methods that are not part of the /// * interface as declared in xpidl. Usually this is a good thing. /// * /// * However, in some cases it is useful to allow the JS caller access to the /// * JS component's underlying implementation. In order to facilitate this /// * XPConnect supports the 'wrappedJSObject' property. The caller code can do: /// * /// * // 'foo' is some xpcom component (that might be implemented in JS). /// * try { /// * var bar = foo.wrappedJSObject; /// * if(bar) { /// * // bar is the underlying JSObject. Do stuff with it here. /// * } /// * } catch(e) { /// * // security exception? /// * } /// * /// * Recall that 'foo' above is an XPConnect wrapper, not the underlying JS /// * object. The property get "foo.wrappedJSObject" will only succeed if three /// * conditions are met: /// * /// * 1) 'foo' really is an XPConnect wrapper around a JSObject. /// * 2) The underlying JSObject actually implements a "wrappedJSObject" /// * property that returns a JSObject. This is called by XPConnect. This /// * restriction allows wrapped objects to only allow access to the underlying /// * JSObject if they choose to do so. Ususally this just means that 'foo' /// * would have a property tht looks like: /// * this.wrappedJSObject = this. /// * 3) The implemementation of nsIXPCSecurityManager (if installed) allows /// * a property get on the interface below. Although the JSObject need not /// * implement 'nsIXPCWrappedJSObjectGetter', XPConnect will ask the /// * security manager if it is OK for the caller to access the only method /// * in nsIXPCWrappedJSObjectGetter before allowing the activity. This fits /// * in with the security manager paradigm and makes control over accessing /// * the property on this interface the control factor for getting the /// * underlying wrapped JSObject of a JS component from JS code. /// * /// * Notes: /// * /// * a) If 'foo' above were the underlying JSObject and not a wrapper at all, /// * then this all just works and XPConnect is not part of the picture at all. /// * b) One might ask why 'foo' should not just implement an interface through /// * which callers might get at the underlying object. There are three reasons: /// * i) XPConnect would still have to do magic since JSObject is not a /// * scriptable type. /// * ii) JS Components might use aggregation (like C++ objects) and have /// * different JSObjects for different interfaces 'within' an aggregate /// * object. But, using an additional interface only allows returning one /// * underlying JSObject. However, this allows for the possibility that /// * each of the aggregte JSObjects could return something different. /// * Note that one might do: this.wrappedJSObject = someOtherObject; /// * iii) Avoiding the explicit interface makes it easier for both the caller /// * and the component. /// * /// * Anyway, some future implementation of nsIXPCSecurityManager might want /// * do special processing on 'nsIXPCSecurityManager::CanGetProperty' when /// * the interface id is that of nsIXPCWrappedJSObjectGetter. /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCWrappedJSObjectGetter { vtable: *const nsIXPCWrappedJSObjectGetterVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCWrappedJSObjectGetter. unsafe impl XpCom for nsIXPCWrappedJSObjectGetter { const IID: nsIID = nsID(0x254bb2e0, 0x6439, 0x11d4, [0x8f, 0xe0, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCWrappedJSObjectGetter { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCWrappedJSObjectGetter. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCWrappedJSObjectGetterCoerce { /// Cheaply cast a value of this type from a `nsIXPCWrappedJSObjectGetter`. fn coerce_from(v: &nsIXPCWrappedJSObjectGetter) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCWrappedJSObjectGetterCoerce for nsIXPCWrappedJSObjectGetter { #[inline] fn coerce_from(v: &nsIXPCWrappedJSObjectGetter) -> &Self { v } } impl nsIXPCWrappedJSObjectGetter { /// Cast this `nsIXPCWrappedJSObjectGetter` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCWrappedJSObjectGetterCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCWrappedJSObjectGetter { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCWrappedJSObjectGetterCoerce for T { #[inline] fn coerce_from(v: &nsIXPCWrappedJSObjectGetter) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCWrappedJSObjectGetter // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCWrappedJSObjectGetterVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* readonly attribute nsISupports neverCalled; */ pub GetNeverCalled: unsafe extern "system" fn (this: *const nsIXPCWrappedJSObjectGetter, aNeverCalled: *mut *const nsISupports) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCWrappedJSObjectGetter { /// `readonly attribute nsISupports neverCalled;` #[inline] pub unsafe fn GetNeverCalled(&self, aNeverCalled: *mut *const nsISupports) -> nsresult { ((*self.vtable).GetNeverCalled)(self, aNeverCalled) } } /// `interface nsIXPCFunctionThisTranslator : nsISupports` /// /// ```text /// /***************************************************************************/ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCFunctionThisTranslator { vtable: *const nsIXPCFunctionThisTranslatorVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCFunctionThisTranslator. unsafe impl XpCom for nsIXPCFunctionThisTranslator { const IID: nsIID = nsID(0xf5f84b70, 0x92eb, 0x41f1, [0xa1, 0xdd, 0x2e, 0xaa, 0xc0, 0xed, 0x56, 0x4c]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCFunctionThisTranslator { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCFunctionThisTranslator. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCFunctionThisTranslatorCoerce { /// Cheaply cast a value of this type from a `nsIXPCFunctionThisTranslator`. fn coerce_from(v: &nsIXPCFunctionThisTranslator) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCFunctionThisTranslatorCoerce for nsIXPCFunctionThisTranslator { #[inline] fn coerce_from(v: &nsIXPCFunctionThisTranslator) -> &Self { v } } impl nsIXPCFunctionThisTranslator { /// Cast this `nsIXPCFunctionThisTranslator` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCFunctionThisTranslatorCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCFunctionThisTranslator { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCFunctionThisTranslatorCoerce for T { #[inline] fn coerce_from(v: &nsIXPCFunctionThisTranslator) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCFunctionThisTranslator // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCFunctionThisTranslatorVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* nsISupports TranslateThis (in nsISupports aInitialThis); */ pub TranslateThis: unsafe extern "system" fn (this: *const nsIXPCFunctionThisTranslator, aInitialThis: *const nsISupports, _retval: *mut *const nsISupports) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCFunctionThisTranslator { /// `nsISupports TranslateThis (in nsISupports aInitialThis);` #[inline] pub unsafe fn TranslateThis(&self, aInitialThis: *const nsISupports, _retval: *mut *const nsISupports) -> nsresult { ((*self.vtable).TranslateThis)(self, aInitialThis, _retval) } } /// `interface nsIXPConnect : nsISupports` /// /// ```text /// /***************************************************************************/ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPConnect { vtable: *const nsIXPConnectVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPConnect. unsafe impl XpCom for nsIXPConnect { const IID: nsIID = nsID(0x768507b5, 0xb981, 0x40c7, [0x82, 0x76, 0xf6, 0xa1, 0xda, 0x50, 0x2a, 0x24]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPConnect { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPConnect. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPConnectCoerce { /// Cheaply cast a value of this type from a `nsIXPConnect`. fn coerce_from(v: &nsIXPConnect) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPConnectCoerce for nsIXPConnect { #[inline] fn coerce_from(v: &nsIXPConnect) -> &Self { v } } impl nsIXPConnect { /// Cast this `nsIXPConnect` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPConnectCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPConnect { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPConnectCoerce for T { #[inline] fn coerce_from(v: &nsIXPConnect) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPConnect // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPConnectVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* JSObjectPtr wrapNative (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsIIDRef aIID); */ /// Unable to generate binding because `native type JSContext is unsupported` pub WrapNative: *const ::libc::c_void, /* void wrapNativeToJSVal (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsWrapperCachePtr aCache, in nsIIDPtr aIID, in boolean aAllowWrapper, out jsval aVal); */ /// Unable to generate binding because `native type JSContext is unsupported` pub WrapNativeToJSVal: *const ::libc::c_void, /* void wrapJS (in JSContextPtr aJSContext, in JSObjectPtr aJSObj, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */ /// Unable to generate binding because `native type JSContext is unsupported` pub WrapJS: *const ::libc::c_void, /* nsIVariant jSValToVariant (in JSContextPtr cx, in jsval aJSVal); */ /// Unable to generate binding because `native type JSContext is unsupported` pub JSValToVariant: *const ::libc::c_void, /* nsIXPConnectWrappedNative getWrappedNativeOfJSObject (in JSContextPtr aJSContext, in JSObjectPtr aJSObj); */ /// Unable to generate binding because `native type JSContext is unsupported` pub GetWrappedNativeOfJSObject: *const ::libc::c_void, /* void debugDump (in short depth); */ pub DebugDump: unsafe extern "system" fn (this: *const nsIXPConnect, depth: libc::int16_t) -> nsresult, /* void debugDumpObject (in nsISupports aCOMObj, in short depth); */ pub DebugDumpObject: unsafe extern "system" fn (this: *const nsIXPConnect, aCOMObj: *const nsISupports, depth: libc::int16_t) -> nsresult, /* void debugDumpJSStack (in boolean showArgs, in boolean showLocals, in boolean showThisProps); */ pub DebugDumpJSStack: unsafe extern "system" fn (this: *const nsIXPConnect, showArgs: bool, showLocals: bool, showThisProps: bool) -> nsresult, /* void wrapJSAggregatedToNative (in nsISupports aOuter, in JSContextPtr aJSContext, in JSObjectPtr aJSObj, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */ /// Unable to generate binding because `native type JSContext is unsupported` pub WrapJSAggregatedToNative: *const ::libc::c_void, /* void setFunctionThisTranslator (in nsIIDRef aIID, in nsIXPCFunctionThisTranslator aTranslator); */ pub SetFunctionThisTranslator: unsafe extern "system" fn (this: *const nsIXPConnect, aIID: &nsIID, aTranslator: *const nsIXPCFunctionThisTranslator) -> nsresult, /* JSObjectPtr getWrappedNativePrototype (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsIClassInfo aClassInfo); */ /// Unable to generate binding because `native type JSContext is unsupported` pub GetWrappedNativePrototype: *const ::libc::c_void, /* jsval variantToJS (in JSContextPtr ctx, in JSObjectPtr scope, in nsIVariant value); */ /// Unable to generate binding because `native type JSContext is unsupported` pub VariantToJS: *const ::libc::c_void, /* nsIVariant JSToVariant (in JSContextPtr ctx, in jsval value); */ /// Unable to generate binding because `native type JSContext is unsupported` pub JSToVariant: *const ::libc::c_void, /* [noscript] JSObjectPtr createSandbox (in JSContextPtr cx, in nsIPrincipal principal); */ /// Unable to generate binding because `native type JSContext is unsupported` pub CreateSandbox: *const ::libc::c_void, /* [noscript] jsval evalInSandboxObject (in AString source, in string filename, in JSContextPtr cx, in JSObjectPtr sandbox); */ /// Unable to generate binding because `native type JSContext is unsupported` pub EvalInSandboxObject: *const ::libc::c_void, /* [noscript] void writeScript (in nsIObjectOutputStream aStream, in JSContextPtr aJSContext, in JSScriptPtr aJSScript); */ /// Unable to generate binding because `native type JSContext is unsupported` pub WriteScript: *const ::libc::c_void, /* [noscript] JSScriptPtr readScript (in nsIObjectInputStream aStream, in JSContextPtr aJSContext); */ /// Unable to generate binding because `native type JSContext is unsupported` pub ReadScript: *const ::libc::c_void, /* [noscript] void writeFunction (in nsIObjectOutputStream aStream, in JSContextPtr aJSContext, in JSObjectPtr aJSObject); */ /// Unable to generate binding because `native type JSContext is unsupported` pub WriteFunction: *const ::libc::c_void, /* [noscript] JSObjectPtr readFunction (in nsIObjectInputStream aStream, in JSContextPtr aJSContext); */ /// Unable to generate binding because `native type JSContext is unsupported` pub ReadFunction: *const ::libc::c_void, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPConnect { /// ```text /// /** /// * wrapNative will create a new JSObject or return an existing one. /// * /// * This method now correctly deals with cases where the passed in xpcom /// * object already has an associated JSObject for the cases: /// * 1) The xpcom object has already been wrapped for use in the same scope /// * as an nsIXPConnectWrappedNative. /// * 2) The xpcom object is in fact a nsIXPConnectWrappedJS and thus already /// * has an underlying JSObject. /// * /// * It *might* be possible to QueryInterface the nsIXPConnectJSObjectHolder /// * returned by the method into a nsIXPConnectWrappedNative or a /// * nsIXPConnectWrappedJS. /// * /// * This method will never wrap the JSObject involved in an /// * XPCNativeWrapper before returning. /// * /// * Returns: /// * success: /// * NS_OK /// * failure: /// * NS_ERROR_XPC_BAD_CONVERT_NATIVE /// * NS_ERROR_XPC_CANT_GET_JSOBJECT_OF_DOM_OBJECT /// * NS_ERROR_FAILURE /// */ /// ``` /// /// `JSObjectPtr wrapNative (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsIIDRef aIID);` const _WrapNative: () = (); /// ```text /// /** /// * Same as wrapNative, but it returns the JSObject in aVal. C++ callers /// * must ensure that aVal is rooted. /// * aIID may be null, it means the same as passing in /// * &NS_GET_IID(nsISupports) but when passing in null certain shortcuts /// * can be taken because we know without comparing IIDs that the caller is /// * asking for an nsISupports wrapper. /// * If aAllowWrapper, then the returned value will be wrapped in the proper /// * type of security wrapper on top of the XPCWrappedNative (if needed). /// * This method doesn't push aJSContext on the context stack, so the caller /// * is required to push it if the top of the context stack is not equal to /// * aJSContext. /// */ /// ``` /// /// `void wrapNativeToJSVal (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsWrapperCachePtr aCache, in nsIIDPtr aIID, in boolean aAllowWrapper, out jsval aVal);` const _WrapNativeToJSVal: () = (); /// ```text /// /** /// * wrapJS will yield a new or previously existing xpcom interface pointer /// * to represent the JSObject passed in. /// * /// * This method now correctly deals with cases where the passed in JSObject /// * already has an associated xpcom interface for the cases: /// * 1) The JSObject has already been wrapped as a nsIXPConnectWrappedJS. /// * 2) The JSObject is in fact a nsIXPConnectWrappedNative and thus already /// * has an underlying xpcom object. /// * 3) The JSObject is of a jsclass which supports getting the nsISupports /// * from the JSObject directly. This is used for idlc style objects /// * (e.g. DOM objects). /// * /// * It *might* be possible to QueryInterface the resulting interface pointer /// * to nsIXPConnectWrappedJS. /// * /// * Returns: /// * success: /// * NS_OK /// * failure: /// * NS_ERROR_XPC_BAD_CONVERT_JS /// * NS_ERROR_FAILURE /// */ /// ``` /// /// `void wrapJS (in JSContextPtr aJSContext, in JSObjectPtr aJSObj, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result);` const _WrapJS: () = (); /// ```text /// /** /// * Wraps the given jsval in a nsIVariant and returns the new variant. /// */ /// ``` /// /// `nsIVariant jSValToVariant (in JSContextPtr cx, in jsval aJSVal);` const _JSValToVariant: () = (); /// ```text /// /** /// * This only succeeds if the JSObject is a nsIXPConnectWrappedNative. /// * A new wrapper is *never* constructed. /// */ /// ``` /// /// `nsIXPConnectWrappedNative getWrappedNativeOfJSObject (in JSContextPtr aJSContext, in JSObjectPtr aJSObj);` const _GetWrappedNativeOfJSObject: () = (); /// `void debugDump (in short depth);` #[inline] pub unsafe fn DebugDump(&self, depth: libc::int16_t) -> nsresult { ((*self.vtable).DebugDump)(self, depth) } /// `void debugDumpObject (in nsISupports aCOMObj, in short depth);` #[inline] pub unsafe fn DebugDumpObject(&self, aCOMObj: *const nsISupports, depth: libc::int16_t) -> nsresult { ((*self.vtable).DebugDumpObject)(self, aCOMObj, depth) } /// `void debugDumpJSStack (in boolean showArgs, in boolean showLocals, in boolean showThisProps);` #[inline] pub unsafe fn DebugDumpJSStack(&self, showArgs: bool, showLocals: bool, showThisProps: bool) -> nsresult { ((*self.vtable).DebugDumpJSStack)(self, showArgs, showLocals, showThisProps) } /// ```text /// /** /// * wrapJSAggregatedToNative is just like wrapJS except it is used in cases /// * where the JSObject is also aggregated to some native xpcom Object. /// * At present XBL is the only system that might want to do this. /// * /// * XXX write more! /// * /// * Returns: /// * success: /// * NS_OK /// * failure: /// * NS_ERROR_XPC_BAD_CONVERT_JS /// * NS_ERROR_FAILURE /// */ /// ``` /// /// `void wrapJSAggregatedToNative (in nsISupports aOuter, in JSContextPtr aJSContext, in JSObjectPtr aJSObj, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result);` const _WrapJSAggregatedToNative: () = (); /// `void setFunctionThisTranslator (in nsIIDRef aIID, in nsIXPCFunctionThisTranslator aTranslator);` #[inline] pub unsafe fn SetFunctionThisTranslator(&self, aIID: &nsIID, aTranslator: *const nsIXPCFunctionThisTranslator) -> nsresult { ((*self.vtable).SetFunctionThisTranslator)(self, aIID, aTranslator) } /// `JSObjectPtr getWrappedNativePrototype (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsIClassInfo aClassInfo);` const _GetWrappedNativePrototype: () = (); /// `jsval variantToJS (in JSContextPtr ctx, in JSObjectPtr scope, in nsIVariant value);` const _VariantToJS: () = (); /// `nsIVariant JSToVariant (in JSContextPtr ctx, in jsval value);` const _JSToVariant: () = (); /// ```text /// /** /// * Create a sandbox for evaluating code in isolation using /// * evalInSandboxObject(). /// * /// * @param cx A context to use when creating the sandbox object. /// * @param principal The principal (or NULL to use the null principal) /// * to use when evaluating code in this sandbox. /// */ /// ``` /// /// `[noscript] JSObjectPtr createSandbox (in JSContextPtr cx, in nsIPrincipal principal);` const _CreateSandbox: () = (); /// ```text /// /** /// * Evaluate script in a sandbox, completely isolated from all /// * other running scripts. /// * /// * @param source The source of the script to evaluate. /// * @param filename The filename of the script. May be null. /// * @param cx The context to use when setting up the evaluation of /// * the script. The actual evaluation will happen on a new /// * temporary context. /// * @param sandbox The sandbox object to evaluate the script in. /// * @return The result of the evaluation as a jsval. If the caller /// * intends to use the return value from this call the caller /// * is responsible for rooting the jsval before making a call /// * to this method. /// */ /// ``` /// /// `[noscript] jsval evalInSandboxObject (in AString source, in string filename, in JSContextPtr cx, in JSObjectPtr sandbox);` const _EvalInSandboxObject: () = (); /// `[noscript] void writeScript (in nsIObjectOutputStream aStream, in JSContextPtr aJSContext, in JSScriptPtr aJSScript);` const _WriteScript: () = (); /// `[noscript] JSScriptPtr readScript (in nsIObjectInputStream aStream, in JSContextPtr aJSContext);` const _ReadScript: () = (); /// `[noscript] void writeFunction (in nsIObjectOutputStream aStream, in JSContextPtr aJSContext, in JSObjectPtr aJSObject);` const _WriteFunction: () = (); /// `[noscript] JSObjectPtr readFunction (in nsIObjectInputStream aStream, in JSContextPtr aJSContext);` const _ReadFunction: () = (); }