| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "modules/crypto/KeyPair.h" | 32 #include "modules/crypto/KeyPair.h" |
| 33 | 33 |
| 34 #include "modules/crypto/Key.h" | 34 #include "modules/crypto/Key.h" |
| 35 #include "public/platform/WebCryptoKey.h" | 35 #include "public/platform/WebCryptoKey.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 | 38 |
| 39 DEFINE_GC_INFO(KeyPair); | |
| 40 | |
| 41 PassRefPtrWillBeRawPtr<KeyPair> KeyPair::create(const blink::WebCryptoKey& publi
cKey, const blink::WebCryptoKey& privateKey) | 39 PassRefPtrWillBeRawPtr<KeyPair> KeyPair::create(const blink::WebCryptoKey& publi
cKey, const blink::WebCryptoKey& privateKey) |
| 42 { | 40 { |
| 43 ASSERT(publicKey.type() == blink::WebCryptoKeyTypePublic); | 41 ASSERT(publicKey.type() == blink::WebCryptoKeyTypePublic); |
| 44 ASSERT(privateKey.type() == blink::WebCryptoKeyTypePrivate); | 42 ASSERT(privateKey.type() == blink::WebCryptoKeyTypePrivate); |
| 45 return adoptRefWillBeNoop(new KeyPair(Key::create(publicKey), Key::create(pr
ivateKey))); | 43 return adoptRefWillBeNoop(new KeyPair(Key::create(publicKey), Key::create(pr
ivateKey))); |
| 46 } | 44 } |
| 47 | 45 |
| 48 KeyPair::KeyPair(const PassRefPtrWillBeRawPtr<Key>& publicKey, const PassRefPtrW
illBeRawPtr<Key>& privateKey) | 46 KeyPair::KeyPair(const PassRefPtrWillBeRawPtr<Key>& publicKey, const PassRefPtrW
illBeRawPtr<Key>& privateKey) |
| 49 : m_publicKey(publicKey) | 47 : m_publicKey(publicKey) |
| 50 , m_privateKey(privateKey) | 48 , m_privateKey(privateKey) |
| 51 { | 49 { |
| 52 ASSERT(m_publicKey.get()); | 50 ASSERT(m_publicKey.get()); |
| 53 ASSERT(m_privateKey.get()); | 51 ASSERT(m_privateKey.get()); |
| 54 ScriptWrappable::init(this); | 52 ScriptWrappable::init(this); |
| 55 } | 53 } |
| 56 | 54 |
| 57 void KeyPair::trace(Visitor* visitor) | 55 void KeyPair::trace(Visitor* visitor) |
| 58 { | 56 { |
| 59 visitor->trace(m_publicKey); | 57 visitor->trace(m_publicKey); |
| 60 visitor->trace(m_privateKey); | 58 visitor->trace(m_privateKey); |
| 61 } | 59 } |
| 62 | 60 |
| 63 } // namespace WebCore | 61 } // namespace WebCore |
| OLD | NEW |