// Package memory provides the Chrome DevTools Protocol // commands, types, and events for the Memory domain. // // Generated by the cdproto-gen command.
package memory // Code generated by cdproto-gen. DO NOT EDIT. import ( ) // GetDOMCountersParams [no description]. type GetDOMCountersParams struct{} // GetDOMCounters [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getDOMCounters func () *GetDOMCountersParams { return &GetDOMCountersParams{} } // GetDOMCountersReturns return values. type GetDOMCountersReturns struct { Documents int64 `json:"documents,omitempty"` Nodes int64 `json:"nodes,omitempty"` JsEventListeners int64 `json:"jsEventListeners,omitempty"` } // Do executes Memory.getDOMCounters against the provided context. // // returns: // // documents // nodes // jsEventListeners func ( *GetDOMCountersParams) ( context.Context) ( int64, int64, int64, error) { // execute var GetDOMCountersReturns = cdp.Execute(, CommandGetDOMCounters, nil, &) if != nil { return 0, 0, 0, } return .Documents, .Nodes, .JsEventListeners, nil } // PrepareForLeakDetectionParams [no description]. type PrepareForLeakDetectionParams struct{} // PrepareForLeakDetection [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-prepareForLeakDetection func () *PrepareForLeakDetectionParams { return &PrepareForLeakDetectionParams{} } // Do executes Memory.prepareForLeakDetection against the provided context. func ( *PrepareForLeakDetectionParams) ( context.Context) ( error) { return cdp.Execute(, CommandPrepareForLeakDetection, nil, nil) } // ForciblyPurgeJavaScriptMemoryParams simulate OomIntervention by purging V8 // memory. type ForciblyPurgeJavaScriptMemoryParams struct{} // ForciblyPurgeJavaScriptMemory simulate OomIntervention by purging V8 // memory. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-forciblyPurgeJavaScriptMemory func () *ForciblyPurgeJavaScriptMemoryParams { return &ForciblyPurgeJavaScriptMemoryParams{} } // Do executes Memory.forciblyPurgeJavaScriptMemory against the provided context. func ( *ForciblyPurgeJavaScriptMemoryParams) ( context.Context) ( error) { return cdp.Execute(, CommandForciblyPurgeJavaScriptMemory, nil, nil) } // SetPressureNotificationsSuppressedParams enable/disable suppressing memory // pressure notifications in all processes. type SetPressureNotificationsSuppressedParams struct { Suppressed bool `json:"suppressed"` // If true, memory pressure notifications will be suppressed. } // SetPressureNotificationsSuppressed enable/disable suppressing memory // pressure notifications in all processes. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-setPressureNotificationsSuppressed // // parameters: // // suppressed - If true, memory pressure notifications will be suppressed. func ( bool) *SetPressureNotificationsSuppressedParams { return &SetPressureNotificationsSuppressedParams{ Suppressed: , } } // Do executes Memory.setPressureNotificationsSuppressed against the provided context. func ( *SetPressureNotificationsSuppressedParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetPressureNotificationsSuppressed, , nil) } // SimulatePressureNotificationParams simulate a memory pressure notification // in all processes. type SimulatePressureNotificationParams struct { Level PressureLevel `json:"level"` // Memory pressure level of the notification. } // SimulatePressureNotification simulate a memory pressure notification in // all processes. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-simulatePressureNotification // // parameters: // // level - Memory pressure level of the notification. func ( PressureLevel) *SimulatePressureNotificationParams { return &SimulatePressureNotificationParams{ Level: , } } // Do executes Memory.simulatePressureNotification against the provided context. func ( *SimulatePressureNotificationParams) ( context.Context) ( error) { return cdp.Execute(, CommandSimulatePressureNotification, , nil) } // StartSamplingParams start collecting native memory profile. type StartSamplingParams struct { SamplingInterval int64 `json:"samplingInterval,omitempty"` // Average number of bytes between samples. SuppressRandomness bool `json:"suppressRandomness,omitempty"` // Do not randomize intervals between samples. } // StartSampling start collecting native memory profile. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-startSampling // // parameters: func () *StartSamplingParams { return &StartSamplingParams{} } // WithSamplingInterval average number of bytes between samples. func ( StartSamplingParams) ( int64) *StartSamplingParams { .SamplingInterval = return & } // WithSuppressRandomness do not randomize intervals between samples. func ( StartSamplingParams) ( bool) *StartSamplingParams { .SuppressRandomness = return & } // Do executes Memory.startSampling against the provided context. func ( *StartSamplingParams) ( context.Context) ( error) { return cdp.Execute(, CommandStartSampling, , nil) } // StopSamplingParams stop collecting native memory profile. type StopSamplingParams struct{} // StopSampling stop collecting native memory profile. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-stopSampling func () *StopSamplingParams { return &StopSamplingParams{} } // Do executes Memory.stopSampling against the provided context. func ( *StopSamplingParams) ( context.Context) ( error) { return cdp.Execute(, CommandStopSampling, nil, nil) } // GetAllTimeSamplingProfileParams retrieve native memory allocations profile // collected since renderer process startup. type GetAllTimeSamplingProfileParams struct{} // GetAllTimeSamplingProfile retrieve native memory allocations profile // collected since renderer process startup. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getAllTimeSamplingProfile func () *GetAllTimeSamplingProfileParams { return &GetAllTimeSamplingProfileParams{} } // GetAllTimeSamplingProfileReturns return values. type GetAllTimeSamplingProfileReturns struct { Profile *SamplingProfile `json:"profile,omitempty"` } // Do executes Memory.getAllTimeSamplingProfile against the provided context. // // returns: // // profile func ( *GetAllTimeSamplingProfileParams) ( context.Context) ( *SamplingProfile, error) { // execute var GetAllTimeSamplingProfileReturns = cdp.Execute(, CommandGetAllTimeSamplingProfile, nil, &) if != nil { return nil, } return .Profile, nil } // GetBrowserSamplingProfileParams retrieve native memory allocations profile // collected since browser process startup. type GetBrowserSamplingProfileParams struct{} // GetBrowserSamplingProfile retrieve native memory allocations profile // collected since browser process startup. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getBrowserSamplingProfile func () *GetBrowserSamplingProfileParams { return &GetBrowserSamplingProfileParams{} } // GetBrowserSamplingProfileReturns return values. type GetBrowserSamplingProfileReturns struct { Profile *SamplingProfile `json:"profile,omitempty"` } // Do executes Memory.getBrowserSamplingProfile against the provided context. // // returns: // // profile func ( *GetBrowserSamplingProfileParams) ( context.Context) ( *SamplingProfile, error) { // execute var GetBrowserSamplingProfileReturns = cdp.Execute(, CommandGetBrowserSamplingProfile, nil, &) if != nil { return nil, } return .Profile, nil } // GetSamplingProfileParams retrieve native memory allocations profile // collected since last startSampling call. type GetSamplingProfileParams struct{} // GetSamplingProfile retrieve native memory allocations profile collected // since last startSampling call. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getSamplingProfile func () *GetSamplingProfileParams { return &GetSamplingProfileParams{} } // GetSamplingProfileReturns return values. type GetSamplingProfileReturns struct { Profile *SamplingProfile `json:"profile,omitempty"` } // Do executes Memory.getSamplingProfile against the provided context. // // returns: // // profile func ( *GetSamplingProfileParams) ( context.Context) ( *SamplingProfile, error) { // execute var GetSamplingProfileReturns = cdp.Execute(, CommandGetSamplingProfile, nil, &) if != nil { return nil, } return .Profile, nil } // Command names. const ( CommandGetDOMCounters = "Memory.getDOMCounters" CommandPrepareForLeakDetection = "Memory.prepareForLeakDetection" CommandForciblyPurgeJavaScriptMemory = "Memory.forciblyPurgeJavaScriptMemory" CommandSetPressureNotificationsSuppressed = "Memory.setPressureNotificationsSuppressed" CommandSimulatePressureNotification = "Memory.simulatePressureNotification" CommandStartSampling = "Memory.startSampling" CommandStopSampling = "Memory.stopSampling" CommandGetAllTimeSamplingProfile = "Memory.getAllTimeSamplingProfile" CommandGetBrowserSamplingProfile = "Memory.getBrowserSamplingProfile" CommandGetSamplingProfile = "Memory.getSamplingProfile" )