Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Side by Side Diff: third_party/WebKit/public/platform/WebRTCCertificate.h

Issue 2147413002: WebRTCCertificateGenerator should not use std::string. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698