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;
11 include protocol PDocAccessible;
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;
22 include NeckoChannelParams;
23 include WindowGlobalTypes;
26 include IPCTransferable;
28 include PPrintingTypes;
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::LayersObserverEpoch from "mozilla/layers/LayersTypes.h";
59 using mozilla::layers::GeckoContentController_TapType from "mozilla/layers/GeckoContentControllerTypes.h";
60 using mozilla::layers::ScrollableLayerGuid::ViewID from "mozilla/layers/ScrollableLayerGuid.h";
61 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
62 using mozilla::WindowsHandle from "mozilla/ipc/IPCTypes.h";
63 using class mozilla::WidgetCompositionEvent from "ipc/nsGUIEventIPC.h";
64 using struct mozilla::widget::IMENotification from "mozilla/widget/IMEData.h";
65 using struct mozilla::widget::IMENotificationRequests from "mozilla/widget/IMEData.h";
66 using struct mozilla::widget::IMEState from "mozilla/widget/IMEData.h";
67 using struct mozilla::widget::InputContext from "mozilla/widget/IMEData.h";
68 using struct mozilla::widget::InputContextAction from "mozilla/widget/IMEData.h";
69 using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
70 using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
71 using class mozilla::ContentCache from "ipc/nsGUIEventIPC.h";
72 using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h";
73 using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
74 using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h";
75 using class mozilla::WidgetDragEvent from "ipc/nsGUIEventIPC.h";
76 using struct nsRect from "nsRect.h";
77 using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h";
78 using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
79 using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageTypes.h";
80 using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
81 using mozilla::layers::CompositorOptions from "mozilla/layers/CompositorOptions.h";
82 using mozilla::CSSToScreenScale from "Units.h";
83 using mozilla::CommandInt from "mozilla/EventForwards.h";
84 using nsIWidget::TouchPointerState from "nsIWidget.h";
85 using nsIWidget::TouchpadGesturePhase from "nsIWidget.h";
86 using nsCursor from "nsIWidget.h";
87 using struct LookAndFeelInt from "mozilla/widget/WidgetMessageUtils.h";
88 using struct mozilla::DimensionRequest from "mozilla/widget/WidgetMessageUtils.h";
89 using class mozilla::dom::MessagePort from "mozilla/dom/MessagePort.h";
90 using class mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/StructuredCloneData.h";
91 using mozilla::dom::MaybeDiscardedWindowContext from "mozilla/dom/WindowContext.h";
92 using mozilla::EventMessage from "mozilla/EventForwards.h";
93 using nsEventStatus from "mozilla/EventForwards.h";
94 using mozilla::Modifiers from "mozilla/EventForwards.h";
95 using struct mozilla::widget::CandidateWindowPosition from "ipc/nsGUIEventIPC.h";
96 using struct mozilla::FontRange from "ipc/nsGUIEventIPC.h";
97 using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
98 using mozilla::dom::EffectsInfo from "mozilla/dom/EffectsInfo.h";
99 using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
100 using mozilla::ScrollAxis from "mozilla/PresShellForwards.h";
101 using mozilla::ScrollFlags from "mozilla/PresShellForwards.h";
102 using struct InputFormData from "mozilla/dom/SessionStoreMessageUtils.h";
103 using struct CollectedInputDataValue from "mozilla/dom/SessionStoreMessageUtils.h";
104 using mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason from "mozilla/ContentBlockingNotifier.h";
105 using mozilla::dom::CallerType from "mozilla/dom/BindingDeclarations.h";
106 using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageTypes.h";
107 using mozilla::IntrinsicSize from "nsIFrame.h";
108 using mozilla::AspectRatio from "mozilla/AspectRatio.h";
109 using mozilla::NativeKeyBindingsType from "mozilla/NativeKeyBindingsType.h";
110 using mozilla::StyleImageRendering from "mozilla/ServoStyleConsts.h";
111 [MoveOnly] using class mozilla::ipc::BigBuffer from "mozilla/ipc/BigBuffer.h";
112 using nsIFilePicker::Mode from "nsIFilePicker.h";
117 struct WebProgressData
119 MaybeDiscardedBrowsingContext browsingContext;
125 nullable nsIURI requestURI;
126 nullable nsIURI originalRequestURI;
127 nsCString matchedList;
130 struct WebProgressStateChangeData
133 bool mayEnableCharacterEncodingMenu;
135 // The following fields are only set when the aStateFlags param passed with
136 // this struct is |nsIWebProgress.STATE_STOP|.
137 nsString contentType;
139 nullable nsIURI documentURI;
142 struct WebProgressLocationChangeData
145 bool isSyntheticDocument;
146 bool mayEnableCharacterEncodingMenu;
147 nsString contentType;
150 nullable nsIURI documentURI;
151 nullable nsIPrincipal contentPrincipal;
152 nullable nsIPrincipal contentPartitionedPrincipal;
153 nullable nsIContentSecurityPolicy csp;
154 nullable nsIReferrerInfo referrerInfo;
155 uint64_t? requestContextID;
159 * If creating the print preview document or updating it with new print
160 * settings fails, sheetCount will be zero.
162 struct PrintPreviewResultInfo
165 uint32_t totalPageCount;
167 // Whether there's a selection in the previewed page, including its subframes.
169 // Whether there's a selection in the previewed page, excluding its subframes.
170 bool hasSelfSelection;
171 // If present, indicates if the page should be printed landscape when true or
172 // portrait when false;
173 bool? printLandscape;
174 // The at-page specified page width or null when no width is provided.
176 // The at-page specified page height or null when no height is provided.
181 * A PBrowser manages a maximal locally connected subtree of BrowsingContexts
182 * in a content process.
184 * See `dom/docs/Fission-IPC-Diagram.svg` for an overview of the DOM IPC
187 [NestedUpTo=inside_cpow] sync protocol PBrowser
191 manages PColorPicker;
194 manages PDocAccessible;
198 manages PPaymentRequest;
199 manages PSessionStore;
200 manages PWindowGlobal;
201 manages PBrowserBridge;
205 async AsyncMessage(nsString aMessage, ClonedMessageData aData);
210 * Tell the parent process a new accessible document has been created.
211 * aParentDoc is the accessible document it was created in if any, and
212 * aParentAcc is the id of the accessible in that document the new document
215 async PDocAccessible(nullable PDocAccessible aParentDoc, uint64_t aParentAcc,
216 MaybeDiscardedBrowsingContext aBrowsingContext);
219 async PPaymentRequest();
222 * Create a new Vsync connection for our associated root widget
227 * When the child process unsuppresses painting, we send the message for the
228 * parent process to start painting the new document, if it's still painting
231 [Priority=control] async DidUnsuppressPainting();
233 async DidUnsuppressPaintingNormalPriority();
236 * When child sends this message, parent should move focus to
237 * the next or previous focusable element or document.
239 async MoveFocus(bool forward, bool forDocumentNavigation);
242 * Called by the child to inform the parent that links are dropped into
245 * aLinks A flat array of url, name, and type for each link
247 async DropLinks(nsString[] aLinks);
249 sync SyncMessage(nsString aMessage, ClonedMessageData aData)
250 returns (StructuredCloneData[] retval);
253 * Notifies chrome that there is a focus change involving an editable
254 * object (input, textarea, document, contentEditable. etc.)
256 * contentCache Cache of content
257 * notification Whole data of the notification
258 * requests Requests of notification for IME of the native widget
260 [Nested=inside_cpow] async NotifyIMEFocus(ContentCache contentCache,
261 IMENotification notification)
262 returns (IMENotificationRequests requests);
265 * Notifies chrome that there has been a change in text content
266 * One call can encompass both a delete and an insert operation
267 * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates
269 * contentCache Cache of content
270 * notification Whole data of the notification
272 [Nested=inside_cpow] async NotifyIMETextChange(ContentCache contentCache,
273 IMENotification notification);
276 * Notifies chrome that there is a IME compostion rect updated
278 * contentCache Cache of content
280 [Nested=inside_cpow] async NotifyIMECompositionUpdate(ContentCache contentCache,
281 IMENotification notification);
284 * Notifies chrome that there has been a change in selection
285 * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates
287 * contentCache Cache of content
288 * notification Whole data of the notification
290 [Nested=inside_cpow] async NotifyIMESelection(ContentCache contentCache,
291 IMENotification notification);
294 * Notifies chrome of updating its content cache.
295 * This is useful if content is modified but we don't need to notify IME.
297 * contentCache Cache of content
299 [Nested=inside_cpow] async UpdateContentCache(ContentCache contentCache);
302 * Notifies IME of mouse button event on a character in focused editor.
304 * Returns true if the mouse button event is consumed by IME.
306 [Nested=inside_cpow] sync NotifyIMEMouseButtonEvent(IMENotification notification)
307 returns (bool consumedByIME);
310 * Notifies chrome to position change
312 * contentCache Cache of content
314 [Nested=inside_cpow] async NotifyIMEPositionChange(ContentCache contentCache,
315 IMENotification notification);
318 * Requests chrome to commit or cancel composition of IME.
320 * cancel Set true if composition should be cancelled.
321 * compositionId Set the composition ID to requesting commit
322 * (stored in TextComposition).
324 * isCommitted Returns true if the request causes composition
325 * being committed synchronously.
326 * committedString Returns committed string. The may be non-empty
327 * string even if cancel is true because IME may
328 * try to restore selected string which was
329 * replaced with the composition.
331 [Nested=inside_cpow] sync RequestIMEToCommitComposition(bool cancel,
332 uint32_t aCompositionId)
333 returns (bool isCommitted, nsString committedString);
336 * OnEventNeedingAckHandled() is called after a child process dispatches a
337 * composition event or a selection event which is sent from the parent
340 * message The message value of the handled event.
341 * compositionId The composition ID of handled composition event if
342 * the message is a composition event message. Otherwise,
345 [Nested=inside_cpow] async OnEventNeedingAckHandled(EventMessage message,
346 uint32_t compositionId);
349 * Request that the parent process move focus to the browser's frame. If
350 * canRaise is true, the window can be raised if it is inactive.
352 async RequestFocus(bool canRaise, CallerType aCallerType);
355 * Sends a mouse wheel zoom change to the parent process, to be handled by
356 * the front end as needed.
358 async WheelZoomChange(bool increase);
361 * Indicate, based on the current state, that some commands are enabled and
364 async EnableDisableCommands(MaybeDiscardedBrowsingContext bc,
366 nsCString[] enabledCommands,
367 nsCString[] disabledCommands);
369 [Nested=inside_cpow] sync GetInputContext() returns (IMEState state);
371 [Nested=inside_cpow] async SetInputContext(InputContext context,
372 InputContextAction action);
375 * Set the native cursor.
377 * The widget cursor to set.
378 * @param hasCustomCursor
379 * Whether there's any custom cursor represented by cursorData and
381 * @param customCursorData
382 * Serialized image data.
384 * Width of the image.
386 * Height of the image.
388 * Resolution of the image X axis in dppx units.
390 * Resolution of the image Y axis in dppx units.
392 * Stride used in the image data.
394 * Image format, see gfx::SurfaceFormat for possible values.
396 * Horizontal hotspot of the image, as specified by the css cursor property.
398 * Vertical hotspot of the image, as specified by the css cursor property.
400 * Invalidate any locally cached cursor settings and force an
403 async SetCursor(nsCursor value,
404 bool hasCustomCursor,
405 BigBuffer? customCursorData,
406 uint32_t width, uint32_t height,
407 float resolutionX, float resolutionY,
408 uint32_t stride, SurfaceFormat format,
409 uint32_t hotspotX, uint32_t hotspotY, bool force);
412 * Used to set the current text of the status tooltip.
413 * Nowadays this is only used for link locations on hover.
415 async SetLinkStatus(nsString status);
418 * Show/hide a tooltip when the mouse hovers over an element in the content
421 async ShowTooltip(uint32_t x, uint32_t y, nsString tooltip, nsString direction);
425 * Create an asynchronous color picker on the parent side,
426 * but don't open it yet.
428 async PColorPicker(nsString title, nsString initialColor, nsString[] defaultColors);
430 async PFilePicker(nsString aTitle, Mode aMode);
433 * Tells the containing widget whether the given input block results in a
434 * swipe. Should be called in response to a WidgetWheelEvent that has
435 * mFlags.mCanTriggerSwipe set on it.
437 async RespondStartSwipeEvent(uint64_t aInputBlockId, bool aStartSwipe);
440 * Look up dictionary by selected word for OSX
442 * @param aText The word to look up
443 * @param aFontRange Text decoration of aText
444 * @param aIsVertical true if vertical layout
446 async LookUpDictionary(nsString aText, FontRange[] aFontRangeArray,
447 bool aIsVertical, LayoutDeviceIntPoint aPoint);
452 * Send a reply of keyboard event to the parent. Then, parent can consider
453 * whether the event should kick a shortcut key or ignore.
455 * @param aEvent The event which was sent from the parent and handled
456 * in a remote process.
457 * @param aUUI The UUID which was generated when aEvent was sent to
460 async ReplyKeyEvent(WidgetKeyboardEvent aEvent, nsID aUUID);
463 * Retrieves edit commands for the key combination represented by aEvent.
465 * @param aType One of NativeKeyBindingsType.
466 * @param aEvent KeyboardEvent which represents a key combination.
467 * Note that this must be a trusted event.
468 * @return Array of edit commands which should be executed in
469 * editor of native applications.
471 sync RequestNativeKeyBindings(uint32_t aType, WidgetKeyboardEvent aEvent)
472 returns (CommandInt[] commands);
474 async SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout,
475 int32_t aNativeKeyCode,
476 uint32_t aModifierFlags,
477 nsString aCharacters,
478 nsString aUnmodifiedCharacters,
479 uint64_t aObserverId);
480 async SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
481 uint32_t aNativeMessage,
483 uint32_t aModifierFlags,
484 uint64_t aObserverId);
485 async SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
486 uint64_t aObserverId);
487 async SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint,
488 uint32_t aNativeMessage,
492 uint32_t aModifierFlags,
493 uint32_t aAdditionalFlags,
494 uint64_t aObserverId);
495 async SynthesizeNativeTouchPoint(uint32_t aPointerId,
496 TouchPointerState aPointerState,
497 LayoutDeviceIntPoint aPoint,
498 double aPointerPressure,
499 uint32_t aPointerOrientation,
500 uint64_t aObserverId);
501 async SynthesizeNativeTouchPadPinch(TouchpadGesturePhase aEventPhase,
503 LayoutDeviceIntPoint aPoint,
504 int32_t aModifierFlags);
505 async SynthesizeNativeTouchTap(LayoutDeviceIntPoint aPoint,
507 uint64_t aObserverId);
508 async ClearNativeTouchSequence(uint64_t aObserverId);
509 async SynthesizeNativePenInput(uint32_t aPointerId,
510 TouchPointerState aPointerState,
511 LayoutDeviceIntPoint aPoint,
517 uint64_t aObserverId);
518 async SynthesizeNativeTouchpadDoubleTap(LayoutDeviceIntPoint aPoint,
519 uint32_t aModifierFlags);
520 async SynthesizeNativeTouchpadPan(TouchpadGesturePhase aEventPhase,
521 LayoutDeviceIntPoint aPoint,
522 double aDeltaX, double aDeltaY,
523 int32_t aModifierFlags,
524 uint64_t aObserverId);
526 async LockNativePointer();
527 async UnlockNativePointer();
529 async AccessKeyNotHandled(WidgetKeyboardEvent event);
531 async RegisterProtocolHandler(nsString scheme, nullable nsIURI handlerURI, nsString title,
532 nullable nsIURI documentURI);
534 async OnStateChange(WebProgressData aWebProgressData,
535 RequestData aRequestData, uint32_t aStateFlags,
537 WebProgressStateChangeData? aStateChangeData);
539 async OnLocationChange(WebProgressData aWebProgressData,
540 RequestData aRequestData, nullable nsIURI aLocation,
541 uint32_t aFlags, bool aCanGoBack,
543 WebProgressLocationChangeData? aLocationChangeData);
545 // We only track information about total progress in the parent process.
546 // This value is throttled using nsBrowserStatusFilter, and records the full
547 // total progress for nsDocShells managed by this actor.
548 async OnProgressChange(int32_t aCurTotalProgress, int32_t aMaxTotalProgress);
550 // Calls to OnStatusChange are throttled by nsBrowserStatusFilter, meaning
551 // they are only called with a status of `NS_OK`, and with no webProgress or
553 async OnStatusChange(nsString aMessage);
555 async NotifyContentBlockingEvent(uint32_t aEvent, RequestData aRequestData,
556 bool aBlocked, nsCString aTrackingOrigin,
557 nsCString[] aTrackingFullHashes,
558 StorageAccessPermissionGrantedReason? aReason);
560 async NavigationFinished();
562 async IntrinsicSizeOrRatioChanged(IntrinsicSize? aIntrinsicSize,
563 AspectRatio? aIntrinsicRatio);
565 async ImageLoadComplete(nsresult aResult);
568 * Child informs the parent that a pointer lock has requested/released.
570 async RequestPointerLock() returns (nsCString error);
571 async ReleasePointerLock();
574 * Child informs the parent that a pointer capture has requested/released.
576 async RequestPointerCapture(uint32_t aPointerId) returns (bool aSuccess);
577 async ReleasePointerCapture(uint32_t aPointerId);
580 async NativeSynthesisResponse(uint64_t aObserverId, nsCString aResponse);
581 async UpdateSHistory();
582 async CloneDocumentTreeIntoSelf(MaybeDiscardedBrowsingContext aBc, PrintData aPrintData) returns(bool aSuccess);
583 async UpdateRemotePrintSettings(PrintData aPrintData);
586 * Parent informs the child to release all pointer capture.
588 [Priority=input] async ReleaseAllPointerCapture();
593 * Child informs the parent that the content is ready to handle input
594 * events. This is sent when the BrowserChild is created.
596 async RemoteIsReadyToHandleInputEvents();
599 * Child informs the parent that the layer tree is already available.
601 async PaintWhileInterruptingJSNoOp(LayersObserverEpoch aEpoch);
605 * Parent informs the child of graphical effects that are being applied
606 * to the child browser.
608 async UpdateEffects(EffectsInfo aEffects);
613 * Sent by the child to the parent to inform it that an update to the
614 * dimensions has been requested.
616 * @param aRequest The requested change of inner or outer dimensions.
617 * @param aScale The scale at the time of the request. This is to allow
618 * the parent to recompute the dimensions in case of an
619 * ongoing scale change.
621 async SetDimensions(DimensionRequest aRequest, double aScale);
623 [Nested=inside_sync] sync DispatchWheelEvent(WidgetWheelEvent event);
624 [Nested=inside_sync] sync DispatchMouseEvent(WidgetMouseEvent event);
625 [Nested=inside_sync] sync DispatchKeyboardEvent(WidgetKeyboardEvent event);
626 [Nested=inside_sync] sync DispatchTouchEvent(WidgetTouchEvent event);
628 async InvokeDragSession(IPCTransferableData[] transfers, uint32_t action,
629 BigBuffer? visualData,
630 uint32_t stride, SurfaceFormat format,
631 LayoutDeviceIntRect dragRect,
632 nullable nsIPrincipal principal,
633 nullable nsIContentSecurityPolicy csp,
634 CookieJarSettingsArgs cookieJarSettings,
635 MaybeDiscardedWindowContext sourceWindowContext,
636 MaybeDiscardedWindowContext sourceTopWindowContext);
638 // After a compositor reset, it is necessary to reconnect each layers ID to
639 // the compositor of the widget that will render those layers. Note that
640 // this is sync so we can ensure that messages to the window compositor
641 // arrive before the BrowserChild attempts to use its cross-process compositor
643 sync EnsureLayersConnected() returns (CompositorOptions compositorOptions);
646 * This function is used to notify the parent that it should display a
647 * canvas permission prompt.
649 * @param aOrigin origin string of the document that is requesting access.
651 async ShowCanvasPermissionPrompt(nsCString aOrigin,
652 bool aHideDoorHanger);
654 sync SetSystemFont(nsCString aFontName);
655 sync GetSystemFont() returns (nsCString retval);
658 * Called once this PBrowser's OOP subdoc no longer blocks its
659 * embedding element's and embedding doc's 'load' events.
661 async MaybeFireEmbedderLoadEvents(EmbedderElementEventType aFireEventAtEmbeddingElement);
663 async ScrollRectIntoView(nsRect aRect, ScrollAxis aVertical,
664 ScrollAxis aHorizontal, ScrollFlags aScrollFlags,
665 int32_t aAppUnitsPerDevPixel);
667 async ShowDynamicToolbar();
671 * Notify the remote browser that it has been Show()n on this side. This
672 * message is expected to trigger creation of the remote browser's "widget".
674 async Show(ParentShowInfo parentInfo, OwnerShowInfo childInfo);
677 * Sending an activate message moves focus to the child.
679 async Activate(uint64_t aActionId);
681 async Deactivate(uint64_t aActionId);
683 async ScrollbarPreferenceChanged(ScrollbarPreference pref);
685 async InitRendering(TextureFactoryIdentifier textureFactoryIdentifier,
687 CompositorOptions compositorOptions,
688 bool layersConnected);
690 async CompositorOptionsChanged(CompositorOptions newOptions);
692 async LoadURL(nsDocShellLoadState loadState, ParentShowInfo info);
694 async CreateAboutBlankContentViewer(nullable nsIPrincipal principal,
695 nullable nsIPrincipal partitionedPrincipal);
697 async ResumeLoad(uint64_t pendingSwitchID, ParentShowInfo info);
699 [Compress=all] async UpdateDimensions(DimensionInfo dimensions);
701 async SizeModeChanged(nsSizeMode sizeMode);
703 async ChildToParentMatrix(Matrix4x4? aMatrix,
704 ScreenRect aRemoteDocumentRect);
706 async UpdateRemoteStyle(StyleImageRendering aImageRendering);
708 async DynamicToolbarMaxHeightChanged(ScreenIntCoord height);
710 async DynamicToolbarOffsetChanged(ScreenIntCoord height);
713 * StopIMEStateManagement() is called when the process loses focus and
714 * should stop managing IME state.
716 async StopIMEStateManagement();
719 * When two consecutive mouse move events would be added to the message queue,
720 * they are 'compressed' by dumping the oldest one.
722 [Compress, Priority=input]
723 async RealMouseMoveEvent(WidgetMouseEvent event,
724 ScrollableLayerGuid aGuid,
725 uint64_t aInputBlockId);
727 async NormalPriorityRealMouseMoveEvent(WidgetMouseEvent event,
728 ScrollableLayerGuid aGuid,
729 uint64_t aInputBlockId);
732 * But don't compress mousemove events for tests since every event is
733 * important for the test since synthesizing various input events may
734 * be faster than what the user operates same things. If you need to
735 * test the `Compress`, send mouse move events with setting `isSyntehsized`
736 * of `aEvent` of `EventUtils#syntehsizeMouse*()`.
739 async RealMouseMoveEventForTests(WidgetMouseEvent event,
740 ScrollableLayerGuid aGuid,
741 uint64_t aInputBlockId);
742 async NormalPriorityRealMouseMoveEventForTests(WidgetMouseEvent event,
743 ScrollableLayerGuid aGuid,
744 uint64_t aInputBlockId);
747 * Mouse move events with |reason == eSynthesized| are sent via a separate
748 * message because they do not generate DOM 'mousemove' events, and the
749 * 'Compress' attribute on RealMouseMoveEvent() could result in a
750 * |reason == eReal| event being dropped in favour of an |eSynthesized|
751 * event, and thus a DOM 'mousemove' event to be lost.
754 async SynthMouseMoveEvent(WidgetMouseEvent event,
755 ScrollableLayerGuid aGuid,
756 uint64_t aInputBlockId);
757 async NormalPrioritySynthMouseMoveEvent(WidgetMouseEvent event,
758 ScrollableLayerGuid aGuid,
759 uint64_t aInputBlockId);
762 async RealMouseButtonEvent(WidgetMouseEvent event,
763 ScrollableLayerGuid aGuid,
764 uint64_t aInputBlockId);
765 async NormalPriorityRealMouseButtonEvent(WidgetMouseEvent event,
766 ScrollableLayerGuid aGuid,
767 uint64_t aInputBlockId);
770 async RealMouseEnterExitWidgetEvent(WidgetMouseEvent event,
771 ScrollableLayerGuid aGuid,
772 uint64_t aInputBlockId);
773 async NormalPriorityRealMouseEnterExitWidgetEvent(WidgetMouseEvent event,
774 ScrollableLayerGuid aGuid,
775 uint64_t aInputBlockId);
778 * Send a keyboard event which reporesents a user input to a remote process.
780 * @param aEvent The event which user typed a key.
781 * @param aUUID A UUID which is generated in the parent at sending it.
782 * This must be specified when the child sends a reply
783 * event to the parent.
786 async RealKeyEvent(WidgetKeyboardEvent aEvent, nsID aUUID);
787 async NormalPriorityRealKeyEvent(WidgetKeyboardEvent aEvent, nsID aUUID);
790 async MouseWheelEvent(WidgetWheelEvent event,
791 ScrollableLayerGuid aGuid,
792 uint64_t aInputBlockId);
793 async NormalPriorityMouseWheelEvent(WidgetWheelEvent event,
794 ScrollableLayerGuid aGuid,
795 uint64_t aInputBlockId);
798 async RealTouchEvent(WidgetTouchEvent aEvent,
799 ScrollableLayerGuid aGuid,
800 uint64_t aInputBlockId,
801 nsEventStatus aApzResponse);
802 async NormalPriorityRealTouchEvent(WidgetTouchEvent aEvent,
803 ScrollableLayerGuid aGuid,
804 uint64_t aInputBlockId,
805 nsEventStatus aApzResponse);
808 async HandleTap(GeckoContentController_TapType aType, LayoutDevicePoint point,
809 Modifiers aModifiers, ScrollableLayerGuid aGuid,
810 uint64_t aInputBlockId);
811 async NormalPriorityHandleTap(GeckoContentController_TapType aType, LayoutDevicePoint point,
812 Modifiers aModifiers, ScrollableLayerGuid aGuid,
813 uint64_t aInputBlockId);
815 [Compress, Priority=input]
816 async RealTouchMoveEvent(WidgetTouchEvent aEvent,
817 ScrollableLayerGuid aGuid,
818 uint64_t aInputBlockId,
819 nsEventStatus aApzResponse);
821 async NormalPriorityRealTouchMoveEvent(WidgetTouchEvent aEvent,
822 ScrollableLayerGuid aGuid,
823 uint64_t aInputBlockId,
824 nsEventStatus aApzResponse);
825 [Compress, Priority=input]
826 async RealTouchMoveEvent2(WidgetTouchEvent aEvent,
827 ScrollableLayerGuid aGuid,
828 uint64_t aInputBlockId,
829 nsEventStatus aApzResponse);
831 async NormalPriorityRealTouchMoveEvent2(WidgetTouchEvent aEvent,
832 ScrollableLayerGuid aGuid,
833 uint64_t aInputBlockId,
834 nsEventStatus aApzResponse);
837 * We disable the input event queue when there is an active dnd session. We
838 * don't need support RealDragEvent with input priority.
840 async RealDragEvent(WidgetDragEvent aEvent, uint32_t aDragAction,
841 uint32_t aDropEffect, nullable nsIPrincipal aPrincipal,
842 nullable nsIContentSecurityPolicy csp);
844 [Priority=input] async CompositionEvent(WidgetCompositionEvent event);
845 async NormalPriorityCompositionEvent(WidgetCompositionEvent event);
847 [Priority=input] async SelectionEvent(WidgetSelectionEvent event);
848 async NormalPrioritySelectionEvent(WidgetSelectionEvent event);
851 * Dispatch eContentCommandInsertText event in the remote process.
853 [Priority=input] async InsertText(nsString aStringToInsert);
854 async NormalPriorityInsertText(nsString aStringToInsert);
857 * Call PasteTransferable via a controller on the content process
858 * to handle the command content event, "pasteTransferable".
860 // XXX Do we really need data other than IPCTransferableData? See bug 1833172.
861 async PasteTransferable(IPCTransferableData aTransferableData,
863 nullable nsIPrincipal aRequestingPrincipal,
864 nsContentPolicyType aContentPolicyType);
866 async LoadRemoteScript(nsString aURL, bool aRunInGlobalScope);
869 * Sent by the chrome process when it no longer wants this remote
870 * <browser>. The child side cleans up in response, then
871 * finalizing its death by sending back __delete__() to the
877 * If aEnabled is true, tells the child to paint and upload layers to
878 * the compositor. If aEnabled is false, the child stops painting and
879 * clears the layers from the compositor.
882 * True if the child should render and upload layers, false if the
883 * child should clear layers.
885 * The layer observer epoch for this activation. This message should be
886 * ignored if this epoch has already been observed (via
887 * PaintWhileInterruptingJS).
889 async RenderLayers(bool aEnabled, LayersObserverEpoch aEpoch);
892 * Communicates the child that we want layers to be preserved even when the
893 * browser is inactive.
895 async PreserveLayers(bool aPreserve);
898 * Notify the child that it shouldn't paint the offscreen displayport.
899 * This is useful to speed up interactive operations over async
900 * scrolling performance like resize, tabswitch, pageload.
902 * Each enable call must be matched with a disable call. The child
903 * will remain in the suppress mode as long as there's
904 * a single unmatched call.
906 async SuppressDisplayport(bool aEnabled);
909 * Navigate by key (Tab/Shift+Tab/F6/Shift+f6).
911 async NavigateByKey(bool aForward, bool aForDocumentNavigation);
914 * Tell the child that the UI resolution changed for the containing
916 * To avoid some sync messages from child to parent, we also send the dpi
917 * and default scale with the notification.
918 * If we don't know the dpi and default scale, we just pass in a negative
919 * value (-1) but in the majority of the cases this saves us from two
920 * sync requests from the child to the parent.
922 async UIResolutionChanged(float dpi, int32_t rounding, double scale);
925 * Tell the child that the safe area of widget has changed.
928 async SafeAreaInsetsChanged(ScreenIntMargin aSafeAreaInsets);
931 * Tell the browser that its frame loader has been swapped
934 async SwappedWithOtherRemoteLoader(IPCTabContext context);
937 * A potential accesskey was just pressed. Look for accesskey targets
938 * using the list of provided charCodes.
940 * @param event keyboard event
941 * @param isTrusted true if triggered by a trusted key event
943 async HandleAccessKey(WidgetKeyboardEvent event,
944 uint32_t[] charCodes);
947 * Tell the child to create a print preview document in this browser, or
948 * to update the existing print preview document with new print settings.
950 * @param aPrintData The serialized print settings to use to layout the
951 * print preview document.
952 * @param aSourceBrowsingContext Optionally, the browsing context that
953 * contains the document from which the print preview is to be generated.
954 * This should only be passed on the first call. It should not be passed
955 * for any subsequent calls that are made to update the existing print
956 * preview document with a new print settings object.
958 async PrintPreview(PrintData aPrintData,
959 MaybeDiscardedBrowsingContext aSourceBrowsingContext) returns (PrintPreviewResultInfo aInfo);
962 * Inform the print preview document that we're done with it.
964 async ExitPrintPreview();
967 * Tell the child to print the current page with the given settings.
969 * @param aBrowsingContext the browsing context to print.
970 * @param aPrintData the serialized settings to print with
972 async Print(MaybeDiscardedBrowsingContext aBC, PrintData aPrintData);
975 * Update the child with the tab's current top-level native window handle.
976 * This is used by a11y objects who must expose their native window.
978 * @param aNewHandle The native window handle of the tab's top-level window.
980 async UpdateNativeWindowHandle(uintptr_t aNewHandle);
983 * Tell the BrowserChild to allow scripts in the docshell to close the window.
985 async AllowScriptsToClose();
987 async WillChangeProcess();
991 * Fetches whether this window supports protected media, which is sent back in response.
993 async IsWindowSupportingProtectedMedia(uint64_t aOuterWindowID) returns(bool isSupported);
996 * Fetches whether this window supports WebVR, which is sent back in response.
998 async IsWindowSupportingWebVR(uint64_t aOuterWindowID) returns(bool isSupported);
1000 /** Records a history visit. */
1001 async VisitURI(nullable nsIURI aURI, nullable nsIURI aLastVisitedURI, uint32_t aFlags, uint64_t aBrowserId);
1003 /** Fetches the visited status for an array of URIs (Android-only). */
1004 async QueryVisitedState(nullable nsIURI[] aURIs);
1006 /** Create a session store for a browser child. */
1007 async PSessionStore();
1010 * Construct a new WindowGlobal for an existing global in the content process
1012 async NewWindowGlobal(ManagedEndpoint<PWindowGlobalParent> aEndpoint,
1013 WindowGlobalInit aInit);
1016 * FIXME: write protocol!
1019 send LoadURL goto LIVE;
1021 send Destroy goto DYING;