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

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

Issue 481443003: Add UMA histograms for the inter-process TimeTicks skew. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Alexei's comments. Created 6 years, 4 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
« no previous file with comments | « no previous file | content/child/resource_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/containers/hash_tables.h" 8 #include "base/containers/hash_tables.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/metrics/histogram.h"
10 #include "base/metrics/user_metrics_action.h" 11 #include "base/metrics/user_metrics_action.h"
11 #include "base/time/time.h" 12 #include "base/time/time.h"
12 #include "content/browser/accessibility/accessibility_mode_helper.h" 13 #include "content/browser/accessibility/accessibility_mode_helper.h"
13 #include "content/browser/accessibility/browser_accessibility_manager.h" 14 #include "content/browser/accessibility/browser_accessibility_manager.h"
14 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 15 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
15 #include "content/browser/child_process_security_policy_impl.h" 16 #include "content/browser/child_process_security_policy_impl.h"
16 #include "content/browser/cross_site_request_manager.h" 17 #include "content/browser/cross_site_request_manager.h"
17 #include "content/browser/frame_host/cross_process_frame_connector.h" 18 #include "content/browser/frame_host/cross_process_frame_connector.h"
18 #include "content/browser/frame_host/cross_site_transferring_request.h" 19 #include "content/browser/frame_host/cross_site_transferring_request.h"
19 #include "content/browser/frame_host/frame_tree.h" 20 #include "content/browser/frame_host/frame_tree.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 // process. See comments in inter_process_time_ticks_converter.h for more. 742 // process. See comments in inter_process_time_ticks_converter.h for more.
742 InterProcessTimeTicksConverter converter( 743 InterProcessTimeTicksConverter converter(
743 LocalTimeTicks::FromTimeTicks(send_before_unload_start_time_), 744 LocalTimeTicks::FromTimeTicks(send_before_unload_start_time_),
744 LocalTimeTicks::FromTimeTicks(base::TimeTicks::Now()), 745 LocalTimeTicks::FromTimeTicks(base::TimeTicks::Now()),
745 RemoteTimeTicks::FromTimeTicks(renderer_before_unload_start_time), 746 RemoteTimeTicks::FromTimeTicks(renderer_before_unload_start_time),
746 RemoteTimeTicks::FromTimeTicks(renderer_before_unload_end_time)); 747 RemoteTimeTicks::FromTimeTicks(renderer_before_unload_end_time));
747 LocalTimeTicks browser_before_unload_end_time = 748 LocalTimeTicks browser_before_unload_end_time =
748 converter.ToLocalTimeTicks( 749 converter.ToLocalTimeTicks(
749 RemoteTimeTicks::FromTimeTicks(renderer_before_unload_end_time)); 750 RemoteTimeTicks::FromTimeTicks(renderer_before_unload_end_time));
750 before_unload_end_time = browser_before_unload_end_time.ToTimeTicks(); 751 before_unload_end_time = browser_before_unload_end_time.ToTimeTicks();
752
753 // Collect UMA on the inter-process skew.
754 bool is_skew_additive = false;
755 if (converter.IsSkewAdditiveForMetrics()) {
756 is_skew_additive = true;
757 base::TimeDelta skew = converter.GetSkewForMetrics();
758 if (skew >= base::TimeDelta()) {
759 UMA_HISTOGRAM_TIMES(
760 "InterProcessTimeTicks.BrowserBehind_RendererToBrowser", skew);
761 } else {
762 UMA_HISTOGRAM_TIMES(
763 "InterProcessTimeTicks.BrowserAhead_RendererToBrowser", -skew);
764 }
765 }
766 UMA_HISTOGRAM_BOOLEAN(
767 "InterProcessTimeTicks.IsSkewAdditive_RendererToBrowser",
768 is_skew_additive);
751 } 769 }
752 frame_tree_node_->render_manager()->OnBeforeUnloadACK( 770 frame_tree_node_->render_manager()->OnBeforeUnloadACK(
753 render_view_host_->unload_ack_is_for_cross_site_transition_, proceed, 771 render_view_host_->unload_ack_is_for_cross_site_transition_, proceed,
754 before_unload_end_time); 772 before_unload_end_time);
755 773
756 // If canceled, notify the delegate to cancel its pending navigation entry. 774 // If canceled, notify the delegate to cancel its pending navigation entry.
757 if (!proceed) 775 if (!proceed)
758 render_view_host_->GetDelegate()->DidCancelLoading(); 776 render_view_host_->GetDelegate()->DidCancelLoading();
759 } 777 }
760 778
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 } 1253 }
1236 1254
1237 void RenderFrameHostImpl::CancelSuspendedNavigations() { 1255 void RenderFrameHostImpl::CancelSuspendedNavigations() {
1238 // Clear any state if a pending navigation is canceled or preempted. 1256 // Clear any state if a pending navigation is canceled or preempted.
1239 if (suspended_nav_params_) 1257 if (suspended_nav_params_)
1240 suspended_nav_params_.reset(); 1258 suspended_nav_params_.reset();
1241 navigations_suspended_ = false; 1259 navigations_suspended_ = false;
1242 } 1260 }
1243 1261
1244 } // namespace content 1262 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698