Bug 1861467 - [wpt-sync] Update web-platform-tests to eedf737ce39c512d0ca3471f988972e...
[gecko.git] / dom / ipc / PBrowser.ipdl
blobc16a9efd2d96037b92cda49c8c9bef3a744ce1f7
1 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
2 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 include protocol PColorPicker;
9 include protocol PContent;
10 #ifdef ACCESSIBILITY
11 include protocol PDocAccessible;
12 #endif
13 include protocol PFilePicker;
14 include protocol PRemotePrintJob;
15 include protocol PPaymentRequest;
16 include protocol PSessionStore;
17 include protocol PWindowGlobal;
18 include protocol PBrowserBridge;
19 include protocol PVsync;
21 include DOMTypes;
22 include NeckoChannelParams;
23 include WindowGlobalTypes;
24 include IPCBlob;
25 include IPCStream;
26 include IPCTransferable;
27 include URIParams;
28 include PPrintingTypes;
29 include PTabContext;
30 include PBackgroundSharedTypes;
32 include "mozilla/AntiTrackingIPCUtils.h";
33 include "mozilla/dom/BindingIPCUtils.h";
34 include "mozilla/dom/CSPMessageUtils.h";
35 include "mozilla/dom/DocShellMessageUtils.h";
36 include "mozilla/dom/FilePickerMessageUtils.h";
37 include "mozilla/dom/PermissionMessageUtils.h";
38 include "mozilla/dom/ReferrerInfoUtils.h";
39 include "mozilla/dom/TabMessageUtils.h";
40 include "mozilla/GfxMessageUtils.h";
41 include "mozilla/LayoutMessageUtils.h";
42 include "mozilla/layers/LayersMessageUtils.h";
43 include "mozilla/ipc/TransportSecurityInfoUtils.h";
44 include "mozilla/ipc/URIUtils.h";
46 using struct nsID from "nsID.h";
47 using mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h";
48 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
49 using mozilla::LayoutDeviceIntPoint from "Units.h";
50 using mozilla::LayoutDevicePoint from "Units.h";
51 using mozilla::ScreenIntCoord from "Units.h";
52 using mozilla::ScreenIntMargin from "Units.h";
53 using mozilla::ScreenIntPoint from "Units.h";
54 using mozilla::ScreenRect from "Units.h";
55 using struct mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
56 using struct mozilla::layers::ZoomConstraints from "mozilla/layers/ZoomConstraints.h";
57 using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h";
58 using mozilla::layers::GeckoContentController_TapType from "mozilla/layers/GeckoContentControllerTypes.h";
59 using mozilla::layers::ScrollableLayerGuid::ViewID from "mozilla/layers/ScrollableLayerGuid.h";
60 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
61 using mozilla::WindowsHandle from "mozilla/ipc/IPCTypes.h";
62 using class mozilla::WidgetCompositionEvent from "ipc/nsGUIEventIPC.h";
63 using struct mozilla::widget::IMENotification from "mozilla/widget/IMEData.h";
64 using struct mozilla::widget::IMENotificationRequests from "mozilla/widget/IMEData.h";
65 using struct mozilla::widget::IMEState from "mozilla/widget/IMEData.h";
66 using struct mozilla::widget::InputContext from "mozilla/widget/IMEData.h";
67 using struct mozilla::widget::InputContextAction from "mozilla/widget/IMEData.h";
68 using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
69 using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
70 using class mozilla::ContentCache from "ipc/nsGUIEventIPC.h";
71 using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h";
72 using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
73 using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h";
74 using class mozilla::WidgetDragEvent from "ipc/nsGUIEventIPC.h";
75 using struct nsRect from "nsRect.h";
76 using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h";
77 using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
78 using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageTypes.h";
79 using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
80 using mozilla::layers::CompositorOptions from "mozilla/layers/CompositorOptions.h";
81 using mozilla::CSSToScreenScale from "Units.h";
82 using mozilla::CommandInt from "mozilla/EventForwards.h";
83 using nsIWidget::TouchPointerState from "nsIWidget.h";
84 using nsIWidget::TouchpadGesturePhase from "nsIWidget.h";
85 using nsCursor from "nsIWidget.h";
86 using struct LookAndFeelInt from "mozilla/widget/WidgetMessageUtils.h";
87 using struct mozilla::DimensionRequest from "mozilla/widget/WidgetMessageUtils.h";
88 using class mozilla::dom::MessagePort from "mozilla/dom/MessagePort.h";
89 using class mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/StructuredCloneData.h";
90 using mozilla::dom::MaybeDiscardedWindowContext from "mozilla/dom/WindowContext.h";
91 using mozilla::EventMessage from "mozilla/EventForwards.h";
92 using nsEventStatus from "mozilla/EventForwards.h";
93 using mozilla::Modifiers from "mozilla/EventForwards.h";
94 using struct mozilla::widget::CandidateWindowPosition from "ipc/nsGUIEventIPC.h";
95 using struct mozilla::FontRange from "ipc/nsGUIEventIPC.h";
96 using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
97 using mozilla::dom::EffectsInfo from "mozilla/dom/EffectsInfo.h";
98 using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
99 using mozilla::ScrollAxis from "mozilla/PresShellForwards.h";
100 using mozilla::ScrollFlags from "mozilla/PresShellForwards.h";
101 using struct InputFormData from "mozilla/dom/SessionStoreMessageUtils.h";
102 using struct CollectedInputDataValue from "mozilla/dom/SessionStoreMessageUtils.h";
103 using mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason from "mozilla/ContentBlockingNotifier.h";
104 using mozilla::dom::CallerType from "mozilla/dom/BindingDeclarations.h";
105 using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageTypes.h";
106 using mozilla::IntrinsicSize from "nsIFrame.h";
107 using mozilla::AspectRatio from "mozilla/AspectRatio.h";
108 using mozilla::NativeKeyBindingsType from "mozilla/NativeKeyBindingsType.h";
109 using mozilla::StyleImageRendering from "mozilla/ServoStyleConsts.h";
110 [MoveOnly] using class mozilla::ipc::BigBuffer from "mozilla/ipc/BigBuffer.h";
111 using nsIFilePicker::Mode from "nsIFilePicker.h";
113 namespace mozilla {
114 namespace dom {
116 struct WebProgressData
118   MaybeDiscardedBrowsingContext browsingContext;
119   uint32_t loadType;
122 struct RequestData
124   nullable nsIURI requestURI;
125   nullable nsIURI originalRequestURI;
126   nsCString matchedList;
129 struct WebProgressStateChangeData
131   bool isNavigating;
132   bool mayEnableCharacterEncodingMenu;
134   // The following fields are only set when the aStateFlags param passed with
135   // this struct is |nsIWebProgress.STATE_STOP|.
136   nsString contentType;
137   nsString charset;
138   nullable nsIURI documentURI;
141 struct WebProgressLocationChangeData
143   bool isNavigating;
144   bool isSyntheticDocument;
145   bool mayEnableCharacterEncodingMenu;
146   nsString contentType;
147   nsString title;
148   nsString charset;
149   nullable nsIURI documentURI;
150   nullable nsIPrincipal contentPrincipal;
151   nullable nsIPrincipal contentPartitionedPrincipal;
152   nullable nsIContentSecurityPolicy csp;
153   nullable nsIReferrerInfo referrerInfo;
154   uint64_t? requestContextID;
158  * If creating the print preview document or updating it with new print
159  * settings fails, sheetCount will be zero.
160  */
161 struct PrintPreviewResultInfo
163   uint32_t sheetCount;
164   uint32_t totalPageCount;
165   bool isEmpty;
166   // Whether there's a selection in the previewed page, including its subframes.
167   bool hasSelection;
168   // Whether there's a selection in the previewed page, excluding its subframes.
169   bool hasSelfSelection;
170   // If present, indicates if the page should be printed landscape when true or
171   // portrait when false;
172   bool? printLandscape;
173   // The at-page specified page width or null when no width is provided.
174   float? pageWidth;
175   // The at-page specified page height or null when no height is provided.
176   float? pageHeight;
180  * A PBrowser manages a maximal locally connected subtree of BrowsingContexts
181  * in a content process.
183  * See `dom/docs/Fission-IPC-Diagram.svg` for an overview of the DOM IPC
184  * actors.
185  */
186 [NestedUpTo=inside_cpow] sync protocol PBrowser
188     manager PContent;
190     manages PColorPicker;
192 #ifdef ACCESSIBILITY
193     manages PDocAccessible;
194 #endif
196     manages PFilePicker;
197     manages PPaymentRequest;
198     manages PSessionStore;
199     manages PWindowGlobal;
200     manages PBrowserBridge;
201     manages PVsync;
203 both:
204     async AsyncMessage(nsString aMessage, ClonedMessageData aData);
206 parent:
207 #ifdef ACCESSIBILITY
208     /**
209      * Tell the parent process a new accessible document has been created.
210      * aParentDoc is the accessible document it was created in if any, and
211      * aParentAcc is the id of the accessible in that document the new document
212      * is a child of.
213      */
214     async PDocAccessible(nullable PDocAccessible aParentDoc, uint64_t aParentAcc,
215                          MaybeDiscardedBrowsingContext aBrowsingContext);
216 #endif
218     async PPaymentRequest();
220     /**
221      * Create a new Vsync connection for our associated root widget
222      */
223     async PVsync();
225     /**
226      * When the child process unsuppresses painting, we send the message for the
227      * parent process to start painting the new document, if it's still painting
228      * the old one.
229      */
230     [Priority=control] async DidUnsuppressPainting();
232     async DidUnsuppressPaintingNormalPriority();
234     /**
235      * When child sends this message, parent should move focus to
236      * the next or previous focusable element or document.
237      */
238     async MoveFocus(bool forward, bool forDocumentNavigation);
240     /**
241      * Called by the child to inform the parent that links are dropped into
242      * content area.
243      *
244      * aLinks A flat array of url, name, and type for each link
245      */
246     async DropLinks(nsString[] aLinks);
248     sync SyncMessage(nsString aMessage, ClonedMessageData aData)
249       returns (StructuredCloneData[] retval);
251     /**
252      * Notifies chrome that there is a focus change involving an editable
253      * object (input, textarea, document, contentEditable. etc.)
254      *
255      *  contentCache Cache of content
256      *  notification Whole data of the notification
257      *  requests     Requests of notification for IME of the native widget
258      */
259     [Nested=inside_cpow] async NotifyIMEFocus(ContentCache contentCache,
260                                               IMENotification notification)
261       returns (IMENotificationRequests requests);
263     /**
264      * Notifies chrome that there has been a change in text content
265      * One call can encompass both a delete and an insert operation
266      * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates
267      *
268      *  contentCache Cache of content
269      *  notification Whole data of the notification
270      */
271     [Nested=inside_cpow] async NotifyIMETextChange(ContentCache contentCache,
272                                                    IMENotification notification);
274     /**
275      * Notifies chrome that there is a IME compostion rect updated
276      *
277      *  contentCache Cache of content
278      */
279     [Nested=inside_cpow] async NotifyIMECompositionUpdate(ContentCache contentCache,
280                                                           IMENotification notification);
282     /**
283      * Notifies chrome that there has been a change in selection
284      * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates
285      *
286      *  contentCache Cache of content
287      *  notification Whole data of the notification
288      */
289     [Nested=inside_cpow] async NotifyIMESelection(ContentCache contentCache,
290                                                   IMENotification notification);
292     /**
293      * Notifies chrome of updating its content cache.
294      * This is useful if content is modified but we don't need to notify IME.
295      *
296      *  contentCache Cache of content
297      */
298     [Nested=inside_cpow] async UpdateContentCache(ContentCache contentCache);
300     /**
301      * Notifies IME of mouse button event on a character in focused editor.
302      *
303      * Returns true if the mouse button event is consumed by IME.
304      */
305     [Nested=inside_cpow] sync NotifyIMEMouseButtonEvent(IMENotification notification)
306       returns (bool consumedByIME);
308     /**
309      * Notifies chrome to position change
310      *
311      *  contentCache Cache of content
312      */
313     [Nested=inside_cpow] async NotifyIMEPositionChange(ContentCache contentCache,
314                                                        IMENotification notification);
316     /**
317      * Requests chrome to commit or cancel composition of IME.
318      *
319      *  cancel                Set true if composition should be cancelled.
320      *  compositionId         Set the composition ID to requesting commit
321      *                        (stored in TextComposition).
322      *
323      *  isCommitted           Returns true if the request causes composition
324      *                        being committed synchronously.
325      *  committedString       Returns committed string.  The may be non-empty
326      *                        string even if cancel is true because IME may
327      *                        try to restore selected string which was
328      *                        replaced with the composition.
329      */
330     [Nested=inside_cpow] sync RequestIMEToCommitComposition(bool cancel,
331                                                             uint32_t aCompositionId)
332       returns (bool isCommitted, nsString committedString);
334     /**
335      * OnEventNeedingAckHandled() is called after a child process dispatches a
336      * composition event or a selection event which is sent from the parent
337      * process.
338      *
339      * message          The message value of the handled event.
340      * compositionId    The composition ID of handled composition event if
341      *                  the message is a composition event message.  Otherwise,
342      *                  0.
343      */
344     [Nested=inside_cpow] async OnEventNeedingAckHandled(EventMessage message,
345                                                         uint32_t compositionId);
347     /**
348      * Request that the parent process move focus to the browser's frame. If
349      * canRaise is true, the window can be raised if it is inactive.
350      */
351     async RequestFocus(bool canRaise, CallerType aCallerType);
353     /**
354      * Sends a mouse wheel zoom change to the parent process, to be handled by
355      * the front end as needed.
356      */
357     async WheelZoomChange(bool increase);
359     /**
360      * Indicate, based on the current state, that some commands are enabled and
361      * some are disabled.
362      */
363     async EnableDisableCommands(MaybeDiscardedBrowsingContext bc,
364                                 nsString action,
365                                 nsCString[] enabledCommands,
366                                 nsCString[] disabledCommands);
368     [Nested=inside_cpow] sync GetInputContext() returns (IMEState state);
370     [Nested=inside_cpow] async SetInputContext(InputContext context,
371                                                InputContextAction action);
373     /**
374      * Set the native cursor.
375      * @param value
376      *   The widget cursor to set.
377      * @param hasCustomCursor
378      *   Whether there's any custom cursor represented by cursorData and
379      *   company.
380      * @param customCursorData
381      *   Serialized image data.
382      * @param width
383      *   Width of the image.
384      * @param height
385      *   Height of the image.
386      * @param resolutionX
387      *   Resolution of the image X axis in dppx units.
388      * @param resolutionY
389      *   Resolution of the image Y axis in dppx units.
390      * @param stride
391      *   Stride used in the image data.
392      * @param format
393      *   Image format, see gfx::SurfaceFormat for possible values.
394      * @param hotspotX
395      *   Horizontal hotspot of the image, as specified by the css cursor property.
396      * @param hotspotY
397      *   Vertical hotspot of the image, as specified by the css cursor property.
398      * @param force
399      *   Invalidate any locally cached cursor settings and force an
400      *   update.
401      */
402     async SetCursor(nsCursor value,
403                     bool hasCustomCursor,
404                     BigBuffer? customCursorData,
405                     uint32_t width, uint32_t height,
406                     float resolutionX, float resolutionY,
407                     uint32_t stride, SurfaceFormat format,
408                     uint32_t hotspotX, uint32_t hotspotY, bool force);
410     /**
411      * Used to set the current text of the status tooltip.
412      * Nowadays this is only used for link locations on hover.
413      */
414     async SetLinkStatus(nsString status);
416     /**
417      * Show/hide a tooltip when the mouse hovers over an element in the content
418      * document.
419      */
420     async ShowTooltip(uint32_t x, uint32_t y, nsString tooltip, nsString direction);
421     async HideTooltip();
423     /**
424      * Create an asynchronous color picker on the parent side,
425      * but don't open it yet.
426      */
427     async PColorPicker(nsString title, nsString initialColor, nsString[] defaultColors);
429     async PFilePicker(nsString aTitle, Mode aMode);
431     /**
432      * Tells the containing widget whether the given input block results in a
433      * swipe. Should be called in response to a WidgetWheelEvent that has
434      * mFlags.mCanTriggerSwipe set on it.
435      */
436     async RespondStartSwipeEvent(uint64_t aInputBlockId, bool aStartSwipe);
438     /**
439      * Look up dictionary by selected word for OSX
440      *
441      * @param aText       The word to look up
442      * @param aFontRange  Text decoration of aText
443      * @param aIsVertical true if vertical layout
444      */
445     async LookUpDictionary(nsString aText, FontRange[] aFontRangeArray,
446                            bool aIsVertical, LayoutDeviceIntPoint aPoint);
448     async __delete__();
450     /**
451      * Send a reply of keyboard event to the parent.  Then, parent can consider
452      * whether the event should kick a shortcut key or ignore.
453      *
454      * @param aEvent    The event which was sent from the parent and handled
455      *                  in a remote process.
456      * @param aUUI      The UUID which was generated when aEvent was sent to
457      *                  a remote process.
458      */
459     async ReplyKeyEvent(WidgetKeyboardEvent aEvent, nsID aUUID);
461     /**
462      * Retrieves edit commands for the key combination represented by aEvent.
463      *
464      * @param aType       One of NativeKeyBindingsType.
465      * @param aEvent      KeyboardEvent which represents a key combination.
466      *                    Note that this must be a trusted event.
467      * @return            Array of edit commands which should be executed in
468      *                    editor of native applications.
469      */
470     sync RequestNativeKeyBindings(uint32_t aType, WidgetKeyboardEvent aEvent)
471         returns (CommandInt[] commands);
473     async SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout,
474                                    int32_t aNativeKeyCode,
475                                    uint32_t aModifierFlags,
476                                    nsString aCharacters,
477                                    nsString aUnmodifiedCharacters,
478                                    uint64_t aObserverId);
479     async SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
480                                      uint32_t aNativeMessage,
481                                      int16_t aButton,
482                                      uint32_t aModifierFlags,
483                                      uint64_t aObserverId);
484     async SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
485                                     uint64_t aObserverId);
486     async SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint,
487                                            uint32_t aNativeMessage,
488                                            double aDeltaX,
489                                            double aDeltaY,
490                                            double aDeltaZ,
491                                            uint32_t aModifierFlags,
492                                            uint32_t aAdditionalFlags,
493                                            uint64_t aObserverId);
494     async SynthesizeNativeTouchPoint(uint32_t aPointerId,
495                                      TouchPointerState aPointerState,
496                                      LayoutDeviceIntPoint aPoint,
497                                      double aPointerPressure,
498                                      uint32_t aPointerOrientation,
499                                      uint64_t aObserverId);
500     async SynthesizeNativeTouchPadPinch(TouchpadGesturePhase aEventPhase,
501                                         float aScale,
502                                         LayoutDeviceIntPoint aPoint,
503                                         int32_t aModifierFlags);
504     async SynthesizeNativeTouchTap(LayoutDeviceIntPoint aPoint,
505                                    bool aLongTap,
506                                    uint64_t aObserverId);
507     async ClearNativeTouchSequence(uint64_t aObserverId);
508     async SynthesizeNativePenInput(uint32_t aPointerId,
509                                    TouchPointerState aPointerState,
510                                    LayoutDeviceIntPoint aPoint,
511                                    double aPressure,
512                                    uint32_t aRotation,
513                                    int32_t aTiltX,
514                                    int32_t aTiltY,
515                                    int32_t aButton,
516                                    uint64_t aObserverId);
517     async SynthesizeNativeTouchpadDoubleTap(LayoutDeviceIntPoint aPoint,
518                                             uint32_t aModifierFlags);
519     async SynthesizeNativeTouchpadPan(TouchpadGesturePhase aEventPhase,
520                                       LayoutDeviceIntPoint aPoint,
521                                       double aDeltaX, double aDeltaY,
522                                       int32_t aModifierFlags,
523                                       uint64_t aObserverId);
525     async LockNativePointer();
526     async UnlockNativePointer();
528     async AccessKeyNotHandled(WidgetKeyboardEvent event);
530     async RegisterProtocolHandler(nsString scheme, nullable nsIURI handlerURI, nsString title,
531                                   nullable nsIURI documentURI);
533     async OnStateChange(WebProgressData aWebProgressData,
534                         RequestData aRequestData, uint32_t aStateFlags,
535                         nsresult aStatus,
536                         WebProgressStateChangeData? aStateChangeData);
538     async OnLocationChange(WebProgressData aWebProgressData,
539                            RequestData aRequestData, nullable nsIURI aLocation,
540                            uint32_t aFlags, bool aCanGoBack,
541                            bool aCanGoForward,
542                            WebProgressLocationChangeData? aLocationChangeData);
544     // We only track information about total progress in the parent process.
545     // This value is throttled using nsBrowserStatusFilter, and records the full
546     // total progress for nsDocShells managed by this actor.
547     async OnProgressChange(int32_t aCurTotalProgress, int32_t aMaxTotalProgress);
549     // Calls to OnStatusChange are throttled by nsBrowserStatusFilter, meaning
550     // they are only called with a status of `NS_OK`, and with no webProgress or
551     // request.
552     async OnStatusChange(nsString aMessage);
554     async NotifyContentBlockingEvent(uint32_t aEvent, RequestData aRequestData,
555                                      bool aBlocked, nsCString aTrackingOrigin,
556                                      nsCString[] aTrackingFullHashes,
557                                      StorageAccessPermissionGrantedReason? aReason);
559     async NavigationFinished();
561     async IntrinsicSizeOrRatioChanged(IntrinsicSize? aIntrinsicSize,
562                                       AspectRatio? aIntrinsicRatio);
564     async ImageLoadComplete(nsresult aResult);
566     /**
567      * Child informs the parent that a pointer lock has requested/released.
568      */
569     async RequestPointerLock() returns (nsCString error);
570     async ReleasePointerLock();
572     /**
573      * Child informs the parent that a pointer capture has requested/released.
574      */
575     async RequestPointerCapture(uint32_t aPointerId) returns (bool aSuccess);
576     async ReleasePointerCapture(uint32_t aPointerId);
578 child:
579     async NativeSynthesisResponse(uint64_t aObserverId, nsCString aResponse);
580     async UpdateSHistory();
581     async CloneDocumentTreeIntoSelf(MaybeDiscardedBrowsingContext aBc, PrintData aPrintData) returns(bool aSuccess);
582     async UpdateRemotePrintSettings(PrintData aPrintData);
584     /**
585      * Parent informs the child to release all pointer capture.
586      */
587     [Priority=input] async ReleaseAllPointerCapture();
589 parent:
591     /**
592      * Child informs the parent that the content is ready to handle input
593      * events. This is sent when the BrowserChild is created.
594      */
595     async RemoteIsReadyToHandleInputEvents();
597 child:
598     /**
599      * Parent informs the child of graphical effects that are being applied
600      * to the child browser.
601      */
602     async UpdateEffects(EffectsInfo aEffects);
604 parent:
606     /**
607      * Sent by the child to the parent to inform it that an update to the
608      * dimensions has been requested.
609      *
610      * @param aRequest  The requested change of inner or outer dimensions.
611      * @param aScale    The scale at the time of the request. This is to allow
612      *                  the parent to recompute the dimensions in case of an
613      *                  ongoing scale change.
614      */
615     async SetDimensions(DimensionRequest aRequest, double aScale);
617     [Nested=inside_sync] sync DispatchWheelEvent(WidgetWheelEvent event);
618     [Nested=inside_sync] sync DispatchMouseEvent(WidgetMouseEvent event);
619     [Nested=inside_sync] sync DispatchKeyboardEvent(WidgetKeyboardEvent event);
620     [Nested=inside_sync] sync DispatchTouchEvent(WidgetTouchEvent event);
622     async InvokeDragSession(IPCTransferableData[] transfers, uint32_t action,
623                             BigBuffer? visualData,
624                             uint32_t stride, SurfaceFormat format,
625                             LayoutDeviceIntRect dragRect,
626                             nullable nsIPrincipal principal,
627                             nullable nsIContentSecurityPolicy csp,
628                             CookieJarSettingsArgs cookieJarSettings,
629                             MaybeDiscardedWindowContext sourceWindowContext,
630                             MaybeDiscardedWindowContext sourceTopWindowContext);
632     // After a compositor reset, it is necessary to reconnect each layers ID to
633     // the compositor of the widget that will render those layers. Note that
634     // this is sync so we can ensure that messages to the window compositor
635     // arrive before the BrowserChild attempts to use its cross-process compositor
636     // bridge.
637     sync EnsureLayersConnected() returns (CompositorOptions compositorOptions);
639     /**
640      * This function is used to notify the parent that it should display a
641      * canvas permission prompt.
642      *
643      * @param aOrigin origin string of the document that is requesting access.
644      */
645     async ShowCanvasPermissionPrompt(nsCString aOrigin,
646                                      bool aHideDoorHanger);
648     sync SetSystemFont(nsCString aFontName);
649     sync GetSystemFont() returns (nsCString retval);
651     /**
652      * Called once this PBrowser's OOP subdoc no longer blocks its
653      * embedding element's and embedding doc's 'load' events.
654      */
655     async MaybeFireEmbedderLoadEvents(EmbedderElementEventType aFireEventAtEmbeddingElement);
657     async ScrollRectIntoView(nsRect aRect, ScrollAxis aVertical,
658                              ScrollAxis aHorizontal, ScrollFlags aScrollFlags,
659                              int32_t aAppUnitsPerDevPixel);
661     async ShowDynamicToolbar();
663 child:
664     /**
665      * Notify the remote browser that it has been Show()n on this side. This
666      * message is expected to trigger creation of the remote browser's "widget".
667      */
668     async Show(ParentShowInfo parentInfo, OwnerShowInfo childInfo);
670     /**
671      * Sending an activate message moves focus to the child.
672      */
673     async Activate(uint64_t aActionId);
675     async Deactivate(uint64_t aActionId);
677     async ScrollbarPreferenceChanged(ScrollbarPreference pref);
679     async InitRendering(TextureFactoryIdentifier textureFactoryIdentifier,
680                         LayersId layersId,
681                         CompositorOptions compositorOptions,
682                         bool layersConnected);
684     async CompositorOptionsChanged(CompositorOptions newOptions);
686     async LoadURL(nsDocShellLoadState loadState, ParentShowInfo info);
688     async CreateAboutBlankContentViewer(nullable nsIPrincipal principal,
689                                         nullable nsIPrincipal partitionedPrincipal);
691     async ResumeLoad(uint64_t pendingSwitchID, ParentShowInfo info);
693     [Compress=all] async UpdateDimensions(DimensionInfo dimensions);
695     async SizeModeChanged(nsSizeMode sizeMode);
697     async ChildToParentMatrix(Matrix4x4? aMatrix,
698                               ScreenRect aRemoteDocumentRect);
700     async UpdateRemoteStyle(StyleImageRendering aImageRendering);
702     async DynamicToolbarMaxHeightChanged(ScreenIntCoord height);
704     async DynamicToolbarOffsetChanged(ScreenIntCoord height);
706     /**
707      * StopIMEStateManagement() is called when the process loses focus and
708      * should stop managing IME state.
709      */
710     async StopIMEStateManagement();
712     /**
713      * When two consecutive mouse move events would be added to the message queue,
714      * they are 'compressed' by dumping the oldest one.
715      */
716     [Compress, Priority=input]
717     async RealMouseMoveEvent(WidgetMouseEvent event,
718                              ScrollableLayerGuid aGuid,
719                              uint64_t aInputBlockId);
720     [Compress]
721     async NormalPriorityRealMouseMoveEvent(WidgetMouseEvent event,
722                                            ScrollableLayerGuid aGuid,
723                                            uint64_t aInputBlockId);
725     /**
726      * But don't compress mousemove events for tests since every event is
727      * important for the test since synthesizing various input events may
728      * be faster than what the user operates same things.  If you need to
729      * test the `Compress`, send mouse move events with setting `isSyntehsized`
730      * of `aEvent` of `EventUtils#syntehsizeMouse*()`.
731      */
732     [Priority=input]
733     async RealMouseMoveEventForTests(WidgetMouseEvent event,
734                                      ScrollableLayerGuid aGuid,
735                                      uint64_t aInputBlockId);
736     async NormalPriorityRealMouseMoveEventForTests(WidgetMouseEvent event,
737                                                    ScrollableLayerGuid aGuid,
738                                                    uint64_t aInputBlockId);
740     /**
741      * Mouse move events with |reason == eSynthesized| are sent via a separate
742      * message because they do not generate DOM 'mousemove' events, and the
743      * 'Compress' attribute on RealMouseMoveEvent() could result in a
744      * |reason == eReal| event being dropped in favour of an |eSynthesized|
745      * event, and thus a DOM 'mousemove' event to be lost.
746      */
747     [Priority=input]
748     async SynthMouseMoveEvent(WidgetMouseEvent event,
749                               ScrollableLayerGuid aGuid,
750                               uint64_t aInputBlockId);
751     async NormalPrioritySynthMouseMoveEvent(WidgetMouseEvent event,
752                                             ScrollableLayerGuid aGuid,
753                                             uint64_t aInputBlockId);
755     [Priority=input]
756     async RealMouseButtonEvent(WidgetMouseEvent event,
757                                ScrollableLayerGuid aGuid,
758                                uint64_t aInputBlockId);
759     async NormalPriorityRealMouseButtonEvent(WidgetMouseEvent event,
760                                              ScrollableLayerGuid aGuid,
761                                              uint64_t aInputBlockId);
763     [Priority=input]
764     async RealMouseEnterExitWidgetEvent(WidgetMouseEvent event,
765                                                     ScrollableLayerGuid aGuid,
766                                                     uint64_t aInputBlockId);
767     async NormalPriorityRealMouseEnterExitWidgetEvent(WidgetMouseEvent event,
768                                                       ScrollableLayerGuid aGuid,
769                                                       uint64_t aInputBlockId);
771     /**
772      * Send a keyboard event which reporesents a user input to a remote process.
773      *
774      * @param aEvent    The event which user typed a key.
775      * @param aUUID     A UUID which is generated in the parent at sending it.
776      *                  This must be specified when the child sends a reply
777      *                  event to the parent.
778      */
779     [Priority=input]
780     async RealKeyEvent(WidgetKeyboardEvent aEvent, nsID aUUID);
781     async NormalPriorityRealKeyEvent(WidgetKeyboardEvent aEvent, nsID aUUID);
783     [Priority=input]
784     async MouseWheelEvent(WidgetWheelEvent event,
785                           ScrollableLayerGuid aGuid,
786                           uint64_t aInputBlockId);
787     async NormalPriorityMouseWheelEvent(WidgetWheelEvent event,
788                                         ScrollableLayerGuid aGuid,
789                                         uint64_t aInputBlockId);
791     [Priority=input]
792     async RealTouchEvent(WidgetTouchEvent aEvent,
793                          ScrollableLayerGuid aGuid,
794                          uint64_t aInputBlockId,
795                          nsEventStatus aApzResponse);
796     async NormalPriorityRealTouchEvent(WidgetTouchEvent aEvent,
797                                        ScrollableLayerGuid aGuid,
798                                        uint64_t aInputBlockId,
799                                        nsEventStatus aApzResponse);
801     [Priority=input]
802     async HandleTap(GeckoContentController_TapType aType, LayoutDevicePoint point,
803                     Modifiers aModifiers, ScrollableLayerGuid aGuid,
804                     uint64_t aInputBlockId);
805     async NormalPriorityHandleTap(GeckoContentController_TapType aType, LayoutDevicePoint point,
806                                   Modifiers aModifiers, ScrollableLayerGuid aGuid,
807                                   uint64_t aInputBlockId);
809     [Compress, Priority=input]
810     async RealTouchMoveEvent(WidgetTouchEvent aEvent,
811                              ScrollableLayerGuid aGuid,
812                              uint64_t aInputBlockId,
813                              nsEventStatus aApzResponse);
814     [Compress]
815     async NormalPriorityRealTouchMoveEvent(WidgetTouchEvent aEvent,
816                                            ScrollableLayerGuid aGuid,
817                                            uint64_t aInputBlockId,
818                                            nsEventStatus aApzResponse);
819     [Compress, Priority=input]
820     async RealTouchMoveEvent2(WidgetTouchEvent aEvent,
821                               ScrollableLayerGuid aGuid,
822                               uint64_t aInputBlockId,
823                               nsEventStatus aApzResponse);
824     [Compress]
825     async NormalPriorityRealTouchMoveEvent2(WidgetTouchEvent aEvent,
826                                             ScrollableLayerGuid aGuid,
827                                             uint64_t aInputBlockId,
828                                             nsEventStatus aApzResponse);
830     /*
831      * We disable the input event queue when there is an active dnd session. We
832      * don't need support RealDragEvent with input priority.
833      */
834     async RealDragEvent(WidgetDragEvent aEvent, uint32_t aDragAction,
835                         uint32_t aDropEffect, nullable nsIPrincipal aPrincipal,
836                         nullable nsIContentSecurityPolicy csp);
838     [Priority=input] async CompositionEvent(WidgetCompositionEvent event);
839     async NormalPriorityCompositionEvent(WidgetCompositionEvent event);
841     [Priority=input] async SelectionEvent(WidgetSelectionEvent event);
842     async NormalPrioritySelectionEvent(WidgetSelectionEvent event);
844     /**
845      * Dispatch eContentCommandInsertText event in the remote process.
846      */
847     [Priority=input] async InsertText(nsString aStringToInsert);
848     async NormalPriorityInsertText(nsString aStringToInsert);
850     /**
851      * Call PasteTransferable via a controller on the content process
852      * to handle the command content event, "pasteTransferable".
853      */
854     // XXX Do we really need data other than IPCTransferableData? See bug 1833172.
855     async PasteTransferable(IPCTransferableData aTransferableData,
856                             bool aIsPrivateData,
857                             nullable nsIPrincipal aRequestingPrincipal,
858                             nsContentPolicyType aContentPolicyType);
860     async LoadRemoteScript(nsString aURL, bool aRunInGlobalScope);
862     /**
863      * Sent by the chrome process when it no longer wants this remote
864      * <browser>.  The child side cleans up in response, then
865      * finalizing its death by sending back __delete__() to the
866      * parent.
867      */
868     async Destroy();
870     /**
871      * If aEnabled is true, tells the child to paint and upload layers to
872      * the compositor. If aEnabled is false, the child stops painting and
873      * clears the layers from the compositor.
874      *
875      * @param aEnabled
876      *        True if the child should render and upload layers, false if the
877      *        child should clear layers.
878      */
879     async RenderLayers(bool aEnabled);
881     /**
882      * Communicates the child that we want layers to be preserved even when the
883      * browser is inactive.
884      */
885     async PreserveLayers(bool aPreserve);
886 child:
887     /**
888      * Notify the child that it shouldn't paint the offscreen displayport.
889      * This is useful to speed up interactive operations over async
890      * scrolling performance like resize, tabswitch, pageload.
891      *
892      * Each enable call must be matched with a disable call. The child
893      * will remain in the suppress mode as long as there's
894      * a single unmatched call.
895      */
896     async SuppressDisplayport(bool aEnabled);
898     /**
899      * Navigate by key (Tab/Shift+Tab/F6/Shift+f6).
900      */
901     async NavigateByKey(bool aForward, bool aForDocumentNavigation);
903     /**
904      * Tell the child that the UI resolution changed for the containing
905      * window.
906      * To avoid some sync messages from child to parent, we also send the dpi
907      * and default scale with the notification.
908      * If we don't know the dpi and default scale, we just pass in a negative
909      * value (-1) but in the majority of the cases this saves us from two
910      * sync requests from the child to the parent.
911      */
912     async UIResolutionChanged(float dpi, int32_t rounding, double scale);
914     /**
915      * Tell the child that the safe area of widget has changed.
916      *
917      */
918     async SafeAreaInsetsChanged(ScreenIntMargin aSafeAreaInsets);
920     /**
921      * Tell the browser that its frame loader has been swapped
922      * with another.
923      */
924     async SwappedWithOtherRemoteLoader(IPCTabContext context);
926     /**
927      * A potential accesskey was just pressed. Look for accesskey targets
928      * using the list of provided charCodes.
929      *
930      * @param event keyboard event
931      * @param isTrusted true if triggered by a trusted key event
932      */
933     async HandleAccessKey(WidgetKeyboardEvent event,
934                           uint32_t[] charCodes);
936     /**
937      * Tell the child to create a print preview document in this browser, or
938      * to update the existing print preview document with new print settings.
939      *
940      * @param aPrintData The serialized print settings to use to layout the
941      *   print preview document.
942      * @param aSourceBrowsingContext Optionally, the browsing context that
943      *   contains the document from which the print preview is to be generated.
944      *   This should only be passed on the first call.  It should not be passed
945      *   for any subsequent calls that are made to update the existing print
946      *   preview document with a new print settings object.
947      */
948     async PrintPreview(PrintData aPrintData,
949                        MaybeDiscardedBrowsingContext aSourceBrowsingContext) returns (PrintPreviewResultInfo aInfo);
951     /**
952      * Inform the print preview document that we're done with it.
953      */
954     async ExitPrintPreview();
956     /**
957      * Tell the child to print the current page with the given settings.
958      *
959      * @param aBrowsingContext the browsing context to print.
960      * @param aPrintData the serialized settings to print with
961      */
962     async Print(MaybeDiscardedBrowsingContext aBC, PrintData aPrintData);
964     /**
965      * Update the child with the tab's current top-level native window handle.
966      * This is used by a11y objects who must expose their native window.
967      *
968      * @param aNewHandle The native window handle of the tab's top-level window.
969      */
970     async UpdateNativeWindowHandle(uintptr_t aNewHandle);
972     /**
973      * Tell the BrowserChild to allow scripts in the docshell to close the window.
974      */
975     async AllowScriptsToClose();
977     async WillChangeProcess();
979 parent:
980     /**
981      * Fetches whether this window supports protected media, which is sent back in response.
982      */
983     async IsWindowSupportingProtectedMedia(uint64_t aOuterWindowID) returns(bool isSupported);
985     /**
986     * Fetches whether this window supports WebVR, which is sent back in response.
987     */
988     async IsWindowSupportingWebVR(uint64_t aOuterWindowID) returns(bool isSupported);
990     /** Records a history visit. */
991     async VisitURI(nullable nsIURI aURI, nullable nsIURI aLastVisitedURI, uint32_t aFlags, uint64_t aBrowserId);
993     /** Fetches the visited status for an array of URIs (Android-only). */
994     async QueryVisitedState(nullable nsIURI[] aURIs);
996     /** Create a session store for a browser child. */
997     async PSessionStore();
999     /**
1000      * Construct a new WindowGlobal for an existing global in the content process
1001      */
1002     async NewWindowGlobal(ManagedEndpoint<PWindowGlobalParent> aEndpoint,
1003                           WindowGlobalInit aInit);
1006  * FIXME: write protocol!
1008 state LIVE:
1009     send LoadURL goto LIVE;
1010 //etc.
1011     send Destroy goto DYING;
1013 state DYING:
1014     discard send blah;
1015 // etc.
1016     recv __delete__;
1017  */