Commit ea567d2c authored by Ryan Hunt's avatar Ryan Hunt
Browse files

Bug 1519546, part 4 - Wire up basic EffectsInfo updates in DOM IPC. r=farre

This commit adds RemoteBrowser::UpdateEffects for updating a remote browser's
EffectsInfo over IPC.

A following commit will actually use the EffectsInfo for
enabling/disabling rendering for a remote browser, and another
commit will actually use these IPDL methods.

Differential Revision: https://phabricator.services.mozilla.com/D31472

--HG--
extra : rebase_source : 304d843d2c4a35f468aa847ee66005a932bb7eb2
extra : intermediate-source : d31b7d33efc711fb8115663f4cfc5bc98fd58d73
extra : source : 5aea122dea2120efe107c639b17678e0464b1389
parent 40069aeb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2784,6 +2784,10 @@ bool nsFrameLoader::IsRemoteFrame() {
  return false;
}

RemoteBrowser* nsFrameLoader::GetRemoteBrowser() const {
  return mRemoteBrowser;
}

BrowserParent* nsFrameLoader::GetBrowserParent() const {
  if (!mRemoteBrowser) {
    return nullptr;
+2 −0
Original line number Diff line number Diff line
@@ -312,6 +312,8 @@ class nsFrameLoader final : public nsStubMutationObserver,
   */
  bool IsRemoteFrame();

  mozilla::dom::RemoteBrowser* GetRemoteBrowser() const;

  /**
   * Returns the IPDL actor used if this is a top-level remote browser, or null
   * otherwise.
+10 −0
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@

#include "mozilla/dom/BrowserBridgeHost.h"

#include "mozilla/Unused.h"

namespace mozilla {
namespace dom {

@@ -97,5 +99,13 @@ void BrowserBridgeHost::UpdateDimensions(const nsIntRect& aRect,
  Unused << mBridge->SendUpdateDimensions(di);
}

void BrowserBridgeHost::UpdateEffects(EffectsInfo aEffects) {
  if (!mBridge || mEffectsInfo == aEffects) {
    return;
  }
  mEffectsInfo = aEffects;
  Unused << mBridge->SendUpdateEffects(mEffectsInfo);
}

}  // namespace dom
}  // namespace mozilla
+3 −0
Original line number Diff line number Diff line
@@ -50,11 +50,14 @@ class BrowserBridgeHost : public RemoteBrowser {
  void UpdateDimensions(const nsIntRect& aRect,
                        const ScreenIntSize& aSize) override;

  void UpdateEffects(EffectsInfo aInfo) override;

 private:
  virtual ~BrowserBridgeHost() = default;

  // The IPDL actor for proxying browser operations
  RefPtr<BrowserBridgeChild> mBridge;
  EffectsInfo mEffectsInfo;
};

}  // namespace dom
+5 −0
Original line number Diff line number Diff line
@@ -154,6 +154,11 @@ IPCResult BrowserBridgeParent::RecvUpdateDimensions(
  return IPC_OK();
}

IPCResult BrowserBridgeParent::RecvUpdateEffects(const EffectsInfo& aEffects) {
  Unused << mBrowserParent->SendUpdateEffects(aEffects);
  return IPC_OK();
}

IPCResult BrowserBridgeParent::RecvRenderLayers(
    const bool& aEnabled, const bool& aForceRepaint,
    const layers::LayersObserverEpoch& aEpoch) {
Loading