1#[allow(unused_imports)]
3use super::types::*;
4#[allow(unused_imports)]
5use serde::{Deserialize, Serialize};
6#[allow(unused_imports)]
7use serde_json::Value as Json;
8#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
9pub enum PressureLevel {
10 #[serde(rename = "moderate")]
11 Moderate,
12 #[serde(rename = "critical")]
13 Critical,
14}
15#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
16pub struct SamplingProfileNode {
17 #[serde(default)]
18 #[serde(rename = "size")]
19 pub size: JsFloat,
20 #[serde(default)]
21 #[serde(rename = "total")]
22 pub total: JsFloat,
23 #[serde(default)]
24 #[serde(rename = "stack")]
25 pub stack: Vec<String>,
26}
27#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
28pub struct SamplingProfile {
29 #[serde(rename = "samples")]
30 pub samples: Vec<SamplingProfileNode>,
31 #[serde(rename = "modules")]
32 pub modules: Vec<Module>,
33}
34#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
35pub struct Module {
36 #[serde(default)]
37 #[serde(rename = "name")]
38 pub name: String,
39 #[serde(default)]
40 #[serde(rename = "uuid")]
41 pub uuid: String,
42 #[serde(default)]
43 #[serde(rename = "baseAddress")]
44 pub base_address: String,
45 #[serde(default)]
46 #[serde(rename = "size")]
47 pub size: JsFloat,
48}
49#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
50pub struct DomCounter {
51 #[serde(default)]
52 #[serde(rename = "name")]
53 pub name: String,
54 #[serde(default)]
55 #[serde(rename = "count")]
56 pub count: JsUInt,
57}
58#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
59#[serde(rename_all = "camelCase")]
60pub struct GetDOMCounters(pub Option<serde_json::Value>);
61#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
62#[serde(rename_all = "camelCase")]
63pub struct GetDOMCountersForLeakDetection(pub Option<serde_json::Value>);
64#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
65#[serde(rename_all = "camelCase")]
66pub struct PrepareForLeakDetection(pub Option<serde_json::Value>);
67#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
68#[serde(rename_all = "camelCase")]
69pub struct ForciblyPurgeJavaScriptMemory(pub Option<serde_json::Value>);
70#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
71pub struct SetPressureNotificationsSuppressed {
72 #[serde(default)]
73 #[serde(rename = "suppressed")]
74 pub suppressed: bool,
75}
76#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
77pub struct SimulatePressureNotification {
78 #[serde(rename = "level")]
79 pub level: PressureLevel,
80}
81#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
82pub struct StartSampling {
83 #[serde(skip_serializing_if = "Option::is_none")]
84 #[serde(default)]
85 #[serde(rename = "samplingInterval")]
86 pub sampling_interval: Option<JsUInt>,
87 #[serde(skip_serializing_if = "Option::is_none")]
88 #[serde(default)]
89 #[serde(rename = "suppressRandomness")]
90 pub suppress_randomness: Option<bool>,
91}
92#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
93#[serde(rename_all = "camelCase")]
94pub struct StopSampling(pub Option<serde_json::Value>);
95#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
96#[serde(rename_all = "camelCase")]
97pub struct GetAllTimeSamplingProfile(pub Option<serde_json::Value>);
98#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
99#[serde(rename_all = "camelCase")]
100pub struct GetBrowserSamplingProfile(pub Option<serde_json::Value>);
101#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
102#[serde(rename_all = "camelCase")]
103pub struct GetSamplingProfile(pub Option<serde_json::Value>);
104#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
105pub struct GetDOMCountersReturnObject {
106 #[serde(default)]
107 #[serde(rename = "documents")]
108 pub documents: JsUInt,
109 #[serde(default)]
110 #[serde(rename = "nodes")]
111 pub nodes: JsUInt,
112 #[serde(default)]
113 #[serde(rename = "jsEventListeners")]
114 pub js_event_listeners: JsUInt,
115}
116#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
117pub struct GetDOMCountersForLeakDetectionReturnObject {
118 #[serde(rename = "counters")]
119 pub counters: Vec<DomCounter>,
120}
121#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
122#[serde(rename_all = "camelCase")]
123pub struct PrepareForLeakDetectionReturnObject {}
124#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
125#[serde(rename_all = "camelCase")]
126pub struct ForciblyPurgeJavaScriptMemoryReturnObject {}
127#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
128#[serde(rename_all = "camelCase")]
129pub struct SetPressureNotificationsSuppressedReturnObject {}
130#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
131#[serde(rename_all = "camelCase")]
132pub struct SimulatePressureNotificationReturnObject {}
133#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
134#[serde(rename_all = "camelCase")]
135pub struct StartSamplingReturnObject {}
136#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
137#[serde(rename_all = "camelCase")]
138pub struct StopSamplingReturnObject {}
139#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
140pub struct GetAllTimeSamplingProfileReturnObject {
141 #[serde(rename = "profile")]
142 pub profile: SamplingProfile,
143}
144#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
145pub struct GetBrowserSamplingProfileReturnObject {
146 #[serde(rename = "profile")]
147 pub profile: SamplingProfile,
148}
149#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
150pub struct GetSamplingProfileReturnObject {
151 #[serde(rename = "profile")]
152 pub profile: SamplingProfile,
153}
154impl Method for GetDOMCounters {
155 const NAME: &'static str = "Memory.getDOMCounters";
156 type ReturnObject = GetDOMCountersReturnObject;
157}
158impl Method for GetDOMCountersForLeakDetection {
159 const NAME: &'static str = "Memory.getDOMCountersForLeakDetection";
160 type ReturnObject = GetDOMCountersForLeakDetectionReturnObject;
161}
162impl Method for PrepareForLeakDetection {
163 const NAME: &'static str = "Memory.prepareForLeakDetection";
164 type ReturnObject = PrepareForLeakDetectionReturnObject;
165}
166impl Method for ForciblyPurgeJavaScriptMemory {
167 const NAME: &'static str = "Memory.forciblyPurgeJavaScriptMemory";
168 type ReturnObject = ForciblyPurgeJavaScriptMemoryReturnObject;
169}
170impl Method for SetPressureNotificationsSuppressed {
171 const NAME: &'static str = "Memory.setPressureNotificationsSuppressed";
172 type ReturnObject = SetPressureNotificationsSuppressedReturnObject;
173}
174impl Method for SimulatePressureNotification {
175 const NAME: &'static str = "Memory.simulatePressureNotification";
176 type ReturnObject = SimulatePressureNotificationReturnObject;
177}
178impl Method for StartSampling {
179 const NAME: &'static str = "Memory.startSampling";
180 type ReturnObject = StartSamplingReturnObject;
181}
182impl Method for StopSampling {
183 const NAME: &'static str = "Memory.stopSampling";
184 type ReturnObject = StopSamplingReturnObject;
185}
186impl Method for GetAllTimeSamplingProfile {
187 const NAME: &'static str = "Memory.getAllTimeSamplingProfile";
188 type ReturnObject = GetAllTimeSamplingProfileReturnObject;
189}
190impl Method for GetBrowserSamplingProfile {
191 const NAME: &'static str = "Memory.getBrowserSamplingProfile";
192 type ReturnObject = GetBrowserSamplingProfileReturnObject;
193}
194impl Method for GetSamplingProfile {
195 const NAME: &'static str = "Memory.getSamplingProfile";
196 type ReturnObject = GetSamplingProfileReturnObject;
197}
198pub mod events {
199 #[allow(unused_imports)]
200 use super::super::types::*;
201 #[allow(unused_imports)]
202 use serde::{Deserialize, Serialize};
203}