Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: Source/core/timing/Performance.idl

Issue 1198863006: First version of PerformanceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Sync with latest spec draft (DOMString -> PerformanceEntryType and new PerformanceObserver -> windo… Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/timing/Performance.idl
diff --git a/Source/core/timing/Performance.idl b/Source/core/timing/Performance.idl
index 6a8fab6b0030ec60e72d6f7d0230919d69f66bae..07cf38a88e5f0c48da8cc95b28a9e06a0699aa90 100644
--- a/Source/core/timing/Performance.idl
+++ b/Source/core/timing/Performance.idl
@@ -29,21 +29,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://w3c.github.io/performance-timeline/#entryType/index.html#idl-def-PerformanceEntryType
+enum PerformanceEntryType {
+ "composite",
+ "mark",
+ "measure",
+ "navigation",
+ "render",
+ "resource",
+ "server"
+};
+
+// http://w3c.github.io/performance-timeline/#idl-def-PerformanceObserverCallback
+callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries, PerformanceObserver observer);
+
// https://w3c.github.io/hr-time/#the-performance-interface
// TODO(philipj): This interface should be [Exposed=(Window,Worker)]. Doing that
// would allow the WorkerPerformance interface to be merged into this.
// TODO(philipj): None of the optional DOMString arguments in this interface
// should have a default value.
-interface Performance : EventTarget {
+[
+ GarbageCollected
+] interface Performance : EventTarget {
DOMHighResTimeStamp now();
// Performance Timeline
// https://w3c.github.io/performance-timeline/#the-performance-interface
// TODO(philipj): getEntries() should take an optional FilterOptions argument.
[MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntries();
- [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntriesByType(DOMString entryType);
- [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType = null);
+ [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntriesByType(PerformanceEntryType entryType);
+ [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntriesByName(DOMString name, optional PerformanceEntryType entryType = null);
// Resource Timing
// https://w3c.github.io/resource-timing/#extensions-performance-interface
@@ -75,6 +91,10 @@ interface Performance : EventTarget {
[RuntimeEnabled=FrameTimingSupport, MeasureAs=PerformanceFrameTiming] void setFrameTimingBufferSize(unsigned long maxSize);
[RuntimeEnabled=FrameTimingSupport] attribute EventHandler onframetimingbufferfull;
+ // Performance Observer
+ // http://w3c.github.io/performance-timeline/#extensions-to-the-performance-interface-1
+ [Custom, RuntimeEnabled=PerformanceObserverSupport] PerformanceObserver createPerformanceObserver(PerformanceObserverCallback callback);
+
// TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
// https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
[Measure] readonly attribute MemoryInfo memory;

Powered by Google App Engine
This is Rietveld 408576698