Commit 554a9efe authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

[COOP] access reporting [7/N] Detect "location" accesses.

Patch [3/N] modified blink windows's binding to call CheckCoopAccess()
whenever a "CrossOrigin" attribute/methods was accessed.

So far, so good. Nevertheless, some attributes are missing, because they
have a custom implementation. CheckCoopAccess needs to be added manually
for them. This patch fixes the accesses to "location".

COOP access reporting:
[1/N] https://chromium-review.googlesource.com/c/chromium/src/+/2264294
[2/N] https://chromium-review.googlesource.com/c/chromium/src/+/2270185
[3/N] https://chromium-review.googlesource.com/c/chromium/src/+/2270472
[4/N] https://chromium-review.googlesource.com/c/chromium/src/+/2273120
[5/N] https://chromium-review.googlesource.com/c/chromium/src/+/2309433
[6/N] https://chromium-review.googlesource.com/c/chromium/src/+/2308715
[7/N] this patch.

Bug: chromium:1090273
Change-Id: I6509604950baf04e5a9b644981c58282ef5e7dc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2309697
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791209}
parent 2fdee206
......@@ -69,6 +69,7 @@ static void LocationAttributeGet(const CallbackInfo& info) {
v8::Local<v8::Object> holder = info.Holder();
DOMWindow* window = V8Window::ToImpl(holder);
window->ReportCoopAccess(isolate, "location");
Location* location = window->location();
DCHECK(location);
......
......@@ -7,8 +7,8 @@ PASS cross-origin > w => w.frames
FAIL cross-origin > w => w[0] assert_not_equals: Report not received got disallowed value "timeout"
FAIL cross-origin > w => w[0] = "" assert_not_equals: Report not received got disallowed value "timeout"
PASS cross-origin > w => w.length
FAIL cross-origin > w => w.location assert_not_equals: Report not received got disallowed value "timeout"
FAIL cross-origin > w => w.location = "#" assert_not_equals: Report not received got disallowed value "timeout"
PASS cross-origin > w => w.location
PASS cross-origin > w => w.location = "#"
FAIL cross-origin > w => w["test"] assert_not_equals: Report not received got disallowed value "timeout"
FAIL cross-origin > w => w["test"] = "" assert_not_equals: Report not received got disallowed value "timeout"
PASS cross-origin > w => w.opener
......@@ -26,8 +26,8 @@ PASS same-site > w => w.frames
FAIL same-site > w => w[0] assert_not_equals: Report not received got disallowed value "timeout"
FAIL same-site > w => w[0] = "" assert_not_equals: Report not received got disallowed value "timeout"
PASS same-site > w => w.length
FAIL same-site > w => w.location assert_not_equals: Report not received got disallowed value "timeout"
FAIL same-site > w => w.location = "#" assert_not_equals: Report not received got disallowed value "timeout"
PASS same-site > w => w.location
PASS same-site > w => w.location = "#"
FAIL same-site > w => w["test"] assert_not_equals: Report not received got disallowed value "timeout"
FAIL same-site > w => w["test"] = "" assert_not_equals: Report not received got disallowed value "timeout"
PASS same-site > w => w.opener
......
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