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

Unified Diff: third_party/WebKit/Source/modules/crypto/CryptoUtilities.h

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/CryptoUtilities.h
diff --git a/third_party/WebKit/Source/modules/crypto/CryptoUtilities.h b/third_party/WebKit/Source/modules/crypto/CryptoUtilities.h
new file mode 100644
index 0000000000000000000000000000000000000000..13216dbf46a3f52dd69f5eb89661e6d881a293a5
--- /dev/null
+++ b/third_party/WebKit/Source/modules/crypto/CryptoUtilities.h
@@ -0,0 +1,18 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CryptoUtilities_h
+#define CryptoUtilities_h
+
+#include "core/dom/DOMArrayPiece.h"
+#include "public/platform/WebVector.h"
+
+namespace blink {
+inline WebVector<uint8_t> CopyBytes(const DOMArrayPiece& source) {
+ return WebVector<uint8_t>(static_cast<const uint8_t*>(source.Data()),
+ source.ByteLength());
+}
+} // namespace blink
+
+#endif // CryptoUtilities_h
« no previous file with comments | « third_party/WebKit/Source/modules/crypto/BUILD.gn ('k') | third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698