| Index: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
|
| diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
|
| index 8ddc31da5d52fad531a6f8c458da1cbfbd4fc248..b228e08fb6f9b6d9b7e39dcf32697f522a017e7c 100644
|
| --- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
|
| +++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
|
| @@ -629,6 +629,22 @@ ScriptPromise RTCPeerConnection::generateCertificate(ScriptState* scriptState, c
|
| return promise;
|
| }
|
|
|
| + // Check if |keygenAlgorithm| contains the optional DOMTimeStamp |expires| attribute.
|
| + Nullable<DOMTimeStamp> expires;
|
| + if (keygenAlgorithm.isDictionary()) {
|
| + Dictionary keygenAlgorithmDict = keygenAlgorithm.getAsDictionary();
|
| + if (keygenAlgorithmDict.hasProperty("expires")) {
|
| + v8::Local<v8::Value> expiresValue;
|
| + keygenAlgorithmDict.get("expires", expiresValue);
|
| + if (expiresValue->IsNumber()) {
|
| + double expiresDouble = expiresValue->ToNumber(scriptState->isolate()->GetCurrentContext()).ToLocalChecked()->Value();
|
| + if (expiresDouble >= 0) {
|
| + expires.set(static_cast<DOMTimeStamp>(expiresDouble));
|
| + }
|
| + }
|
| + }
|
| + }
|
| +
|
| // Convert from WebCrypto representation to recognized WebRTCKeyParams. WebRTC supports a small subset of what are valid AlgorithmIdentifiers.
|
| const char* unsupportedParamsString = "The 1st argument provided is an AlgorithmIdentifier with a supported algorithm name, but the parameters are not supported.";
|
| Nullable<WebRTCKeyParams> keyParams;
|
| @@ -675,11 +691,20 @@ ScriptPromise RTCPeerConnection::generateCertificate(ScriptState* scriptState, c
|
|
|
| // Generate certificate. The |certificateObserver| will resolve the promise asynchronously upon completion.
|
| // The observer will manage its own destruction as well as the resolver's destruction.
|
| - certificateGenerator->generateCertificate(
|
| - keyParams.get(),
|
| - toDocument(scriptState->executionContext())->url(),
|
| - toDocument(scriptState->executionContext())->firstPartyForCookies(),
|
| - certificateObserver);
|
| + if (expires.isNull()) {
|
| + certificateGenerator->generateCertificate(
|
| + keyParams.get(),
|
| + toDocument(scriptState->executionContext())->url(),
|
| + toDocument(scriptState->executionContext())->firstPartyForCookies(),
|
| + certificateObserver);
|
| + } else {
|
| + certificateGenerator->generateCertificate(
|
| + keyParams.get(),
|
| + toDocument(scriptState->executionContext())->url(),
|
| + toDocument(scriptState->executionContext())->firstPartyForCookies(),
|
| + expires.get(),
|
| + certificateObserver);
|
| + }
|
|
|
| return promise;
|
| }
|
|
|