OLD | NEW |
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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 // Defined by the WebCrypto spec as: | 321 // Defined by the WebCrypto spec as: |
322 // | 322 // |
323 // typedef Uint8Array BigInteger; | 323 // typedef Uint8Array BigInteger; |
324 bool getBigInteger(const Dictionary& raw, const char* propertyName, RefPtr<DOMUi
nt8Array>& array, const ErrorContext& context, AlgorithmError* error) | 324 bool getBigInteger(const Dictionary& raw, const char* propertyName, RefPtr<DOMUi
nt8Array>& array, const ErrorContext& context, AlgorithmError* error) |
325 { | 325 { |
326 if (!getUint8Array(raw, propertyName, array, context, error)) | 326 if (!getUint8Array(raw, propertyName, array, context, error)) |
327 return false; | 327 return false; |
328 | 328 |
329 if (!array->byteLength()) { | 329 if (!array->byteLength()) { |
330 // Empty BigIntegers represent 0 according to the spec | 330 // Empty BigIntegers represent 0 according to the spec |
331 array = DOMUint8Array::create(1); | 331 array = DOMUint8Array::deprecatedCreateOrCrash(nullptr, 1); |
332 } | 332 } |
333 | 333 |
334 return true; | 334 return true; |
335 } | 335 } |
336 | 336 |
337 // Gets an integer according to WebIDL's [EnforceRange]. | 337 // Gets an integer according to WebIDL's [EnforceRange]. |
338 bool getOptionalInteger(const Dictionary& raw, const char* propertyName, bool& h
asProperty, double& value, double minValue, double maxValue, const ErrorContext&
context, AlgorithmError* error) | 338 bool getOptionalInteger(const Dictionary& raw, const char* propertyName, bool& h
asProperty, double& value, double minValue, double maxValue, const ErrorContext&
context, AlgorithmError* error) |
339 { | 339 { |
340 double number; | 340 double number; |
341 bool ok = DictionaryHelper::get(raw, propertyName, number, hasProperty); | 341 bool ok = DictionaryHelper::get(raw, propertyName, number, hasProperty); |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 } | 978 } |
979 | 979 |
980 } // namespace | 980 } // namespace |
981 | 981 |
982 bool normalizeAlgorithm(const AlgorithmIdentifier& raw, WebCryptoOperation op, W
ebCryptoAlgorithm& algorithm, AlgorithmError* error) | 982 bool normalizeAlgorithm(const AlgorithmIdentifier& raw, WebCryptoOperation op, W
ebCryptoAlgorithm& algorithm, AlgorithmError* error) |
983 { | 983 { |
984 return parseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error); | 984 return parseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error); |
985 } | 985 } |
986 | 986 |
987 } // namespace blink | 987 } // namespace blink |
OLD | NEW |