WebKit Bugzilla
Attachment 357073 Details for
Bug 192599
: IDB should store RTCCertificate
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192599-20181211134826.patch (text/plain), 4.97 KB, created by
youenn fablet
on 2018-12-11 13:48:26 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-12-11 13:48:26 PST
Size:
4.97 KB
patch
obsolete
>Subversion Revision: 239028 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3aa0e8cea035144cceafc95e81412646bf5b92e9..2599d7008d449e570e80707147cbaac40f29b74f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-12-11 Youenn Fablet <youenn@apple.com> >+ >+ IDB should store RTCCertificate >+ https://bugs.webkit.org/show_bug.cgi?id=192599 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate. >+ Instead, create an empty object so that the deserialization can still succeed. >+ This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper. >+ >+ Test: webrtc/certificates-indexeddb.html >+ >+ * bindings/js/SerializedScriptValue.cpp: >+ (WebCore::CloneDeserializer::readTerminal): >+ > 2018-12-10 Youenn Fablet <youenn@apple.com> > > Remove derived classes of RealtimeMediaSourceCenter >diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp >index ab8120fa34883caadf7b2067c826f2ccffd23ca6..2b8d9c0528ba8ceb9873cb6f133593635bc3faa5 100644 >--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp >+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp >@@ -2717,6 +2717,9 @@ private: > fingerprints.uncheckedAppend(RTCCertificate::DtlsFingerprint { algorithm->string(), value->string() }); > } > >+ if (!m_isDOMGlobalObject) >+ return constructEmptyObject(m_exec, m_globalObject->objectPrototype()); >+ > auto rtcCertificate = RTCCertificate::create(SecurityOrigin::createFromString(origin->string()), expires, WTFMove(fingerprints), certificate->takeString(), keyedMaterial->takeString()); > return toJSNewlyCreated(m_exec, jsCast<JSDOMGlobalObject*>(m_globalObject), WTFMove(rtcCertificate)); > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 202893917e53d9aaa0af273fc573667ad8a8ea56..da1ac9a2facbd66bd05ba54e5434bb3f8c76defb 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2018-12-11 Youenn Fablet <youenn@apple.com> >+ >+ IDB should store RTCCertificate >+ https://bugs.webkit.org/show_bug.cgi?id=192599 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * webrtc/certificates-indexeddb-expected.txt: Added. >+ * webrtc/certificates-indexeddb.html: Added. >+ > 2018-12-09 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r239010. >diff --git a/LayoutTests/webrtc/certificates-indexeddb-expected.txt b/LayoutTests/webrtc/certificates-indexeddb-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..cdcf735d091b471b5722f774cb273c0deae0b395 >--- /dev/null >+++ b/LayoutTests/webrtc/certificates-indexeddb-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Testing certificates IndexedDB storage >+ >diff --git a/LayoutTests/webrtc/certificates-indexeddb.html b/LayoutTests/webrtc/certificates-indexeddb.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3aa8bacac116d1f77324dbedccad153fcf2cfd47 >--- /dev/null >+++ b/LayoutTests/webrtc/certificates-indexeddb.html >@@ -0,0 +1,54 @@ >+<!doctype html> >+<html> >+ <head> >+ <meta charset="utf-8"> >+ <title>Testing certificates IndexedDB storage</title> >+ <script src="../resources/testharness.js"></script> >+ <script src="../resources/testharnessreport.js"></script> >+ </head> >+ <body> >+ <script> >+let certificate; >+ >+function storeKey() { >+ var objectStore = db.transaction("certificate", "readwrite").objectStore("certificate"); >+ var req = objectStore.put(certificate, "mycertificate"); >+ req.onerror = function(event) { >+ assert_unreached("Could not put a key into database: " + event.target.error.name); >+ } >+ req.onsuccess = function(event) { readKey(); } >+} >+ >+function readKey() { >+ var objectStore = db.transaction("certificate").objectStore("certificate"); >+ var req = objectStore.get("mycertificate"); >+ req.onerror = function(event) { >+ assert_not_reached("Could not get a key from database: " + event.target.error.name); >+ } >+ req.onsuccess = function(event) { >+ assert_not_equals(event.target.result, undefined); >+ assert_equals(event.target.result.expires, certificate.expires); >+ done(); >+ } >+} >+ >+async function doTest() { >+ certificate = await RTCPeerConnection.generateCertificate({ name: 'ECDSA', namedCurve: 'P-256' }); >+ >+ var openRequest = indexedDB.open("rtc"); >+ openRequest.onupgradeneeded = function(event) { >+ var objectStore = event.target.result.createObjectStore("certificate"); >+ } >+ openRequest.onerror = function(event) { >+ assert_not_reached("Could not open database: " + event.target.error.name); >+ } >+ openRequest.onsuccess = function(event) { >+ db = event.target.result; >+ storeKey(); >+ } >+} >+doTest(); >+ >+ </script> >+ </body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192599
:
357064
|
357065
| 357073