Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 253333003: Add a histogram for size of the memory used by redirect chain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 601f9a26e313050b38226bd8f518e76c0846bdc6..3b159d142de117fa9ee11c42c45e8704c65ac55c 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
#include "base/strings/string_number_conversions.h" // Temporary
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -826,6 +827,14 @@ bool NavigationControllerImpl::RendererDidNavigate(
active_entry->SetPageState(params.page_state);
active_entry->SetRedirectChain(params.redirects);
+ // Use histogram to track memory impact of redirect chain because it's now
+ // not cleared for committed entries.
+ size_t redirect_chain_size = 0;
+ for (size_t i = 0; i < params.redirects.size(); ++i) {
+ redirect_chain_size += params.redirects[i].spec().length();
+ }
+ UMA_HISTOGRAM_COUNTS("Navigation.RedirectChainSize", redirect_chain_size);
+
// Once it is committed, we no longer need to track several pieces of state on
// the entry.
active_entry->ResetForCommit();
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698