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
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
//
// DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIHttpChannel.idl
//


/// `interface nsIHttpChannel : nsIChannel`
///

/// ```text
/// /**
///  * nsIHttpChannel
///  *
///  * This interface allows for the modification of HTTP request parameters and
///  * the inspection of the resulting HTTP response status and headers when they
///  * become available.
///  */
/// ```
///

// 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 nsIHttpChannel {
    vtable: *const nsIHttpChannelVTable,

    /// 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 nsIHttpChannel.
unsafe impl XpCom for nsIHttpChannel {
    const IID: nsIID = nsID(0xc5a4a073, 0x4539, 0x49c7,
        [0xa3, 0xf2, 0xce, 0xc3, 0xf0, 0x61, 0x9c, 0x6c]);
}

// 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 nsIHttpChannel {
    #[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 nsIHttpChannel.
// 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 nsIHttpChannelCoerce {
    /// Cheaply cast a value of this type from a `nsIHttpChannel`.
    fn coerce_from(v: &nsIHttpChannel) -> &Self;
}

// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIHttpChannelCoerce for nsIHttpChannel {
    #[inline]
    fn coerce_from(v: &nsIHttpChannel) -> &Self {
        v
    }
}

impl nsIHttpChannel {
    /// Cast this `nsIHttpChannel` to one of its base interfaces.
    #[inline]
    pub fn coerce<T: nsIHttpChannelCoerce>(&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 nsIHttpChannel {
    type Target = nsIChannel;
    #[inline]
    fn deref(&self) -> &nsIChannel {
        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: nsIChannelCoerce> nsIHttpChannelCoerce for T {
    #[inline]
    fn coerce_from(v: &nsIHttpChannel) -> &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 nsIHttpChannel
// 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 nsIHttpChannelVTable {
    /// We need to include the members from the base interface's vtable at the start
    /// of the VTable definition.
    pub __base: nsIChannelVTable,

    /* [must_use] attribute ACString requestMethod; */
    pub GetRequestMethod: unsafe extern "system" fn (this: *const nsIHttpChannel, aRequestMethod: &mut ::nsstring::nsACString) -> nsresult,

    /* [must_use] attribute ACString requestMethod; */
    pub SetRequestMethod: unsafe extern "system" fn (this: *const nsIHttpChannel, aRequestMethod: &::nsstring::nsACString) -> nsresult,

    /* [must_use] attribute nsIURI referrer; */
    pub GetReferrer: unsafe extern "system" fn (this: *const nsIHttpChannel, aReferrer: *mut *const nsIURI) -> nsresult,

    /* [must_use] attribute nsIURI referrer; */
    pub SetReferrer: unsafe extern "system" fn (this: *const nsIHttpChannel, aReferrer: *const nsIURI) -> nsresult,

    /* [must_use] readonly attribute unsigned long referrerPolicy; */
    pub GetReferrerPolicy: unsafe extern "system" fn (this: *const nsIHttpChannel, aReferrerPolicy: *mut libc::uint32_t) -> nsresult,

    /* [must_use] void setReferrerWithPolicy (in nsIURI referrer, in unsigned long referrerPolicy); */
    pub SetReferrerWithPolicy: unsafe extern "system" fn (this: *const nsIHttpChannel, referrer: *const nsIURI, referrerPolicy: libc::uint32_t) -> nsresult,

    /* [must_use] readonly attribute ACString protocolVersion; */
    pub GetProtocolVersion: unsafe extern "system" fn (this: *const nsIHttpChannel, aProtocolVersion: &mut ::nsstring::nsACString) -> nsresult,

    /* [must_use] readonly attribute uint64_t transferSize; */
    pub GetTransferSize: unsafe extern "system" fn (this: *const nsIHttpChannel, aTransferSize: *mut uint64_t) -> nsresult,

    /* [must_use] readonly attribute uint64_t decodedBodySize; */
    pub GetDecodedBodySize: unsafe extern "system" fn (this: *const nsIHttpChannel, aDecodedBodySize: *mut uint64_t) -> nsresult,

    /* [must_use] readonly attribute uint64_t encodedBodySize; */
    pub GetEncodedBodySize: unsafe extern "system" fn (this: *const nsIHttpChannel, aEncodedBodySize: *mut uint64_t) -> nsresult,

    /* [must_use] ACString getRequestHeader (in ACString aHeader); */
    pub GetRequestHeader: unsafe extern "system" fn (this: *const nsIHttpChannel, aHeader: &::nsstring::nsACString, _retval: &mut ::nsstring::nsACString) -> nsresult,

    /* [must_use] void setRequestHeader (in ACString aHeader, in ACString aValue, in boolean aMerge); */
    pub SetRequestHeader: unsafe extern "system" fn (this: *const nsIHttpChannel, aHeader: &::nsstring::nsACString, aValue: &::nsstring::nsACString, aMerge: bool) -> nsresult,

    /* [must_use] void setEmptyRequestHeader (in ACString aHeader); */
    pub SetEmptyRequestHeader: unsafe extern "system" fn (this: *const nsIHttpChannel, aHeader: &::nsstring::nsACString) -> nsresult,

    /* [must_use] void visitRequestHeaders (in nsIHttpHeaderVisitor aVisitor); */
    pub VisitRequestHeaders: unsafe extern "system" fn (this: *const nsIHttpChannel, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult,

    /* [must_use] void visitNonDefaultRequestHeaders (in nsIHttpHeaderVisitor aVisitor); */
    pub VisitNonDefaultRequestHeaders: unsafe extern "system" fn (this: *const nsIHttpChannel, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult,

    /* [must_use] attribute boolean allowPipelining; */
    pub GetAllowPipelining: unsafe extern "system" fn (this: *const nsIHttpChannel, aAllowPipelining: *mut bool) -> nsresult,

    /* [must_use] attribute boolean allowPipelining; */
    pub SetAllowPipelining: unsafe extern "system" fn (this: *const nsIHttpChannel, aAllowPipelining: bool) -> nsresult,

    /* [must_use] attribute boolean allowSTS; */
    pub GetAllowSTS: unsafe extern "system" fn (this: *const nsIHttpChannel, aAllowSTS: *mut bool) -> nsresult,

    /* [must_use] attribute boolean allowSTS; */
    pub SetAllowSTS: unsafe extern "system" fn (this: *const nsIHttpChannel, aAllowSTS: bool) -> nsresult,

    /* [must_use] attribute unsigned long redirectionLimit; */
    pub GetRedirectionLimit: unsafe extern "system" fn (this: *const nsIHttpChannel, aRedirectionLimit: *mut libc::uint32_t) -> nsresult,

    /* [must_use] attribute unsigned long redirectionLimit; */
    pub SetRedirectionLimit: unsafe extern "system" fn (this: *const nsIHttpChannel, aRedirectionLimit: libc::uint32_t) -> nsresult,

    /* [must_use] readonly attribute unsigned long responseStatus; */
    pub GetResponseStatus: unsafe extern "system" fn (this: *const nsIHttpChannel, aResponseStatus: *mut libc::uint32_t) -> nsresult,

    /* [must_use] readonly attribute ACString responseStatusText; */
    pub GetResponseStatusText: unsafe extern "system" fn (this: *const nsIHttpChannel, aResponseStatusText: &mut ::nsstring::nsACString) -> nsresult,

    /* [must_use] readonly attribute boolean requestSucceeded; */
    pub GetRequestSucceeded: unsafe extern "system" fn (this: *const nsIHttpChannel, aRequestSucceeded: *mut bool) -> nsresult,

    /* [must_use] attribute boolean isMainDocumentChannel; */
    pub GetIsMainDocumentChannel: unsafe extern "system" fn (this: *const nsIHttpChannel, aIsMainDocumentChannel: *mut bool) -> nsresult,

    /* [must_use] attribute boolean isMainDocumentChannel; */
    pub SetIsMainDocumentChannel: unsafe extern "system" fn (this: *const nsIHttpChannel, aIsMainDocumentChannel: bool) -> nsresult,

    /* [must_use] ACString getResponseHeader (in ACString header); */
    pub GetResponseHeader: unsafe extern "system" fn (this: *const nsIHttpChannel, header: &::nsstring::nsACString, _retval: &mut ::nsstring::nsACString) -> nsresult,

    /* [must_use] void setResponseHeader (in ACString header, in ACString value, in boolean merge); */
    pub SetResponseHeader: unsafe extern "system" fn (this: *const nsIHttpChannel, header: &::nsstring::nsACString, value: &::nsstring::nsACString, merge: bool) -> nsresult,

    /* [must_use] void visitResponseHeaders (in nsIHttpHeaderVisitor aVisitor); */
    pub VisitResponseHeaders: unsafe extern "system" fn (this: *const nsIHttpChannel, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult,

    /* [must_use] void getOriginalResponseHeader (in ACString aHeader, in nsIHttpHeaderVisitor aVisitor); */
    pub GetOriginalResponseHeader: unsafe extern "system" fn (this: *const nsIHttpChannel, aHeader: &::nsstring::nsACString, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult,

    /* [must_use] void visitOriginalResponseHeaders (in nsIHttpHeaderVisitor aVisitor); */
    pub VisitOriginalResponseHeaders: unsafe extern "system" fn (this: *const nsIHttpChannel, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult,

    /* [must_use] boolean isNoStoreResponse (); */
    pub IsNoStoreResponse: unsafe extern "system" fn (this: *const nsIHttpChannel, _retval: *mut bool) -> nsresult,

    /* [must_use] boolean isNoCacheResponse (); */
    pub IsNoCacheResponse: unsafe extern "system" fn (this: *const nsIHttpChannel, _retval: *mut bool) -> nsresult,

    /* [must_use] boolean isPrivateResponse (); */
    pub IsPrivateResponse: unsafe extern "system" fn (this: *const nsIHttpChannel, _retval: *mut bool) -> nsresult,

    /* [must_use] void redirectTo (in nsIURI aTargetURI); */
    pub RedirectTo: unsafe extern "system" fn (this: *const nsIHttpChannel, aTargetURI: *const nsIURI) -> nsresult,

    /* [must_use] void upgradeToSecure (); */
    pub UpgradeToSecure: unsafe extern "system" fn (this: *const nsIHttpChannel) -> nsresult,

    /* [must_use,noscript] attribute uint64_t requestContextID; */
    pub GetRequestContextID: unsafe extern "system" fn (this: *const nsIHttpChannel, aRequestContextID: *mut uint64_t) -> nsresult,

    /* [must_use,noscript] attribute uint64_t requestContextID; */
    pub SetRequestContextID: unsafe extern "system" fn (this: *const nsIHttpChannel, aRequestContextID: uint64_t) -> nsresult,

    /* [must_use] attribute uint64_t channelId; */
    pub GetChannelId: unsafe extern "system" fn (this: *const nsIHttpChannel, aChannelId: *mut uint64_t) -> nsresult,

    /* [must_use] attribute uint64_t channelId; */
    pub SetChannelId: unsafe extern "system" fn (this: *const nsIHttpChannel, aChannelId: uint64_t) -> nsresult,

    /* [must_use] attribute uint64_t topLevelContentWindowId; */
    pub GetTopLevelContentWindowId: unsafe extern "system" fn (this: *const nsIHttpChannel, aTopLevelContentWindowId: *mut uint64_t) -> nsresult,

    /* [must_use] attribute uint64_t topLevelContentWindowId; */
    pub SetTopLevelContentWindowId: unsafe extern "system" fn (this: *const nsIHttpChannel, aTopLevelContentWindowId: uint64_t) -> nsresult,

    /* [infallible] readonly attribute boolean isTrackingResource; */
    pub GetIsTrackingResource: unsafe extern "system" fn (this: *const nsIHttpChannel, aIsTrackingResource: *mut bool) -> nsresult,

    /* [must_use] attribute uint64_t topLevelOuterContentWindowId; */
    pub GetTopLevelOuterContentWindowId: unsafe extern "system" fn (this: *const nsIHttpChannel, aTopLevelOuterContentWindowId: *mut uint64_t) -> nsresult,

    /* [must_use] attribute uint64_t topLevelOuterContentWindowId; */
    pub SetTopLevelOuterContentWindowId: unsafe extern "system" fn (this: *const nsIHttpChannel, aTopLevelOuterContentWindowId: uint64_t) -> nsresult,

    /* void logBlockedCORSRequest (in AString aMessage); */
    pub LogBlockedCORSRequest: unsafe extern "system" fn (this: *const nsIHttpChannel, aMessage: &::nsstring::nsAString) -> 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 nsIHttpChannel {
    /// ```text
    /// /**
    ///      * Referrer policies. See ReferrerPolicy.h for more details.
    ///      */
    /// ```
    ///

    pub const REFERRER_POLICY_UNSET: i64 = 0;


    pub const REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE: i64 = 1;


    pub const REFERRER_POLICY_NO_REFERRER: i64 = 2;


    pub const REFERRER_POLICY_ORIGIN: i64 = 3;


    pub const REFERRER_POLICY_ORIGIN_WHEN_XORIGIN: i64 = 4;


    pub const REFERRER_POLICY_UNSAFE_URL: i64 = 5;


    pub const REFERRER_POLICY_SAME_ORIGIN: i64 = 6;


    pub const REFERRER_POLICY_STRICT_ORIGIN: i64 = 7;


    pub const REFERRER_POLICY_STRICT_ORIGIN_WHEN_XORIGIN: i64 = 8;

    /// ```text
    /// /**************************************************************************
    ///      * REQUEST CONFIGURATION
    ///      *
    ///      * Modifying request parameters after asyncOpen has been called is an error.
    ///      */
    /// /**
    ///      * Set/get the HTTP request method (default is "GET").  Both setter and
    ///      * getter are case sensitive.
    ///      *
    ///      * This attribute may only be set before the channel is opened.
    ///      *
    ///      * NOTE: The data for a "POST" or "PUT" request can be configured via
    ///      * nsIUploadChannel; however, after setting the upload data, it may be
    ///      * necessary to set the request method explicitly.  The documentation
    ///      * for nsIUploadChannel has further details.
    ///      *
    ///      * @throws NS_ERROR_IN_PROGRESS if set after the channel has been opened.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute ACString requestMethod;`
    #[inline]
    pub unsafe fn GetRequestMethod(&self, aRequestMethod: &mut ::nsstring::nsACString) -> nsresult {
        ((*self.vtable).GetRequestMethod)(self, aRequestMethod)
    }


    /// ```text
    /// /**************************************************************************
    ///      * REQUEST CONFIGURATION
    ///      *
    ///      * Modifying request parameters after asyncOpen has been called is an error.
    ///      */
    /// /**
    ///      * Set/get the HTTP request method (default is "GET").  Both setter and
    ///      * getter are case sensitive.
    ///      *
    ///      * This attribute may only be set before the channel is opened.
    ///      *
    ///      * NOTE: The data for a "POST" or "PUT" request can be configured via
    ///      * nsIUploadChannel; however, after setting the upload data, it may be
    ///      * necessary to set the request method explicitly.  The documentation
    ///      * for nsIUploadChannel has further details.
    ///      *
    ///      * @throws NS_ERROR_IN_PROGRESS if set after the channel has been opened.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute ACString requestMethod;`
    #[inline]
    pub unsafe fn SetRequestMethod(&self, aRequestMethod: &::nsstring::nsACString) -> nsresult {
        ((*self.vtable).SetRequestMethod)(self, aRequestMethod)
    }


    /// ```text
    /// /**
    ///      * Get/set the HTTP referrer URI.  This is the address (URI) of the
    ///      * resource from which this channel's URI was obtained (see RFC2616 section
        ///      * 14.36).
    ///      *
    ///      * This attribute may only be set before the channel is opened.
    ///      *
    ///      * NOTE: The channel may silently refuse to set the Referer header if the
    ///      * URI does not pass certain security checks (e.g., a "https://" URL will
        ///      * never be sent as the referrer for a plaintext HTTP request).  The
    ///      * implementation is not required to throw an exception when the referrer
    ///      * URI is rejected.
    ///      *
    ///      * @throws NS_ERROR_IN_PROGRESS if set after the channel has been opened.
    ///      * @throws NS_ERROR_FAILURE if used for setting referrer during
    ///      *         visitRequestHeaders. Getting the value will not throw.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute nsIURI referrer;`
    #[inline]
    pub unsafe fn GetReferrer(&self, aReferrer: *mut *const nsIURI) -> nsresult {
        ((*self.vtable).GetReferrer)(self, aReferrer)
    }


    /// ```text
    /// /**
    ///      * Get/set the HTTP referrer URI.  This is the address (URI) of the
    ///      * resource from which this channel's URI was obtained (see RFC2616 section
        ///      * 14.36).
    ///      *
    ///      * This attribute may only be set before the channel is opened.
    ///      *
    ///      * NOTE: The channel may silently refuse to set the Referer header if the
    ///      * URI does not pass certain security checks (e.g., a "https://" URL will
        ///      * never be sent as the referrer for a plaintext HTTP request).  The
    ///      * implementation is not required to throw an exception when the referrer
    ///      * URI is rejected.
    ///      *
    ///      * @throws NS_ERROR_IN_PROGRESS if set after the channel has been opened.
    ///      * @throws NS_ERROR_FAILURE if used for setting referrer during
    ///      *         visitRequestHeaders. Getting the value will not throw.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute nsIURI referrer;`
    #[inline]
    pub unsafe fn SetReferrer(&self, aReferrer: *const nsIURI) -> nsresult {
        ((*self.vtable).SetReferrer)(self, aReferrer)
    }


    /// ```text
    /// /**
    ///      * Get the HTTP referrer policy.  The policy is retrieved from the meta
    ///      * referrer tag, which can be one of many values (see ReferrerPolicy.h for
        ///      * more details).
    ///      */
    /// ```
    ///

    /// `[must_use] readonly attribute unsigned long referrerPolicy;`
    #[inline]
    pub unsafe fn GetReferrerPolicy(&self, aReferrerPolicy: *mut libc::uint32_t) -> nsresult {
        ((*self.vtable).GetReferrerPolicy)(self, aReferrerPolicy)
    }


    /// ```text
    /// /**
    ///      * Set the HTTP referrer URI with a referrer policy.
    ///      * @throws NS_ERROR_FAILURE if called during visitRequestHeaders.
    ///      */
    /// ```
    ///

    /// `[must_use] void setReferrerWithPolicy (in nsIURI referrer, in unsigned long referrerPolicy);`
    #[inline]
    pub unsafe fn SetReferrerWithPolicy(&self, referrer: *const nsIURI, referrerPolicy: libc::uint32_t) -> nsresult {
        ((*self.vtable).SetReferrerWithPolicy)(self, referrer, referrerPolicy)
    }


    /// ```text
    /// /**
    ///      * Returns the network protocol used to fetch the resource as identified
    ///      * by the ALPN Protocol ID.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      */
    /// ```
    ///

    /// `[must_use] readonly attribute ACString protocolVersion;`
    #[inline]
    pub unsafe fn GetProtocolVersion(&self, aProtocolVersion: &mut ::nsstring::nsACString) -> nsresult {
        ((*self.vtable).GetProtocolVersion)(self, aProtocolVersion)
    }


    /// ```text
    /// /**
    ///      * size consumed by the response header fields and the response payload body
    ///      */
    /// ```
    ///

    /// `[must_use] readonly attribute uint64_t transferSize;`
    #[inline]
    pub unsafe fn GetTransferSize(&self, aTransferSize: *mut uint64_t) -> nsresult {
        ((*self.vtable).GetTransferSize)(self, aTransferSize)
    }


    /// ```text
    /// /**
    ///      * The size of the message body received by the client,
    ///      * after removing any applied content-codings
    ///      */
    /// ```
    ///

    /// `[must_use] readonly attribute uint64_t decodedBodySize;`
    #[inline]
    pub unsafe fn GetDecodedBodySize(&self, aDecodedBodySize: *mut uint64_t) -> nsresult {
        ((*self.vtable).GetDecodedBodySize)(self, aDecodedBodySize)
    }


    /// ```text
    /// /**
    ///      * The size in octets of the payload body, prior to removing content-codings
    ///      */
    /// ```
    ///

    /// `[must_use] readonly attribute uint64_t encodedBodySize;`
    #[inline]
    pub unsafe fn GetEncodedBodySize(&self, aEncodedBodySize: *mut uint64_t) -> nsresult {
        ((*self.vtable).GetEncodedBodySize)(self, aEncodedBodySize)
    }


    /// ```text
    /// /**
    ///      * Get the value of a particular request header.
    ///      *
    ///      * @param aHeader
    ///      *        The case-insensitive name of the request header to query (e.g.,
        ///      *        "Cache-Control").
    ///      *
    ///      * @return the value of the request header.
    ///      * @throws NS_ERROR_NOT_AVAILABLE if the header is not set.
    ///      */
    /// ```
    ///

    /// `[must_use] ACString getRequestHeader (in ACString aHeader);`
    #[inline]
    pub unsafe fn GetRequestHeader(&self, aHeader: &::nsstring::nsACString, _retval: &mut ::nsstring::nsACString) -> nsresult {
        ((*self.vtable).GetRequestHeader)(self, aHeader, _retval)
    }


    /// ```text
    /// /**
    ///      * Set the value of a particular request header.
    ///      *
    ///      * This method allows, for example, the cookies module to add "Cookie"
    ///      * headers to the outgoing HTTP request.
    ///      *
    ///      * This method may only be called before the channel is opened.
    ///      *
    ///      * @param aHeader
    ///      *        The case-insensitive name of the request header to set (e.g.,
        ///      *        "Cookie").
    ///      * @param aValue
    ///      *        The request header value to set (e.g., "X=1").
    ///      * @param aMerge
    ///      *        If true, the new header value will be merged with any existing
    ///      *        values for the specified header.  This flag is ignored if the
    ///      *        specified header does not support merging (e.g., the "Content-
        ///      *        Type" header can only have one value).  The list of headers for
    ///      *        which this flag is ignored is an implementation detail.  If this
    ///      *        flag is false, then the header value will be replaced with the
    ///      *        contents of |aValue|.
    ///      *
    ///      * If aValue is empty and aMerge is false, the header will be cleared.
    ///      *
    ///      * @throws NS_ERROR_IN_PROGRESS if called after the channel has been
    ///      *         opened.
    ///      * @throws NS_ERROR_FAILURE if called during visitRequestHeaders.
    ///      */
    /// ```
    ///

    /// `[must_use] void setRequestHeader (in ACString aHeader, in ACString aValue, in boolean aMerge);`
    #[inline]
    pub unsafe fn SetRequestHeader(&self, aHeader: &::nsstring::nsACString, aValue: &::nsstring::nsACString, aMerge: bool) -> nsresult {
        ((*self.vtable).SetRequestHeader)(self, aHeader, aValue, aMerge)
    }


    /// ```text
    /// /**
    ///      * Set a request header with empty value.
    ///      *
    ///      * This should be used with caution in the cases where the behavior of
    ///      * setRequestHeader ignoring empty header values is undesirable.
    ///      *
    ///      * This method may only be called before the channel is opened.
    ///      *
    ///      * @param aHeader
    ///      *        The case-insensitive name of the request header to set (e.g.,
        ///      *        "Cookie").
    ///      *
    ///      * @throws NS_ERROR_IN_PROGRESS if called after the channel has been
    ///      *         opened.
    ///      * @throws NS_ERROR_FAILURE if called during visitRequestHeaders.
    ///      */
    /// ```
    ///

    /// `[must_use] void setEmptyRequestHeader (in ACString aHeader);`
    #[inline]
    pub unsafe fn SetEmptyRequestHeader(&self, aHeader: &::nsstring::nsACString) -> nsresult {
        ((*self.vtable).SetEmptyRequestHeader)(self, aHeader)
    }


    /// ```text
    /// /**
    ///      * Call this method to visit all request headers.  Calling setRequestHeader
    ///      * while visiting request headers has undefined behavior.  Don't do it!
    ///      *
    ///      * @param aVisitor
    ///      *        the header visitor instance.
    ///      */
    /// ```
    ///

    /// `[must_use] void visitRequestHeaders (in nsIHttpHeaderVisitor aVisitor);`
    #[inline]
    pub unsafe fn VisitRequestHeaders(&self, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult {
        ((*self.vtable).VisitRequestHeaders)(self, aVisitor)
    }


    /// ```text
    /// /**
    ///      * Call this method to visit all non-default (UA-provided) request headers.
    ///      * Calling setRequestHeader while visiting request headers has undefined
    ///      * behavior. Don't do it!
    ///      *
    ///      * @param aVisitor
    ///      *        the header visitor instance.
    ///      */
    /// ```
    ///

    /// `[must_use] void visitNonDefaultRequestHeaders (in nsIHttpHeaderVisitor aVisitor);`
    #[inline]
    pub unsafe fn VisitNonDefaultRequestHeaders(&self, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult {
        ((*self.vtable).VisitNonDefaultRequestHeaders)(self, aVisitor)
    }


    /// ```text
    /// /**
    ///      * This attribute no longer has any effect, it remains for backwards compat
    ///      *
    ///      * @throws NS_ERROR_FAILURE if set after the channel has been opened.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute boolean allowPipelining;`
    #[inline]
    pub unsafe fn GetAllowPipelining(&self, aAllowPipelining: *mut bool) -> nsresult {
        ((*self.vtable).GetAllowPipelining)(self, aAllowPipelining)
    }


    /// ```text
    /// /**
    ///      * This attribute no longer has any effect, it remains for backwards compat
    ///      *
    ///      * @throws NS_ERROR_FAILURE if set after the channel has been opened.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute boolean allowPipelining;`
    #[inline]
    pub unsafe fn SetAllowPipelining(&self, aAllowPipelining: bool) -> nsresult {
        ((*self.vtable).SetAllowPipelining)(self, aAllowPipelining)
    }


    /// ```text
    /// /**
    ///      * This attribute of the channel indicates whether or not
    ///      * the underlying HTTP transaction should be honor stored Strict Transport
    ///      * Security directives for its principal. It defaults to true. Using
    ///      * OCSP to bootstrap the HTTPs is the likely use case for setting it to
    ///      * false.
    ///      *
    ///      * This attribute may only be set before the channel is opened.
    ///      *
    ///      * @throws NS_ERROR_IN_PROGRESS or NS_ERROR_ALREADY_OPENED
    ///      *         if called after the channel has been opened.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute boolean allowSTS;`
    #[inline]
    pub unsafe fn GetAllowSTS(&self, aAllowSTS: *mut bool) -> nsresult {
        ((*self.vtable).GetAllowSTS)(self, aAllowSTS)
    }


    /// ```text
    /// /**
    ///      * This attribute of the channel indicates whether or not
    ///      * the underlying HTTP transaction should be honor stored Strict Transport
    ///      * Security directives for its principal. It defaults to true. Using
    ///      * OCSP to bootstrap the HTTPs is the likely use case for setting it to
    ///      * false.
    ///      *
    ///      * This attribute may only be set before the channel is opened.
    ///      *
    ///      * @throws NS_ERROR_IN_PROGRESS or NS_ERROR_ALREADY_OPENED
    ///      *         if called after the channel has been opened.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute boolean allowSTS;`
    #[inline]
    pub unsafe fn SetAllowSTS(&self, aAllowSTS: bool) -> nsresult {
        ((*self.vtable).SetAllowSTS)(self, aAllowSTS)
    }


    /// ```text
    /// /**
    ///      * This attribute specifies the number of redirects this channel is allowed
    ///      * to make.  If zero, the channel will fail to redirect and will generate
    ///      * a NS_ERROR_REDIRECT_LOOP failure status.
    ///      *
    ///      * NOTE: An HTTP redirect results in a new channel being created.  If the
    ///      * new channel supports nsIHttpChannel, then it will be assigned a value
    ///      * to its |redirectionLimit| attribute one less than the value of the
    ///      * redirected channel's |redirectionLimit| attribute.  The initial value
    ///      * for this attribute may be a configurable preference (depending on the
        ///      * implementation).
    ///      */
    /// ```
    ///

    /// `[must_use] attribute unsigned long redirectionLimit;`
    #[inline]
    pub unsafe fn GetRedirectionLimit(&self, aRedirectionLimit: *mut libc::uint32_t) -> nsresult {
        ((*self.vtable).GetRedirectionLimit)(self, aRedirectionLimit)
    }


    /// ```text
    /// /**
    ///      * This attribute specifies the number of redirects this channel is allowed
    ///      * to make.  If zero, the channel will fail to redirect and will generate
    ///      * a NS_ERROR_REDIRECT_LOOP failure status.
    ///      *
    ///      * NOTE: An HTTP redirect results in a new channel being created.  If the
    ///      * new channel supports nsIHttpChannel, then it will be assigned a value
    ///      * to its |redirectionLimit| attribute one less than the value of the
    ///      * redirected channel's |redirectionLimit| attribute.  The initial value
    ///      * for this attribute may be a configurable preference (depending on the
        ///      * implementation).
    ///      */
    /// ```
    ///

    /// `[must_use] attribute unsigned long redirectionLimit;`
    #[inline]
    pub unsafe fn SetRedirectionLimit(&self, aRedirectionLimit: libc::uint32_t) -> nsresult {
        ((*self.vtable).SetRedirectionLimit)(self, aRedirectionLimit)
    }


    /// ```text
    /// /**************************************************************************
    ///      * RESPONSE INFO
    ///      *
    ///      * Accessing response info before the onStartRequest event is an error.
    ///      */
    /// /**
    ///      * Get the HTTP response code (e.g., 200).
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      */
    /// ```
    ///

    /// `[must_use] readonly attribute unsigned long responseStatus;`
    #[inline]
    pub unsafe fn GetResponseStatus(&self, aResponseStatus: *mut libc::uint32_t) -> nsresult {
        ((*self.vtable).GetResponseStatus)(self, aResponseStatus)
    }


    /// ```text
    /// /**
    ///      * Get the HTTP response status text (e.g., "OK").
    ///      *
    ///      * NOTE: This returns the raw (possibly 8-bit) text from the server.  There
    ///      * are no assumptions made about the charset of the returned text.  You
    ///      * have been warned!
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      */
    /// ```
    ///

    /// `[must_use] readonly attribute ACString responseStatusText;`
    #[inline]
    pub unsafe fn GetResponseStatusText(&self, aResponseStatusText: &mut ::nsstring::nsACString) -> nsresult {
        ((*self.vtable).GetResponseStatusText)(self, aResponseStatusText)
    }


    /// ```text
    /// /**
    ///      * Returns true if the HTTP response code indicates success.  The value of
    ///      * nsIRequest::status will be NS_OK even when processing a 404 response
    ///      * because a 404 response may include a message body that (in some cases)
    ///      * should be shown to the user.
    ///      *
    ///      * Use this attribute to distinguish server error pages from normal pages,
    ///      * instead of comparing the response status manually against the set of
    ///      * valid response codes, if that is required by your application.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      */
    /// ```
    ///

    /// `[must_use] readonly attribute boolean requestSucceeded;`
    #[inline]
    pub unsafe fn GetRequestSucceeded(&self, aRequestSucceeded: *mut bool) -> nsresult {
        ((*self.vtable).GetRequestSucceeded)(self, aRequestSucceeded)
    }


    /// ```text
    /// /** Indicates whether channel should be treated as the main one for the
    ///     *  current document.  If manually set to true, will always remain true.  Otherwise,
    ///     *  will be true if LOAD_DOCUMENT_URI is set in the channel's loadflags.
    ///     */
    /// ```
    ///

    /// `[must_use] attribute boolean isMainDocumentChannel;`
    #[inline]
    pub unsafe fn GetIsMainDocumentChannel(&self, aIsMainDocumentChannel: *mut bool) -> nsresult {
        ((*self.vtable).GetIsMainDocumentChannel)(self, aIsMainDocumentChannel)
    }


    /// ```text
    /// /** Indicates whether channel should be treated as the main one for the
    ///     *  current document.  If manually set to true, will always remain true.  Otherwise,
    ///     *  will be true if LOAD_DOCUMENT_URI is set in the channel's loadflags.
    ///     */
    /// ```
    ///

    /// `[must_use] attribute boolean isMainDocumentChannel;`
    #[inline]
    pub unsafe fn SetIsMainDocumentChannel(&self, aIsMainDocumentChannel: bool) -> nsresult {
        ((*self.vtable).SetIsMainDocumentChannel)(self, aIsMainDocumentChannel)
    }


    /// ```text
    /// /**
    ///      * Get the value of a particular response header.
    ///      *
    ///      * @param aHeader
    ///      *        The case-insensitive name of the response header to query (e.g.,
        ///      *        "Set-Cookie").
    ///      *
    ///      * @return the value of the response header.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest) or if the header is
    ///      *         not set in the response.
    ///      */
    /// ```
    ///

    /// `[must_use] ACString getResponseHeader (in ACString header);`
    #[inline]
    pub unsafe fn GetResponseHeader(&self, header: &::nsstring::nsACString, _retval: &mut ::nsstring::nsACString) -> nsresult {
        ((*self.vtable).GetResponseHeader)(self, header, _retval)
    }


    /// ```text
    /// /**
    ///      * Set the value of a particular response header.
    ///      *
    ///      * This method allows, for example, the HTML content sink to inform the HTTP
    ///      * channel about HTTP-EQUIV headers found in HTML <META> tags.
    ///      *
    ///      * @param aHeader
    ///      *        The case-insensitive name of the response header to set (e.g.,
        ///      *        "Cache-control").
    ///      * @param aValue
    ///      *        The response header value to set (e.g., "no-cache").
    ///      * @param aMerge
    ///      *        If true, the new header value will be merged with any existing
    ///      *        values for the specified header.  This flag is ignored if the
    ///      *        specified header does not support merging (e.g., the "Content-
        ///      *        Type" header can only have one value).  The list of headers for
    ///      *        which this flag is ignored is an implementation detail.  If this
    ///      *        flag is false, then the header value will be replaced with the
    ///      *        contents of |aValue|.
    ///      *
    ///      * If aValue is empty and aMerge is false, the header will be cleared.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      * @throws NS_ERROR_ILLEGAL_VALUE if changing the value of this response
    ///      *         header is not allowed.
    ///      * @throws NS_ERROR_FAILURE if called during visitResponseHeaders,
    ///      *         VisitOriginalResponseHeaders or getOriginalResponseHeader.
    ///      */
    /// ```
    ///

    /// `[must_use] void setResponseHeader (in ACString header, in ACString value, in boolean merge);`
    #[inline]
    pub unsafe fn SetResponseHeader(&self, header: &::nsstring::nsACString, value: &::nsstring::nsACString, merge: bool) -> nsresult {
        ((*self.vtable).SetResponseHeader)(self, header, value, merge)
    }


    /// ```text
    /// /**
    ///      * Call this method to visit all response headers.  Calling
    ///      * setResponseHeader while visiting response headers has undefined
    ///      * behavior.  Don't do it!
    ///      *
    ///      * @param aVisitor
    ///      *        the header visitor instance.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      */
    /// ```
    ///

    /// `[must_use] void visitResponseHeaders (in nsIHttpHeaderVisitor aVisitor);`
    #[inline]
    pub unsafe fn VisitResponseHeaders(&self, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult {
        ((*self.vtable).VisitResponseHeaders)(self, aVisitor)
    }


    /// ```text
    /// /**
    ///      * Get the value(s) of a particular response header in the form and order
    ///      * it has been received from the remote peer. There can be multiple headers
    ///      * with the same name.
    ///      *
    ///      * @param aHeader
    ///      *        The case-insensitive name of the response header to query (e.g.,
        ///      *        "Set-Cookie").
    ///      *
    ///      * @param aVisitor
    ///      *        the header visitor instance.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest) or if the header is
    ///      *         not set in the response.
    ///      */
    /// ```
    ///

    /// `[must_use] void getOriginalResponseHeader (in ACString aHeader, in nsIHttpHeaderVisitor aVisitor);`
    #[inline]
    pub unsafe fn GetOriginalResponseHeader(&self, aHeader: &::nsstring::nsACString, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult {
        ((*self.vtable).GetOriginalResponseHeader)(self, aHeader, aVisitor)
    }


    /// ```text
    /// /**
    ///      * Call this method to visit all response headers in the form and order as
    ///      * they have been received from the remote peer.
    ///      * Calling setResponseHeader while visiting response headers has undefined
    ///      * behavior.  Don't do it!
    ///      *
    ///      * @param aVisitor
    ///      *        the header visitor instance.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      */
    /// ```
    ///

    /// `[must_use] void visitOriginalResponseHeaders (in nsIHttpHeaderVisitor aVisitor);`
    #[inline]
    pub unsafe fn VisitOriginalResponseHeaders(&self, aVisitor: *const nsIHttpHeaderVisitor) -> nsresult {
        ((*self.vtable).VisitOriginalResponseHeaders)(self, aVisitor)
    }


    /// ```text
    /// /**
    ///      * Returns true if the server sent a "Cache-Control: no-store" response
    ///      * header.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      */
    /// ```
    ///

    /// `[must_use] boolean isNoStoreResponse ();`
    #[inline]
    pub unsafe fn IsNoStoreResponse(&self, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsNoStoreResponse)(self, _retval)
    }


    /// ```text
    /// /**
    ///      * Returns true if the server sent the equivalent of a "Cache-control:
    ///      * no-cache" response header.  Equivalent response headers include:
    ///      * "Pragma: no-cache", "Expires: 0", and "Expires" with a date value
    ///      * in the past relative to the value of the "Date" header.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      */
    /// ```
    ///

    /// `[must_use] boolean isNoCacheResponse ();`
    #[inline]
    pub unsafe fn IsNoCacheResponse(&self, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsNoCacheResponse)(self, _retval)
    }


    /// ```text
    /// /**
    ///      * Returns true if the server sent a "Cache-Control: private" response
    ///      * header.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
    ///      *         has been received (before onStartRequest).
    ///      */
    /// ```
    ///

    /// `[must_use] boolean isPrivateResponse ();`
    #[inline]
    pub unsafe fn IsPrivateResponse(&self, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsPrivateResponse)(self, _retval)
    }


    /// ```text
    /// /**
    ///      * Instructs the channel to immediately redirect to a new destination.
    ///      * Can only be called on channels that have not yet called their
    ///      * listener's OnStartRequest(). Generally that means the latest time
    ///      * this can be used is one of:
    ///      *    "http-on-examine-response"
    ///      *    "http-on-examine-merged-response"
    ///      *    "http-on-examine-cached-response"
    ///      *
    ///      * When non-null URL is set before AsyncOpen:
    ///      *  we attempt to redirect to the targetURI before we even start building
    ///      *  and sending the request to the cache or the origin server.
    ///      *  If the redirect is vetoed, we fail the channel.
    ///      *
    ///      * When set between AsyncOpen and first call to OnStartRequest being called:
    ///      *  we attempt to redirect before we start delivery of network or cached
    ///      *  response to the listener.  If vetoed, we continue with delivery of
    ///      *  the original content to the channel listener.
    ///      *
    ///      * When passed aTargetURI is null the channel behaves normally (can be
        ///      * rewritten).
    ///      *
    ///      * This method provides no explicit conflict resolution. The last
    ///      * caller to call it wins.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called after the channel has already
    ///      *         started to deliver the content to its listener.
    ///      */
    /// ```
    ///

    /// `[must_use] void redirectTo (in nsIURI aTargetURI);`
    #[inline]
    pub unsafe fn RedirectTo(&self, aTargetURI: *const nsIURI) -> nsresult {
        ((*self.vtable).RedirectTo)(self, aTargetURI)
    }


    /// ```text
    /// /**
    ///      * Flags a channel to be upgraded to HTTPS.
    ///      *
    ///      * Upgrading to a secure channel must happen before or during
    ///      * "http-on-modify-request". If redirectTo is called early as well, it
    ///      * will win and upgradeToSecure will be a no-op.
    ///      *
    ///      * @throws NS_ERROR_NOT_AVAILABLE if called after the channel has already
    ///      *         started to deliver the content to its listener.
    ///      */
    /// ```
    ///

    /// `[must_use] void upgradeToSecure ();`
    #[inline]
    pub unsafe fn UpgradeToSecure(&self, ) -> nsresult {
        ((*self.vtable).UpgradeToSecure)(self, )
    }


    /// ```text
    /// /**
    ///      * Identifies the request context for this load.
    ///      */
    /// ```
    ///

    /// `[must_use,noscript] attribute uint64_t requestContextID;`
    #[inline]
    pub unsafe fn GetRequestContextID(&self, aRequestContextID: *mut uint64_t) -> nsresult {
        ((*self.vtable).GetRequestContextID)(self, aRequestContextID)
    }


    /// ```text
    /// /**
    ///      * Identifies the request context for this load.
    ///      */
    /// ```
    ///

    /// `[must_use,noscript] attribute uint64_t requestContextID;`
    #[inline]
    pub unsafe fn SetRequestContextID(&self, aRequestContextID: uint64_t) -> nsresult {
        ((*self.vtable).SetRequestContextID)(self, aRequestContextID)
    }


    /// ```text
    /// /**
    ///      * Unique ID of the channel, shared between parent and child. Needed if
    ///      * the channel activity needs to be monitored across process boundaries,
    ///      * like in devtools net monitor. See bug 1274556.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute uint64_t channelId;`
    #[inline]
    pub unsafe fn GetChannelId(&self, aChannelId: *mut uint64_t) -> nsresult {
        ((*self.vtable).GetChannelId)(self, aChannelId)
    }


    /// ```text
    /// /**
    ///      * Unique ID of the channel, shared between parent and child. Needed if
    ///      * the channel activity needs to be monitored across process boundaries,
    ///      * like in devtools net monitor. See bug 1274556.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute uint64_t channelId;`
    #[inline]
    pub unsafe fn SetChannelId(&self, aChannelId: uint64_t) -> nsresult {
        ((*self.vtable).SetChannelId)(self, aChannelId)
    }


    /// ```text
    /// /**
    ///      * ID of the top-level document's inner window.  Identifies the content
    ///      * this channels is being load in.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute uint64_t topLevelContentWindowId;`
    #[inline]
    pub unsafe fn GetTopLevelContentWindowId(&self, aTopLevelContentWindowId: *mut uint64_t) -> nsresult {
        ((*self.vtable).GetTopLevelContentWindowId)(self, aTopLevelContentWindowId)
    }


    /// ```text
    /// /**
    ///      * ID of the top-level document's inner window.  Identifies the content
    ///      * this channels is being load in.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute uint64_t topLevelContentWindowId;`
    #[inline]
    pub unsafe fn SetTopLevelContentWindowId(&self, aTopLevelContentWindowId: uint64_t) -> nsresult {
        ((*self.vtable).SetTopLevelContentWindowId)(self, aTopLevelContentWindowId)
    }


    /// ```text
    /// /**
    ///      * Returns true if the channel has loaded a resource that is on the tracking
    ///      * protection list.  This is only available if the
    ///      * privacy.trackingprotection.annotate_channels pref is set and its value
    ///      * should only be relied on after the channel has established a connection.
    ///      */
    /// ```
    ///

    /// `[infallible] readonly attribute boolean isTrackingResource;`
    #[inline]
    pub unsafe fn GetIsTrackingResource(&self) -> bool {
        let mut result = <bool as ::std::default::Default>::default();
        let _rv = ((*self.vtable).GetIsTrackingResource)(self, &mut result);
        debug_assert!(::nserror::NsresultExt::succeeded(_rv));
        result
    }


    /// ```text
    /// /**
    ///      * ID of the top-level outer content window. Identifies this channel's
    ///      * top-level window it comes from.
    ///      *
    ///      * NOTE: The setter of this attribute is currently for xpcshell test only.
    ///      *       Don't alter it otherwise.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute uint64_t topLevelOuterContentWindowId;`
    #[inline]
    pub unsafe fn GetTopLevelOuterContentWindowId(&self, aTopLevelOuterContentWindowId: *mut uint64_t) -> nsresult {
        ((*self.vtable).GetTopLevelOuterContentWindowId)(self, aTopLevelOuterContentWindowId)
    }


    /// ```text
    /// /**
    ///      * ID of the top-level outer content window. Identifies this channel's
    ///      * top-level window it comes from.
    ///      *
    ///      * NOTE: The setter of this attribute is currently for xpcshell test only.
    ///      *       Don't alter it otherwise.
    ///      */
    /// ```
    ///

    /// `[must_use] attribute uint64_t topLevelOuterContentWindowId;`
    #[inline]
    pub unsafe fn SetTopLevelOuterContentWindowId(&self, aTopLevelOuterContentWindowId: uint64_t) -> nsresult {
        ((*self.vtable).SetTopLevelOuterContentWindowId)(self, aTopLevelOuterContentWindowId)
    }


    /// ```text
    /// /**
    ///      * In e10s, the information that the CORS response blocks the load is in the
    ///      * parent, which doesn't know the true window id of the request, so we may
    ///      * need to proxy the request to the child.
    ///      *
    ///      * @param aMessage
    ///      *        The message to print in the console.
    ///      */
    /// ```
    ///

    /// `void logBlockedCORSRequest (in AString aMessage);`
    #[inline]
    pub unsafe fn LogBlockedCORSRequest(&self, aMessage: &::nsstring::nsAString) -> nsresult {
        ((*self.vtable).LogBlockedCORSRequest)(self, aMessage)
    }


}