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/. */
6 #ifndef _mozilla_dom_Clients_h
7 #define _mozilla_dom_Clients_h
10 #include "nsISupports.h"
11 #include "nsWrapperCache.h"
13 class nsIGlobalObject
;
21 struct ClientQueryOptions
;
24 class Clients final
: public nsISupports
, public nsWrapperCache
{
25 nsCOMPtr
<nsIGlobalObject
> mGlobal
;
30 explicit Clients(nsIGlobalObject
* aGlobal
);
32 // nsWrapperCache interface methods
33 JSObject
* WrapObject(JSContext
* aCx
,
34 JS::Handle
<JSObject
*> aGivenProto
) override
;
36 // DOM bindings methods
37 nsIGlobalObject
* GetParentObject() const;
39 already_AddRefed
<Promise
> Get(const nsAString
& aClientID
, ErrorResult
& aRv
);
41 already_AddRefed
<Promise
> MatchAll(const ClientQueryOptions
& aOptions
,
44 already_AddRefed
<Promise
> OpenWindow(const nsAString
& aURL
, ErrorResult
& aRv
);
46 already_AddRefed
<Promise
> Claim(ErrorResult
& aRv
);
48 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
49 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Clients
)
53 } // namespace mozilla
55 #endif // _mozilla_dom_Clients_h