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


/// `interface nsIFrameLoader : 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 nsIFrameLoader {
    vtable: *const nsIFrameLoaderVTable,

    /// 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 nsIFrameLoader.
unsafe impl XpCom for nsIFrameLoader {
    const IID: nsIID = nsID(0x1645af04, 0x1bc7, 0x4363,
        [0x8f, 0x2c, 0xeb, 0x96, 0x79, 0x22, 0x0a, 0xb1]);
}

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

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

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

    /* readonly attribute nsIDocShell docShell; */
    pub GetDocShell: unsafe extern "system" fn (this: *const nsIFrameLoader, aDocShell: *mut *const nsIDocShell) -> nsresult,

    /* readonly attribute nsITabParent tabParent; */
    pub GetTabParent: unsafe extern "system" fn (this: *const nsIFrameLoader, aTabParent: *mut *const nsITabParent) -> nsresult,

    /* readonly attribute nsILoadContext loadContext; */
    pub GetLoadContext: unsafe extern "system" fn (this: *const nsIFrameLoader, aLoadContext: *mut *const nsILoadContext) -> nsresult,

    /* void loadFrame (); */
    pub LoadFrame: unsafe extern "system" fn (this: *const nsIFrameLoader) -> nsresult,

    /* void loadURI (in nsIURI aURI); */
    pub LoadURI: unsafe extern "system" fn (this: *const nsIFrameLoader, aURI: *const nsIURI) -> nsresult,

    /* void setIsPrerendered (); */
    pub SetIsPrerendered: unsafe extern "system" fn (this: *const nsIFrameLoader) -> nsresult,

    /* void makePrerenderedLoaderActive (); */
    pub MakePrerenderedLoaderActive: unsafe extern "system" fn (this: *const nsIFrameLoader) -> nsresult,

    /* nsISupports appendPartialSHistoryAndSwap (in nsIFrameLoader aOther); */
    pub AppendPartialSHistoryAndSwap: unsafe extern "system" fn (this: *const nsIFrameLoader, aOther: *const nsIFrameLoader, _retval: *mut *const nsISupports) -> nsresult,

    /* nsISupports requestGroupedHistoryNavigation (in unsigned long aGlobalIndex); */
    pub RequestGroupedHistoryNavigation: unsafe extern "system" fn (this: *const nsIFrameLoader, aGlobalIndex: libc::uint32_t, _retval: *mut *const nsISupports) -> nsresult,

    /* [implicit_jscontext] void addProcessChangeBlockingPromise (in jsval aPromise); */
    /// Unable to generate binding because `native type JS::Value is unsupported`
    pub AddProcessChangeBlockingPromise: *const ::libc::c_void,

    /* void destroy (); */
    pub Destroy: unsafe extern "system" fn (this: *const nsIFrameLoader) -> nsresult,

    /* readonly attribute boolean depthTooGreat; */
    pub GetDepthTooGreat: unsafe extern "system" fn (this: *const nsIFrameLoader, aDepthTooGreat: *mut bool) -> nsresult,

    /* [noscript] void updatePositionAndSize (in nsSubDocumentFrame aIFrame); */
    /// Unable to generate binding because `forward declaration nsSubDocumentFrame is unsupported`
    pub UpdatePositionAndSize: *const ::libc::c_void,

    /* void activateRemoteFrame (); */
    pub ActivateRemoteFrame: unsafe extern "system" fn (this: *const nsIFrameLoader) -> nsresult,

    /* void deactivateRemoteFrame (); */
    pub DeactivateRemoteFrame: unsafe extern "system" fn (this: *const nsIFrameLoader) -> nsresult,

    /* void sendCrossProcessMouseEvent (in AString aType, in float aX, in float aY, in long aButton, in long aClickCount, in long aModifiers, [optional] in boolean aIgnoreRootScrollFrame); */
    pub SendCrossProcessMouseEvent: unsafe extern "system" fn (this: *const nsIFrameLoader, aType: &::nsstring::nsAString, aX: libc::c_float, aY: libc::c_float, aButton: libc::int32_t, aClickCount: libc::int32_t, aModifiers: libc::int32_t, aIgnoreRootScrollFrame: bool) -> nsresult,

    /* void activateFrameEvent (in AString aType, in boolean capture); */
    pub ActivateFrameEvent: unsafe extern "system" fn (this: *const nsIFrameLoader, aType: &::nsstring::nsAString, capture: bool) -> nsresult,

    /* readonly attribute nsIMessageSender messageManager; */
    pub GetMessageManager: unsafe extern "system" fn (this: *const nsIFrameLoader, aMessageManager: *mut *const nsIMessageSender) -> nsresult,

    /* void sendCrossProcessKeyEvent (in AString aType, in long aKeyCode, in long aCharCode, in long aModifiers, [optional] in boolean aPreventDefault); */
    pub SendCrossProcessKeyEvent: unsafe extern "system" fn (this: *const nsIFrameLoader, aType: &::nsstring::nsAString, aKeyCode: libc::int32_t, aCharCode: libc::int32_t, aModifiers: libc::int32_t, aPreventDefault: bool) -> nsresult,

    /* void requestNotifyAfterRemotePaint (); */
    pub RequestNotifyAfterRemotePaint: unsafe extern "system" fn (this: *const nsIFrameLoader) -> nsresult,

    /* void requestFrameLoaderClose (); */
    pub RequestFrameLoaderClose: unsafe extern "system" fn (this: *const nsIFrameLoader) -> nsresult,

    /* void print (in unsigned long long aOuterWindowID, in nsIPrintSettings aPrintSettings, in nsIWebProgressListener aProgressListener); */
    pub Print: unsafe extern "system" fn (this: *const nsIFrameLoader, aOuterWindowID: libc::uint64_t, aPrintSettings: *const nsIPrintSettings, aProgressListener: *const nsIWebProgressListener) -> nsresult,

    /* nsIGroupedSHistory ensureGroupedSHistory (); */
    pub EnsureGroupedSHistory: unsafe extern "system" fn (this: *const nsIFrameLoader, _retval: *mut *const nsIGroupedSHistory) -> nsresult,

    /* attribute unsigned long eventMode; */
    pub GetEventMode: unsafe extern "system" fn (this: *const nsIFrameLoader, aEventMode: *mut libc::uint32_t) -> nsresult,

    /* attribute unsigned long eventMode; */
    pub SetEventMode: unsafe extern "system" fn (this: *const nsIFrameLoader, aEventMode: libc::uint32_t) -> nsresult,

    /* attribute boolean clipSubdocument; */
    pub GetClipSubdocument: unsafe extern "system" fn (this: *const nsIFrameLoader, aClipSubdocument: *mut bool) -> nsresult,

    /* attribute boolean clipSubdocument; */
    pub SetClipSubdocument: unsafe extern "system" fn (this: *const nsIFrameLoader, aClipSubdocument: bool) -> nsresult,

    /* attribute boolean clampScrollPosition; */
    pub GetClampScrollPosition: unsafe extern "system" fn (this: *const nsIFrameLoader, aClampScrollPosition: *mut bool) -> nsresult,

    /* attribute boolean clampScrollPosition; */
    pub SetClampScrollPosition: unsafe extern "system" fn (this: *const nsIFrameLoader, aClampScrollPosition: bool) -> nsresult,

    /* readonly attribute nsIDOMElement ownerElement; */
    pub GetOwnerElement: unsafe extern "system" fn (this: *const nsIFrameLoader, aOwnerElement: *mut *const nsIDOMElement) -> nsresult,

    /* readonly attribute unsigned long long childID; */
    pub GetChildID: unsafe extern "system" fn (this: *const nsIFrameLoader, aChildID: *mut libc::uint64_t) -> nsresult,

    /* readonly attribute boolean ownerIsMozBrowserFrame; */
    pub GetOwnerIsMozBrowserFrame: unsafe extern "system" fn (this: *const nsIFrameLoader, aOwnerIsMozBrowserFrame: *mut bool) -> nsresult,

    /* readonly attribute unsigned long lazyWidth; */
    pub GetLazyWidth: unsafe extern "system" fn (this: *const nsIFrameLoader, aLazyWidth: *mut libc::uint32_t) -> nsresult,

    /* readonly attribute unsigned long lazyHeight; */
    pub GetLazyHeight: unsafe extern "system" fn (this: *const nsIFrameLoader, aLazyHeight: *mut libc::uint32_t) -> nsresult,

    /* readonly attribute nsIPartialSHistory partialSHistory; */
    pub GetPartialSHistory: unsafe extern "system" fn (this: *const nsIFrameLoader, aPartialSHistory: *mut *const nsIPartialSHistory) -> nsresult,

    /* readonly attribute nsIGroupedSHistory groupedSHistory; */
    pub GetGroupedSHistory: unsafe extern "system" fn (this: *const nsIFrameLoader, aGroupedSHistory: *mut *const nsIGroupedSHistory) -> nsresult,

    /* [infallible] readonly attribute boolean isDead; */
    pub GetIsDead: unsafe extern "system" fn (this: *const nsIFrameLoader, aIsDead: *mut bool) -> 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 nsIFrameLoader {
    /// ```text
    /// /**
    ///    * The default event mode automatically forwards the events
    ///    * handled in EventStateManager::HandleCrossProcessEvent to
    ///    * the child content process when these events are targeted to
    ///    * the remote browser element.
    ///    *
    ///    * Used primarly for input events (mouse, keyboard)
    ///    */
    /// ```
    ///

    pub const EVENT_MODE_NORMAL_DISPATCH: i64 = 0;

    /// ```text
    /// /**
    ///    * With this event mode, it's the application's responsability to
    ///    * convert and forward events to the content process
    ///    */
    /// ```
    ///

    pub const EVENT_MODE_DONT_FORWARD_TO_CHILD: i64 = 1;

    /// ```text
    /// /**
    ///    * Get the docshell from the frame loader.
    ///    */
    /// ```
    ///

    /// `readonly attribute nsIDocShell docShell;`
    #[inline]
    pub unsafe fn GetDocShell(&self, aDocShell: *mut *const nsIDocShell) -> nsresult {
        ((*self.vtable).GetDocShell)(self, aDocShell)
    }


    /// ```text
    /// /**
    ///    * Get this frame loader's TabParent, if it has a remote frame.  Otherwise,
    ///    * returns null.
    ///    */
    /// ```
    ///

    /// `readonly attribute nsITabParent tabParent;`
    #[inline]
    pub unsafe fn GetTabParent(&self, aTabParent: *mut *const nsITabParent) -> nsresult {
        ((*self.vtable).GetTabParent)(self, aTabParent)
    }


    /// ```text
    /// /**
    ///    * Get an nsILoadContext for the top-level docshell. For remote
    ///    * frames, a shim is returned that contains private browsing and app
    ///    * information.
    ///    */
    /// ```
    ///

    /// `readonly attribute nsILoadContext loadContext;`
    #[inline]
    pub unsafe fn GetLoadContext(&self, aLoadContext: *mut *const nsILoadContext) -> nsresult {
        ((*self.vtable).GetLoadContext)(self, aLoadContext)
    }


    /// ```text
    /// /**
    ///    * Start loading the frame. This method figures out what to load
    ///    * from the owner content in the frame loader.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Loads the specified URI in this frame. Behaves identically to loadFrame,
    ///    * except that this method allows specifying the URI to load.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Puts the frameloader in prerendering mode.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Make the prerendered frameloader being active (and clear isPrerendered flag).
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Append partial session history from another frame loader.
    ///    *
    ///    * @return A promise which will be resolved when the navigation is complete.
    ///    */
    /// ```
    ///

    /// `nsISupports appendPartialSHistoryAndSwap (in nsIFrameLoader aOther);`
    #[inline]
    pub unsafe fn AppendPartialSHistoryAndSwap(&self, aOther: *const nsIFrameLoader, _retval: *mut *const nsISupports) -> nsresult {
        ((*self.vtable).AppendPartialSHistoryAndSwap)(self, aOther, _retval)
    }


    /// ```text
    /// /**
    ///    * If grouped session history is applied, use this function to navigate to
    ///    * an entry of session history object of another frameloader.
    ///    *
    ///    * @return A promise which will be resolved when the navigation is complete.
    ///    */
    /// ```
    ///

    /// `nsISupports requestGroupedHistoryNavigation (in unsigned long aGlobalIndex);`
    #[inline]
    pub unsafe fn RequestGroupedHistoryNavigation(&self, aGlobalIndex: libc::uint32_t, _retval: *mut *const nsISupports) -> nsresult {
        ((*self.vtable).RequestGroupedHistoryNavigation)(self, aGlobalIndex, _retval)
    }


    /// ```text
    /// /**
    ///    * Adds a blocking promise for the current cross process navigation.
    ///    * This method can only be called while the "BrowserWillChangeProcess" event
    ///    * is being fired.
    ///    */
    /// ```
    ///

    /// `[implicit_jscontext] void addProcessChangeBlockingPromise (in jsval aPromise);`
    const _AddProcessChangeBlockingPromise: () = ();

    /// ```text
    /// /**
    ///    * Destroy the frame loader and everything inside it. This will
    ///    * clear the weak owner content reference.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Find out whether the loader's frame is at too great a depth in
    ///    * the frame tree.  This can be used to decide what operations may
    ///    * or may not be allowed on the loader's docshell.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Updates the position and size of the subdocument loaded by this frameloader.
    ///    *
    ///    *  @param aIFrame The nsIFrame for the content node that owns this frameloader
    ///    */
    /// ```
    ///

    /// `[noscript] void updatePositionAndSize (in nsSubDocumentFrame aIFrame);`
    const _UpdatePositionAndSize: () = ();

    /// ```text
    /// /**
    ///    * Activate remote frame.
    ///    * Throws an exception with non-remote frames.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Deactivate remote frame.
    ///    * Throws an exception with non-remote frames.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * @see nsIDOMWindowUtils sendMouseEvent.
    ///    */
    /// ```
    ///

    /// `void sendCrossProcessMouseEvent (in AString aType, in float aX, in float aY, in long aButton, in long aClickCount, in long aModifiers, [optional] in boolean aIgnoreRootScrollFrame);`
    #[inline]
    pub unsafe fn SendCrossProcessMouseEvent(&self, aType: &::nsstring::nsAString, aX: libc::c_float, aY: libc::c_float, aButton: libc::int32_t, aClickCount: libc::int32_t, aModifiers: libc::int32_t, aIgnoreRootScrollFrame: bool) -> nsresult {
        ((*self.vtable).SendCrossProcessMouseEvent)(self, aType, aX, aY, aButton, aClickCount, aModifiers, aIgnoreRootScrollFrame)
    }


    /// ```text
    /// /**
    ///    * Activate event forwarding from client (remote frame) to parent.
    ///    */
    /// ```
    ///

    /// `void activateFrameEvent (in AString aType, in boolean capture);`
    #[inline]
    pub unsafe fn ActivateFrameEvent(&self, aType: &::nsstring::nsAString, capture: bool) -> nsresult {
        ((*self.vtable).ActivateFrameEvent)(self, aType, capture)
    }



    /// `readonly attribute nsIMessageSender messageManager;`
    #[inline]
    pub unsafe fn GetMessageManager(&self, aMessageManager: *mut *const nsIMessageSender) -> nsresult {
        ((*self.vtable).GetMessageManager)(self, aMessageManager)
    }


    /// ```text
    /// /**
    ///    * @see nsIDOMWindowUtils sendKeyEvent.
    ///    */
    /// ```
    ///

    /// `void sendCrossProcessKeyEvent (in AString aType, in long aKeyCode, in long aCharCode, in long aModifiers, [optional] in boolean aPreventDefault);`
    #[inline]
    pub unsafe fn SendCrossProcessKeyEvent(&self, aType: &::nsstring::nsAString, aKeyCode: libc::int32_t, aCharCode: libc::int32_t, aModifiers: libc::int32_t, aPreventDefault: bool) -> nsresult {
        ((*self.vtable).SendCrossProcessKeyEvent)(self, aType, aKeyCode, aCharCode, aModifiers, aPreventDefault)
    }


    /// ```text
    /// /**
    ///    * Request that the next time a remote layer transaction has been
    ///    * received by the Compositor, a MozAfterRemoteFrame event be sent
    ///    * to the window.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Close the window through the ownerElement.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Print the current document.
    ///    *
    ///    * @param aOuterWindowID the ID of the outer window to print
    ///    * @param aPrintSettings optional print settings to use; printSilent can be
    ///    *                       set to prevent prompting.
    ///    * @param aProgressListener optional print progress listener.
    ///    */
    /// ```
    ///

    /// `void print (in unsigned long long aOuterWindowID, in nsIPrintSettings aPrintSettings, in nsIWebProgressListener aProgressListener);`
    #[inline]
    pub unsafe fn Print(&self, aOuterWindowID: libc::uint64_t, aPrintSettings: *const nsIPrintSettings, aProgressListener: *const nsIWebProgressListener) -> nsresult {
        ((*self.vtable).Print)(self, aOuterWindowID, aPrintSettings, aProgressListener)
    }


    /// ```text
    /// /**
    ///    * Ensure that the current nsIFrameLoader has a GroupedSHistory.
    ///    */
    /// ```
    ///

    /// `nsIGroupedSHistory ensureGroupedSHistory ();`
    #[inline]
    pub unsafe fn EnsureGroupedSHistory(&self, _retval: *mut *const nsIGroupedSHistory) -> nsresult {
        ((*self.vtable).EnsureGroupedSHistory)(self, _retval)
    }



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



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


    /// ```text
    /// /**
    ///    * If false, then the subdocument is not clipped to its CSS viewport, and the
    ///    * subdocument's viewport scrollbar(s) are not rendered.
    ///    * Defaults to true.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * If false, then the subdocument is not clipped to its CSS viewport, and the
    ///    * subdocument's viewport scrollbar(s) are not rendered.
    ///    * Defaults to true.
    ///    */
    /// ```
    ///

    /// `attribute boolean clipSubdocument;`
    #[inline]
    pub unsafe fn SetClipSubdocument(&self, aClipSubdocument: bool) -> nsresult {
        ((*self.vtable).SetClipSubdocument)(self, aClipSubdocument)
    }


    /// ```text
    /// /**
    ///    * If false, then the subdocument's scroll coordinates will not be clamped
    ///    * to their scroll boundaries.
    ///    * Defaults to true.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * If false, then the subdocument's scroll coordinates will not be clamped
    ///    * to their scroll boundaries.
    ///    * Defaults to true.
    ///    */
    /// ```
    ///

    /// `attribute boolean clampScrollPosition;`
    #[inline]
    pub unsafe fn SetClampScrollPosition(&self, aClampScrollPosition: bool) -> nsresult {
        ((*self.vtable).SetClampScrollPosition)(self, aClampScrollPosition)
    }


    /// ```text
    /// /**
    ///    * The element which owns this frame loader.
    ///    *
    ///    * For example, if this is a frame loader for an <iframe>, this attribute
    ///    * returns the iframe element.
    ///    */
    /// ```
    ///

    /// `readonly attribute nsIDOMElement ownerElement;`
    #[inline]
    pub unsafe fn GetOwnerElement(&self, aOwnerElement: *mut *const nsIDOMElement) -> nsresult {
        ((*self.vtable).GetOwnerElement)(self, aOwnerElement)
    }


    /// ```text
    /// /**
    ///    * Cached childID of the ContentParent owning the TabParent in this frame
    ///    * loader. This can be used to obtain the childID after the TabParent died.
    ///    */
    /// ```
    ///

    /// `readonly attribute unsigned long long childID;`
    #[inline]
    pub unsafe fn GetChildID(&self, aChildID: *mut libc::uint64_t) -> nsresult {
        ((*self.vtable).GetChildID)(self, aChildID)
    }


    /// ```text
    /// /**
    ///    * Find out whether the owner content really is a mozbrowser. <xul:browser>
    ///    * is not considered to be a mozbrowser frame.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * The last known width of the frame. Reading this property will not trigger
    ///    * a reflow, and therefore may not reflect the current state of things. It
    ///    * should only be used in asynchronous APIs where values are not guaranteed
    ///    * to be up-to-date when received.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * The last known height of the frame. Reading this property will not trigger
    ///    * a reflow, and therefore may not reflect the current state of things. It
    ///    * should only be used in asynchronous APIs where values are not guaranteed
    ///    * to be up-to-date when received.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * The partial session history.
    ///    */
    /// ```
    ///

    /// `readonly attribute nsIPartialSHistory partialSHistory;`
    #[inline]
    pub unsafe fn GetPartialSHistory(&self, aPartialSHistory: *mut *const nsIPartialSHistory) -> nsresult {
        ((*self.vtable).GetPartialSHistory)(self, aPartialSHistory)
    }


    /// ```text
    /// /**
    ///    * The grouped session history composed of multiple session history objects
    ///    * across root docshells.
    ///    */
    /// ```
    ///

    /// `readonly attribute nsIGroupedSHistory groupedSHistory;`
    #[inline]
    pub unsafe fn GetGroupedSHistory(&self, aGroupedSHistory: *mut *const nsIGroupedSHistory) -> nsresult {
        ((*self.vtable).GetGroupedSHistory)(self, aGroupedSHistory)
    }


    /// ```text
    /// /**
    ///    * Is `true` if the frameloader is dead (destroy has been called on it)
    ///    */
    /// ```
    ///

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


}


