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

Side by Side Diff: content/browser/frame_host/navigation_entry_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, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/navigation_entry_impl.h" 5 #include "content/browser/frame_host/navigation_entry_impl.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/common/content_constants.h" 10 #include "content/public/common/content_constants.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 http_status_code_ = http_status_code; 285 http_status_code_ = http_status_code;
286 } 286 }
287 287
288 int NavigationEntryImpl::GetHttpStatusCode() const { 288 int NavigationEntryImpl::GetHttpStatusCode() const {
289 return http_status_code_; 289 return http_status_code_;
290 } 290 }
291 291
292 void NavigationEntryImpl::SetRedirectChain( 292 void NavigationEntryImpl::SetRedirectChain(
293 const std::vector<GURL>& redirect_chain) { 293 const std::vector<GURL>& redirect_chain) {
294 redirect_chain_ = redirect_chain; 294 redirect_chain_ = redirect_chain;
295
296 size_t total_size = 0;
297 for (size_t i = 0; i < redirect_chain_.size(); ++i) {
298 total_size += redirect_chain_[i].Bytesize();
299 }
300 UMA_HISTOGRAM_COUNTS("Navigation.RedirectChainSizeInBytes", total_size);
295 } 301 }
296 302
297 const std::vector<GURL>& NavigationEntryImpl::GetRedirectChain() const { 303 const std::vector<GURL>& NavigationEntryImpl::GetRedirectChain() const {
298 return redirect_chain_; 304 return redirect_chain_;
299 } 305 }
300 306
301 bool NavigationEntryImpl::IsRestored() const { 307 bool NavigationEntryImpl::IsRestored() const {
302 return restore_type_ != RESTORE_NONE; 308 return restore_type_ != RESTORE_NONE;
303 } 309 }
304 310
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 356 }
351 357
352 void NavigationEntryImpl::SetScreenshotPNGData( 358 void NavigationEntryImpl::SetScreenshotPNGData(
353 scoped_refptr<base::RefCountedBytes> png_data) { 359 scoped_refptr<base::RefCountedBytes> png_data) {
354 screenshot_ = png_data; 360 screenshot_ = png_data;
355 if (screenshot_.get()) 361 if (screenshot_.get())
356 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); 362 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size());
357 } 363 }
358 364
359 } // namespace content 365 } // namespace content
OLDNEW
« 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