dom/ipc/PBrowserBridge.ipdl
author Tim Huang <tihuang@mozilla.com>
Tue, 19 May 2020 20:22:34 +0000
changeset 530950 5cf6e62ea26befe090114c51306f69a7fbb56a14
parent 527747 3c7cfcd7e08a7a8f7ea1d95a4cd889c584446b33
child 532054 ff9e48641bc68bd55dd7888f73395ff3f7dc093f
permissions -rw-r--r--
Bug 1639195 - Part 1: Make BrowserChild::RecvLoadURL() to use the correct triggering princpal. r=ckerschb,mattwoodrow This patch makes the triggering princpal to be propagated to the BrowserChild when calling LoadURL in nsFrameLoader. And use it as the triggering principal for loading instead of the system principal. Differential Revision: https://phabricator.services.mozilla.com/D75965

/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PBrowser;
#ifdef ACCESSIBILITY
include protocol PDocAccessible;
#endif

include DOMTypes;

using mozilla::layers::LayersObserverEpoch from "mozilla/layers/LayersTypes.h";
using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h";
using mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
using mozilla::a11y::IDispatchHolder from "mozilla/a11y/IPCTypes.h";
using mozilla::dom::EffectsInfo from "mozilla/dom/TabMessageUtils.h";
using mozilla::ScrollAxis from "mozilla/PresShellForwards.h";
using mozilla::ScrollFlags from "mozilla/PresShellForwards.h";
using struct nsRect from "nsRect.h";
using CallerType from "mozilla/dom/BindingDeclarations.h";
using nsIntRect from "nsRect.h";
using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageUtils.h";

namespace mozilla {
namespace dom {

/**
 * A PBrowserBridge connects an iframe/browser in a content process to the
 * PBrowser that manages the embedded content.
 *
 * See `dom/docs/Fission-IPC-Diagram.svg` for an overview of the DOM IPC
 * actors.
 */
async refcounted protocol PBrowserBridge {
  manager PBrowser;

child:
  async SetLayersId(LayersId layersId);

  /**
   * Request that the IPC child / Web parent process move focus to the
   * browser's frame. If canRaise is true, the window can be raised if
   * it is inactive.
   */
  async RequestFocus(bool canRaise, CallerType aCallerType);

  /**
   * When IPC parent / Web child sends this message, the IPC child / Web parent
   * should move focus to the next or previous focusable element or document.
   */
  async MoveFocus(bool forward, bool forDocumentNavigation);

  /**
   * Send the child the COM proxy for the embedded document accessible.
   */
  async SetEmbeddedDocAccessibleCOMProxy(IDispatchHolder aCOMProxy);

  /**
   * Called once this PBrowserBridge's OOP subdoc no longer blocks its
   * embedding element's and embedding doc's 'load' events.
   */
  async MaybeFireEmbedderLoadEvents(EmbedderElementEventType aFireEventAtEmbeddingElement);

  async ScrollRectIntoView(nsRect aRect, ScrollAxis aVertical,
                           ScrollAxis aHorizontal, ScrollFlags aScrollFlags,
                           int32_t aAppUnitsPerDevPixel);

  async SubFrameCrashed();

  async AddBlockedNodeByClassifier();

parent:
  // Destroy the remote web browser due to the nsFrameLoader going away.
  async __delete__();

  // DocShell messaging.
  async LoadURL(nsCString aSpec, nsIPrincipal aTriggeringPrincipal);
  async ResumeLoad(uint64_t aPendingSwitchID);

  // Out of process rendering.
  async Show(OwnerShowInfo info);
  async ScrollbarPreferenceChanged(ScrollbarPreference pref);
  async UpdateDimensions(nsIntRect rect, ScreenIntSize size) compressall;
  async RenderLayers(bool aEnabled, LayersObserverEpoch aEpoch);

  async UpdateEffects(EffectsInfo aEffects);

  /**
   * Navigate by key (Tab/Shift+Tab/F6/Shift+f6).
   */
  async NavigateByKey(bool aForward, bool aForDocumentNavigation);

  /**
   * Dispatch the given synthesized mousemove event to the child.
   */
  async DispatchSynthesizedMouseEvent(WidgetMouseEvent event);

  /**
   * Sending an activate message moves focus to the iframe.
   */
  async Activate();

  async Deactivate(bool aWindowLowering);

  async SetIsUnderHiddenEmbedderElement(bool aIsUnderHiddenEmbedderElement);

  async WillChangeProcess();

#ifdef ACCESSIBILITY
  /**
   * Tell the parent the accessible for this iframe's embedder
   * OuterDocAccessible.
   * aDoc is the actor for the containing document.
   * aID is the unique id of the embedder accessible within that document.
   */
  async SetEmbedderAccessible(PDocAccessible aDoc, uint64_t aID);
#endif
};

}  // namespace dom
}  // namespace mozilla