no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / dom / ipc / WindowGlobalActor.h
blob7ab19c292ecc13aea3ae1a838ffbfeac7da7aa6c
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"
13 #include "nsIURI.h"
14 #include "nsString.h"
15 #include "mozilla/dom/JSActor.h"
16 #include "mozilla/dom/JSActorManager.h"
17 #include "mozilla/dom/WindowGlobalTypes.h"
19 namespace mozilla {
20 class ErrorResult;
22 namespace dom {
24 // Common base class for WindowGlobal{Parent, Child}.
25 class WindowGlobalActor : public JSActorManager {
26 public:
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);
36 protected:
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);
52 } // namespace dom
53 } // namespace mozilla
55 #endif // mozilla_dom_WindowGlobalActor_h