func (c *HeapProfiler) StopTrackingHeapObjects(ctx context.Context, reportProgress bool, treatGlobalObjectsAsRoots bool) (*gcdmessage.ChromeResponse, error) {
	var v HeapProfilerStopTrackingHeapObjectsParams
	v.ReportProgress = reportProgress
	v.TreatGlobalObjectsAsRoots = treatGlobalObjectsAsRoots
	return c.StopTrackingHeapObjectsWithParams(ctx, &v)
}
StopTrackingHeapObjects -
reportProgress - If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
treatGlobalObjectsAsRoots -
package gcdapi
import (
	"context"
	"github.com/wirepair/gcd/v2/gcdmessage"
)
type HeapProfilerSamplingHeapProfileNode struct {
	CallFrame *RuntimeCallFrame                      `json:"callFrame"`  
	SelfSize  float64                                `json:"selfSize"`   
	Id        int                                    `json:"id"`         
	Children  []*HeapProfilerSamplingHeapProfileNode `json:"children"`   
}
type HeapProfilerSamplingHeapProfileSample struct {
	Size    float64 `json:"size"`     
	NodeId  int     `json:"nodeId"`   
	Ordinal float64 `json:"ordinal"`  
}
type HeapProfilerSamplingHeapProfile struct {
	Head    *HeapProfilerSamplingHeapProfileNode     `json:"head"`     
	Samples []*HeapProfilerSamplingHeapProfileSample `json:"samples"`  
}
type HeapProfilerAddHeapSnapshotChunkEvent struct {
	Method string `json:"method"`
	Params struct {
		Chunk string `json:"chunk"`  
	} `json:"Params,omitempty"`
}
type HeapProfilerHeapStatsUpdateEvent struct {
	Method string `json:"method"`
	Params struct {
		StatsUpdate []int `json:"statsUpdate"`  
	} `json:"Params,omitempty"`
}
type HeapProfilerLastSeenObjectIdEvent struct {
	Method string `json:"method"`
	Params struct {
		LastSeenObjectId int     `json:"lastSeenObjectId"`  
		Timestamp        float64 `json:"timestamp"`         
	} `json:"Params,omitempty"`
}
type HeapProfilerReportHeapSnapshotProgressEvent struct {
	Method string `json:"method"`
	Params struct {
		Done     int  `json:"done"`                
		Total    int  `json:"total"`               
		Finished bool `json:"finished,omitempty"`  
	} `json:"Params,omitempty"`
}
type HeapProfiler struct {
	target gcdmessage.ChromeTargeter
}
func NewHeapProfiler(target gcdmessage.ChromeTargeter) *HeapProfiler {
	c := &HeapProfiler{target: target}
	return c
}
type HeapProfilerAddInspectedHeapObjectParams struct {
	HeapObjectId string `json:"heapObjectId"`
}
func (c *HeapProfiler) AddInspectedHeapObjectWithParams(ctx context.Context, v *HeapProfilerAddInspectedHeapObjectParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.addInspectedHeapObject", Params: v})
}
func (c *HeapProfiler) AddInspectedHeapObject(ctx context.Context, heapObjectId string) (*gcdmessage.ChromeResponse, error) {
	var v HeapProfilerAddInspectedHeapObjectParams
	v.HeapObjectId = heapObjectId
	return c.AddInspectedHeapObjectWithParams(ctx, &v)
}
func (c *HeapProfiler) CollectGarbage(ctx context.Context) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.collectGarbage"})
}
func (c *HeapProfiler) Disable(ctx context.Context) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.disable"})
}
func (c *HeapProfiler) Enable(ctx context.Context) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.enable"})
}
type HeapProfilerGetHeapObjectIdParams struct {
	ObjectId string `json:"objectId"`
}
func (c *HeapProfiler) GetHeapObjectIdWithParams(ctx context.Context, v *HeapProfilerGetHeapObjectIdParams) (string, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.getHeapObjectId", Params: v})
	if err != nil {
		return "", err
	}
	var chromeData struct {
		Result struct {
			HeapSnapshotObjectId string
		}
	}
	if resp == nil {
		return "", &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return "", &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return "", err
	}
	return chromeData.Result.HeapSnapshotObjectId, nil
}
func (c *HeapProfiler) GetHeapObjectId(ctx context.Context, objectId string) (string, error) {
	var v HeapProfilerGetHeapObjectIdParams
	v.ObjectId = objectId
	return c.GetHeapObjectIdWithParams(ctx, &v)
}
type HeapProfilerGetObjectByHeapObjectIdParams struct {
	ObjectId string `json:"objectId"`
	ObjectGroup string `json:"objectGroup,omitempty"`
}
func (c *HeapProfiler) GetObjectByHeapObjectIdWithParams(ctx context.Context, v *HeapProfilerGetObjectByHeapObjectIdParams) (*RuntimeRemoteObject, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.getObjectByHeapObjectId", Params: v})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			Result *RuntimeRemoteObject
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.Result, nil
}
func (c *HeapProfiler) GetObjectByHeapObjectId(ctx context.Context, objectId string, objectGroup string) (*RuntimeRemoteObject, error) {
	var v HeapProfilerGetObjectByHeapObjectIdParams
	v.ObjectId = objectId
	v.ObjectGroup = objectGroup
	return c.GetObjectByHeapObjectIdWithParams(ctx, &v)
}
func (c *HeapProfiler) GetSamplingProfile(ctx context.Context) (*HeapProfilerSamplingHeapProfile, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.getSamplingProfile"})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			Profile *HeapProfilerSamplingHeapProfile
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.Profile, nil
}
type HeapProfilerStartSamplingParams struct {
	SamplingInterval float64 `json:"samplingInterval,omitempty"`
}
func (c *HeapProfiler) StartSamplingWithParams(ctx context.Context, v *HeapProfilerStartSamplingParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.startSampling", Params: v})
}
func (c *HeapProfiler) StartSampling(ctx context.Context, samplingInterval float64) (*gcdmessage.ChromeResponse, error) {
	var v HeapProfilerStartSamplingParams
	v.SamplingInterval = samplingInterval
	return c.StartSamplingWithParams(ctx, &v)
}
type HeapProfilerStartTrackingHeapObjectsParams struct {
	TrackAllocations bool `json:"trackAllocations,omitempty"`
}
func (c *HeapProfiler) StartTrackingHeapObjectsWithParams(ctx context.Context, v *HeapProfilerStartTrackingHeapObjectsParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.startTrackingHeapObjects", Params: v})
}
func (c *HeapProfiler) StartTrackingHeapObjects(ctx context.Context, trackAllocations bool) (*gcdmessage.ChromeResponse, error) {
	var v HeapProfilerStartTrackingHeapObjectsParams
	v.TrackAllocations = trackAllocations
	return c.StartTrackingHeapObjectsWithParams(ctx, &v)
}
func (c *HeapProfiler) StopSampling(ctx context.Context) (*HeapProfilerSamplingHeapProfile, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.stopSampling"})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			Profile *HeapProfilerSamplingHeapProfile
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.Profile, nil
}
type HeapProfilerStopTrackingHeapObjectsParams struct {
	ReportProgress bool `json:"reportProgress,omitempty"`
	TreatGlobalObjectsAsRoots bool `json:"treatGlobalObjectsAsRoots,omitempty"`
}
func (c *HeapProfiler) StopTrackingHeapObjectsWithParams(ctx context.Context, v *HeapProfilerStopTrackingHeapObjectsParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.stopTrackingHeapObjects", Params: v})
}