OLD | NEW |
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 #include "content/child/webcrypto/status.h" | 5 #include "content/child/webcrypto/status.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 namespace webcrypto { | 9 namespace webcrypto { |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 return Status(blink::WebCryptoErrorTypeData, | 144 return Status(blink::WebCryptoErrorTypeData, |
145 "The provided data is too large"); | 145 "The provided data is too large"); |
146 } | 146 } |
147 | 147 |
148 Status Status::ErrorDataTooSmall() { | 148 Status Status::ErrorDataTooSmall() { |
149 return Status(blink::WebCryptoErrorTypeData, | 149 return Status(blink::WebCryptoErrorTypeData, |
150 "The provided data is too small"); | 150 "The provided data is too small"); |
151 } | 151 } |
152 | 152 |
153 Status Status::ErrorUnsupported() { | 153 Status Status::ErrorUnsupported() { |
154 return ErrorUnsupported("The requested operation is unsupported"); | 154 return Status(blink::WebCryptoErrorTypeNotSupported, |
155 } | 155 "The requested operation is unsupported"); |
156 | |
157 Status Status::ErrorUnsupported(const std::string& message) { | |
158 return Status(blink::WebCryptoErrorTypeNotSupported, message); | |
159 } | 156 } |
160 | 157 |
161 Status Status::ErrorUnexpected() { | 158 Status Status::ErrorUnexpected() { |
162 return Status(blink::WebCryptoErrorTypeUnknown, | 159 return Status(blink::WebCryptoErrorTypeUnknown, |
163 "Something unexpected happened..."); | 160 "Something unexpected happened..."); |
164 } | 161 } |
165 | 162 |
166 Status Status::ErrorInvalidAesGcmTagLength() { | 163 Status Status::ErrorInvalidAesGcmTagLength() { |
167 return Status( | 164 return Status( |
168 blink::WebCryptoErrorTypeData, | 165 blink::WebCryptoErrorTypeData, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 error_type_(error_type), | 214 error_type_(error_type), |
218 error_details_(error_details_utf8) { | 215 error_details_(error_details_utf8) { |
219 } | 216 } |
220 | 217 |
221 Status::Status(Type type) : type_(type) { | 218 Status::Status(Type type) : type_(type) { |
222 } | 219 } |
223 | 220 |
224 } // namespace webcrypto | 221 } // namespace webcrypto |
225 | 222 |
226 } // namespace content | 223 } // namespace content |
OLD | NEW |