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

Unified Diff: third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h

Issue 2160943003: Transfer WebCrypto databuffers across the Blink API using blink::WebVector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 | « third_party/WebKit/public/platform/WebCrypto.h ('k') | third_party/WebKit/public/platform/WebVector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h
diff --git a/third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h b/third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h
index 335a8306bc95fdeb8f345838ec273ce64d8036fd..96a41f45460cd8ab0277444155e5e2a412d36919 100644
--- a/third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h
+++ b/third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h
@@ -60,8 +60,8 @@ public:
class WebCryptoAesCbcParams : public WebCryptoAlgorithmParams {
public:
- WebCryptoAesCbcParams(const unsigned char* iv, unsigned ivSize)
- : m_iv(iv, ivSize)
+ explicit WebCryptoAesCbcParams(WebVector<unsigned char> iv)
+ : m_iv(std::move(iv))
{
}
@@ -89,9 +89,9 @@ private:
class WebCryptoAesCtrParams : public WebCryptoAlgorithmParams {
public:
- WebCryptoAesCtrParams(unsigned char lengthBits, const unsigned char* counter, unsigned counterSize)
+ WebCryptoAesCtrParams(unsigned char lengthBits, WebVector<unsigned char> counter)
: WebCryptoAlgorithmParams()
- , m_counter(counter, counterSize)
+ , m_counter(std::move(counter))
, m_lengthBits(lengthBits)
{
}
@@ -173,14 +173,14 @@ private:
class WebCryptoAesGcmParams : public WebCryptoAlgorithmParams {
public:
- WebCryptoAesGcmParams(const unsigned char* iv, unsigned ivSize, bool hasAdditionalData, const unsigned char* additionalData, unsigned additionalDataSize, bool hasTagLengthBits, unsigned char tagLengthBits)
- : m_iv(iv, ivSize)
+ WebCryptoAesGcmParams(WebVector<unsigned char> iv, bool hasAdditionalData, WebVector<unsigned char> additionalData, bool hasTagLengthBits, unsigned char tagLengthBits)
+ : m_iv(std::move(iv))
, m_hasAdditionalData(hasAdditionalData)
- , m_optionalAdditionalData(additionalData, additionalDataSize)
+ , m_optionalAdditionalData(std::move(additionalData))
, m_hasTagLengthBits(hasTagLengthBits)
, m_optionalTagLengthBits(tagLengthBits)
{
- DCHECK(hasAdditionalData || !additionalDataSize);
+ DCHECK(hasAdditionalData || m_optionalAdditionalData.isEmpty());
DCHECK(hasTagLengthBits || !tagLengthBits);
}
@@ -214,9 +214,9 @@ public:
class WebCryptoRsaHashedKeyGenParams : public WebCryptoAlgorithmParams {
public:
- explicit WebCryptoRsaHashedKeyGenParams(const WebCryptoAlgorithm& hash, unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize)
+ WebCryptoRsaHashedKeyGenParams(const WebCryptoAlgorithm& hash, unsigned modulusLengthBits, WebVector<unsigned char> publicExponent)
: m_modulusLengthBits(modulusLengthBits)
- , m_publicExponent(publicExponent, publicExponentSize)
+ , m_publicExponent(std::move(publicExponent))
, m_hash(hash)
{
DCHECK(!hash.isNull());
@@ -252,11 +252,11 @@ private:
class WebCryptoRsaOaepParams : public WebCryptoAlgorithmParams {
public:
- WebCryptoRsaOaepParams(bool hasLabel, const unsigned char* label, unsigned labelSize)
+ WebCryptoRsaOaepParams(bool hasLabel, WebVector<unsigned char> label)
: m_hasLabel(hasLabel)
- , m_optionalLabel(label, labelSize)
+ , m_optionalLabel(std::move(label))
{
- DCHECK(hasLabel || !labelSize);
+ DCHECK(hasLabel || m_optionalLabel.isEmpty());
}
virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeRsaOaepParams; }
@@ -356,10 +356,10 @@ private:
class WebCryptoHkdfParams : public WebCryptoAlgorithmParamsWithHash {
public:
- WebCryptoHkdfParams(const WebCryptoAlgorithm& hash, const unsigned char* salt, unsigned saltSize, const unsigned char* info, unsigned infoSize)
+ WebCryptoHkdfParams(const WebCryptoAlgorithm& hash, WebVector<unsigned char> salt, WebVector<unsigned char> info)
: WebCryptoAlgorithmParamsWithHash(hash)
- , m_salt(salt, saltSize)
- , m_info(info, infoSize)
+ , m_salt(std::move(salt))
+ , m_info(std::move(info))
{
}
@@ -379,9 +379,9 @@ private:
class WebCryptoPbkdf2Params : public WebCryptoAlgorithmParamsWithHash {
public:
- WebCryptoPbkdf2Params(const WebCryptoAlgorithm& hash, const unsigned char* salt, unsigned saltLength, unsigned iterations)
+ WebCryptoPbkdf2Params(const WebCryptoAlgorithm& hash, WebVector<unsigned char> salt, unsigned iterations)
: WebCryptoAlgorithmParamsWithHash(hash)
- , m_salt(salt, saltLength)
+ , m_salt(std::move(salt))
, m_iterations(iterations)
{
}
« no previous file with comments | « third_party/WebKit/public/platform/WebCrypto.h ('k') | third_party/WebKit/public/platform/WebVector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698