no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / dom / ipc / BrowserBridgeHost.h
blob09f2f4dfdd06b8bb91bdbe899e5df91c2a9206e9
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_BrowserBridgeHost_h
8 #define mozilla_dom_BrowserBridgeHost_h
10 #include "mozilla/dom/RemoteBrowser.h"
11 #include "mozilla/dom/BrowserBridgeChild.h"
13 namespace mozilla::dom {
15 /**
16 * BrowserBridgeHost manages a remote browser from a content process.
18 * It is used via the RemoteBrowser interface in nsFrameLoader and proxies
19 * work to the chrome process via PBrowserBridge.
21 * See `dom/docs/Fission-IPC-Diagram.svg` for an overview of the DOM IPC
22 * actors.
24 class BrowserBridgeHost : public RemoteBrowser {
25 public:
26 typedef mozilla::layers::LayersId LayersId;
28 explicit BrowserBridgeHost(BrowserBridgeChild* aChild);
30 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
31 NS_DECL_CYCLE_COLLECTION_CLASS(BrowserBridgeHost)
33 // Get the IPDL actor for the BrowserBridgeChild.
34 BrowserBridgeChild* GetActor() { return mBridge; }
36 BrowserHost* AsBrowserHost() override { return nullptr; }
37 BrowserBridgeHost* AsBrowserBridgeHost() override { return this; }
39 TabId GetTabId() const override;
40 LayersId GetLayersId() const override;
41 BrowsingContext* GetBrowsingContext() const override;
42 nsILoadContext* GetLoadContext() const override;
43 bool CanRecv() const override;
45 void LoadURL(nsDocShellLoadState* aLoadState) override;
46 void ResumeLoad(uint64_t aPendingSwitchId) override;
47 void DestroyStart() override;
48 void DestroyComplete() override;
50 bool Show(const OwnerShowInfo&) override;
51 void UpdateDimensions(const nsIntRect& aRect,
52 const ScreenIntSize& aSize) override;
54 void UpdateEffects(EffectsInfo aInfo) override;
56 private:
57 virtual ~BrowserBridgeHost() = default;
59 already_AddRefed<nsIWidget> GetWidget() const;
61 // The IPDL actor for proxying browser operations
62 RefPtr<BrowserBridgeChild> mBridge;
63 EffectsInfo mEffectsInfo;
66 } // namespace mozilla::dom
68 #endif // mozilla_dom_BrowserBridgeHost_h