PBrowser.ipdl (46737B)
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 : */ 3 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/. */ 7 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; 20 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; 31 32 include "mozilla/AntiTrackingIPCUtils.h"; 33 include "mozilla/nsRFPIPCUtils.h"; 34 include "mozilla/dom/BindingIPCUtils.h"; 35 include "mozilla/dom/CSPMessageUtils.h"; 36 include "mozilla/dom/PolicyContainerMessageUtils.h"; 37 include "mozilla/dom/DocShellMessageUtils.h"; 38 include "mozilla/dom/FilePickerMessageUtils.h"; 39 include "mozilla/dom/PermissionMessageUtils.h"; 40 include "mozilla/dom/ReferrerInfoUtils.h"; 41 include "mozilla/dom/TabMessageUtils.h"; 42 include "mozilla/GfxMessageUtils.h"; 43 include "mozilla/LayoutMessageUtils.h"; 44 include "mozilla/layers/LayersMessageUtils.h"; 45 include "mozilla/ipc/TransportSecurityInfoUtils.h"; 46 include "mozilla/ipc/URIUtils.h"; 47 48 using struct nsID from "nsID.h"; 49 using mozilla::contentanalysis::StringHashSet from "mozilla/contentanalysis/ContentAnalysisIPCTypes.h"; 50 using mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h"; 51 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h"; 52 using mozilla::LayoutDeviceIntPoint from "Units.h"; 53 using mozilla::LayoutDevicePoint from "Units.h"; 54 using mozilla::LayoutDeviceIntMargin from "Units.h"; 55 using mozilla::ScreenIntCoord from "Units.h"; 56 using mozilla::ScreenRect from "Units.h"; 57 using struct mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h"; 58 using struct mozilla::layers::ZoomConstraints from "mozilla/layers/ZoomConstraints.h"; 59 using struct mozilla::layers::DoubleTapToZoomMetrics from "mozilla/layers/DoubleTapToZoom.h"; 60 using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h"; 61 using mozilla::layers::GeckoContentController_TapType from "mozilla/layers/GeckoContentControllerTypes.h"; 62 using mozilla::layers::ScrollableLayerGuid::ViewID from "mozilla/layers/ScrollableLayerGuid.h"; 63 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h"; 64 using mozilla::WindowsHandle from "mozilla/ipc/IPCTypes.h"; 65 using class mozilla::WidgetCompositionEvent from "ipc/nsGUIEventIPC.h"; 66 using struct mozilla::widget::IMENotification from "mozilla/widget/IMEData.h"; 67 using struct mozilla::widget::IMENotificationRequests from "mozilla/widget/IMEData.h"; 68 using struct mozilla::widget::IMEState from "mozilla/widget/IMEData.h"; 69 using struct mozilla::widget::InputContext from "mozilla/widget/IMEData.h"; 70 using struct mozilla::widget::InputContextAction from "mozilla/widget/IMEData.h"; 71 using mozilla::gfx::IntSize from "mozilla/gfx/Point.h"; 72 using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h"; 73 using class mozilla::ContentCache from "ipc/nsGUIEventIPC.h"; 74 using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h"; 75 using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h"; 76 using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h"; 77 using class mozilla::WidgetDragEvent from "ipc/nsGUIEventIPC.h"; 78 using class mozilla::WidgetPointerEvent from "ipc/nsGUIEventIPC.h"; 79 using struct nsRect from "nsRect.h"; 80 using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h"; 81 using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h"; 82 using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageTypes.h"; 83 using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h"; 84 using mozilla::layers::CompositorOptions from "mozilla/layers/CompositorOptions.h"; 85 using mozilla::CSSToScreenScale from "Units.h"; 86 using mozilla::CommandInt from "mozilla/EventForwards.h"; 87 using nsIWidget::TouchPointerState from "nsIWidget.h"; 88 using nsIWidget::TouchpadGesturePhase from "nsIWidget.h"; 89 using nsCursor from "nsIWidget.h"; 90 using struct LookAndFeelInt from "mozilla/widget/WidgetMessageUtils.h"; 91 using struct mozilla::DimensionRequest from "mozilla/widget/WidgetMessageUtils.h"; 92 using class mozilla::dom::MessagePort from "mozilla/dom/MessagePort.h"; 93 using mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/StructuredCloneData.h"; 94 using mozilla::dom::MaybeDiscardedWindowContext from "mozilla/dom/WindowContext.h"; 95 using mozilla::EventMessage from "mozilla/EventForwards.h"; 96 using nsEventStatus from "mozilla/EventForwards.h"; 97 using mozilla::Modifiers from "mozilla/EventForwards.h"; 98 using struct mozilla::FontRange from "ipc/nsGUIEventIPC.h"; 99 using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h"; 100 using mozilla::dom::EffectsInfo from "mozilla/dom/EffectsInfo.h"; 101 using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h"; 102 using mozilla::ScrollAxis from "mozilla/PresShellForwards.h"; 103 using mozilla::ScrollFlags from "mozilla/PresShellForwards.h"; 104 using struct InputFormData from "mozilla/dom/SessionStoreMessageUtils.h"; 105 using struct CollectedInputDataValue from "mozilla/dom/SessionStoreMessageUtils.h"; 106 using mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason from "mozilla/ContentBlockingNotifier.h"; 107 using mozilla::CanvasFingerprintingEvent from "nsRFPService.h"; 108 using mozilla::dom::CallerType from "mozilla/dom/BindingDeclarations.h"; 109 using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageTypes.h"; 110 using mozilla::IntrinsicSize from "nsIFrame.h"; 111 using mozilla::AspectRatio from "mozilla/AspectRatio.h"; 112 using mozilla::NativeKeyBindingsType from "mozilla/NativeKeyBindingsType.h"; 113 using mozilla::StyleImageRendering from "mozilla/ServoStyleConsts.h"; 114 [MoveOnly] using class mozilla::ipc::BigBuffer from "mozilla/ipc/BigBuffer.h"; 115 using nsIFilePicker::Mode from "nsIFilePicker.h"; 116 117 namespace mozilla { 118 namespace dom { 119 120 struct WebProgressData 121 { 122 MaybeDiscardedBrowsingContext browsingContext; 123 uint32_t loadType; 124 }; 125 126 struct RequestData 127 { 128 nullable nsIURI requestURI; 129 nullable nsIURI originalRequestURI; 130 nsCString matchedList; 131 nsCString canceledReason; 132 }; 133 134 struct WebProgressStateChangeData 135 { 136 bool isNavigating; 137 bool mayEnableCharacterEncodingMenu; 138 139 // The following fields are only set when the aStateFlags param passed with 140 // this struct is |nsIWebProgress.STATE_STOP|. 141 nsString contentType; 142 nsString charset; 143 nullable nsIURI documentURI; 144 }; 145 146 struct WebProgressLocationChangeData 147 { 148 bool isNavigating; 149 bool isSyntheticDocument; 150 bool mayEnableCharacterEncodingMenu; 151 nsString contentType; 152 nsString title; 153 nsString charset; 154 nullable nsIURI documentURI; 155 nullable nsIPrincipal contentPrincipal; 156 nullable nsIPrincipal contentPartitionedPrincipal; 157 nullable nsIPolicyContainer policyContainer; 158 nullable nsIReferrerInfo referrerInfo; 159 uint64_t? requestContextID; 160 }; 161 162 /** 163 * If creating the print preview document or updating it with new print 164 * settings fails, sheetCount will be zero. 165 */ 166 struct PrintPreviewResultInfo 167 { 168 uint32_t sheetCount; 169 uint32_t totalPageCount; 170 bool isEmpty; 171 // Whether there's a selection in the previewed page, including its subframes. 172 bool hasSelection; 173 // Whether there's a selection in the previewed page, excluding its subframes. 174 bool hasSelfSelection; 175 // If present, indicates if the page should be printed landscape when true or 176 // portrait when false; 177 bool? printLandscape; 178 // The at-page specified page width or null when no width is provided. 179 float? pageWidth; 180 // The at-page specified page height or null when no height is provided. 181 float? pageHeight; 182 }; 183 184 /** 185 * A PBrowser manages a maximal locally connected subtree of BrowsingContexts 186 * in a content process. 187 * 188 * See `dom/docs/Fission-IPC-Diagram.svg` for an overview of the DOM IPC 189 * actors. 190 */ 191 [NestedUpTo=inside_cpow] sync protocol PBrowser 192 { 193 manager PContent; 194 195 manages PColorPicker; 196 197 #ifdef ACCESSIBILITY 198 manages PDocAccessible; 199 #endif 200 201 manages PFilePicker; 202 manages PPaymentRequest; 203 manages PSessionStore; 204 manages PWindowGlobal; 205 manages PBrowserBridge; 206 manages PVsync; 207 208 both: 209 async AsyncMessage(nsString aMessage, ClonedMessageData aData); 210 211 parent: 212 #ifdef ACCESSIBILITY 213 /** 214 * Tell the parent process a new accessible document has been created. 215 * aParentDoc is the accessible document it was created in if any, and 216 * aParentAcc is the id of the accessible in that document the new document 217 * is a child of. 218 */ 219 async PDocAccessible(nullable PDocAccessible aParentDoc, uint64_t aParentAcc, 220 MaybeDiscardedBrowsingContext aBrowsingContext); 221 #endif 222 223 async PPaymentRequest(); 224 225 /** 226 * Create a new Vsync connection for our associated root widget 227 */ 228 async PVsync(); 229 230 /** 231 * When the child process unsuppresses painting, we send the message for the 232 * parent process to start painting the new document, if it's still painting 233 * the old one. 234 */ 235 [Priority=control] async DidUnsuppressPainting(); 236 237 async DidUnsuppressPaintingNormalPriority(); 238 239 /** 240 * When child sends this message, parent should move focus to 241 * the next or previous focusable element or document. 242 */ 243 async MoveFocus(bool forward, bool forDocumentNavigation); 244 245 /** 246 * Called by the child to inform the parent that links are dropped into 247 * content area. 248 * 249 * aLinks A flat array of url, name, and type for each link 250 */ 251 async DropLinks(nsString[] aLinks); 252 253 sync SyncMessage(nsString aMessage, ClonedMessageData aData) 254 returns (UniquePtr<StructuredCloneData>[] retval); 255 256 /** 257 * Notifies chrome that there is a focus change involving an editable 258 * object (input, textarea, document, contentEditable. etc.) 259 * 260 * contentCache Cache of content 261 * notification Whole data of the notification 262 * requests Requests of notification for IME of the native widget 263 */ 264 [Nested=inside_cpow] async NotifyIMEFocus(ContentCache contentCache, 265 IMENotification notification) 266 returns (IMENotificationRequests requests); 267 268 /** 269 * Notifies chrome that there has been a change in text content 270 * One call can encompass both a delete and an insert operation 271 * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates 272 * 273 * contentCache Cache of content 274 * notification Whole data of the notification 275 */ 276 [Nested=inside_cpow] async NotifyIMETextChange(ContentCache contentCache, 277 IMENotification notification); 278 279 /** 280 * Notifies chrome that there is a IME compostion rect updated 281 * 282 * contentCache Cache of content 283 */ 284 [Nested=inside_cpow] async NotifyIMECompositionUpdate(ContentCache contentCache, 285 IMENotification notification); 286 287 /** 288 * Notifies chrome that there has been a change in selection 289 * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates 290 * 291 * contentCache Cache of content 292 * notification Whole data of the notification 293 */ 294 [Nested=inside_cpow] async NotifyIMESelection(ContentCache contentCache, 295 IMENotification notification); 296 297 /** 298 * Notifies chrome of updating its content cache. 299 * This is useful if content is modified but we don't need to notify IME. 300 * 301 * contentCache Cache of content 302 */ 303 [Nested=inside_cpow] async UpdateContentCache(ContentCache contentCache); 304 305 /** 306 * Notifies IME of mouse button event on a character in focused editor. 307 * 308 * Returns true if the mouse button event is consumed by IME. 309 */ 310 [Nested=inside_cpow] sync NotifyIMEMouseButtonEvent(IMENotification notification) 311 returns (bool consumedByIME); 312 313 /** 314 * Notifies chrome to position change 315 * 316 * contentCache Cache of content 317 */ 318 [Nested=inside_cpow] async NotifyIMEPositionChange(ContentCache contentCache, 319 IMENotification notification); 320 321 /** 322 * Requests chrome to commit or cancel composition of IME. 323 * 324 * cancel Set true if composition should be cancelled. 325 * compositionId Set the composition ID to requesting commit 326 * (stored in TextComposition). 327 * 328 * isCommitted Returns true if the request causes composition 329 * being committed synchronously. 330 * committedString Returns committed string. The may be non-empty 331 * string even if cancel is true because IME may 332 * try to restore selected string which was 333 * replaced with the composition. 334 */ 335 [Nested=inside_cpow] sync RequestIMEToCommitComposition(bool cancel, 336 uint32_t aCompositionId) 337 returns (bool isCommitted, nsString committedString); 338 339 /** 340 * OnEventNeedingAckHandled() is called after a child process dispatches a 341 * composition event or a selection event which is sent from the parent 342 * process. 343 * 344 * message The message value of the handled event. 345 * compositionId The composition ID of handled composition event if 346 * the message is a composition event message. Otherwise, 347 * 0. 348 */ 349 [Nested=inside_cpow] async OnEventNeedingAckHandled(EventMessage message, 350 uint32_t compositionId); 351 352 /** 353 * Request that the parent process move focus to the browser's frame. If 354 * canRaise is true, the window can be raised if it is inactive. 355 */ 356 async RequestFocus(bool canRaise, CallerType aCallerType); 357 358 /** 359 * Sends a mouse wheel zoom change to the parent process, to be handled by 360 * the front end as needed. 361 */ 362 async WheelZoomChange(bool increase); 363 364 /** 365 * Indicate, based on the current state, that some commands are enabled and 366 * some are disabled. 367 */ 368 async EnableDisableCommands(MaybeDiscardedBrowsingContext bc, 369 nsString action, 370 nsCString[] enabledCommands, 371 nsCString[] disabledCommands); 372 373 [Nested=inside_cpow] sync GetInputContext() returns (IMEState state); 374 375 [Nested=inside_cpow] async SetInputContext(InputContext context, 376 InputContextAction action); 377 378 /** 379 * Set the native cursor. 380 * @param value 381 * The widget cursor to set. 382 * @param customCursor 383 * Serialized image data for custom cursor. 384 * @param resolutionX 385 * Resolution of the image X axis in dppx units. 386 * @param resolutionY 387 * Resolution of the image Y axis in dppx units. 388 * @param hotspotX 389 * Horizontal hotspot of the image, as specified by the css cursor property. 390 * @param hotspotY 391 * Vertical hotspot of the image, as specified by the css cursor property. 392 * @param force 393 * Invalidate any locally cached cursor settings and force an 394 * update. 395 */ 396 async SetCursor(nsCursor value, 397 IPCImage? customCursor, 398 float resolutionX, float resolutionY, 399 uint32_t hotspotX, uint32_t hotspotY, bool force); 400 401 /** 402 * Used to set the current text of the status tooltip. 403 * Nowadays this is only used for link locations on hover. 404 */ 405 async SetLinkStatus(nsString status); 406 407 /** 408 * Show/hide a tooltip when the mouse hovers over an element in the content 409 * document. 410 */ 411 async ShowTooltip(uint32_t x, uint32_t y, nsString tooltip, nsString direction); 412 async HideTooltip(); 413 414 /** 415 * Create an asynchronous color picker on the parent side, 416 * but don't open it yet. 417 */ 418 async PColorPicker(MaybeDiscardedBrowsingContext aBrowsingContext, 419 nsString title, nsString initialColor, 420 nsString[] defaultColors); 421 422 async PFilePicker(nsString aTitle, Mode aMode, MaybeDiscardedBrowsingContext aBrowsingContext); 423 424 /** 425 * Tells the containing widget whether the given input block results in a 426 * swipe. Should be called in response to a WidgetWheelEvent that has 427 * mFlags.mCanTriggerSwipe set on it. 428 */ 429 async RespondStartSwipeEvent(uint64_t aInputBlockId, bool aStartSwipe); 430 431 /** 432 * Look up dictionary by selected word for OSX 433 * 434 * @param aText The word to look up 435 * @param aFontRange Text decoration of aText 436 * @param aIsVertical true if vertical layout 437 */ 438 async LookUpDictionary(nsString aText, FontRange[] aFontRangeArray, 439 bool aIsVertical, LayoutDeviceIntPoint aPoint); 440 441 async __delete__(); 442 443 /** 444 * Send a reply of keyboard event to the parent. Then, parent can consider 445 * whether the event should kick a shortcut key or ignore. 446 * 447 * @param aEvent The event which was sent from the parent and handled 448 * in a remote process. 449 * @param aUUI The UUID which was generated when aEvent was sent to 450 * a remote process. 451 */ 452 async ReplyKeyEvent(WidgetKeyboardEvent aEvent, nsID aUUID); 453 454 /** 455 * Retrieves edit commands for the key combination represented by aEvent. 456 * 457 * @param aType One of NativeKeyBindingsType. 458 * @param aEvent KeyboardEvent which represents a key combination. 459 * Note that this must be a trusted event. 460 * @return Array of edit commands which should be executed in 461 * editor of native applications. 462 */ 463 sync RequestNativeKeyBindings(uint32_t aType, WidgetKeyboardEvent aEvent) 464 returns (CommandInt[] commands); 465 466 async SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout, 467 int32_t aNativeKeyCode, 468 uint32_t aModifierFlags, 469 nsString aCharacters, 470 nsString aUnmodifiedCharacters, 471 uint64_t? aCallbackId); 472 async SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint, 473 uint32_t aNativeMessage, 474 int16_t aButton, 475 uint32_t aModifierFlags, 476 uint64_t? aCallbackId); 477 async SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint, 478 uint64_t? aCallbackId); 479 async SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint, 480 uint32_t aNativeMessage, 481 double aDeltaX, 482 double aDeltaY, 483 double aDeltaZ, 484 uint32_t aModifierFlags, 485 uint32_t aAdditionalFlags, 486 uint64_t? aCallbackId); 487 async SynthesizeNativeTouchPoint(uint32_t aPointerId, 488 TouchPointerState aPointerState, 489 LayoutDeviceIntPoint aPoint, 490 double aPointerPressure, 491 uint32_t aPointerOrientation, 492 uint64_t? aCallbackId); 493 async SynthesizeNativeTouchPadPinch(TouchpadGesturePhase aEventPhase, 494 float aScale, 495 LayoutDeviceIntPoint aPoint, 496 int32_t aModifierFlags); 497 async SynthesizeNativeTouchTap(LayoutDeviceIntPoint aPoint, 498 bool aLongTap, 499 uint64_t? aCallbackId); 500 async SynthesizeNativePenInput(uint32_t aPointerId, 501 TouchPointerState aPointerState, 502 LayoutDeviceIntPoint aPoint, 503 double aPressure, 504 uint32_t aRotation, 505 int32_t aTiltX, 506 int32_t aTiltY, 507 int32_t aButton, 508 uint64_t? aCallbackId); 509 async SynthesizeNativeTouchpadDoubleTap(LayoutDeviceIntPoint aPoint, 510 uint32_t aModifierFlags); 511 async SynthesizeNativeTouchpadPan(TouchpadGesturePhase aEventPhase, 512 LayoutDeviceIntPoint aPoint, 513 double aDeltaX, double aDeltaY, 514 int32_t aModifierFlags, 515 uint64_t? aCallbackId); 516 517 async LockNativePointer(); 518 async UnlockNativePointer(); 519 520 async AccessKeyNotHandled(WidgetKeyboardEvent event); 521 522 async RegisterProtocolHandler(nsString scheme, nullable nsIURI handlerURI, nsString title, 523 nullable nsIURI documentURI); 524 525 async OnStateChange(WebProgressData aWebProgressData, 526 RequestData aRequestData, uint32_t aStateFlags, 527 nsresult aStatus, 528 WebProgressStateChangeData? aStateChangeData); 529 530 async OnLocationChange(WebProgressData aWebProgressData, 531 RequestData aRequestData, nullable nsIURI aLocation, 532 uint32_t aFlags, bool aCanGoBack, 533 bool aCanGoBackIgnoringUserInteraction, 534 bool aCanGoForward, 535 WebProgressLocationChangeData? aLocationChangeData); 536 537 // NOTE: ProgressChange and StatusChange notifications here are throttled by 538 // nsBrowserStatusFilter, which passes meaningless values for all other 539 // arguments. 540 // 541 // This throttling is required to avoid sending every status and progress 542 // notification, which can lead to performance issues (bug 1970073). 543 async OnProgressChange(int32_t aCurTotalProgress, int32_t aMaxTotalProgress); 544 async OnStatusChange(nsString aMessage); 545 546 async NotifyContentBlockingEvent(uint32_t aEvent, RequestData aRequestData, 547 bool aBlocked, nsCString aTrackingOrigin, 548 nsCString[] aTrackingFullHashes, 549 StorageAccessPermissionGrantedReason? aReason, 550 CanvasFingerprintingEvent? aCanvasFingerprintingEvent); 551 552 async NavigationFinished(); 553 554 async IntrinsicSizeOrRatioChanged(IntrinsicSize? aIntrinsicSize, 555 AspectRatio? aIntrinsicRatio); 556 557 async ImageLoadComplete(nsresult aResult); 558 559 /** 560 * Child informs the parent that a pointer capture has requested/released. 561 */ 562 async RequestPointerCapture(uint32_t aPointerId) returns (bool aSuccess); 563 async ReleasePointerCapture(uint32_t aPointerId); 564 565 /** 566 * Child informs the parent that a pointer lock has requested. 567 */ 568 async RequestPointerLock() returns (nsCString error); 569 570 /** 571 * This function is used to notify the parent that it should display a 572 * onion services client authentication prompt. 573 * 574 * @param aOnionHost The hostname of the .onion that needs authentication. 575 * @param aTopic The reason for the prompt. 576 */ 577 async ShowOnionServicesAuthPrompt(nsCString aOnionHost, nsCString aTopic); 578 579 both: 580 /** 581 * informs that a pointer lock has released. 582 */ 583 async ReleasePointerLock(); 584 585 child: 586 async UpdateSHistory(); 587 async CloneDocumentTreeIntoSelf(MaybeDiscardedBrowsingContext aBc, PrintData aPrintData) returns(bool aSuccess); 588 async UpdateRemotePrintSettings(PrintData aPrintData); 589 590 /** 591 * Parent informs the child to release all pointer capture. 592 */ 593 [Priority=input] async ReleaseAllPointerCapture(); 594 595 parent: 596 597 /** 598 * Child informs the parent that the content is ready to handle input 599 * events. This is sent when the BrowserChild is created. 600 */ 601 async RemoteIsReadyToHandleInputEvents(); 602 603 child: 604 /** 605 * Parent informs the child of graphical effects that are being applied 606 * to the child browser. 607 */ 608 async UpdateEffects(EffectsInfo aEffects); 609 610 parent: 611 612 /** 613 * Sent by the child to the parent to inform it that an update to the 614 * dimensions has been requested. 615 * 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. 620 */ 621 async SetDimensions(DimensionRequest aRequest, double aScale); 622 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); 627 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 nsIPolicyContainer policyContainer, 634 CookieJarSettingsArgs cookieJarSettings, 635 MaybeDiscardedWindowContext sourceWindowContext, 636 MaybeDiscardedWindowContext sourceTopWindowContext); 637 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 642 // bridge. 643 sync EnsureLayersConnected() returns (CompositorOptions compositorOptions); 644 645 /** 646 * This function is used to notify the parent that it should display a 647 * canvas permission prompt. 648 * 649 * @param aOrigin origin string of the document that is requesting access. 650 */ 651 async ShowCanvasPermissionPrompt(nsCString aOrigin, 652 bool aHideDoorHanger); 653 654 sync SetSystemFont(nsCString aFontName); 655 sync GetSystemFont() returns (nsCString retval); 656 657 /** 658 * Called once this PBrowser's OOP subdoc no longer blocks its 659 * embedding element's and embedding doc's 'load' events. 660 */ 661 async MaybeFireEmbedderLoadEvents(EmbedderElementEventType aFireEventAtEmbeddingElement); 662 663 async ScrollRectIntoView(nsRect aRect, ScrollAxis aVertical, 664 ScrollAxis aHorizontal, ScrollFlags aScrollFlags, 665 int32_t aAppUnitsPerDevPixel); 666 667 async ShowDynamicToolbar(); 668 669 child: 670 /** 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". 673 */ 674 async Show(ParentShowInfo parentInfo, OwnerShowInfo childInfo); 675 676 /** 677 * Sending an activate message moves focus to the child. 678 */ 679 async Activate(uint64_t aActionId); 680 681 async Deactivate(uint64_t aActionId); 682 683 async ScrollbarPreferenceChanged(ScrollbarPreference pref); 684 685 async InitRendering(TextureFactoryIdentifier textureFactoryIdentifier, 686 LayersId layersId, 687 CompositorOptions compositorOptions, 688 bool layersConnected); 689 690 async CompositorOptionsChanged(CompositorOptions newOptions); 691 692 async LoadURL(nsDocShellLoadState loadState, ParentShowInfo info); 693 694 async CreateAboutBlankDocumentViewer(nullable nsIPrincipal principal, 695 nullable nsIPrincipal partitionedPrincipal); 696 697 async ResumeLoad(uint64_t pendingSwitchID, ParentShowInfo info); 698 699 [Compress=all] async UpdateDimensions(DimensionInfo dimensions); 700 701 async SizeModeChanged(nsSizeMode sizeMode); 702 703 async ChildToParentMatrix(Matrix4x4? aMatrix, 704 ScreenRect aRemoteDocumentRect); 705 706 async UpdateRemoteStyle(StyleImageRendering aImageRendering); 707 708 async DynamicToolbarMaxHeightChanged(ScreenIntCoord height); 709 710 async DynamicToolbarOffsetChanged(ScreenIntCoord offset); 711 712 async KeyboardHeightChanged(ScreenIntCoord height); 713 714 async AndroidPipModeChanged(bool aPipMode); 715 716 /** 717 * StopIMEStateManagement() is called when the process loses focus and 718 * should stop managing IME state. 719 */ 720 async StopIMEStateManagement(); 721 722 /** 723 * When two consecutive mouse move events would be added to the message queue, 724 * they are 'compressed' by dumping the oldest one. 725 */ 726 [Compress, Priority=input] 727 async RealMouseMoveEvent(WidgetMouseEvent event, 728 ScrollableLayerGuid aGuid, 729 uint64_t aInputBlockId); 730 [Compress] 731 async NormalPriorityRealMouseMoveEvent(WidgetMouseEvent event, 732 ScrollableLayerGuid aGuid, 733 uint64_t aInputBlockId); 734 735 /** 736 * But don't compress mousemove events for tests since every event is 737 * important for the test since synthesizing various input events may 738 * be faster than what the user operates same things. If you need to 739 * test the `Compress`, send mouse move events with setting `isSyntehsized` 740 * of `aEvent` of `EventUtils#syntehsizeMouse*()`. 741 */ 742 [Priority=input] 743 async RealMouseMoveEventForTests(WidgetMouseEvent event, 744 ScrollableLayerGuid aGuid, 745 uint64_t aInputBlockId); 746 async NormalPriorityRealMouseMoveEventForTests(WidgetMouseEvent event, 747 ScrollableLayerGuid aGuid, 748 uint64_t aInputBlockId); 749 750 /** 751 * Mouse move events with |reason == eSynthesized| are sent via a separate 752 * message because they do not generate DOM 'mousemove' events, and the 753 * 'Compress' attribute on RealMouseMoveEvent() could result in a 754 * |reason == eReal| event being dropped in favour of an |eSynthesized| 755 * event, and thus a DOM 'mousemove' event to be lost. 756 */ 757 [Priority=input] 758 async SynthMouseMoveEvent(WidgetMouseEvent event, 759 ScrollableLayerGuid aGuid, 760 uint64_t aInputBlockId); 761 async NormalPrioritySynthMouseMoveEvent(WidgetMouseEvent event, 762 ScrollableLayerGuid aGuid, 763 uint64_t aInputBlockId); 764 765 [Priority=input] 766 async RealMouseButtonEvent(WidgetMouseEvent event, 767 ScrollableLayerGuid aGuid, 768 uint64_t aInputBlockId); 769 async NormalPriorityRealMouseButtonEvent(WidgetMouseEvent event, 770 ScrollableLayerGuid aGuid, 771 uint64_t aInputBlockId); 772 773 [Priority=input] 774 async RealPointerButtonEvent(WidgetPointerEvent event, 775 ScrollableLayerGuid aGuid, 776 uint64_t aInputBlockId); 777 async NormalPriorityRealPointerButtonEvent(WidgetPointerEvent event, 778 ScrollableLayerGuid aGuid, 779 uint64_t aInputBlockId); 780 781 [Priority=input] 782 async RealMouseEnterExitWidgetEvent(WidgetMouseEvent event, 783 ScrollableLayerGuid aGuid, 784 uint64_t aInputBlockId); 785 async NormalPriorityRealMouseEnterExitWidgetEvent(WidgetMouseEvent event, 786 ScrollableLayerGuid aGuid, 787 uint64_t aInputBlockId); 788 789 /** 790 * Send a keyboard event which reporesents a user input to a remote process. 791 * 792 * @param aEvent The event which user typed a key. 793 * @param aUUID A UUID which is generated in the parent at sending it. 794 * This must be specified when the child sends a reply 795 * event to the parent. 796 */ 797 [Priority=input] 798 async RealKeyEvent(WidgetKeyboardEvent aEvent, nsID aUUID); 799 async NormalPriorityRealKeyEvent(WidgetKeyboardEvent aEvent, nsID aUUID); 800 801 [Priority=input] 802 async MouseWheelEvent(WidgetWheelEvent event, 803 ScrollableLayerGuid aGuid, 804 uint64_t aInputBlockId); 805 async NormalPriorityMouseWheelEvent(WidgetWheelEvent event, 806 ScrollableLayerGuid aGuid, 807 uint64_t aInputBlockId); 808 809 [Priority=input] 810 async RealTouchEvent(WidgetTouchEvent aEvent, 811 ScrollableLayerGuid aGuid, 812 uint64_t aInputBlockId, 813 nsEventStatus aApzResponse); 814 async NormalPriorityRealTouchEvent(WidgetTouchEvent aEvent, 815 ScrollableLayerGuid aGuid, 816 uint64_t aInputBlockId, 817 nsEventStatus aApzResponse); 818 819 [Priority=input] 820 async HandleTap(GeckoContentController_TapType aType, LayoutDevicePoint point, 821 Modifiers aModifiers, ScrollableLayerGuid aGuid, 822 uint64_t aInputBlockId, 823 DoubleTapToZoomMetrics? aMetrics); 824 async NormalPriorityHandleTap(GeckoContentController_TapType aType, LayoutDevicePoint point, 825 Modifiers aModifiers, ScrollableLayerGuid aGuid, 826 uint64_t aInputBlockId, 827 DoubleTapToZoomMetrics? aMetrics); 828 829 [Compress, Priority=input] 830 async RealTouchMoveEvent(WidgetTouchEvent aEvent, 831 ScrollableLayerGuid aGuid, 832 uint64_t aInputBlockId, 833 nsEventStatus aApzResponse); 834 [Compress] 835 async NormalPriorityRealTouchMoveEvent(WidgetTouchEvent aEvent, 836 ScrollableLayerGuid aGuid, 837 uint64_t aInputBlockId, 838 nsEventStatus aApzResponse); 839 [Compress, Priority=input] 840 async RealTouchMoveEvent2(WidgetTouchEvent aEvent, 841 ScrollableLayerGuid aGuid, 842 uint64_t aInputBlockId, 843 nsEventStatus aApzResponse); 844 [Compress] 845 async NormalPriorityRealTouchMoveEvent2(WidgetTouchEvent aEvent, 846 ScrollableLayerGuid aGuid, 847 uint64_t aInputBlockId, 848 nsEventStatus aApzResponse); 849 850 /* 851 * We disable the input event queue when there is an active dnd session. We 852 * don't need support RealDragEvent with input priority. 853 */ 854 async RealDragEvent(WidgetDragEvent aEvent, uint32_t aDragAction, 855 uint32_t aDropEffect, nullable nsIPrincipal aPrincipal, 856 nullable nsIPolicyContainer policyContainer); 857 858 both: 859 async SynthesizedEventResponse(uint64_t aCallbackId); 860 861 child: 862 [Priority=input] async CompositionEvent(WidgetCompositionEvent event); 863 async NormalPriorityCompositionEvent(WidgetCompositionEvent event); 864 865 [Priority=input] async SelectionEvent(WidgetSelectionEvent event); 866 async NormalPrioritySelectionEvent(WidgetSelectionEvent event); 867 868 869 [Priority=input] async SimpleContentCommandEvent(EventMessage message); 870 async NormalPrioritySimpleContentCommandEvent(EventMessage message); 871 872 /** 873 * Dispatch eContentCommandInsertText event in the remote process. 874 */ 875 [Priority=input] async InsertText(nsString aStringToInsert); 876 async NormalPriorityInsertText(nsString aStringToInsert); 877 878 /** 879 * Dispatch eContentCommandReplaceText event in the remote process. 880 */ 881 [Priority=input] async ReplaceText(nsString aReplacementString, 882 nsString aStringToInsert, 883 uint32_t aOffset, 884 bool aPreventSetSelection); 885 async NormalPriorityReplaceText(nsString aReplacementString, 886 nsString aStringToInsert, 887 uint32_t aOffset, 888 bool aPreventSetSelection); 889 890 /** 891 * Call PasteTransferable via a controller on the content process 892 * to handle the command content event, "pasteTransferable". 893 */ 894 async PasteTransferable(IPCTransferable aTransferable); 895 896 async LoadRemoteScript(nsString aURL, bool aRunInGlobalScope); 897 898 /** 899 * Sent by the chrome process when it no longer wants this remote 900 * <browser>. The child side cleans up in response, then 901 * finalizing its death by sending back __delete__() to the 902 * parent. 903 */ 904 async Destroy(); 905 906 /** 907 * If aEnabled is true, tells the child to paint and upload layers to 908 * the compositor. If aEnabled is false, the child stops painting and 909 * clears the layers from the compositor. 910 * 911 * @param aEnabled 912 * True if the child should render and upload layers, false if the 913 * child should clear layers. 914 */ 915 async RenderLayers(bool aEnabled); 916 917 /** 918 * Communicates the child that we want layers to be preserved even when the 919 * browser is inactive. 920 */ 921 async PreserveLayers(bool aPreserve); 922 child: 923 /** 924 * Notify the child that it shouldn't paint the offscreen displayport. 925 * This is useful to speed up interactive operations over async 926 * scrolling performance like resize, tabswitch, pageload. 927 * 928 * Each enable call must be matched with a disable call. The child 929 * will remain in the suppress mode as long as there's 930 * a single unmatched call. 931 */ 932 async SuppressDisplayport(bool aEnabled); 933 934 /** 935 * Navigate by key (Tab/Shift+Tab/F6/Shift+f6). 936 */ 937 async NavigateByKey(bool aForward, bool aForDocumentNavigation); 938 939 /** 940 * Tell the child that the UI resolution changed for the containing 941 * window. 942 * To avoid some sync messages from child to parent, we also send the dpi 943 * and default scale with the notification. 944 * If we don't know the dpi and default scale, we just pass in a negative 945 * value (-1) but in the majority of the cases this saves us from two 946 * sync requests from the child to the parent. 947 */ 948 async UIResolutionChanged(float dpi, int32_t rounding, double scale); 949 950 /** 951 * Tell the child that whether it's allowed to render transparent has 952 * changed. See also ParentShowInfo::isTransparent. 953 */ 954 async TransparencyChanged(bool transparent); 955 956 /** 957 * Tell the child that the safe area of widget has changed. 958 * 959 */ 960 async SafeAreaInsetsChanged(LayoutDeviceIntMargin aSafeAreaInsets); 961 962 /** 963 * Tell the browser that its frame loader has been swapped 964 * with another. 965 */ 966 async SwappedWithOtherRemoteLoader(IPCTabContext context); 967 968 /** 969 * A potential accesskey was just pressed. Look for accesskey targets 970 * using the list of provided charCodes. 971 * 972 * @param event keyboard event 973 * @param isTrusted true if triggered by a trusted key event 974 */ 975 async HandleAccessKey(WidgetKeyboardEvent event, 976 uint32_t[] charCodes); 977 978 /** 979 * Tell the child to create a print preview document in this browser, or 980 * to update the existing print preview document with new print settings. 981 * 982 * @param aPrintData The serialized print settings to use to layout the 983 * print preview document. 984 * @param aSourceBrowsingContext Optionally, the browsing context that 985 * contains the document from which the print preview is to be generated. 986 * This should only be passed on the first call. It should not be passed 987 * for any subsequent calls that are made to update the existing print 988 * preview document with a new print settings object. 989 */ 990 async PrintPreview(PrintData aPrintData, 991 MaybeDiscardedBrowsingContext aSourceBrowsingContext) returns (PrintPreviewResultInfo aInfo); 992 993 /** 994 * Inform the print preview document that we're done with it. 995 */ 996 async ExitPrintPreview(); 997 998 /** 999 * Tell the child to print the current page with the given settings. 1000 * 1001 * @param aBrowsingContext the browsing context to print. 1002 * @param aPrintData the serialized settings to print with 1003 * @param aReturnStaticClone If the document in aBrowsingContext is not a static clone, whether 1004 * to return the static document clone created. 1005 * Note that if you call this with true but do not later call PrintClonedPage(), 1006 * you must call DestroyPrintCache() to avoid leaks. 1007 */ 1008 async Print(MaybeDiscardedBrowsingContext aBC, PrintData aPrintData, bool aReturnStaticClone) returns(MaybeDiscardedBrowsingContext staticCloneBrowsingContext); 1009 1010 /** 1011 * Tell the child to print the passed in static clone browsing context with the given settings. 1012 * 1013 * @param aBrowsingContext the browsing context to print. 1014 * @param aPrintData the serialized settings to print with 1015 * @param aStaticCloneBrowsingContext The static clone of aBrowsingContext that 1016 * was created by an earlier call to Print(). This is the page that will actually be 1017 * printed. 1018 */ 1019 async PrintClonedPage(MaybeDiscardedBrowsingContext aBC, PrintData aPrintData, MaybeDiscardedBrowsingContext aStaticCloneBrowsingContext); 1020 1021 /** 1022 * Destroy the static document clone for printing, if present. See Print() for details. 1023 * For callers' simplicity, it is safe to call this method even if aStaticCloneBrowsingContext 1024 * is null or has already been discarded. 1025 * 1026 * @param aStaticCloneBrowsingContext The static clone that was created by 1027 * an earlier call to Print(). 1028 */ 1029 async DestroyPrintClone(MaybeDiscardedBrowsingContext aStaticCloneBrowsingContext); 1030 1031 /** 1032 * Update the child with the tab's current top-level native window handle. 1033 * This is used by a11y objects who must expose their native window. 1034 * 1035 * @param aNewHandle The native window handle of the tab's top-level window. 1036 */ 1037 async UpdateNativeWindowHandle(uintptr_t aNewHandle); 1038 1039 /** 1040 * Tell the BrowserChild to allow scripts in the docshell to close the window. 1041 */ 1042 async AllowScriptsToClose(); 1043 1044 async WillChangeProcess(); 1045 1046 async InvokeChildDragSession( 1047 MaybeDiscardedWindowContext aSourceWindowContext, 1048 MaybeDiscardedWindowContext aSourceTopWindowContext, 1049 nullable nsIPrincipal aPrincipal, 1050 IPCTransferableData[] transfers, uint32_t action); 1051 1052 async UpdateDragSession( 1053 nullable nsIPrincipal aPrincipal, 1054 IPCTransferableData[] transfers, 1055 EventMessage message); 1056 1057 async EndDragSession(bool aDoneDrag, bool aUserCancelled, 1058 LayoutDeviceIntPoint aDragEndPoint, 1059 uint32_t aKeyModifiers, 1060 uint32_t aDropEffect); 1061 1062 /** 1063 * Use a eQueryDropTargetHittest event to obtain the element under aPt. 1064 * Store that in the current drag session for later event targetting. 1065 * Also tell the drag session to hold off on running EndDragSession 1066 * until it is told to resume. 1067 */ 1068 async StoreDropTargetAndDelayEndDragSession( 1069 LayoutDeviceIntPoint aPt, uint32_t aDropEffect, uint32_t aDragAction, 1070 nullable nsIPrincipal aPrincipal, 1071 nullable nsIPolicyContainer aPolicyContainer); 1072 1073 /** 1074 * Send a drop (if aShouldDrop) or dragexit (otherwise) event to the 1075 * recorded drop target and issue any EndDragSession call that was stopped 1076 * by StoreDropTargetAndDelayEndDragSession (if any). 1077 */ 1078 async DispatchToDropTargetAndResumeEndDragSession(bool aShouldDrop, StringHashSet aAllowedFilePaths); 1079 1080 parent: 1081 /** 1082 * Fetches whether this window supports protected media, which is sent back in response. 1083 */ 1084 async IsWindowSupportingProtectedMedia(uint64_t aOuterWindowID) returns(bool isSupported); 1085 1086 /** 1087 * Fetches whether this window supports WebVR, which is sent back in response. 1088 */ 1089 async IsWindowSupportingWebVR(uint64_t aOuterWindowID) returns(bool isSupported); 1090 1091 /** Records a history visit. */ 1092 async VisitURI(nullable nsIURI aURI, nullable nsIURI aLastVisitedURI, uint32_t aFlags, uint64_t aBrowserId); 1093 1094 /** Fetches the visited status for an array of URIs (Android-only). */ 1095 async QueryVisitedState(nullable nsIURI[] aURIs); 1096 1097 /** Create a session store for a browser child. */ 1098 async PSessionStore(); 1099 1100 /** 1101 * Construct a new WindowGlobal for an existing global in the content process 1102 */ 1103 async NewWindowGlobal(ManagedEndpoint<PWindowGlobalParent> aEndpoint, 1104 WindowGlobalInit aInit); 1105 1106 async UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect); 1107 1108 /* 1109 * FIXME: write protocol! 1110 1111 state LIVE: 1112 send LoadURL goto LIVE; 1113 //etc. 1114 send Destroy goto DYING; 1115 1116 state DYING: 1117 discard send blah; 1118 // etc. 1119 recv __delete__; 1120 */ 1121 }; 1122 1123 } 1124 }