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

Unified Diff: third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp

Issue 2972023002: Deduplicate CopyBytes in modules/crypto (Closed)
Patch Set: Dropped the "test in jumbo" code Created 3 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
Index: third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp
diff --git a/third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp b/third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp
index 93b13d4bfff20c0eb7307e4219c9c11de641f3f8..b8f4bb97e8cbbae1be4e9a6b9ec78b0e9cb0f367 100644
--- a/third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp
+++ b/third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp
@@ -39,6 +39,7 @@
#include "bindings/modules/v8/V8CryptoKey.h"
#include "core/dom/DOMArrayPiece.h"
#include "core/dom/DOMTypedArray.h"
+#include "modules/crypto/CryptoUtilities.h"
#include "platform/wtf/MathExtras.h"
#include "platform/wtf/PtrUtil.h"
#include "platform/wtf/Vector.h"
@@ -50,8 +51,6 @@ namespace blink {
namespace {
-typedef ArrayBufferOrArrayBufferView BufferSource;
-
struct AlgorithmNameMapping {
// Must be an upper case ASCII string.
const char* const algorithm_name;
@@ -264,11 +263,6 @@ class ErrorContext {
Vector<const char*, 10> messages_;
};
-static WebVector<uint8_t> CopyBytes(const DOMArrayPiece& source) {
- return WebVector<uint8_t>(static_cast<const uint8_t*>(source.Data()),
- source.ByteLength());
-}
-
// Defined by the WebCrypto spec as:
//
// typedef (ArrayBuffer or ArrayBufferView) BufferSource;
« no previous file with comments | « third_party/WebKit/Source/modules/crypto/CryptoUtilities.h ('k') | third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698