Chromium Code Reviews| Index: Source/modules/crypto/NormalizeAlgorithm.h |
| diff --git a/Source/modules/crypto/WorkerCrypto.h b/Source/modules/crypto/NormalizeAlgorithm.h |
| similarity index 71% |
| copy from Source/modules/crypto/WorkerCrypto.h |
| copy to Source/modules/crypto/NormalizeAlgorithm.h |
| index 5bbb3f5d39eba918f40aab6f91439d3993547e81..3e3fafadf579fa34667caaee7bb4a526ba31db09 100644 |
| --- a/Source/modules/crypto/WorkerCrypto.h |
| +++ b/Source/modules/crypto/NormalizeAlgorithm.h |
| @@ -28,26 +28,37 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#ifndef WorkerCrypto_h |
| -#define WorkerCrypto_h |
| +#ifndef NormalizeAlgorithm_h |
| +#define NormalizeAlgorithm_h |
| -#include "bindings/v8/ScriptWrappable.h" |
| -#include "wtf/Forward.h" |
| -#include "wtf/PassRefPtr.h" |
| -#include "wtf/RefCounted.h" |
| +#include "wtf/Assertions.h" |
| + |
| +namespace WebKit { class WebCryptoAlgorithm; } |
| namespace WebCore { |
| -typedef int ExceptionCode; |
| +class Dictionary; |
| -class WorkerCrypto : public ScriptWrappable, public RefCounted<WorkerCrypto> { |
| -public: |
| - static PassRefPtr<WorkerCrypto> create() { return adoptRef(new WorkerCrypto()); } |
| +typedef int ExceptionCode; |
| -private: |
| - WorkerCrypto(); |
| +enum AlgorithmOperation { |
| + Encrypt, |
| + Decrypt, |
| + Sign, |
| + Verify, |
| + Digest, |
| + GenerateKey, |
| + DeriveKey, |
| + WrapKey, |
| + UnwrapKey, |
| + // <---- End of list |
| + NumAlgorithmOperations, |
|
abarth-chromium
2013/07/02 06:46:36
NumAlgorithmOperations -> NumberOfAlgorithmOperati
eroman
2013/07/02 08:12:27
Done.
|
| }; |
| -} |
| +// Normalizes an algorithm identifier (dictionary) into a WebCryptoAlgorithm. If |
| +// normalization fails then returns false and sets |ec|. |
| +bool normalizeAlgorithm(const Dictionary& raw, AlgorithmOperation, WebKit::WebCryptoAlgorithm&, ExceptionCode&) WARN_UNUSED_RETURN; |
|
abarth-chromium
2013/07/02 06:46:36
raw -> You can omit this argument name. The name
eroman
2013/07/02 08:12:27
Done.
|
| + |
| +} // namespace WebCore |
| #endif |