| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 #include "bindings/core/v8/Dictionary.h" | 33 #include "bindings/core/v8/Dictionary.h" |
| 34 #include "core/dom/DOMArrayBuffer.h" | 34 #include "core/dom/DOMArrayBuffer.h" |
| 35 #include "core/dom/DOMArrayBufferView.h" | 35 #include "core/dom/DOMArrayBufferView.h" |
| 36 #include "core/dom/DOMArrayPiece.h" | 36 #include "core/dom/DOMArrayPiece.h" |
| 37 #include "core/dom/ExecutionContext.h" | 37 #include "core/dom/ExecutionContext.h" |
| 38 #include "modules/crypto/CryptoHistograms.h" | 38 #include "modules/crypto/CryptoHistograms.h" |
| 39 #include "modules/crypto/CryptoKey.h" | 39 #include "modules/crypto/CryptoKey.h" |
| 40 #include "modules/crypto/CryptoResultImpl.h" | 40 #include "modules/crypto/CryptoResultImpl.h" |
| 41 #include "modules/crypto/NormalizeAlgorithm.h" | 41 #include "modules/crypto/NormalizeAlgorithm.h" |
| 42 #include "platform/JSONValues.h" | 42 #include "platform/json/JSONValues.h" |
| 43 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
| 44 #include "public/platform/WebCrypto.h" | 44 #include "public/platform/WebCrypto.h" |
| 45 #include "public/platform/WebCryptoAlgorithm.h" | 45 #include "public/platform/WebCryptoAlgorithm.h" |
| 46 | 46 |
| 47 namespace blink { | 47 namespace blink { |
| 48 | 48 |
| 49 static bool parseAlgorithm(const AlgorithmIdentifier& raw, WebCryptoOperation op
, WebCryptoAlgorithm& algorithm, CryptoResult* result) | 49 static bool parseAlgorithm(const AlgorithmIdentifier& raw, WebCryptoOperation op
, WebCryptoAlgorithm& algorithm, CryptoResult* result) |
| 50 { | 50 { |
| 51 AlgorithmError error; | 51 AlgorithmError error; |
| 52 bool success = normalizeAlgorithm(raw, op, algorithm, &error); | 52 bool success = normalizeAlgorithm(raw, op, algorithm, &error); |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 // normative requirement is enforced by the platform implementation in the | 657 // normative requirement is enforced by the platform implementation in the |
| 658 // call below. | 658 // call below. |
| 659 | 659 |
| 660 histogramAlgorithmAndKey(scriptState->getExecutionContext(), normalizedAlgor
ithm, baseKey->key()); | 660 histogramAlgorithmAndKey(scriptState->getExecutionContext(), normalizedAlgor
ithm, baseKey->key()); |
| 661 histogramAlgorithm(scriptState->getExecutionContext(), normalizedDerivedKeyA
lgorithm); | 661 histogramAlgorithm(scriptState->getExecutionContext(), normalizedDerivedKeyA
lgorithm); |
| 662 Platform::current()->crypto()->deriveKey(normalizedAlgorithm, baseKey->key()
, normalizedDerivedKeyAlgorithm, keyLengthAlgorithm, extractable, keyUsages, res
ult->result()); | 662 Platform::current()->crypto()->deriveKey(normalizedAlgorithm, baseKey->key()
, normalizedDerivedKeyAlgorithm, keyLengthAlgorithm, extractable, keyUsages, res
ult->result()); |
| 663 return promise; | 663 return promise; |
| 664 } | 664 } |
| 665 | 665 |
| 666 } // namespace blink | 666 } // namespace blink |
| OLD | NEW |