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

Side by Side Diff: content/child/webcrypto/status.cc

Issue 780923003: Fix a WebCrypto error type: InvalidAccessError --> OperationError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@derive_key
Patch Set: Created 6 years 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 | content/test/data/webcrypto/ecdh.json » ('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 #include "content/child/webcrypto/status.h" 5 #include "content/child/webcrypto/status.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 "The public parameter for ECDH key derivation must be for ECDH"); 318 "The public parameter for ECDH key derivation must be for ECDH");
319 } 319 }
320 320
321 Status Status::ErrorEcdhCurveMismatch() { 321 Status Status::ErrorEcdhCurveMismatch() {
322 return Status(blink::WebCryptoErrorTypeInvalidAccess, 322 return Status(blink::WebCryptoErrorTypeInvalidAccess,
323 "The public parameter for ECDH key derivation is for a " 323 "The public parameter for ECDH key derivation is for a "
324 "different named curve"); 324 "different named curve");
325 } 325 }
326 326
327 Status Status::ErrorEcdhLengthTooBig(unsigned int max_length_bits) { 327 Status Status::ErrorEcdhLengthTooBig(unsigned int max_length_bits) {
328 return Status(blink::WebCryptoErrorTypeInvalidAccess, 328 return Status(blink::WebCryptoErrorTypeOperation,
329 base::StringPrintf( 329 base::StringPrintf(
330 "Length specified for ECDH key derivation is too large. " 330 "Length specified for ECDH key derivation is too large. "
331 "Maximum allowed is %u bits", 331 "Maximum allowed is %u bits",
332 max_length_bits)); 332 max_length_bits));
333 } 333 }
334 334
335 Status::Status(blink::WebCryptoErrorType error_type, 335 Status::Status(blink::WebCryptoErrorType error_type,
336 const std::string& error_details_utf8) 336 const std::string& error_details_utf8)
337 : type_(TYPE_ERROR), 337 : type_(TYPE_ERROR),
338 error_type_(error_type), 338 error_type_(error_type),
339 error_details_(error_details_utf8) { 339 error_details_(error_details_utf8) {
340 } 340 }
341 341
342 Status::Status(Type type) : type_(type) { 342 Status::Status(Type type) : type_(type) {
343 } 343 }
344 344
345 } // namespace webcrypto 345 } // namespace webcrypto
346 346
347 } // namespace content 347 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/test/data/webcrypto/ecdh.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698