Commit 6790530d authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

[WPT/common/security-features] Make subresourceContext unmodified

To enable to reference `sourceContextList` when checking results.

Bug: 906850
Change-Id: I6d27ac081cef1f2cfa3d387a2a448833aa424694
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1725258
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683371}
parent 249021ac
...@@ -1104,7 +1104,7 @@ self.invokeRequest = invokeRequest; ...@@ -1104,7 +1104,7 @@ self.invokeRequest = invokeRequest;
*/ */
function invokeFromWorker(isDataUrl, workerOptions, function invokeFromWorker(isDataUrl, workerOptions,
subresource, sourceContextList) { subresource, sourceContextList) {
const currentSourceContext = sourceContextList.shift(); const currentSourceContext = sourceContextList[0];
let workerUrl = let workerUrl =
"/common/security-features/scope/worker.py?policyDeliveries=" + "/common/security-features/scope/worker.py?policyDeliveries=" +
encodeURIComponent(JSON.stringify( encodeURIComponent(JSON.stringify(
...@@ -1128,7 +1128,7 @@ function invokeFromWorker(isDataUrl, workerOptions, ...@@ -1128,7 +1128,7 @@ function invokeFromWorker(isDataUrl, workerOptions,
.then(url => { .then(url => {
const worker = new Worker(url, workerOptions); const worker = new Worker(url, workerOptions);
worker.postMessage({subresource: subresource, worker.postMessage({subresource: subresource,
sourceContextList: sourceContextList}); sourceContextList: sourceContextList.slice(1)});
return bindEvents2(worker, "message", worker, "error", window, "error"); return bindEvents2(worker, "message", worker, "error", window, "error");
}) })
.then(event => { .then(event => {
...@@ -1139,7 +1139,7 @@ function invokeFromWorker(isDataUrl, workerOptions, ...@@ -1139,7 +1139,7 @@ function invokeFromWorker(isDataUrl, workerOptions,
} }
function invokeFromIframe(subresource, sourceContextList) { function invokeFromIframe(subresource, sourceContextList) {
const currentSourceContext = sourceContextList.shift(); const currentSourceContext = sourceContextList[0];
const frameUrl = const frameUrl =
"/common/security-features/scope/document.py?policyDeliveries=" + "/common/security-features/scope/document.py?policyDeliveries=" +
encodeURIComponent(JSON.stringify( encodeURIComponent(JSON.stringify(
...@@ -1165,7 +1165,7 @@ function invokeFromIframe(subresource, sourceContextList) { ...@@ -1165,7 +1165,7 @@ function invokeFromIframe(subresource, sourceContextList) {
window, "message", iframe, "error", window, "error"); window, "message", iframe, "error", window, "error");
iframe.contentWindow.postMessage( iframe.contentWindow.postMessage(
{subresource: subresource, {subresource: subresource,
sourceContextList: sourceContextList}, sourceContextList: sourceContextList.slice(1)},
"*"); "*");
return promise; return promise;
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment