| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 WebRTCKeyParams keyParams(WebRTCKeyTypeECDSA); | 62 WebRTCKeyParams keyParams(WebRTCKeyTypeECDSA); |
| 63 keyParams.m_params.ecCurve = curve; | 63 keyParams.m_params.ecCurve = curve; |
| 64 return keyParams; | 64 return keyParams; |
| 65 } | 65 } |
| 66 | 66 |
| 67 WebRTCKeyParams() : WebRTCKeyParams(WebRTCKeyTypeNull) {} | 67 WebRTCKeyParams() : WebRTCKeyParams(WebRTCKeyTypeNull) {} |
| 68 | 68 |
| 69 WebRTCKeyType keyType() const { return m_keyType; } | 69 WebRTCKeyType keyType() const { return m_keyType; } |
| 70 WebRTCRSAParams rsaParams() const | 70 WebRTCRSAParams rsaParams() const |
| 71 { | 71 { |
| 72 BLINK_ASSERT(m_keyType == WebRTCKeyTypeRSA); | 72 DCHECK_EQ(m_keyType, WebRTCKeyTypeRSA); |
| 73 return m_params.rsa; | 73 return m_params.rsa; |
| 74 } | 74 } |
| 75 WebRTCECCurve ecCurve() const | 75 WebRTCECCurve ecCurve() const |
| 76 { | 76 { |
| 77 BLINK_ASSERT(m_keyType == WebRTCKeyTypeECDSA); | 77 DCHECK_EQ(m_keyType, WebRTCKeyTypeECDSA); |
| 78 return m_params.ecCurve; | 78 return m_params.ecCurve; |
| 79 } | 79 } |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 WebRTCKeyParams(WebRTCKeyType keyType) : m_keyType(keyType) {} | 82 WebRTCKeyParams(WebRTCKeyType keyType) : m_keyType(keyType) {} |
| 83 | 83 |
| 84 WebRTCKeyType m_keyType; | 84 WebRTCKeyType m_keyType; |
| 85 union { | 85 union { |
| 86 WebRTCRSAParams rsa; | 86 WebRTCRSAParams rsa; |
| 87 WebRTCECCurve ecCurve; | 87 WebRTCECCurve ecCurve; |
| 88 } m_params; | 88 } m_params; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| 92 | 92 |
| 93 #endif // WebRTCKeyParams_h | 93 #endif // WebRTCKeyParams_h |
| OLD | NEW |