Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v8binding: Implement timers with IDL callback function of type Function
This is mostly a reland of Iee5c1d6917ad7770383e06a425f96000835a663a. This patch implements setTimeout/setInterval Web APIs with IDL callback function of type Function (i.e. V8Function in Blink). Also ensure eager finalization of ScheduledAction in DOMTimer to prevent a memory leak. Bug: 866610 Change-Id: I3f460247f27069e4054a984efd3f98a2ce0ceac7 Reviewed-on: https://chromium-review.googlesource.com/c/1391248 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#619125}
- Loading branch information
1 parent
16fc0dc
commit 7fc323f
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...c-markup-insertion/opening-the-input-stream/resources/url-entry-document-timer-frame.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
setTimeout(parent.timerTest, 10); | ||
</script> |
18 changes: 18 additions & 0 deletions
18
...webappapis/dynamic-markup-insertion/opening-the-input-stream/url-entry-document.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
async_test(t => { | ||
const frame = document.body.appendChild(document.createElement("iframe")); | ||
t.add_cleanup(() => frame.remove()); | ||
const frameURL = new URL("resources/url-entry-document-timer-frame.html", document.URL).href; | ||
window.timerTest = t.step_func_done(() => { | ||
assert_equals(frame.contentDocument.URL, frameURL); | ||
assert_equals(frame.contentWindow.location.href, frameURL); | ||
|
||
// In this case, the entry settings object was set when this function is | ||
// executed in the timer task through Web IDL's "invoke a callback | ||
// function" algorithm, to be the relevant settings object of this | ||
// function. Therefore the URL of this document would be inherited. | ||
assert_equals(frame.contentDocument.open(), frame.contentDocument); | ||
assert_equals(frame.contentDocument.URL, document.URL); | ||
assert_equals(frame.contentWindow.location.href, document.URL); | ||
}); | ||
frame.src = frameURL; | ||
}, "document.open() changes document's URL to the entry settings object's responsible document's (through timeouts)"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters