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 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebRTCCertificateGenerator_h | 31 #ifndef WebRTCCertificateGenerator_h |
32 #define WebRTCCertificateGenerator_h | 32 #define WebRTCCertificateGenerator_h |
33 | 33 |
34 #include "public/platform/WebCallbacks.h" | 34 #include "public/platform/WebCallbacks.h" |
35 #include "public/platform/WebPassOwnPtr.h" | |
36 #include "public/platform/WebRTCCertificate.h" | 35 #include "public/platform/WebRTCCertificate.h" |
37 #include "public/platform/WebRTCKeyParams.h" | 36 #include "public/platform/WebRTCKeyParams.h" |
38 #include "public/platform/WebURL.h" | 37 #include "public/platform/WebURL.h" |
39 | 38 |
| 39 #include <memory> |
| 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
42 using WebRTCCertificateCallback = WebCallbacks<WebPassOwnPtr<WebRTCCertificate>,
void>; | 43 using WebRTCCertificateCallback = WebCallbacks<std::unique_ptr<WebRTCCertificate
>, void>; |
43 | 44 |
44 // Interface defining a class that can generate WebRTCCertificates asynchronousl
y. | 45 // Interface defining a class that can generate WebRTCCertificates asynchronousl
y. |
45 class WebRTCCertificateGenerator { | 46 class WebRTCCertificateGenerator { |
46 public: | 47 public: |
47 virtual ~WebRTCCertificateGenerator() {} | 48 virtual ~WebRTCCertificateGenerator() {} |
48 | 49 |
49 // Start generating a certificate asynchronously. |observer| is invoked on t
he | 50 // Start generating a certificate asynchronously. |observer| is invoked on t
he |
50 // same thread that called generateCertificate when the operation is complet
ed. | 51 // same thread that called generateCertificate when the operation is complet
ed. |
51 virtual void generateCertificate( | 52 virtual void generateCertificate( |
52 const WebRTCKeyParams&, | 53 const WebRTCKeyParams&, |
53 const WebURL&, | 54 const WebURL&, |
54 const WebURL& firstPartyForCookies, | 55 const WebURL& firstPartyForCookies, |
55 WebPassOwnPtr<WebRTCCertificateCallback> observer) = 0; | 56 std::unique_ptr<WebRTCCertificateCallback> observer) |
| 57 = 0; |
56 | 58 |
57 // Determines if the parameters are supported by generateCertificate. | 59 // Determines if the parameters are supported by generateCertificate. |
58 // For example, if the number of bits of some parameter is too small or too
large we | 60 // For example, if the number of bits of some parameter is too small or too
large we |
59 // may want to reject it for security or performance reasons. | 61 // may want to reject it for security or performance reasons. |
60 virtual bool isSupportedKeyParams(const WebRTCKeyParams&) = 0; | 62 virtual bool isSupportedKeyParams(const WebRTCKeyParams&) = 0; |
61 }; | 63 }; |
62 | 64 |
63 } // namespace blink | 65 } // namespace blink |
64 | 66 |
65 #endif // WebRTCCertificateGenerator_h | 67 #endif // WebRTCCertificateGenerator_h |
OLD | NEW |