| Index: content/renderer/webcrypto/crypto_data.cc
|
| diff --git a/content/renderer/webcrypto/crypto_data.cc b/content/renderer/webcrypto/crypto_data.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6383c5c0c3c536876a4ec798c939fb9a2ca3f757
|
| --- /dev/null
|
| +++ b/content/renderer/webcrypto/crypto_data.cc
|
| @@ -0,0 +1,32 @@
|
| +// Copyright (c) 2014 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.
|
| +
|
| +#include "content/renderer/webcrypto/crypto_data.h"
|
| +
|
| +#include "third_party/WebKit/public/platform/WebArrayBuffer.h"
|
| +
|
| +namespace content {
|
| +
|
| +namespace webcrypto {
|
| +
|
| +CryptoData::CryptoData() : bytes_(NULL), byte_length_(0) {}
|
| +
|
| +CryptoData::CryptoData(const unsigned char* bytes, unsigned int byte_length)
|
| + : bytes_(bytes), byte_length_(byte_length) {}
|
| +
|
| +CryptoData::CryptoData(const std::vector<unsigned char>& bytes)
|
| + : bytes_(bytes.size() ? &bytes[0] : NULL), byte_length_(bytes.size()) {}
|
| +
|
| +CryptoData::CryptoData(const std::string& bytes)
|
| + : bytes_(bytes.size() ? reinterpret_cast<const unsigned char*>(bytes.data())
|
| + : NULL),
|
| + byte_length_(bytes.size()) {}
|
| +
|
| +CryptoData::CryptoData(const blink::WebArrayBuffer& buffer)
|
| + : bytes_(reinterpret_cast<const unsigned char*>(buffer.data())),
|
| + byte_length_(buffer.byteLength()) {}
|
| +
|
| +} // namespace webcrypto
|
| +
|
| +} // namespace content
|
|
|