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

Unified Diff: third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 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
Index: third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp b/third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
index 45e406a0e4a0de67d35c8f2567456e66e247bcbf..771722e26abc0878c6b2ffd5afdcd9fe0f033009 100644
--- a/third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
@@ -30,8 +30,9 @@
#include "public/platform/WebCryptoKeyAlgorithm.h"
-#include "wtf/OwnPtr.h"
+#include "wtf/PtrUtil.h"
#include "wtf/ThreadSafeRefCounted.h"
+#include <memory>
namespace blink {
@@ -43,24 +44,24 @@ WebCryptoAlgorithm createHash(WebCryptoAlgorithmId hash)
class WebCryptoKeyAlgorithmPrivate : public ThreadSafeRefCounted<WebCryptoKeyAlgorithmPrivate> {
public:
- WebCryptoKeyAlgorithmPrivate(WebCryptoAlgorithmId id, PassOwnPtr<WebCryptoKeyAlgorithmParams> params)
+ WebCryptoKeyAlgorithmPrivate(WebCryptoAlgorithmId id, std::unique_ptr<WebCryptoKeyAlgorithmParams> params)
: id(id)
, params(std::move(params))
{
}
WebCryptoAlgorithmId id;
- OwnPtr<WebCryptoKeyAlgorithmParams> params;
+ std::unique_ptr<WebCryptoKeyAlgorithmParams> params;
};
-WebCryptoKeyAlgorithm::WebCryptoKeyAlgorithm(WebCryptoAlgorithmId id, PassOwnPtr<WebCryptoKeyAlgorithmParams> params)
+WebCryptoKeyAlgorithm::WebCryptoKeyAlgorithm(WebCryptoAlgorithmId id, std::unique_ptr<WebCryptoKeyAlgorithmParams> params)
: m_private(adoptRef(new WebCryptoKeyAlgorithmPrivate(id, std::move(params))))
{
}
WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::adoptParamsAndCreate(WebCryptoAlgorithmId id, WebCryptoKeyAlgorithmParams* params)
{
- return WebCryptoKeyAlgorithm(id, adoptPtr(params));
+ return WebCryptoKeyAlgorithm(id, wrapUnique(params));
}
WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createAes(WebCryptoAlgorithmId id, unsigned short keyLengthBits)
@@ -69,14 +70,14 @@ WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createAes(WebCryptoAlgorithmId id,
// FIXME: Move this somewhere more general.
if (keyLengthBits != 128 && keyLengthBits != 192 && keyLengthBits != 256)
return WebCryptoKeyAlgorithm();
- return WebCryptoKeyAlgorithm(id, adoptPtr(new WebCryptoAesKeyAlgorithmParams(keyLengthBits)));
+ return WebCryptoKeyAlgorithm(id, wrapUnique(new WebCryptoAesKeyAlgorithmParams(keyLengthBits)));
}
WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createHmac(WebCryptoAlgorithmId hash, unsigned keyLengthBits)
{
if (!WebCryptoAlgorithm::isHash(hash))
return WebCryptoKeyAlgorithm();
- return WebCryptoKeyAlgorithm(WebCryptoAlgorithmIdHmac, adoptPtr(new WebCryptoHmacKeyAlgorithmParams(createHash(hash), keyLengthBits)));
+ return WebCryptoKeyAlgorithm(WebCryptoAlgorithmIdHmac, wrapUnique(new WebCryptoHmacKeyAlgorithmParams(createHash(hash), keyLengthBits)));
}
WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createRsaHashed(WebCryptoAlgorithmId id, unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize, WebCryptoAlgorithmId hash)
@@ -84,12 +85,12 @@ WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createRsaHashed(WebCryptoAlgorithmI
// FIXME: Verify that id is an RSA algorithm which expects a hash
if (!WebCryptoAlgorithm::isHash(hash))
return WebCryptoKeyAlgorithm();
- return WebCryptoKeyAlgorithm(id, adoptPtr(new WebCryptoRsaHashedKeyAlgorithmParams(modulusLengthBits, publicExponent, publicExponentSize, createHash(hash))));
+ return WebCryptoKeyAlgorithm(id, wrapUnique(new WebCryptoRsaHashedKeyAlgorithmParams(modulusLengthBits, publicExponent, publicExponentSize, createHash(hash))));
}
WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createEc(WebCryptoAlgorithmId id, WebCryptoNamedCurve namedCurve)
{
- return WebCryptoKeyAlgorithm(id, adoptPtr(new WebCryptoEcKeyAlgorithmParams(namedCurve)));
+ return WebCryptoKeyAlgorithm(id, wrapUnique(new WebCryptoEcKeyAlgorithmParams(namedCurve)));
}
WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createWithoutParams(WebCryptoAlgorithmId id)

Powered by Google App Engine
This is Rietveld 408576698