| Index: Source/modules/crypto/HmacKeyAlgorithm.cpp
|
| diff --git a/Source/modules/crypto/Algorithm.cpp b/Source/modules/crypto/HmacKeyAlgorithm.cpp
|
| similarity index 72%
|
| copy from Source/modules/crypto/Algorithm.cpp
|
| copy to Source/modules/crypto/HmacKeyAlgorithm.cpp
|
| index 35568ff46e53cd840dc945fad6df50f12beff7be..5d42b817f645488637f81a2878ea7372e33f32c8 100644
|
| --- a/Source/modules/crypto/Algorithm.cpp
|
| +++ b/Source/modules/crypto/HmacKeyAlgorithm.cpp
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (C) 2013 Google Inc. All rights reserved.
|
| + * Copyright (C) 2014 Google Inc. All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions are
|
| @@ -29,27 +29,35 @@
|
| */
|
|
|
| #include "config.h"
|
| -#include "modules/crypto/Algorithm.h"
|
| +#include "modules/crypto/HmacKeyAlgorithm.h"
|
|
|
| #include "modules/crypto/NormalizeAlgorithm.h"
|
| #include "wtf/text/WTFString.h"
|
|
|
| namespace WebCore {
|
|
|
| -PassRefPtrWillBeRawPtr<Algorithm> Algorithm::create(const blink::WebCryptoAlgorithm& algorithm)
|
| +PassRefPtrWillBeRawPtr<HmacKeyAlgorithm> HmacKeyAlgorithm::create(const blink::WebCryptoKeyAlgorithm& algorithm)
|
| {
|
| - return adoptRefWillBeNoop(new Algorithm(algorithm));
|
| + return adoptRefWillBeNoop(new HmacKeyAlgorithm(algorithm));
|
| }
|
|
|
| -Algorithm::Algorithm(const blink::WebCryptoAlgorithm& algorithm)
|
| - : m_algorithm(algorithm)
|
| +KeyAlgorithm* HmacKeyAlgorithm::hash()
|
| {
|
| - ScriptWrappable::init(this);
|
| + if (!m_hash)
|
| + m_hash = KeyAlgorithm::createHash(m_algorithm.hmacParams()->hash());
|
| + return m_hash.get();
|
| }
|
|
|
| -String Algorithm::name()
|
| +void HmacKeyAlgorithm::trace(Visitor* visitor)
|
| {
|
| - return algorithmIdToName(m_algorithm.id());
|
| + KeyAlgorithm::trace(visitor);
|
| + visitor->trace(m_hash);
|
| +}
|
| +
|
| +HmacKeyAlgorithm::HmacKeyAlgorithm(const blink::WebCryptoKeyAlgorithm& algorithm)
|
| + : KeyAlgorithm(algorithm)
|
| +{
|
| + ScriptWrappable::init(this);
|
| }
|
|
|
| } // namespace WebCore
|
|
|