diff options
Diffstat (limited to 'Source/WebCore/page/Crypto.h')
-rw-r--r-- | Source/WebCore/page/Crypto.h | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/Source/WebCore/page/Crypto.h b/Source/WebCore/page/Crypto.h index 94eab5678..9b480e054 100644 --- a/Source/WebCore/page/Crypto.h +++ b/Source/WebCore/page/Crypto.h @@ -27,14 +27,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef Crypto_h -#define Crypto_h +#pragma once #include "ContextDestructionObserver.h" -#include <wtf/Forward.h> -#include <wtf/PassRefPtr.h> -#include <wtf/RefCounted.h> -#include <wtf/RefPtr.h> +#include "ExceptionOr.h" namespace JSC { class ArrayBufferView; @@ -42,32 +38,32 @@ class ArrayBufferView; namespace WebCore { -typedef int ExceptionCode; - -class Document; class SubtleCrypto; +class WebKitSubtleCrypto; class Crypto : public ContextDestructionObserver, public RefCounted<Crypto> { public: - static PassRefPtr<Crypto> create(Document& document) { return adoptRef(new Crypto(document)); } + static Ref<Crypto> create(ScriptExecutionContext& context) { return adoptRef(*new Crypto(context)); } virtual ~Crypto(); - Document* document() const; - - void getRandomValues(JSC::ArrayBufferView*, ExceptionCode&); + ExceptionOr<void> getRandomValues(JSC::ArrayBufferView&); #if ENABLE(SUBTLE_CRYPTO) - SubtleCrypto* subtle(); + SubtleCrypto& subtle(); + + // Will be deprecated. + ExceptionOr<WebKitSubtleCrypto&> webkitSubtle(); #endif private: - Crypto(Document&); + Crypto(ScriptExecutionContext&); #if ENABLE(SUBTLE_CRYPTO) - RefPtr<SubtleCrypto> m_subtle; + Ref<SubtleCrypto> m_subtle; + + // Will be deprecated. + RefPtr<WebKitSubtleCrypto> m_webkitSubtle; #endif }; } - -#endif |