Bug 1550519 - Show a translucent parent highlight when a subgrid is highlighted....
[gecko.git] / dom / base / Crypto.h
blob5deaaf540c77a9f1a255c2a3c8420c2957d2451c
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/. */
6 #ifndef mozilla_dom_Crypto_h
7 #define mozilla_dom_Crypto_h
9 #include "mozilla/dom/SubtleCrypto.h"
10 #include "nsIGlobalObject.h"
12 #include "nsWrapperCache.h"
13 #include "mozilla/dom/TypedArray.h"
15 namespace mozilla {
17 class ErrorResult;
19 namespace dom {
21 class Crypto final : public nsISupports, public nsWrapperCache {
22 protected:
23 virtual ~Crypto();
25 public:
26 explicit Crypto(nsIGlobalObject* aParent);
28 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
29 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Crypto)
31 void GetRandomValues(JSContext* aCx, const ArrayBufferView& aArray,
32 JS::MutableHandle<JSObject*> aRetval, ErrorResult& aRv);
34 SubtleCrypto* Subtle();
36 nsIGlobalObject* GetParentObject() const { return mParent; }
38 virtual JSObject* WrapObject(JSContext* aCx,
39 JS::Handle<JSObject*> aGivenProto) override;
41 private:
42 nsCOMPtr<nsIGlobalObject> mParent;
43 RefPtr<SubtleCrypto> mSubtle;
46 } // namespace dom
47 } // namespace mozilla
49 #endif // mozilla_dom_Crypto_h