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

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') | tools/metrics/histograms/histograms.xml » ('J')
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 4fa5f0883f6b4e12bb3403cfdfdabe0ea4d04846..1c608f095837a9563877ca251cc25a6f2ace820b 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -7,6 +7,7 @@
#include "base/bind.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"
@@ -824,6 +825,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') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698