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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 659773002: New histogram to track overhead time spent around beforeunload event + fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR comments Created 6 years, 1 month 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
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/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 880
881 base::TimeDelta time_to_commit = 881 base::TimeDelta time_to_commit =
882 base::TimeTicks::Now() - navigation_data_->start_time_; 882 base::TimeTicks::Now() - navigation_data_->start_time_;
883 UMA_HISTOGRAM_TIMES("Navigation.TimeToCommit", time_to_commit); 883 UMA_HISTOGRAM_TIMES("Navigation.TimeToCommit", time_to_commit);
884 884
885 time_to_commit -= navigation_data_->before_unload_delay_; 885 time_to_commit -= navigation_data_->before_unload_delay_;
886 base::TimeDelta time_to_network = navigation_data_->url_job_start_time_ - 886 base::TimeDelta time_to_network = navigation_data_->url_job_start_time_ -
887 navigation_data_->start_time_ - 887 navigation_data_->start_time_ -
888 navigation_data_->before_unload_delay_; 888 navigation_data_->before_unload_delay_;
889 if (navigation_data_->is_restoring_from_last_session_) { 889 if (navigation_data_->is_restoring_from_last_session_) {
890 DCHECK(!navigation_data_->before_unload_delay_.InMicroseconds());
891 UMA_HISTOGRAM_TIMES( 890 UMA_HISTOGRAM_TIMES(
892 "Navigation.TimeToCommit_SessionRestored", 891 "Navigation.TimeToCommit_SessionRestored",
893 time_to_commit); 892 time_to_commit);
894 UMA_HISTOGRAM_TIMES( 893 UMA_HISTOGRAM_TIMES(
895 "Navigation.TimeToURLJobStart_SessionRestored", 894 "Navigation.TimeToURLJobStart_SessionRestored",
896 time_to_network); 895 time_to_network);
897 navigation_data_.reset(); 896 navigation_data_.reset();
898 return; 897 return;
899 } 898 }
900 RenderProcessHostImpl* process_host = 899 RenderProcessHostImpl* process_host =
(...skipping 12 matching lines...) Expand all
913 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", 912 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted",
914 time_to_commit); 913 time_to_commit);
915 UMA_HISTOGRAM_TIMES( 914 UMA_HISTOGRAM_TIMES(
916 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", 915 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted",
917 time_to_network); 916 time_to_network);
918 } 917 }
919 navigation_data_.reset(); 918 navigation_data_.reset();
920 } 919 }
921 920
922 } // namespace content 921 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698