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
//
// DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsISiteSecurityService.idl
//


/// `interface nsISiteSecurityState : nsISupports`
///


// 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 nsISiteSecurityState {
    vtable: *const nsISiteSecurityStateVTable,

    /// 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 nsISiteSecurityState.
unsafe impl XpCom for nsISiteSecurityState {
    const IID: nsIID = nsID(0x31313372, 0x842c, 0x4110,
        [0xbd, 0xf1, 0x6a, 0xea, 0x17, 0xc8, 0x45, 0xad]);
}

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

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

impl nsISiteSecurityState {
    /// Cast this `nsISiteSecurityState` to one of its base interfaces.
    #[inline]
    pub fn coerce<T: nsISiteSecurityStateCoerce>(&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 nsISiteSecurityState {
    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> nsISiteSecurityStateCoerce for T {
    #[inline]
    fn coerce_from(v: &nsISiteSecurityState) -> &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 nsISiteSecurityState
// 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 nsISiteSecurityStateVTable {
    /// We need to include the members from the base interface's vtable at the start
    /// of the VTable definition.
    pub __base: nsISupportsVTable,

    /* [must_use] readonly attribute ACString hostname; */
    pub GetHostname: unsafe extern "system" fn (this: *const nsISiteSecurityState, aHostname: &mut ::nsstring::nsACString) -> nsresult,

    /* [infallible] readonly attribute long long expireTime; */
    pub GetExpireTime: unsafe extern "system" fn (this: *const nsISiteSecurityState, aExpireTime: *mut libc::int64_t) -> nsresult,

    /* [infallible] readonly attribute short securityPropertyState; */
    pub GetSecurityPropertyState: unsafe extern "system" fn (this: *const nsISiteSecurityState, aSecurityPropertyState: *mut libc::int16_t) -> nsresult,

    /* [infallible] readonly attribute boolean includeSubdomains; */
    pub GetIncludeSubdomains: unsafe extern "system" fn (this: *const nsISiteSecurityState, aIncludeSubdomains: *mut bool) -> nsresult,

    /* [implicit_jscontext,must_use] readonly attribute jsval originAttributes; */
    /// Unable to generate binding because `native type JS::Value is unsupported`
    pub GetOriginAttributes: *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 nsISiteSecurityState {

    pub const SECURITY_PROPERTY_UNSET: i64 = 0;


    pub const SECURITY_PROPERTY_SET: i64 = 1;


    pub const SECURITY_PROPERTY_KNOCKOUT: i64 = 2;


    pub const SECURITY_PROPERTY_NEGATIVE: i64 = 3;


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



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



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



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



    /// `[implicit_jscontext,must_use] readonly attribute jsval originAttributes;`
    const _GetOriginAttributes: () = ();

}


/// `interface nsISiteHSTSState : nsISiteSecurityState`
///


// 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 nsISiteHSTSState {
    vtable: *const nsISiteHSTSStateVTable,

    /// 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 nsISiteHSTSState.
unsafe impl XpCom for nsISiteHSTSState {
    const IID: nsIID = nsID(0x9ff16e40, 0x1029, 0x496c,
        [0x95, 0xc2, 0xbc, 0x81, 0x98, 0x72, 0xb2, 0x16]);
}

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

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

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

}


// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsISiteHSTSState {


}


/// `interface nsISiteHPKPState : nsISiteSecurityState`
///


// 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 nsISiteHPKPState {
    vtable: *const nsISiteHPKPStateVTable,

    /// 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 nsISiteHPKPState.
unsafe impl XpCom for nsISiteHPKPState {
    const IID: nsIID = nsID(0xae395078, 0xc7d0, 0x474d,
        [0xb1, 0x47, 0xf4, 0xaa, 0x20, 0x3a, 0x9b, 0x2c]);
}

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

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

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

    /* [must_use] readonly attribute nsISimpleEnumerator sha256Keys; */
    pub GetSha256Keys: unsafe extern "system" fn (this: *const nsISiteHPKPState, aSha256Keys: *mut *const nsISimpleEnumerator) -> 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 nsISiteHPKPState {


    /// `[must_use] readonly attribute nsISimpleEnumerator sha256Keys;`
    #[inline]
    pub unsafe fn GetSha256Keys(&self, aSha256Keys: *mut *const nsISimpleEnumerator) -> nsresult {
        ((*self.vtable).GetSha256Keys)(self, aSha256Keys)
    }


}


/// `interface nsISiteSecurityService : nsISupports`
///


// 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 nsISiteSecurityService {
    vtable: *const nsISiteSecurityServiceVTable,

    /// 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 nsISiteSecurityService.
unsafe impl XpCom for nsISiteSecurityService {
    const IID: nsIID = nsID(0x275127f8, 0xdbd7, 0x4681,
        [0xaf, 0xbf, 0x6d, 0xf0, 0xc6, 0x58, 0x7a, 0x01]);
}

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

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

impl nsISiteSecurityService {
    /// Cast this `nsISiteSecurityService` to one of its base interfaces.
    #[inline]
    pub fn coerce<T: nsISiteSecurityServiceCoerce>(&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 nsISiteSecurityService {
    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> nsISiteSecurityServiceCoerce for T {
    #[inline]
    fn coerce_from(v: &nsISiteSecurityService) -> &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 nsISiteSecurityService
// 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 nsISiteSecurityServiceVTable {
    /// We need to include the members from the base interface's vtable at the start
    /// of the VTable definition.
    pub __base: nsISupportsVTable,

    /* [binaryname(ProcessHeader),must_use,noscript] void processHeaderNative (in uint32_t aType, in nsIURI aSourceURI, in ACString aHeader, in nsISSLStatus aSSLStatus, in uint32_t aFlags, in uint32_t aSource, in const_OriginAttributesRef aOriginAttributes, [optional] out unsigned long long aMaxAge, [optional] out boolean aIncludeSubdomains, [optional] out uint32_t aFailureResult); */
    /// Unable to generate binding because `native type const mozilla::OriginAttributes is unsupported`
    pub ProcessHeader: *const ::libc::c_void,

    /* [binaryname(ProcessHeaderScriptable),implicit_jscontext,must_use,optional_argc] void processHeader (in uint32_t aType, in nsIURI aSourceURI, in ACString aHeader, in nsISSLStatus aSSLStatus, in uint32_t aFlags, in uint32_t aSource, [optional] in jsval aOriginAttributes, [optional] out unsigned long long aMaxAge, [optional] out boolean aIncludeSubdomains, [optional] out uint32_t aFailureResult); */
    /// Unable to generate binding because `native type JS::Value is unsupported`
    pub ProcessHeaderScriptable: *const ::libc::c_void,

    /* [implicit_jscontext,must_use,optional_argc] void removeState (in uint32_t aType, in nsIURI aURI, in uint32_t aFlags, [optional] in jsval aOriginAttributes); */
    /// Unable to generate binding because `native type JS::Value is unsupported`
    pub RemoveState: *const ::libc::c_void,

    /* [binaryname(IsSecureURI),must_use,noscript] boolean isSecureURINative (in uint32_t aType, in nsIURI aURI, in uint32_t aFlags, in const_OriginAttributesRef aOriginAttributes, [optional] out boolean aCached, [optional] out uint32_t aSource); */
    /// Unable to generate binding because `native type const mozilla::OriginAttributes is unsupported`
    pub IsSecureURI: *const ::libc::c_void,

    /* [binaryname(IsSecureURIScriptable),implicit_jscontext,must_use,optional_argc] boolean isSecureURI (in uint32_t aType, in nsIURI aURI, in uint32_t aFlags, [optional] in jsval aOriginAttributes, [optional] out boolean aCached, [optional] out uint32_t aSource); */
    /// Unable to generate binding because `native type JS::Value is unsupported`
    pub IsSecureURIScriptable: *const ::libc::c_void,

    /* [must_use] void clearAll (); */
    pub ClearAll: unsafe extern "system" fn (this: *const nsISiteSecurityService) -> nsresult,

    /* [must_use] void clearPreloads (); */
    pub ClearPreloads: unsafe extern "system" fn (this: *const nsISiteSecurityService) -> nsresult,

    /* [must_use,noscript] boolean getKeyPinsForHostname (in ACString aHostname, in mozillaPkixTime evalTime, in const_OriginAttributesRef aOriginAttributes, out nsCStringTArrayRef aPinArray, out boolean aIncludeSubdomains); */
    /// Unable to generate binding because `native type mozilla::pkix::Time is unsupported`
    pub GetKeyPinsForHostname: *const ::libc::c_void,

    /* [implicit_jscontext,must_use,optional_argc] boolean setKeyPins (in ACString aHost, in boolean aIncludeSubdomains, in int64_t aExpires, in unsigned long aPinCount, [array, size_is (aPinCount)] in string aSha256Pins, [optional] in boolean aIsPreload, [optional] in jsval aOriginAttributes); */
    /// Unable to generate binding because `native type JS::Value is unsupported`
    pub SetKeyPins: *const ::libc::c_void,

    /* [must_use] boolean setHSTSPreload (in ACString aHost, in boolean aIncludesSubdomains, in int64_t aExpires); */
    pub SetHSTSPreload: unsafe extern "system" fn (this: *const nsISiteSecurityService, aHost: &::nsstring::nsACString, aIncludesSubdomains: bool, aExpires: int64_t, _retval: *mut bool) -> nsresult,

    /* [must_use,noscript] void cacheNegativeHSTSResult (in nsIURI aURI, in unsigned long long aMaxAge, in const_OriginAttributesRef aOriginAttributes); */
    /// Unable to generate binding because `native type const mozilla::OriginAttributes is unsupported`
    pub CacheNegativeHSTSResult: *const ::libc::c_void,

    /* [must_use] nsISimpleEnumerator enumerate (in uint32_t aType); */
    pub Enumerate: unsafe extern "system" fn (this: *const nsISiteSecurityService, aType: uint32_t, _retval: *mut *const nsISimpleEnumerator) -> 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 nsISiteSecurityService {

    pub const HEADER_HSTS: i64 = 0;


    pub const HEADER_HPKP: i64 = 1;


    pub const HEADER_OMS: i64 = 2;


    pub const Success: i64 = 0;


    pub const ERROR_UNKNOWN: i64 = 1;


    pub const ERROR_UNTRUSTWORTHY_CONNECTION: i64 = 2;


    pub const ERROR_COULD_NOT_PARSE_HEADER: i64 = 3;


    pub const ERROR_NO_MAX_AGE: i64 = 4;


    pub const ERROR_MULTIPLE_MAX_AGES: i64 = 5;


    pub const ERROR_INVALID_MAX_AGE: i64 = 6;


    pub const ERROR_MULTIPLE_INCLUDE_SUBDOMAINS: i64 = 7;


    pub const ERROR_INVALID_INCLUDE_SUBDOMAINS: i64 = 8;


    pub const ERROR_INVALID_PIN: i64 = 9;


    pub const ERROR_MULTIPLE_REPORT_URIS: i64 = 10;


    pub const ERROR_PINSET_DOES_NOT_MATCH_CHAIN: i64 = 11;


    pub const ERROR_NO_BACKUP_PIN: i64 = 12;


    pub const ERROR_COULD_NOT_SAVE_STATE: i64 = 13;


    pub const ERROR_ROOT_NOT_BUILT_IN: i64 = 14;

    /// ```text
    /// /**
    ///      * nsISiteSecurityService::IsSecureURI can optionally return a flag
    ///      * indicating the source of the HSTS cache entry, if it comes from the
    ///      * preload list, was seen naturally, or is a result of HSTS priming.
    ///      */
    /// ```
    ///

    pub const SOURCE_UNKNOWN: i64 = 0;


    pub const SOURCE_PRELOAD_LIST: i64 = 1;


    pub const SOURCE_ORGANIC_REQUEST: i64 = 2;


    pub const SOURCE_HSTS_PRIMING: i64 = 3;

    /// ```text
    /// /**
    ///      * Parses a given HTTP header and records the results internally.
    ///      * Currently two header types are supported: HSTS (aka STS) and HPKP
    ///      * The format of the HSTS header is defined by the HSTS specification:
    ///      * https://tools.ietf.org/html/rfc6797
    ///      * and allows a host to specify that future HTTP requests should be
    ///      * upgraded to HTTPS.
    ///      * The format of the HPKP header is defined by the HPKP specification:
    ///      * https://tools.ietf.org/html/rfc7469
    ///      * and allows a host to specify a subset of trusted anchors to be used
    ///      * in future HTTPS connections.
    ///      *
    ///      * @param aType the type of security header in question.
    ///      * @param aSourceURI the URI of the resource with the HTTP header.
    ///      * @param aHeader the HTTP response header specifying security data.
    ///      * @param aSSLStatus the SSLStatus of the current channel.
    ///      * @param aFlags  options for this request as defined in nsISocketProvider:
    ///      *                  NO_PERMANENT_STORAGE
    ///      * @param aOriginAttributes the origin attributes that isolate this origin,
    ///      *                          (note that this implementation does not isolate
        ///      *                          by userContextId because of the risk of man-in-
        ///      *                          the-middle attacks before trust-on-second-use
        ///      *                          happens).
    ///      * @param aSource the source of the header, whether it was from the preload
    ///      *                list, an organic header, or HSTS priming, or unknown.
    ///      * @param aMaxAge the parsed max-age directive of the header.
    ///      * @param aIncludeSubdomains the parsed includeSubdomains directive.
    ///      * @param aFailureResult a more specific failure result if NS_ERROR_FAILURE
    ///                              was returned.
    ///      * @return NS_OK            if it succeeds
    ///      *         NS_ERROR_FAILURE if it can't be parsed
    ///      *         NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA
    ///      *                          if there are unrecognized tokens in the header.
    ///      */
    /// ```
    ///

    /// `[binaryname(ProcessHeader),must_use,noscript] void processHeaderNative (in uint32_t aType, in nsIURI aSourceURI, in ACString aHeader, in nsISSLStatus aSSLStatus, in uint32_t aFlags, in uint32_t aSource, in const_OriginAttributesRef aOriginAttributes, [optional] out unsigned long long aMaxAge, [optional] out boolean aIncludeSubdomains, [optional] out uint32_t aFailureResult);`
    const _ProcessHeader: () = ();


    /// `[binaryname(ProcessHeaderScriptable),implicit_jscontext,must_use,optional_argc] void processHeader (in uint32_t aType, in nsIURI aSourceURI, in ACString aHeader, in nsISSLStatus aSSLStatus, in uint32_t aFlags, in uint32_t aSource, [optional] in jsval aOriginAttributes, [optional] out unsigned long long aMaxAge, [optional] out boolean aIncludeSubdomains, [optional] out uint32_t aFailureResult);`
    const _ProcessHeaderScriptable: () = ();

    /// ```text
    /// /**
    ///      * Given a header type, removes state relating to that header of a host,
    ///      * including the includeSubdomains state that would affect subdomains.
    ///      * This essentially removes the state for the domain tree rooted at this
    ///      * host.
    ///      * @param aType   the type of security state in question
    ///      * @param aURI    the URI of the target host
    ///      * @param aFlags  options for this request as defined in nsISocketProvider:
    ///      *                  NO_PERMANENT_STORAGE
    ///      * @param aOriginAttributes the origin attributes that isolate this origin,
    ///      *                          (note that this implementation does not isolate
        ///      *                          by userContextId because of the risk of man-in-
        ///      *                          the-middle attacks before trust-on-second-use
        ///      *                          happens).
    ///      */
    /// ```
    ///

    /// `[implicit_jscontext,must_use,optional_argc] void removeState (in uint32_t aType, in nsIURI aURI, in uint32_t aFlags, [optional] in jsval aOriginAttributes);`
    const _RemoveState: () = ();

    /// ```text
    /// /**
    ///      * Checks whether or not the URI's hostname has a given security state set.
    ///      * For example, for HSTS:
    ///      * The URI is an HSTS URI if either the host has the HSTS state set, or one
    ///      * of its super-domains has the HSTS "includeSubdomains" flag set.
    ///      * NOTE: this function makes decisions based only on the
    ///      * host contained in the URI, and disregards other portions of the URI
    ///      * such as path and port.
    ///      *
    ///      * @param aType the type of security state in question.
    ///      * @param aURI the URI to query for STS state.
    ///      * @param aFlags  options for this request as defined in nsISocketProvider:
    ///      *                  NO_PERMANENT_STORAGE
    ///      * @param aOriginAttributes the origin attributes that isolate this origin,
    ///      *                          (note that this implementation does not isolate
        ///      *                          by userContextId because of the risk of man-in-
        ///      *                          the-middle attacks before trust-on-second-use
        ///      *                          happens).
    ///      * @param aCached true if we have cached information about this host, even
    ///      *                if the security state is false.
    ///      * @param aSource the source of the HSTS entry. One of SOURCE_PRELOAD_LIST,
    ///      *                SOURCE_ORGANIC_REQUEST, SOURCE_HSTS_PRIMING, or
    ///      *                SOURCE_UNKNOWN. Not implemented for HPKP.
    ///      */
    /// ```
    ///

    /// `[binaryname(IsSecureURI),must_use,noscript] boolean isSecureURINative (in uint32_t aType, in nsIURI aURI, in uint32_t aFlags, in const_OriginAttributesRef aOriginAttributes, [optional] out boolean aCached, [optional] out uint32_t aSource);`
    const _IsSecureURI: () = ();


    /// `[binaryname(IsSecureURIScriptable),implicit_jscontext,must_use,optional_argc] boolean isSecureURI (in uint32_t aType, in nsIURI aURI, in uint32_t aFlags, [optional] in jsval aOriginAttributes, [optional] out boolean aCached, [optional] out uint32_t aSource);`
    const _IsSecureURIScriptable: () = ();

    /// ```text
    /// /**
    ///      * Removes all non-preloaded security state by resetting to factory-original
    ///      * settings.
    ///      */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///      * Removes all preloaded security state.
    ///      */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///      * Returns an array of sha256-hashed key pins for the given domain, if any.
    ///      * If these pins also apply to subdomains of the given domain,
    ///      * aIncludeSubdomains will be true. Pins returned are only for non-built-in
    ///      * pin entries.
    ///      *
    ///      * @param aHostname the hostname (punycode) to be queried about
    ///      * @param evalTime the time at which the pins should be valid. This is in
    ///               mozilla::pkix::Time which uses internally seconds since 0 AD.
    ///      * @param aOriginAttributes the origin attributes that isolate this origin,
    ///      *                          (note that this implementation does not isolate
        ///      *                          by userContextId because of the risk of man-in-
        ///      *                          the-middle attacks before trust-on-second-use
        ///      *                          happens).
    ///      * @param aPinArray the set of sha256-hashed key pins for the given domain
    ///      * @param aIncludeSubdomains true if the pins apply to subdomains of the
    ///      *        given domain
    ///      */
    /// ```
    ///

    /// `[must_use,noscript] boolean getKeyPinsForHostname (in ACString aHostname, in mozillaPkixTime evalTime, in const_OriginAttributesRef aOriginAttributes, out nsCStringTArrayRef aPinArray, out boolean aIncludeSubdomains);`
    const _GetKeyPinsForHostname: () = ();

    /// ```text
    /// /**
    ///      * Set public-key pins for a host. The resulting pins will be permanent
    ///      * and visible from private and non-private contexts. These pins replace
    ///      * any already set by this mechanism or those built-in to Gecko.
    ///      *
    ///      * @param aHost the hostname (punycode) that pins will apply to
    ///      * @param aIncludeSubdomains whether these pins also apply to subdomains
    ///      * @param aExpires the time this pin should expire (millis since epoch)
    ///      * @param aPinCount number of keys being pinnned
    ///      * @param aSha256Pins array of hashed key fingerprints (SHA-256, base64)
    ///      * @param aIsPreload are these key pins for a preload entry? (false by
        ///      *        default)
    ///      * @param aOriginAttributes the origin attributes that isolate this origin,
    ///      *                          (note that this implementation does not isolate
        ///      *                          by userContextId because of the risk of man-in-
        ///      *                          the-middle attacks before trust-on-second-use
        ///      *                          happens).
    ///      */
    /// ```
    ///

    /// `[implicit_jscontext,must_use,optional_argc] boolean setKeyPins (in ACString aHost, in boolean aIncludeSubdomains, in int64_t aExpires, in unsigned long aPinCount, [array, size_is (aPinCount)] in string aSha256Pins, [optional] in boolean aIsPreload, [optional] in jsval aOriginAttributes);`
    const _SetKeyPins: () = ();

    /// ```text
    /// /**
    ///      * Set an HSTS preload entry for a host. The resulting entries will be
    ///      * permanent and visible from private and non-private contexts. These
    ///      * entries replace any already set by this mechanism or those built-in to
    ///      * Gecko.
    ///      *
    ///      * @param aHost the hostname (punycode) that the entry applies to
    ///      * @param aIncludeSubdomains whether this entry also applies to subdomains
    ///      * @param aExpires the time this entry should expire (millis since epoch)
    ///      */
    /// ```
    ///

    /// `[must_use] boolean setHSTSPreload (in ACString aHost, in boolean aIncludesSubdomains, in int64_t aExpires);`
    #[inline]
    pub unsafe fn SetHSTSPreload(&self, aHost: &::nsstring::nsACString, aIncludesSubdomains: bool, aExpires: int64_t, _retval: *mut bool) -> nsresult {
        ((*self.vtable).SetHSTSPreload)(self, aHost, aIncludesSubdomains, aExpires, _retval)
    }


    /// ```text
    /// /**
    ///      * Mark a host as declining to provide a given security state so that features
    ///      * such as HSTS priming will not flood a server with requests.
    ///      *
    ///      * @param aURI the nsIURI that this applies to
    ///      * @param aMaxAge lifetime (in seconds) of this negative cache
    ///      * @param aOriginAttributes the origin attributes that isolate this origin,
    ///      *                          (note that this implementation does not isolate
        ///      *                          by userContextId because of the risk of man-in-
        ///      *                          the-middle attacks before trust-on-second-use
        ///      *                          happens).
    ///      */
    /// ```
    ///

    /// `[must_use,noscript] void cacheNegativeHSTSResult (in nsIURI aURI, in unsigned long long aMaxAge, in const_OriginAttributesRef aOriginAttributes);`
    const _CacheNegativeHSTSResult: () = ();

    /// ```text
    /// /**
    ///      * Returns an enumerator of the nsISiteSecurityService storage. Each item in
    ///      * the enumeration is a nsISiteSecurityState that can be QueryInterfaced to
    ///      * the appropriate nsISiteHSTSState or nsISiteHPKPState, depending on the
    ///      * provided type. Doesn't include preloaded entries (either the hard-coded
        ///      * ones or the preloaded-delivered-by-kinto ones).
    ///      *
    ///      * @param aType the type of security state in question.
    ///      */
    /// ```
    ///

    /// `[must_use] nsISimpleEnumerator enumerate (in uint32_t aType);`
    #[inline]
    pub unsafe fn Enumerate(&self, aType: uint32_t, _retval: *mut *const nsISimpleEnumerator) -> nsresult {
        ((*self.vtable).Enumerate)(self, aType, _retval)
    }


}