Auto merge of #25590 - pshaughn:perfobs, r=jdm

Make performance observers take "type" and "buffered" options without panicking.

<!-- Please describe your changes on the following line: -->
I updated the observe() method to align with spec, and fixed the borrow duration bug @jdm pointed out in #25589 so it wouldn't cause a hard crash. Some tests go from failing to passing, but others go from early failing to later timeout; performance observers still aren't doing the right thing in all cases.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #24781 and fix #25589 and fix #23225

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2020-02-12 11:09:52 -05:00 committed by GitHub
commit ed9b584344
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 171 additions and 205 deletions

View file

@ -7,8 +7,9 @@
*/
dictionary PerformanceObserverInit {
required sequence<DOMString> entryTypes;
boolean buffered = false;
sequence<DOMString> entryTypes;
DOMString type;
boolean buffered;
};
callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries, PerformanceObserver observer);
@ -17,6 +18,8 @@ callback PerformanceObserverCallback = void (PerformanceObserverEntryList entrie
interface PerformanceObserver {
[Throws] constructor(PerformanceObserverCallback callback);
[Throws]
void observe(PerformanceObserverInit options);
void observe(optional PerformanceObserverInit options = {});
void disconnect();
PerformanceEntryList takeRecords();
// [SameObject] static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
};