/// `interface nsIFrameLoaderOwner : 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 nsIFrameLoaderOwner {
    vtable: *const nsIFrameLoaderOwnerVTable,

    /// 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 nsIFrameLoaderOwner.
unsafe impl XpCom for nsIFrameLoaderOwner {
    const IID: nsIID = nsID(0xadc1b3ba, 0x8deb, 0x4943,
        [0x80, 0x45, 0xe6, 0xde, 0x00, 0x44, 0xf2, 0xce]);
}

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

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

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

    /* [binaryname(FrameLoaderXPCOM)] readonly attribute nsIFrameLoader frameLoader; */
    pub GetFrameLoaderXPCOM: unsafe extern "system" fn (this: *const nsIFrameLoaderOwner, aFrameLoader: *mut *const nsIFrameLoader) -> nsresult,

    /* [noscript,notxpcom] alreadyAddRefed_nsFrameLoader GetFrameLoader (); */
    /// Unable to generate binding because `native type already_AddRefed<nsFrameLoader> is unsupported`
    pub GetFrameLoader: *const ::libc::c_void,

    /* void setIsPrerendered (); */
    pub SetIsPrerendered: unsafe extern "system" fn (this: *const nsIFrameLoaderOwner) -> nsresult,

    /* [noscript,notxpcom] void internalSetFrameLoader (in nsIFrameLoader aNewFrameLoader); */
    pub InternalSetFrameLoader: unsafe extern "system" fn (this: *const nsIFrameLoaderOwner, aNewFrameLoader: *const nsIFrameLoader) -> 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 nsIFrameLoaderOwner {

    /// ```text
    /// /**
    ///    * The frame loader owned by this nsIFrameLoaderOwner
    ///    */
    /// ```
    ///

    /// `[binaryname(FrameLoaderXPCOM)] readonly attribute nsIFrameLoader frameLoader;`
    #[inline]
    pub unsafe fn GetFrameLoaderXPCOM(&self, aFrameLoader: *mut *const nsIFrameLoader) -> nsresult {
        ((*self.vtable).GetFrameLoaderXPCOM)(self, aFrameLoader)
    }



    /// `[noscript,notxpcom] alreadyAddRefed_nsFrameLoader GetFrameLoader ();`
    const _GetFrameLoader: () = ();

    /// ```text
    /// /**
    ///    * Puts the FrameLoaderOwner in prerendering mode.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * This method is used internally by SwapFrameLoaders to set the frame loader
    ///    * on the target nsFrameLoader.
    ///    *
    ///    * Avoid using this method outside of that context, and instead prefer using
    ///    * SwapFrameLoaders.
    ///    */
    /// ```
    ///

    /// `[noscript,notxpcom] void internalSetFrameLoader (in nsIFrameLoader aNewFrameLoader);`
    #[inline]
    pub unsafe fn InternalSetFrameLoader(&self, aNewFrameLoader: *const nsIFrameLoader) -> libc::c_void {
        ((*self.vtable).InternalSetFrameLoader)(self, aNewFrameLoader)
    }


}