| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebRTCCertificate_h | 5 #ifndef WebRTCCertificate_h |
| 6 #define WebRTCCertificate_h | 6 #define WebRTCCertificate_h |
| 7 | 7 |
| 8 #include "public/platform/WebRTCKeyParams.h" | 8 #include "public/platform/WebRTCKeyParams.h" |
| 9 #include "public/platform/WebString.h" |
| 9 | 10 |
| 10 #include <memory> | 11 #include <memory> |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 | 14 |
| 14 // Corresponds to |rtc::RTCCertificatePEM| in WebRTC. | 15 // Corresponds to |rtc::RTCCertificatePEM| in WebRTC. |
| 15 // See |WebRTCCertificate::toPEM| and |WebRTCCertificateGenerator::fromPEM|. | 16 // See |WebRTCCertificate::toPEM| and |WebRTCCertificateGenerator::fromPEM|. |
| 16 class WebRTCCertificatePEM { | 17 class WebRTCCertificatePEM { |
| 17 public: | 18 public: |
| 18 WebRTCCertificatePEM(std::string privateKey, std::string certificate) | 19 WebRTCCertificatePEM(WebString privateKey, WebString certificate) |
| 19 : m_privateKey(privateKey), m_certificate(certificate) | 20 : m_privateKey(privateKey) |
| 21 , m_certificate(certificate) |
| 20 { | 22 { |
| 21 } | 23 } |
| 22 | 24 |
| 23 const std::string& privateKey() const | 25 WebString privateKey() const { return m_privateKey; } |
| 24 { | 26 WebString certificate() const { return m_certificate; } |
| 25 return m_privateKey; | |
| 26 } | |
| 27 const std::string& certificate() const | |
| 28 { | |
| 29 return m_certificate; | |
| 30 } | |
| 31 | 27 |
| 32 private: | 28 private: |
| 33 std::string m_privateKey; | 29 WebString m_privateKey; |
| 34 std::string m_certificate; | 30 WebString m_certificate; |
| 35 }; | 31 }; |
| 36 | 32 |
| 37 // WebRTCCertificate is an interface defining what Blink needs to know about cer
tificates, | 33 // WebRTCCertificate is an interface defining what Blink needs to know about cer
tificates, |
| 38 // hiding Chromium and WebRTC layer implementation details. It is possible to cr
eate | 34 // hiding Chromium and WebRTC layer implementation details. It is possible to cr
eate |
| 39 // shallow copies of the WebRTCCertificate. When all copies are destroyed, the | 35 // shallow copies of the WebRTCCertificate. When all copies are destroyed, the |
| 40 // implementation specific data must be freed. WebRTCCertificate objects thus ac
t as | 36 // implementation specific data must be freed. WebRTCCertificate objects thus ac
t as |
| 41 // references to the reference counted internal data. | 37 // references to the reference counted internal data. |
| 42 class WebRTCCertificate { | 38 class WebRTCCertificate { |
| 43 public: | 39 public: |
| 44 WebRTCCertificate() = default; | 40 WebRTCCertificate() = default; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 59 virtual bool equals(const WebRTCCertificate& other) const = 0; | 55 virtual bool equals(const WebRTCCertificate& other) const = 0; |
| 60 | 56 |
| 61 private: | 57 private: |
| 62 WebRTCCertificate(const WebRTCCertificate&) = delete; | 58 WebRTCCertificate(const WebRTCCertificate&) = delete; |
| 63 WebRTCCertificate& operator=(const WebRTCCertificate&) = delete; | 59 WebRTCCertificate& operator=(const WebRTCCertificate&) = delete; |
| 64 }; | 60 }; |
| 65 | 61 |
| 66 } // namespace blink | 62 } // namespace blink |
| 67 | 63 |
| 68 #endif // WebRTCCertificate_h | 64 #endif // WebRTCCertificate_h |
| OLD | NEW |