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

Unified Diff: Source/testing/runner/MockWebCrypto.cpp

Issue 23537027: WebCrypto: [refactor] Use "unsigned" rather than "size_t" for buffer sizes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add an ifdef to coordinate with chromium side Created 7 years, 3 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/testing/runner/MockWebCrypto.h ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/testing/runner/MockWebCrypto.cpp
diff --git a/Source/testing/runner/MockWebCrypto.cpp b/Source/testing/runner/MockWebCrypto.cpp
index a0b48af7567f11da428ec0e56b098f12fd5f2f28..51f803bb2d11dcbc4f0074f2f49279b7fc9052e1 100644
--- a/Source/testing/runner/MockWebCrypto.cpp
+++ b/Source/testing/runner/MockWebCrypto.cpp
@@ -39,7 +39,7 @@ namespace WebTestRunner {
namespace {
-std::string mockSign(const unsigned char* bytes, size_t size)
+std::string mockSign(const unsigned char* bytes, unsigned size)
{
return "signed HMAC:" + std::string(reinterpret_cast<const char*>(bytes), size);
}
@@ -52,17 +52,17 @@ MockWebCrypto* MockWebCrypto::get()
return &crypto;
}
-void MockWebCrypto::encrypt(const WebKit::WebCryptoAlgorithm& algorithm, const WebKit::WebCryptoKey& key, const unsigned char* data, size_t dataSize, WebKit::WebCryptoResult result)
+void MockWebCrypto::encrypt(const WebKit::WebCryptoAlgorithm& algorithm, const WebKit::WebCryptoKey& key, const unsigned char* data, unsigned dataSize, WebKit::WebCryptoResult result)
{
result.completeWithError();
}
-void MockWebCrypto::decrypt(const WebKit::WebCryptoAlgorithm& algorithm, const WebKit::WebCryptoKey& key, const unsigned char* data, size_t dataSize, WebKit::WebCryptoResult result)
+void MockWebCrypto::decrypt(const WebKit::WebCryptoAlgorithm& algorithm, const WebKit::WebCryptoKey& key, const unsigned char* data, unsigned dataSize, WebKit::WebCryptoResult result)
{
result.completeWithError();
}
-void MockWebCrypto::sign(const WebKit::WebCryptoAlgorithm& algorithm, const WebKit::WebCryptoKey& key, const unsigned char* data, size_t dataSize, WebKit::WebCryptoResult result)
+void MockWebCrypto::sign(const WebKit::WebCryptoAlgorithm& algorithm, const WebKit::WebCryptoKey& key, const unsigned char* data, unsigned dataSize, WebKit::WebCryptoResult result)
{
if (algorithm.id() != WebKit::WebCryptoAlgorithmIdHmac)
return result.completeWithError();
@@ -71,7 +71,7 @@ void MockWebCrypto::sign(const WebKit::WebCryptoAlgorithm& algorithm, const WebK
result.completeWithBuffer(signedData.data(), signedData.size());
}
-void MockWebCrypto::verifySignature(const WebKit::WebCryptoAlgorithm& algorithm, const WebKit::WebCryptoKey& key, const unsigned char* signatureBytes, size_t signatureSize, const unsigned char* data, size_t dataSize, WebKit::WebCryptoResult result)
+void MockWebCrypto::verifySignature(const WebKit::WebCryptoAlgorithm& algorithm, const WebKit::WebCryptoKey& key, const unsigned char* signatureBytes, unsigned signatureSize, const unsigned char* data, unsigned dataSize, WebKit::WebCryptoResult result)
{
if (algorithm.id() != WebKit::WebCryptoAlgorithmIdHmac)
return result.completeWithError();
@@ -81,7 +81,7 @@ void MockWebCrypto::verifySignature(const WebKit::WebCryptoAlgorithm& algorithm,
result.completeWithBoolean(expectedSignature == signature);
}
-void MockWebCrypto::digest(const WebKit::WebCryptoAlgorithm& algorithm, const unsigned char* data, size_t dataSize, WebKit::WebCryptoResult result)
+void MockWebCrypto::digest(const WebKit::WebCryptoAlgorithm& algorithm, const unsigned char* data, unsigned dataSize, WebKit::WebCryptoResult result)
{
if (algorithm.id() != WebKit::WebCryptoAlgorithmIdSha1)
return result.completeWithError();
@@ -111,7 +111,7 @@ void MockWebCrypto::generateKey(const WebKit::WebCryptoAlgorithm& algorithm, boo
}
}
-void MockWebCrypto::importKey(WebKit::WebCryptoKeyFormat, const unsigned char* keyData, size_t keyDataSize, const WebKit::WebCryptoAlgorithm& algorithm, bool extractable, WebKit::WebCryptoKeyUsageMask usages, WebKit::WebCryptoResult result)
+void MockWebCrypto::importKey(WebKit::WebCryptoKeyFormat, const unsigned char* keyData, unsigned keyDataSize, const WebKit::WebCryptoAlgorithm& algorithm, bool extractable, WebKit::WebCryptoKeyUsageMask usages, WebKit::WebCryptoResult result)
{
std::string keyDataString(reinterpret_cast<const char*>(keyData), keyDataSize);
« no previous file with comments | « Source/testing/runner/MockWebCrypto.h ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698