tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PBrowserBridge.ipdl (4440B)


      1 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
      2 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4  * License, v. 2.0. If a copy of the MPL was not distributed with this
      5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 include protocol PBrowser;
      8 #ifdef ACCESSIBILITY
      9 include protocol PDocAccessible;
     10 #endif
     11 
     12 include DOMTypes;
     13 include PPrintingTypes;
     14 
     15 include "mozilla/LayoutMessageUtils.h";
     16 include "mozilla/dom/BindingIPCUtils.h";
     17 include "mozilla/dom/DocShellMessageUtils.h";
     18 include "mozilla/dom/TabMessageUtils.h";
     19 
     20 using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
     21 using mozilla::dom::EffectsInfo from "mozilla/dom/EffectsInfo.h";
     22 using mozilla::ScrollAxis from "mozilla/PresShellForwards.h";
     23 using mozilla::ScrollFlags from "mozilla/PresShellForwards.h";
     24 using struct nsRect from "nsRect.h";
     25 using mozilla::dom::CallerType from "mozilla/dom/BindingDeclarations.h";
     26 using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageTypes.h";
     27 [RefCounted] using class nsDocShellLoadState from "nsDocShellLoadState.h";
     28 using mozilla::IntrinsicSize from "nsIFrame.h";
     29 using mozilla::AspectRatio from "mozilla/AspectRatio.h";
     30 using mozilla::StyleImageRendering from "mozilla/ServoStyleConsts.h";
     31 
     32 namespace mozilla {
     33 namespace dom {
     34 
     35 /**
     36  * A PBrowserBridge connects an iframe/browser in a content process to the
     37  * PBrowser that manages the embedded content.
     38  *
     39  * See `dom/docs/Fission-IPC-Diagram.svg` for an overview of the DOM IPC
     40  * actors.
     41  */
     42 async protocol PBrowserBridge {
     43   manager PBrowser;
     44 
     45 child:
     46   /**
     47    * Request that the IPC child / Web parent process move focus to the
     48    * browser's frame. If canRaise is true, the window can be raised if
     49    * it is inactive.
     50    */
     51   async RequestFocus(bool canRaise, CallerType aCallerType);
     52 
     53   /**
     54    * When IPC parent / Web child sends this message, the IPC child / Web parent
     55    * should move focus to the next or previous focusable element or document.
     56    */
     57   async MoveFocus(bool forward, bool forDocumentNavigation);
     58 
     59   /**
     60    * Called once this PBrowserBridge's OOP subdoc no longer blocks its
     61    * embedding element's and embedding doc's 'load' events.
     62    */
     63   async MaybeFireEmbedderLoadEvents(EmbedderElementEventType aFireEventAtEmbeddingElement);
     64 
     65   async ScrollRectIntoView(nsRect aRect, ScrollAxis aVertical,
     66                            ScrollAxis aHorizontal, ScrollFlags aScrollFlags,
     67                            int32_t aAppUnitsPerDevPixel);
     68 
     69   async SubFrameCrashed();
     70 
     71   async IntrinsicSizeOrRatioChanged(IntrinsicSize? aIntrinsicSize,
     72                                     AspectRatio? aIntrinsicRatio);
     73 
     74   async ImageLoadComplete(nsresult aResult);
     75 
     76 both:
     77 
     78   // Destroy the remote web browser due to the nsFrameLoader going away.
     79   // Before initialization we sync-delete it from the child. After
     80   // initialization we sync-delete it from the parent after BeginDestroy().
     81   async __delete__();
     82 
     83 parent:
     84 
     85   async BeginDestroy();
     86 
     87   // DocShell messaging.
     88   async LoadURL(nsDocShellLoadState aLoadState);
     89   async ResumeLoad(uint64_t aPendingSwitchID);
     90 
     91   // Out of process rendering.
     92   async Show(OwnerShowInfo info);
     93   async ScrollbarPreferenceChanged(ScrollbarPreference pref);
     94   [Compress=all] async UpdateDimensions(LayoutDeviceIntRect rect, LayoutDeviceIntSize size);
     95   async RenderLayers(bool aEnabled);
     96 
     97   async UpdateEffects(EffectsInfo aEffects);
     98   async UpdateRemotePrintSettings(PrintData aPrintData);
     99 
    100   /**
    101    * Navigate by key (Tab/Shift+Tab/F6/Shift+f6).
    102    */
    103   async NavigateByKey(bool aForward, bool aForDocumentNavigation);
    104 
    105   /**
    106    * Dispatch the given synthesized mousemove event to the child.
    107    */
    108   async DispatchSynthesizedMouseEvent(WidgetMouseEvent event);
    109 
    110   /**
    111    * Sending an activate message moves focus to the iframe.
    112    */
    113   async Activate(uint64_t aActionId);
    114 
    115   async Deactivate(bool aWindowLowering, uint64_t aActionId);
    116 
    117   async UpdateRemoteStyle(StyleImageRendering aImageRendering);
    118 
    119   async WillChangeProcess();
    120 
    121 #ifdef ACCESSIBILITY
    122   /**
    123    * Tell the parent the accessible for this iframe's embedder
    124    * OuterDocAccessible.
    125    * aDoc is the actor for the containing document.
    126    * aID is the unique id of the embedder accessible within that document.
    127    */
    128   async SetEmbedderAccessible(nullable PDocAccessible aDoc, uint64_t aID);
    129 #endif
    130 };
    131 
    132 }  // namespace dom
    133 }  // namespace mozilla