performancetimeline.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. // Code generated by cdproto-gen. DO NOT EDIT.
  10. import (
  11. "context"
  12. "github.com/chromedp/cdproto/cdp"
  13. )
  14. // EnableParams previously buffered events would be reported before method
  15. // returns. See also: timelineEventAdded.
  16. type EnableParams struct {
  17. 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.
  18. }
  19. // Enable previously buffered events would be reported before method returns.
  20. // See also: timelineEventAdded.
  21. //
  22. // See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#method-enable
  23. //
  24. // parameters:
  25. //
  26. // 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.
  27. func Enable(eventTypes []string) *EnableParams {
  28. return &EnableParams{
  29. EventTypes: eventTypes,
  30. }
  31. }
  32. // Do executes PerformanceTimeline.enable against the provided context.
  33. func (p *EnableParams) Do(ctx context.Context) (err error) {
  34. return cdp.Execute(ctx, CommandEnable, p, nil)
  35. }
  36. // Command names.
  37. const (
  38. CommandEnable = "PerformanceTimeline.enable"
  39. )