Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Unified Diff: public/platform/WebCryptoKeyAlgorithm.h

Issue 179353002: [webcrypto] Add the KeyAlgorithm interface. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase yet again (another conflict) Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « public/platform/WebCryptoKey.h ('k') | public/platform/WebCryptoKeyAlgorithmParams.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « public/platform/WebCryptoKey.h ('k') | public/platform/WebCryptoKeyAlgorithmParams.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698