Index: public/platform/WebCryptoKeyAlgorithm.h |
diff --git a/public/platform/WebPrerender.h b/public/platform/WebCryptoKeyAlgorithm.h |
similarity index 51% |
copy from public/platform/WebPrerender.h |
copy to public/platform/WebCryptoKeyAlgorithm.h |
index eb77bf9e1662a862698aa469b2c96620bab0dd94..d35e71561d9c68c62c65385d66d6a11f7ca2c025 100644 |
--- a/public/platform/WebPrerender.h |
+++ b/public/platform/WebCryptoKeyAlgorithm.h |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2012 Google Inc. All rights reserved. |
+ * Copyright (C) 2014 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -28,74 +28,66 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef WebPrerender_h |
-#define WebPrerender_h |
+#ifndef WebCryptoKeyAlgorithm_h |
+#define WebCryptoKeyAlgorithm_h |
#include "WebCommon.h" |
+#include "WebCryptoAlgorithm.h" |
+#include "WebCryptoKeyAlgorithmParams.h" |
#include "WebPrivatePtr.h" |
-#include "WebReferrerPolicy.h" |
-#include "WebString.h" |
-#include "WebURL.h" |
#if INSIDE_BLINK |
-#include "wtf/PassRefPtr.h" |
+#include "wtf/PassOwnPtr.h" |
#endif |
-namespace WebCore { |
-class Prerender; |
-} |
- |
namespace blink { |
-// WebPrerenderRelType is a bitfield since multiple rel attributes can be set on the same prerender. |
-enum WebPrerenderRelType { |
- PrerenderRelTypePrerender = 0x1, |
- PrerenderRelTypeNext = 0x2, |
-}; |
+class WebCryptoKeyAlgorithmPrivate; |
-class WebPrerender { |
+// WebCryptoKeyAlgorithm represents the algorithm used to generate a key. |
+// * Immutable |
+// * Threadsafe |
+// * Copiable (cheaply) |
+class WebCryptoKeyAlgorithm { |
public: |
- class ExtraData { |
- public: |
- virtual ~ExtraData() { } |
- }; |
- |
- ~WebPrerender() { reset(); } |
- WebPrerender() { } |
- WebPrerender(const WebPrerender& other) { assign(other); } |
- WebPrerender& operator=(const WebPrerender& other) |
+ WebCryptoKeyAlgorithm() { } |
+ |
+#if INSIDE_BLINK |
+ BLINK_PLATFORM_EXPORT WebCryptoKeyAlgorithm(WebCryptoAlgorithmId, PassOwnPtr<WebCryptoKeyAlgorithmParams>); |
+#endif |
+ |
+ BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm adoptParamsAndCreate(WebCryptoAlgorithmId, WebCryptoKeyAlgorithmParams*); |
+ |
+ ~WebCryptoKeyAlgorithm() { reset(); } |
+ |
+ WebCryptoKeyAlgorithm(const WebCryptoKeyAlgorithm& other) { assign(other); } |
+ WebCryptoKeyAlgorithm& operator=(const WebCryptoKeyAlgorithm& other) |
{ |
assign(other); |
return *this; |
} |
-#if INSIDE_BLINK |
- BLINK_PLATFORM_EXPORT explicit WebPrerender(PassRefPtr<WebCore::Prerender>); |
- |
- BLINK_PLATFORM_EXPORT const WebCore::Prerender* toPrerender() const; |
-#endif |
- |
- BLINK_PLATFORM_EXPORT void reset(); |
- BLINK_PLATFORM_EXPORT void assign(const WebPrerender&); |
BLINK_PLATFORM_EXPORT bool isNull() const; |
- BLINK_PLATFORM_EXPORT WebURL url() const; |
- BLINK_PLATFORM_EXPORT WebString referrer() const; |
- BLINK_PLATFORM_EXPORT unsigned relTypes() const; |
- BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const; |
+ BLINK_PLATFORM_EXPORT WebCryptoAlgorithmId id() const; |
- BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); |
- BLINK_PLATFORM_EXPORT const ExtraData* extraData() const; |
+ BLINK_PLATFORM_EXPORT WebCryptoKeyAlgorithmParamsType paramsType() const; |
- BLINK_PLATFORM_EXPORT void didStartPrerender(); |
- BLINK_PLATFORM_EXPORT void didStopPrerender(); |
- BLINK_PLATFORM_EXPORT void didSendLoadForPrerender(); |
- BLINK_PLATFORM_EXPORT void didSendDOMContentLoadedForPrerender(); |
+ // Returns the type-specific parameters for this key. If the requested |
+ // parameters are not applicable (for instance an HMAC key does not have |
+ // any AES parameters) then returns 0. |
+ BLINK_PLATFORM_EXPORT WebCryptoAesKeyAlgorithmParams* aesParams() const; |
+ BLINK_PLATFORM_EXPORT WebCryptoHmacKeyAlgorithmParams* hmacParams() const; |
+ BLINK_PLATFORM_EXPORT WebCryptoRsaKeyAlgorithmParams* rsaParams() const; |
+ BLINK_PLATFORM_EXPORT WebCryptoRsaHashedKeyAlgorithmParams* rsaHashedParams() const; |
private: |
- WebPrivatePtr<WebCore::Prerender> m_private; |
+ BLINK_PLATFORM_EXPORT void assign(const WebCryptoKeyAlgorithm& other); |
+ BLINK_PLATFORM_EXPORT void reset(); |
+ |
+ WebPrivatePtr<WebCryptoKeyAlgorithmPrivate> m_private; |
}; |
} // namespace blink |
-#endif // WebPrerender_h |
+#endif |