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

Side by Side Diff: content/renderer/webcrypto/crypto_data.cc

Issue 155623005: Refactor to share more code between OpenSSL and NSS implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for openssl Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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.
4
5 #include "content/renderer/webcrypto/crypto_data.h"
6
7 #include "third_party/WebKit/public/platform/WebArrayBuffer.h"
8
9 namespace content {
10
11 namespace webcrypto {
12
13 CryptoData::CryptoData() : bytes_(NULL), byte_length_(0) {}
14 CryptoData::CryptoData(const unsigned char* bytes, unsigned int byte_length)
15 : bytes_(bytes), byte_length_(byte_length) {}
16 CryptoData::CryptoData(const std::vector<unsigned char>& bytes)
17 : bytes_(bytes.size() ? &bytes[0] : NULL), byte_length_(bytes.size()) {}
18 CryptoData::CryptoData(const std::string& bytes)
19 : bytes_(bytes.size() ? reinterpret_cast<const unsigned char*>(bytes.data())
20 : NULL),
21 byte_length_(bytes.size()) {}
22 CryptoData::CryptoData(const blink::WebArrayBuffer& buffer)
Ryan Sleevi 2014/02/07 01:19:21 new lines between each ctor
eroman 2014/02/07 21:15:57 Done (i think git cl format put it that way).
23 : bytes_(reinterpret_cast<const unsigned char*>(buffer.data())),
24 byte_length_(buffer.byteLength()) {}
25
26 } // namespace webcrypto
27
28 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698