mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
Add scroll tree measurement in IOCompositor (#38922)
Adds a new memory report that aggregates the size of all scroll trees from within all pipelines for each web view. Testing: Acessing `about:memory` Fixes: #38726 --------- Signed-off-by: criskell <96352451+criskell@users.noreply.github.com>
This commit is contained in:
parent
55be274777
commit
7339e2b421
5 changed files with 38 additions and 3 deletions
|
@ -7,7 +7,7 @@ use std::collections::hash_map::{Entry, Values, ValuesMut};
|
|||
|
||||
use base::id::WebViewId;
|
||||
|
||||
use crate::webview_renderer::UnknownWebView;
|
||||
use crate::webview_renderer::{UnknownWebView, WebViewRenderer};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct WebViewManager<WebView> {
|
||||
|
@ -109,6 +109,17 @@ impl<WebView> WebViewManager<WebView> {
|
|||
}
|
||||
}
|
||||
|
||||
impl WebViewManager<WebViewRenderer> {
|
||||
pub(crate) fn scroll_trees_memory_usage(
|
||||
&self,
|
||||
ops: &mut malloc_size_of::MallocSizeOfOps,
|
||||
) -> usize {
|
||||
self.iter()
|
||||
.map(|renderer| renderer.scroll_trees_memory_usage(ops))
|
||||
.sum::<usize>()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use base::id::{BrowsingContextId, Index, PipelineNamespace, PipelineNamespaceId, WebViewId};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue