| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |