| 1 |
// Package performancetimeline provides the Chrome DevTools Protocol |
| 2 |
// commands, types, and events for the PerformanceTimeline domain. |
| 3 |
// |
| 4 |
// Reporting of performance timeline events, as specified in |
| 5 |
// https://w3c.github.io/performance-timeline/#dom-performanceobserver. |
| 6 |
// |
| 7 |
// Generated by the cdproto-gen command. |
| 8 |
package performancetimeline |
| 9 |
|
| 10 |
// Code generated by cdproto-gen. DO NOT EDIT. |
| 11 |
|
| 12 |
import ( |
| 13 |
"context" |
| 14 |
|
| 15 |
"github.com/chromedp/cdproto/cdp" |
| 16 |
) |
| 17 |
|
| 18 |
// EnableParams previously buffered events would be reported before method |
| 19 |
// returns. See also: timelineEventAdded. |
| 20 |
type EnableParams struct { |
| 21 |
EventTypes []string `json:"eventTypes"` // The types of event to report, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype The specified filter overrides any previous filters, passing empty filter disables recording. Note that not all types exposed to the web platform are currently supported. |
| 22 |
} |
| 23 |
|
| 24 |
// Enable previously buffered events would be reported before method returns. |
| 25 |
// See also: timelineEventAdded. |
| 26 |
// |
| 27 |
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#method-enable |
| 28 |
// |
| 29 |
// parameters: |
| 30 |
// |
| 31 |
// eventTypes - The types of event to report, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype The specified filter overrides any previous filters, passing empty filter disables recording. Note that not all types exposed to the web platform are currently supported. |
| 32 |
func Enable(eventTypes []string) *EnableParams { |
| 33 |
return &EnableParams{ |
| 34 |
EventTypes: eventTypes, |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
// Do executes PerformanceTimeline.enable against the provided context. |
| 39 |
func (p *EnableParams) Do(ctx context.Context) (err error) { |
| 40 |
return cdp.Execute(ctx, CommandEnable, p, nil) |
| 41 |
} |
| 42 |
|
| 43 |
// Command names. |
| 44 |
const ( |
| 45 |
CommandEnable = "PerformanceTimeline.enable" |
| 46 |
) |