mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 14:25:49 +00:00
Bug 1542782 - Expose currentRemoteType on CanonicalBrowsingContext, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D26550 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
91f0500959
commit
c5ed431446
@ -65,6 +65,23 @@ ContentParent* CanonicalBrowsingContext::GetContentParent() const {
|
||||
return cpm->GetContentProcessById(ContentParentId(mProcessId));
|
||||
}
|
||||
|
||||
void CanonicalBrowsingContext::GetCurrentRemoteType(nsAString& aRemoteType,
|
||||
ErrorResult& aRv) const {
|
||||
// If we're in the parent process, dump out the void string.
|
||||
if (mProcessId == 0) {
|
||||
aRemoteType.Assign(VoidString());
|
||||
return;
|
||||
}
|
||||
|
||||
ContentParent* cp = GetContentParent();
|
||||
if (!cp) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
aRemoteType.Assign(cp->GetRemoteType());
|
||||
}
|
||||
|
||||
void CanonicalBrowsingContext::GetWindowGlobals(
|
||||
nsTArray<RefPtr<WindowGlobalParent>>& aWindows) {
|
||||
aWindows.SetCapacity(mWindowGlobals.Count());
|
||||
|
@ -36,6 +36,8 @@ class CanonicalBrowsingContext final : public BrowsingContext {
|
||||
uint64_t OwnerProcessId() const { return mProcessId; }
|
||||
ContentParent* GetContentParent() const;
|
||||
|
||||
void GetCurrentRemoteType(nsAString& aRemoteType, ErrorResult& aRv) const;
|
||||
|
||||
void SetOwnerProcessId(uint64_t aProcessId) { mProcessId = aProcessId; }
|
||||
|
||||
void GetWindowGlobals(nsTArray<RefPtr<WindowGlobalParent>>& aWindows);
|
||||
|
@ -33,6 +33,12 @@ interface CanonicalBrowsingContext : BrowsingContext {
|
||||
|
||||
readonly attribute WindowGlobalParent? currentWindowGlobal;
|
||||
|
||||
// XXX(nika): This feels kinda hacky, but will do for now while we don't
|
||||
// synchronously create WindowGlobalParent. It can throw if somehow the
|
||||
// content process has died.
|
||||
[Throws]
|
||||
readonly attribute DOMString? currentRemoteType;
|
||||
|
||||
void notifyStartDelayedAutoplayMedia();
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user