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

Unified Diff: public/platform/WebCryptoAlgorithmParams.h

Issue 44993003: [webcrypto] Make WebCryptoAlgorithm "nullable". (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/WebCryptoAlgorithm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebCryptoAlgorithmParams.h
diff --git a/public/platform/WebCryptoAlgorithmParams.h b/public/platform/WebCryptoAlgorithmParams.h
index ed3d54075b98c77a3410c91bd17ec65018e69646..4ba14a31379d9be824ed3dfd6b191b14f443d649 100644
--- a/public/platform/WebCryptoAlgorithmParams.h
+++ b/public/platform/WebCryptoAlgorithmParams.h
@@ -56,7 +56,7 @@ public:
WebCryptoAlgorithmParamsType type() const { return m_type; }
private:
- WebCryptoAlgorithmParamsType m_type;
+ const WebCryptoAlgorithmParamsType m_type;
};
class WebCryptoAesCbcParams : public WebCryptoAlgorithmParams {
@@ -93,12 +93,13 @@ public:
: WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeHmacParams)
, m_hash(hash)
{
+ BLINK_ASSERT(!hash.isNull());
}
const WebCryptoAlgorithm& hash() const { return m_hash; }
private:
- WebCryptoAlgorithm m_hash;
+ const WebCryptoAlgorithm m_hash;
};
class WebCryptoHmacKeyParams : public WebCryptoAlgorithmParams {
@@ -109,6 +110,7 @@ public:
, m_hasLength(hasLength)
, m_length(length)
{
+ BLINK_ASSERT(!hash.isNull());
}
const WebCryptoAlgorithm& hash() const { return m_hash; }
@@ -124,9 +126,9 @@ public:
}
private:
- WebCryptoAlgorithm m_hash;
- bool m_hasLength;
- unsigned m_length;
+ const WebCryptoAlgorithm m_hash;
+ const bool m_hasLength;
+ const unsigned m_length;
};
class WebCryptoRsaSsaParams : public WebCryptoAlgorithmParams {
@@ -135,12 +137,13 @@ public:
: WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeRsaSsaParams)
, m_hash(hash)
{
+ BLINK_ASSERT(!hash.isNull());
}
const WebCryptoAlgorithm& hash() const { return m_hash; }
private:
- WebCryptoAlgorithm m_hash;
+ const WebCryptoAlgorithm m_hash;
};
class WebCryptoRsaKeyGenParams : public WebCryptoAlgorithmParams {
@@ -208,6 +211,7 @@ public:
, m_hasLabel(hasLabel)
, m_label(label, labelSize)
{
+ BLINK_ASSERT(!hash.isNull());
}
const WebCryptoAlgorithm& hash() const { return m_hash; }
« no previous file with comments | « public/platform/WebCryptoAlgorithm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698