Bug 1472338: part 1) Add Chrome tests for the async Clipboard API. r=NeilDeakin
[gecko.git] / dom / locks / LockManagerChild.h
blob00bc0e8ddb6b20a2401e2f08b48b1f1e55c5f8e0
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_LOCKS_LOCKMANAGERCHILD_H_
8 #define DOM_LOCKS_LOCKMANAGERCHILD_H_
10 #include "mozilla/dom/locks/PLockManagerChild.h"
11 #include "mozilla/dom/Promise.h"
12 #include "nsIUUIDGenerator.h"
14 namespace mozilla::dom::locks {
16 struct LockRequest;
18 class LockManagerChild final : public PLockManagerChild {
19 public:
20 NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(LockManagerChild)
21 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(LockManagerChild)
23 static void NotifyBFCacheOnMainThread(nsPIDOMWindowInner* aInner,
24 bool aCreated);
26 explicit LockManagerChild(nsIGlobalObject* aOwner) : mOwner(aOwner){};
28 nsIGlobalObject* GetParentObject() const { return mOwner; };
30 void RequestLock(const LockRequest& aRequest, const LockOptions& aOptions);
32 void NotifyRequestDestroy() const;
34 void NotifyToWindow(bool aCreated) const;
36 private:
37 ~LockManagerChild() = default;
39 nsCOMPtr<nsIGlobalObject> mOwner;
42 } // namespace mozilla::dom::locks
44 #endif // DOM_LOCKS_LOCKMANAGERCHILD_H_