/src/mozilla-central/dom/clients/api/Clients.h
Line | Count | Source (jump to first uncovered line) |
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 |
8 | | |
9 | | #include "nsCOMPtr.h" |
10 | | #include "nsISupports.h" |
11 | | #include "nsWrapperCache.h" |
12 | | |
13 | | class nsIGlobalObject; |
14 | | |
15 | | namespace mozilla { |
16 | | |
17 | | class ErrorResult; |
18 | | |
19 | | namespace dom { |
20 | | |
21 | | struct ClientQueryOptions; |
22 | | class Promise; |
23 | | |
24 | | class Clients final : public nsISupports |
25 | | , public nsWrapperCache |
26 | | { |
27 | | nsCOMPtr<nsIGlobalObject> mGlobal; |
28 | | |
29 | 0 | ~Clients() = default; |
30 | | |
31 | | public: |
32 | | explicit Clients(nsIGlobalObject* aGlobal); |
33 | | |
34 | | // nsWrapperCache interface methods |
35 | | JSObject* |
36 | | WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
37 | | |
38 | | // DOM bindings methods |
39 | | nsIGlobalObject* |
40 | | GetParentObject() const; |
41 | | |
42 | | already_AddRefed<Promise> |
43 | | Get(const nsAString& aClientID, ErrorResult& aRv); |
44 | | |
45 | | already_AddRefed<Promise> |
46 | | MatchAll(const ClientQueryOptions& aOptions, ErrorResult& aRv); |
47 | | |
48 | | already_AddRefed<Promise> |
49 | | OpenWindow(const nsAString& aURL, ErrorResult& aRv); |
50 | | |
51 | | already_AddRefed<Promise> |
52 | | Claim(ErrorResult& aRv); |
53 | | |
54 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
55 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Clients) |
56 | | }; |
57 | | |
58 | | } // namespace dom |
59 | | } // namespace mozilla |
60 | | |
61 | | #endif // _mozilla_dom_Clients_h |