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

Side by Side Diff: third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp

Issue 2799563002: Replace usage of WebVector::isEmpty with WebVector::empty().
Patch Set: Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // 337 //
338 // typedef Uint8Array BigInteger; 338 // typedef Uint8Array BigInteger;
339 bool getBigInteger(const Dictionary& raw, 339 bool getBigInteger(const Dictionary& raw,
340 const char* propertyName, 340 const char* propertyName,
341 WebVector<uint8_t>& bytes, 341 WebVector<uint8_t>& bytes,
342 const ErrorContext& context, 342 const ErrorContext& context,
343 AlgorithmError* error) { 343 AlgorithmError* error) {
344 if (!getUint8Array(raw, propertyName, bytes, context, error)) 344 if (!getUint8Array(raw, propertyName, bytes, context, error))
345 return false; 345 return false;
346 346
347 if (bytes.isEmpty()) { 347 if (bytes.empty()) {
348 // Empty BigIntegers represent 0 according to the spec 348 // Empty BigIntegers represent 0 according to the spec
349 bytes = WebVector<uint8_t>(static_cast<size_t>(1u)); 349 bytes = WebVector<uint8_t>(static_cast<size_t>(1u));
350 DCHECK_EQ(0u, bytes[0]); 350 DCHECK_EQ(0u, bytes[0]);
351 } 351 }
352 352
353 return true; 353 return true;
354 } 354 }
355 355
356 // Gets an integer according to WebIDL's [EnforceRange]. 356 // Gets an integer according to WebIDL's [EnforceRange].
357 bool getOptionalInteger(const Dictionary& raw, 357 bool getOptionalInteger(const Dictionary& raw,
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 } // namespace 1093 } // namespace
1094 1094
1095 bool normalizeAlgorithm(const AlgorithmIdentifier& raw, 1095 bool normalizeAlgorithm(const AlgorithmIdentifier& raw,
1096 WebCryptoOperation op, 1096 WebCryptoOperation op,
1097 WebCryptoAlgorithm& algorithm, 1097 WebCryptoAlgorithm& algorithm,
1098 AlgorithmError* error) { 1098 AlgorithmError* error) {
1099 return parseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error); 1099 return parseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error);
1100 } 1100 }
1101 1101
1102 } // namespace blink 1102 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698