From 45145108daa6af7e834a7c23530857c504b54b9c Mon Sep 17 00:00:00 2001 From: Bogdan Cuza Date: Wed, 5 Aug 2015 18:31:42 +0300 Subject: Measure heap memory usage for more types. Fixes #6951 --- components/script/textinput.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'components/script/textinput.rs') diff --git a/components/script/textinput.rs b/components/script/textinput.rs index a88f2bf491a..31fc7dc2e25 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -8,6 +8,7 @@ use clipboard_provider::ClipboardProvider; use dom::keyboardevent::{KeyboardEvent, KeyboardEventHelpers, key_value}; use msg::constellation_msg::{SHIFT, CONTROL, ALT, SUPER}; use msg::constellation_msg::{Key, KeyModifiers}; +use util::mem::HeapSizeOf; use util::str::{DOMString, slice_chars}; use std::borrow::ToOwned; @@ -21,7 +22,7 @@ pub enum Selection { NotSelected } -#[derive(JSTraceable, Copy, Clone)] +#[derive(JSTraceable, Copy, Clone, HeapSizeOf)] pub struct TextPoint { /// 0-based line number pub line: usize, @@ -30,7 +31,7 @@ pub struct TextPoint { } /// Encapsulated state for handling keyboard input in a single or multiline text input control. -#[derive(JSTraceable)] +#[derive(JSTraceable, HeapSizeOf)] pub struct TextInput { /// Current text input content, split across lines without trailing '\n' lines: Vec, @@ -40,6 +41,7 @@ pub struct TextInput { selection_begin: Option, /// Is this a multiline input? multiline: bool, + #[ignore_heap_size_of = "Can't easily measure this generic type"] clipboard_provider: T, } -- cgit v1.2.3