Bug 1639230: Remove vendor prefix for printing with webdriver r=jgraham,webdriver...
[gecko.git] / dom / ipc / WindowGlobalActor.h
blob55172d20bbe958e0521501125ebce8f607522077
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 "mozilla/ErrorResult.h"
14 #include "nsIURI.h"
15 #include "nsString.h"
16 #include "mozilla/dom/JSActor.h"
18 namespace mozilla {
19 namespace dom {
21 // Common base class for WindowGlobal{Parent, Child}.
22 class WindowGlobalActor : public nsISupports {
23 public:
24 // Called to determine initial state for a window global actor created for an
25 // initial about:blank document.
26 static WindowGlobalInit AboutBlankInitializer(
27 dom::BrowsingContext* aBrowsingContext, nsIPrincipal* aPrincipal);
29 // Called to determine initial state for a window global actor created for a
30 // specific existing nsGlobalWindowInner.
31 static WindowGlobalInit WindowInitializer(nsGlobalWindowInner* aWindow);
33 protected:
34 virtual ~WindowGlobalActor() = default;
36 // Load the module for the named Window Actor and contruct it.
37 // This method will not initialize the actor or set its manager,
38 // which is handled by callers.
39 void ConstructActor(const nsACString& aName, JS::MutableHandleObject aActor,
40 ErrorResult& aRv);
41 virtual nsIURI* GetDocumentURI() = 0;
42 virtual const nsAString& GetRemoteType() = 0;
43 virtual JSActor::Type GetSide() = 0;
44 virtual dom::BrowsingContext* BrowsingContext() = 0;
46 static WindowGlobalInit BaseInitializer(
47 dom::BrowsingContext* aBrowsingContext, uint64_t aInnerWindowId,
48 uint64_t aOuterWindowId);
51 } // namespace dom
52 } // namespace mozilla
54 #endif // mozilla_dom_WindowGlobalActor_h