mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Measure heap memory usage for more types. Fixes #6951
This commit is contained in:
parent
94c8dcd575
commit
45145108da
175 changed files with 669 additions and 94 deletions
|
@ -48,7 +48,7 @@ use std::borrow::ToOwned;
|
|||
use std::cell::{Cell, RefCell};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Copy, Clone, Debug)]
|
||||
#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)]
|
||||
enum WebSocketRequestState {
|
||||
Connecting = 0,
|
||||
Open = 1,
|
||||
|
@ -58,17 +58,20 @@ enum WebSocketRequestState {
|
|||
|
||||
no_jsmanaged_fields!(Sender<WebSocketStream>);
|
||||
|
||||
#[derive(HeapSizeOf)]
|
||||
enum MessageData {
|
||||
Text(String),
|
||||
Binary(Vec<u8>),
|
||||
}
|
||||
|
||||
#[dom_struct]
|
||||
#[derive(HeapSizeOf)]
|
||||
pub struct WebSocket {
|
||||
eventtarget: EventTarget,
|
||||
url: Url,
|
||||
global: GlobalField,
|
||||
ready_state: Cell<WebSocketRequestState>,
|
||||
#[ignore_heap_size_of = "Defined in std"]
|
||||
sender: RefCell<Option<Arc<Mutex<Sender<WebSocketStream>>>>>,
|
||||
failed: Cell<bool>, //Flag to tell if websocket was closed due to failure
|
||||
full: Cell<bool>, //Flag to tell if websocket queue is full
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue