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 11 matching lines...) Expand all Loading... |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "modules/crypto/AesCtrParams.h" | 32 #include "core/animation/InterpolationEffect.h" |
33 | |
34 #include "public/platform/WebCryptoAlgorithmParams.h" | |
35 | 33 |
36 namespace WebCore { | 34 namespace WebCore { |
37 | 35 |
38 Uint8Array* AesCtrParams::counter() | 36 PassOwnPtr<Vector<RefPtr<Interpolation> > > InterpolationEffect::getActiveInterp
olations(double fraction) const |
39 { | 37 { |
40 if (!m_counter) { | 38 |
41 const blink::WebVector<unsigned char>& counter = m_algorithm.aesCtrParam
s()->counter(); | 39 Vector<RefPtr<Interpolation> >* result = new Vector<RefPtr<Interpolation> >(
); |
42 m_counter = Uint8Array::create(counter.data(), counter.size()); | 40 |
| 41 for (size_t i = 0; i < m_interpolations.size(); ++i) { |
| 42 if (fraction >= m_interpolations[i]->m_start && fraction <= m_interpolat
ions[i]->m_end) { |
| 43 RefPtr<Interpolation> interpolation = m_interpolations[i]->m_interpo
lation; |
| 44 interpolation->interpolate(0, (fraction - m_interpolations[i]->m_sta
rt) / (m_interpolations[i]->m_end - m_interpolations[i]->m_start)); |
| 45 result->append(interpolation); |
| 46 } |
43 } | 47 } |
44 return m_counter.get(); | 48 |
| 49 return adoptPtr(result); |
45 } | 50 } |
46 | 51 |
47 unsigned char AesCtrParams::length() | |
48 { | |
49 return m_algorithm.aesCtrParams()->lengthBits(); | |
50 } | 52 } |
51 | |
52 AesCtrParams::AesCtrParams(const blink::WebCryptoAlgorithm& algorithm) | |
53 : Algorithm(algorithm) | |
54 { | |
55 ASSERT(algorithm.aesCtrParams()); | |
56 ScriptWrappable::init(this); | |
57 } | |
58 | |
59 } // namespace WebCore | |
OLD | NEW |