Switch to using the new app install flow
[chromium-blink-merge.git] / components / webcrypto / crypto_data.cc
blobf5b3c20306156386ec1925205ce30eed0929333f
1 // Copyright 2014 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.
5 #include "components/webcrypto/crypto_data.h"
6 #include "base/stl_util.h"
8 namespace webcrypto {
10 CryptoData::CryptoData() : bytes_(NULL), byte_length_(0) {
13 CryptoData::CryptoData(const unsigned char* bytes, unsigned int byte_length)
14 : bytes_(bytes), byte_length_(byte_length) {
17 CryptoData::CryptoData(const std::vector<unsigned char>& bytes)
18 : bytes_(vector_as_array(&bytes)), byte_length_(bytes.size()) {
21 CryptoData::CryptoData(const std::string& bytes)
22 : bytes_(bytes.size() ? reinterpret_cast<const unsigned char*>(bytes.data())
23 : NULL),
24 byte_length_(bytes.size()) {
27 CryptoData::CryptoData(const blink::WebVector<unsigned char>& bytes)
28 : bytes_(bytes.data()), byte_length_(bytes.size()) {
31 } // namespace webcrypto