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 16 matching lines...) Expand all Loading... |
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/Algorithm.h" | 32 #include "modules/crypto/Algorithm.h" |
33 | 33 |
34 #include "V8AesCbcParams.h" | 34 #include "V8AesCbcParams.h" |
35 #include "V8AesKeyGenParams.h" | 35 #include "V8AesKeyGenParams.h" |
36 #include "V8HmacParams.h" | 36 #include "V8HmacParams.h" |
| 37 #include "V8RsaKeyGenParams.h" |
| 38 #include "V8RsaSsaParams.h" |
37 #include "bindings/v8/V8Binding.h" | 39 #include "bindings/v8/V8Binding.h" |
38 | 40 |
39 namespace WebCore { | 41 namespace WebCore { |
40 | 42 |
41 v8::Handle<v8::Object> wrap(Algorithm* impl, v8::Handle<v8::Object> creationCont
ext, v8::Isolate* isolate) | 43 v8::Handle<v8::Object> wrap(Algorithm* impl, v8::Handle<v8::Object> creationCont
ext, v8::Isolate* isolate) |
42 { | 44 { |
43 ASSERT(impl); | 45 ASSERT(impl); |
44 | 46 |
45 // Wrap as the more derived type. | 47 // Wrap as the more derived type. |
46 switch (impl->type()) { | 48 switch (impl->type()) { |
47 case WebKit::WebCryptoAlgorithmParamsTypeNone: | 49 case WebKit::WebCryptoAlgorithmParamsTypeNone: |
48 return V8Algorithm::createWrapper(impl, creationContext, isolate); | 50 return V8Algorithm::createWrapper(impl, creationContext, isolate); |
49 case WebKit::WebCryptoAlgorithmParamsTypeAesCbcParams: | 51 case WebKit::WebCryptoAlgorithmParamsTypeAesCbcParams: |
50 return wrap(static_cast<AesCbcParams*>(impl), creationContext, isolate); | 52 return wrap(static_cast<AesCbcParams*>(impl), creationContext, isolate); |
51 case WebKit::WebCryptoAlgorithmParamsTypeAesKeyGenParams: | 53 case WebKit::WebCryptoAlgorithmParamsTypeAesKeyGenParams: |
52 return wrap(static_cast<AesKeyGenParams*>(impl), creationContext, isolat
e); | 54 return wrap(static_cast<AesKeyGenParams*>(impl), creationContext, isolat
e); |
53 case WebKit::WebCryptoAlgorithmParamsTypeHmacParams: | 55 case WebKit::WebCryptoAlgorithmParamsTypeHmacParams: |
54 return wrap(static_cast<HmacParams*>(impl), creationContext, isolate); | 56 return wrap(static_cast<HmacParams*>(impl), creationContext, isolate); |
| 57 case WebKit::WebCryptoAlgorithmParamsTypeRsaSsaParams: |
| 58 return wrap(static_cast<RsaSsaParams*>(impl), creationContext, isolate); |
| 59 case WebKit::WebCryptoAlgorithmParamsTypeRsaKeyGenParams: |
| 60 return wrap(static_cast<RsaKeyGenParams*>(impl), creationContext, isolat
e); |
55 } | 61 } |
56 | 62 |
57 ASSERT_NOT_REACHED(); | 63 ASSERT_NOT_REACHED(); |
58 return v8::Handle<v8::Object>(); | 64 return v8::Handle<v8::Object>(); |
59 } | 65 } |
60 | 66 |
61 } // namespace WebCore | 67 } // namespace WebCore |
OLD | NEW |