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

Side by Side Diff: components/webcrypto/webcrypto_impl.h

Issue 2142783002: Use std::unique_ptr to pass around WebCryptoDigestor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/webcrypto/webcrypto_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_WEBCRYPTO_WEBCRYPTO_IMPL_H_ 5 #ifndef COMPONENTS_WEBCRYPTO_WEBCRYPTO_IMPL_H_
6 #define COMPONENTS_WEBCRYPTO_WEBCRYPTO_IMPL_H_ 6 #define COMPONENTS_WEBCRYPTO_WEBCRYPTO_IMPL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "third_party/WebKit/public/platform/WebCrypto.h" 10 #include "third_party/WebKit/public/platform/WebCrypto.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 const blink::WebCryptoKey& base_key, 89 const blink::WebCryptoKey& base_key,
90 const blink::WebCryptoAlgorithm& import_algorithm, 90 const blink::WebCryptoAlgorithm& import_algorithm,
91 const blink::WebCryptoAlgorithm& key_length_algorithm, 91 const blink::WebCryptoAlgorithm& key_length_algorithm,
92 bool extractable, 92 bool extractable,
93 blink::WebCryptoKeyUsageMask usages, 93 blink::WebCryptoKeyUsageMask usages,
94 blink::WebCryptoResult result) override; 94 blink::WebCryptoResult result) override;
95 95
96 // This method returns a digestor object that can be used to synchronously 96 // This method returns a digestor object that can be used to synchronously
97 // compute a digest one chunk at a time. Thus, the consume does not need to 97 // compute a digest one chunk at a time. Thus, the consume does not need to
98 // hold onto a large buffer with all the data to digest. Chunks can be given 98 // hold onto a large buffer with all the data to digest. Chunks can be given
99 // one at a time and the digest will be computed piecemeal. The allocated 99 // one at a time and the digest will be computed piecemeal.
100 // WebCrytpoDigestor that is returned by createDigestor must be freed by the 100 std::unique_ptr<blink::WebCryptoDigestor> createDigestor(
101 // caller.
102 blink::WebCryptoDigestor* createDigestor(
103 blink::WebCryptoAlgorithmId algorithm_id) override; 101 blink::WebCryptoAlgorithmId algorithm_id) override;
104 102
105 bool deserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm, 103 bool deserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm,
106 blink::WebCryptoKeyType type, 104 blink::WebCryptoKeyType type,
107 bool extractable, 105 bool extractable,
108 blink::WebCryptoKeyUsageMask usages, 106 blink::WebCryptoKeyUsageMask usages,
109 const unsigned char* key_data, 107 const unsigned char* key_data,
110 unsigned key_data_size, 108 unsigned key_data_size,
111 blink::WebCryptoKey& key) override; 109 blink::WebCryptoKey& key) override;
112 110
113 bool serializeKeyForClone(const blink::WebCryptoKey& key, 111 bool serializeKeyForClone(const blink::WebCryptoKey& key,
114 blink::WebVector<unsigned char>& key_data) override; 112 blink::WebVector<unsigned char>& key_data) override;
115 113
116 private: 114 private:
117 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); 115 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl);
118 }; 116 };
119 117
120 } // namespace webcrypto 118 } // namespace webcrypto
121 119
122 #endif // COMPONENTS_WEBCRYPTO_WEBCRYPTO_IMPL_H_ 120 #endif // COMPONENTS_WEBCRYPTO_WEBCRYPTO_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | components/webcrypto/webcrypto_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698