1 // Copyright 2017 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_CRYPTO_CRYPTO_UTILITIES_H_ 6 #define THIRD_PARTY_BLINK_RENDERER_MODULES_CRYPTO_CRYPTO_UTILITIES_H_ 7 8 #include "third_party/blink/public/platform/web_vector.h" 9 #include "third_party/blink/renderer/core/typed_arrays/dom_array_piece.h" 10 11 namespace blink { CopyBytes(const DOMArrayPiece & source)12inline WebVector<uint8_t> CopyBytes(const DOMArrayPiece& source) { 13 return WebVector<uint8_t>(static_cast<const uint8_t*>(source.Data()), 14 source.ByteLength()); 15 } 16 } // namespace blink 17 18 #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_CRYPTO_CRYPTO_UTILITIES_H_ 19