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_WindowGlobalActor_h
8 #define mozilla_dom_WindowGlobalActor_h
10 #include "nsWrapperCache.h"
11 #include "nsISupports.h"
12 #include "mozilla/dom/BrowsingContext.h"
15 #include "mozilla/dom/JSActor.h"
16 #include "mozilla/dom/JSActorManager.h"
17 #include "mozilla/dom/WindowGlobalTypes.h"
24 // Common base class for WindowGlobal{Parent, Child}.
25 class WindowGlobalActor
: public JSActorManager
{
27 // Called to determine initial state for a window global actor created for an
28 // initial about:blank document.
29 static WindowGlobalInit
AboutBlankInitializer(
30 dom::BrowsingContext
* aBrowsingContext
, nsIPrincipal
* aPrincipal
);
32 // Called to determine initial state for a window global actor created for a
33 // specific existing nsGlobalWindowInner.
34 static WindowGlobalInit
WindowInitializer(nsGlobalWindowInner
* aWindow
);
37 virtual ~WindowGlobalActor() = default;
39 already_AddRefed
<JSActorProtocol
> MatchingJSActorProtocol(
40 JSActorService
* aActorSvc
, const nsACString
& aName
,
41 ErrorResult
& aRv
) final
;
43 virtual nsIURI
* GetDocumentURI() = 0;
44 virtual const nsACString
& GetRemoteType() = 0;
45 virtual dom::BrowsingContext
* BrowsingContext() = 0;
47 static WindowGlobalInit
BaseInitializer(
48 dom::BrowsingContext
* aBrowsingContext
, uint64_t aInnerWindowId
,
49 uint64_t aOuterWindowId
);
53 } // namespace mozilla
55 #endif // mozilla_dom_WindowGlobalActor_h