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

Unified Diff: Source/platform/exported/WebCryptoKey.cpp

Issue 48753003: [webcrypto] Make WebCryptoKey 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 | « Source/core/platform/chromium/support/WebCrypto.cpp ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/exported/WebCryptoKey.cpp
diff --git a/Source/platform/exported/WebCryptoKey.cpp b/Source/platform/exported/WebCryptoKey.cpp
index 85d4a77db9410fb636d56aed548a94685f593342..7d0646cd3291572e2b8fe417abd00b015ca367b5 100644
--- a/Source/platform/exported/WebCryptoKey.cpp
+++ b/Source/platform/exported/WebCryptoKey.cpp
@@ -63,31 +63,46 @@ WebCryptoKey WebCryptoKey::create(WebCryptoKeyHandle* handle, WebCryptoKeyType t
return key;
}
+WebCryptoKey WebCryptoKey::createNull()
+{
+ return WebCryptoKey();
+}
+
WebCryptoKeyHandle* WebCryptoKey::handle() const
{
+ ASSERT(!isNull());
return m_private->handle.get();
}
WebCryptoKeyType WebCryptoKey::type() const
{
+ ASSERT(!isNull());
return m_private->type;
}
bool WebCryptoKey::extractable() const
{
+ ASSERT(!isNull());
return m_private->extractable;
}
const WebCryptoAlgorithm& WebCryptoKey::algorithm() const
{
+ ASSERT(!isNull());
return m_private->algorithm;
}
WebCryptoKeyUsageMask WebCryptoKey::usages() const
{
+ ASSERT(!isNull());
return m_private->usages;
}
+bool WebCryptoKey::isNull() const
+{
+ return m_private.isNull();
+}
+
void WebCryptoKey::assign(const WebCryptoKey& other)
{
m_private = other.m_private;
« no previous file with comments | « Source/core/platform/chromium/support/WebCrypto.cpp ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698