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

Side by Side Diff: components/webcrypto/blink_key_handle.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 4 years, 11 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 | « components/webcrypto/algorithms/rsa_oaep_unittest.cc ('k') | components/webcrypto/jwk.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "components/webcrypto/blink_key_handle.h" 5 #include "components/webcrypto/blink_key_handle.h"
6 6
7 #include <utility>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "components/webcrypto/crypto_data.h" 11 #include "components/webcrypto/crypto_data.h"
10 #include "components/webcrypto/status.h" 12 #include "components/webcrypto/status.h"
11 13
12 namespace webcrypto { 14 namespace webcrypto {
13 15
14 namespace { 16 namespace {
15 17
16 class SymKey; 18 class SymKey;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 58 }
57 59
58 private: 60 private:
59 DISALLOW_COPY_AND_ASSIGN(SymKey); 61 DISALLOW_COPY_AND_ASSIGN(SymKey);
60 }; 62 };
61 63
62 class AsymKey : public Key { 64 class AsymKey : public Key {
63 public: 65 public:
64 AsymKey(crypto::ScopedEVP_PKEY pkey, 66 AsymKey(crypto::ScopedEVP_PKEY pkey,
65 const std::vector<uint8_t>& serialized_key_data) 67 const std::vector<uint8_t>& serialized_key_data)
66 : Key(CryptoData(serialized_key_data)), pkey_(pkey.Pass()) {} 68 : Key(CryptoData(serialized_key_data)), pkey_(std::move(pkey)) {}
67 69
68 AsymKey* AsAsymKey() override { return this; } 70 AsymKey* AsAsymKey() override { return this; }
69 71
70 EVP_PKEY* pkey() { return pkey_.get(); } 72 EVP_PKEY* pkey() { return pkey_.get(); }
71 73
72 private: 74 private:
73 crypto::ScopedEVP_PKEY pkey_; 75 crypto::ScopedEVP_PKEY pkey_;
74 76
75 DISALLOW_COPY_AND_ASSIGN(AsymKey); 77 DISALLOW_COPY_AND_ASSIGN(AsymKey);
76 }; 78 };
(...skipping 21 matching lines...) Expand all
98 } 100 }
99 101
100 blink::WebCryptoKeyHandle* CreateSymmetricKeyHandle( 102 blink::WebCryptoKeyHandle* CreateSymmetricKeyHandle(
101 const CryptoData& key_bytes) { 103 const CryptoData& key_bytes) {
102 return new SymKey(key_bytes); 104 return new SymKey(key_bytes);
103 } 105 }
104 106
105 blink::WebCryptoKeyHandle* CreateAsymmetricKeyHandle( 107 blink::WebCryptoKeyHandle* CreateAsymmetricKeyHandle(
106 crypto::ScopedEVP_PKEY pkey, 108 crypto::ScopedEVP_PKEY pkey,
107 const std::vector<uint8_t>& serialized_key_data) { 109 const std::vector<uint8_t>& serialized_key_data) {
108 return new AsymKey(pkey.Pass(), serialized_key_data); 110 return new AsymKey(std::move(pkey), serialized_key_data);
109 } 111 }
110 112
111 } // namespace webcrypto 113 } // namespace webcrypto
OLDNEW
« no previous file with comments | « components/webcrypto/algorithms/rsa_oaep_unittest.cc ('k') | components/webcrypto/jwk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698