mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1532795: Part 4 - Add helper to get BrowsingContext from WindowProxy. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D35377 --HG-- extra : rebase_source : 42022b7759d70aee7733f9c24b1828e7441d4581
This commit is contained in:
parent
a66227f3cc
commit
00a255e541
@ -85,6 +85,12 @@ already_AddRefed<BrowsingContext> BrowsingContext::Get(uint64_t aId) {
|
||||
return do_AddRef(sBrowsingContexts->Get(aId));
|
||||
}
|
||||
|
||||
/* static */
|
||||
already_AddRefed<BrowsingContext> BrowsingContext::GetFromWindow(
|
||||
WindowProxyHolder& aProxy) {
|
||||
return do_AddRef(aProxy.get());
|
||||
}
|
||||
|
||||
CanonicalBrowsingContext* BrowsingContext::Canonical() {
|
||||
return CanonicalBrowsingContext::Cast(this);
|
||||
}
|
||||
|
@ -105,6 +105,13 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {
|
||||
return Get(aId);
|
||||
}
|
||||
|
||||
static already_AddRefed<BrowsingContext> GetFromWindow(
|
||||
WindowProxyHolder& aProxy);
|
||||
static already_AddRefed<BrowsingContext> GetFromWindow(
|
||||
GlobalObject&, WindowProxyHolder& aProxy) {
|
||||
return GetFromWindow(aProxy);
|
||||
}
|
||||
|
||||
// Create a brand-new BrowsingContext object.
|
||||
static already_AddRefed<BrowsingContext> Create(BrowsingContext* aParent,
|
||||
BrowsingContext* aOpener,
|
||||
|
@ -9,6 +9,8 @@ interface nsIDocShell;
|
||||
interface BrowsingContext {
|
||||
static BrowsingContext? get(unsigned long long aId);
|
||||
|
||||
static BrowsingContext? getFromWindow(WindowProxy window);
|
||||
|
||||
BrowsingContext? findChildWithName(DOMString name);
|
||||
BrowsingContext? findWithName(DOMString name);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user