OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_RENDERER_MEDIA_RTC_CERTIFICATE_GENERATOR_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_CERTIFICATE_GENERATOR_H_ |
6 #define CONTENT_RENDERER_MEDIA_RTC_CERTIFICATE_GENERATOR_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_CERTIFICATE_GENERATOR_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "third_party/WebKit/public/platform/WebRTCCertificate.h" | 9 #include "third_party/WebKit/public/platform/WebRTCCertificate.h" |
10 #include "third_party/WebKit/public/platform/WebRTCCertificateGenerator.h" | 10 #include "third_party/WebKit/public/platform/WebRTCCertificateGenerator.h" |
11 #include "third_party/WebKit/public/platform/WebRTCKeyParams.h" | 11 #include "third_party/WebKit/public/platform/WebRTCKeyParams.h" |
| 12 #include "third_party/webrtc/base/optional.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
15 // Chromium's WebRTCCertificateGenerator implementation; uses the | 16 // Chromium's WebRTCCertificateGenerator implementation; uses the |
16 // PeerConnectionIdentityStore/SSLIdentity::Generate to generate the identity, | 17 // PeerConnectionIdentityStore/SSLIdentity::Generate to generate the identity, |
17 // rtc::RTCCertificate and content::RTCCertificate. | 18 // rtc::RTCCertificate and content::RTCCertificate. |
18 class RTCCertificateGenerator : public blink::WebRTCCertificateGenerator { | 19 class RTCCertificateGenerator : public blink::WebRTCCertificateGenerator { |
19 public: | 20 public: |
20 RTCCertificateGenerator() {} | 21 RTCCertificateGenerator() {} |
21 ~RTCCertificateGenerator() override {} | 22 ~RTCCertificateGenerator() override {} |
22 | 23 |
23 // blink::WebRTCCertificateGenerator implementation. | 24 // blink::WebRTCCertificateGenerator implementation. |
24 void generateCertificate( | 25 void generateCertificate( |
25 const blink::WebRTCKeyParams& key_params, | 26 const blink::WebRTCKeyParams& key_params, |
26 const blink::WebURL& url, | 27 const blink::WebURL& url, |
27 const blink::WebURL& first_party_for_cookies, | 28 const blink::WebURL& first_party_for_cookies, |
28 std::unique_ptr<blink::WebRTCCertificateCallback> observer) override; | 29 std::unique_ptr<blink::WebRTCCertificateCallback> observer) override; |
| 30 void generateCertificateWithExpiration( |
| 31 const blink::WebRTCKeyParams& key_params, |
| 32 const blink::WebURL& url, |
| 33 const blink::WebURL& first_party_for_cookies, |
| 34 uint64_t expires_ms, |
| 35 std::unique_ptr<blink::WebRTCCertificateCallback> observer) override; |
29 bool isSupportedKeyParams(const blink::WebRTCKeyParams& key_params) override; | 36 bool isSupportedKeyParams(const blink::WebRTCKeyParams& key_params) override; |
30 | 37 |
31 private: | 38 private: |
| 39 void generateCertificateWithOptionalExpiration( |
| 40 const blink::WebRTCKeyParams& key_params, |
| 41 const blink::WebURL& url, |
| 42 const blink::WebURL& first_party_for_cookies, |
| 43 const rtc::Optional<uint64_t>& expires_ms, |
| 44 std::unique_ptr<blink::WebRTCCertificateCallback> observer); |
| 45 |
32 DISALLOW_COPY_AND_ASSIGN(RTCCertificateGenerator); | 46 DISALLOW_COPY_AND_ASSIGN(RTCCertificateGenerator); |
33 }; | 47 }; |
34 | 48 |
35 } // namespace content | 49 } // namespace content |
36 | 50 |
37 #endif // CONTENT_RENDERER_MEDIA_RTC_CERTIFICATE_GENERATOR_H_ | 51 #endif // CONTENT_RENDERER_MEDIA_RTC_CERTIFICATE_GENERATOR_H_ |
OLD | NEW |