Add renderer peak memory metrics during load
This patch adds variants of Memory.Experimental.Renderer.* metrics that
collect peak memory usage during the frame load. This would help us to
understand the renderer-side memory impact of the request throttling.
Bug: 729951
Change-Id: I3417a8dda5480fddbd830f72dea9c4079c73c3a3
Reviewed-on: https://chromium-review.googlesource.com/569327
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Takashi Toyoshima <[email protected]>
Reviewed-by: Keishi Hattori <[email protected]>
Reviewed-by: Ilya Sherman <[email protected]>
Commit-Queue: Kunihiko Sakamoto <[email protected]>
Cr-Commit-Position: refs/heads/master@{#487818}
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 39309d0a..900d476 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -48,6 +48,7 @@
#include "content/public/renderer/render_frame.h"
#include "content/renderer/frame_blame_context.h"
#include "content/renderer/media/media_factory.h"
+#include "content/renderer/render_thread_impl.h"
#include "content/renderer/renderer_webcookiejar_impl.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_platform_file.h"
@@ -1125,6 +1126,9 @@
void SendUpdateFaviconURL(blink::WebIconURL::Type icon_types_mask);
+ void UpdatePeakMemoryStats();
+ void ReportPeakMemoryStats();
+
// Stores the WebLocalFrame we are associated with. This is null from the
// constructor until BindToFrame() is called, and it is null after
// FrameDetached() is called until destruction (which is asynchronous in the
@@ -1426,6 +1430,8 @@
// Callbacks that we should call when we get a routing token.
std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_;
+ RenderThreadImpl::RendererMemoryMetrics peak_memory_metrics_;
+
base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);