aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/textinput.rs
diff options
context:
space:
mode:
authorBogdan Cuza <boghison22@gmail.com>2015-08-05 18:31:42 +0300
committerBogdan Cuza <boghison22@gmail.com>2015-08-13 21:44:41 +0300
commit45145108daa6af7e834a7c23530857c504b54b9c (patch)
treeabc5db1c178435c5192e20049b4b51b196e7b26b /components/script/textinput.rs
parent94c8dcd575a5187e02ec043c686b1cdfa6b30ba6 (diff)
downloadservo-45145108daa6af7e834a7c23530857c504b54b9c.tar.gz
servo-45145108daa6af7e834a7c23530857c504b54b9c.zip
Measure heap memory usage for more types. Fixes #6951
Diffstat (limited to 'components/script/textinput.rs')
-rw-r--r--components/script/textinput.rs6
1 files changed, 4 insertions, 2 deletions
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<T: ClipboardProvider> {
/// Current text input content, split across lines without trailing '\n'
lines: Vec<DOMString>,
@@ -40,6 +41,7 @@ pub struct TextInput<T: ClipboardProvider> {
selection_begin: Option<TextPoint>,
/// Is this a multiline input?
multiline: bool,
+ #[ignore_heap_size_of = "Can't easily measure this generic type"]
clipboard_provider: T,
}