OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
6 | 6 |
7 #include "content/child/resource_dispatcher.h" | 7 #include "content/child/resource_dispatcher.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 RemoteToLocalTimeTicks(converter, &load_timing->proxy_resolve_end); | 778 RemoteToLocalTimeTicks(converter, &load_timing->proxy_resolve_end); |
779 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.dns_start); | 779 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.dns_start); |
780 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.dns_end); | 780 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.dns_end); |
781 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.connect_start); | 781 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.connect_start); |
782 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.connect_end); | 782 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.connect_end); |
783 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.ssl_start); | 783 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.ssl_start); |
784 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.ssl_end); | 784 RemoteToLocalTimeTicks(converter, &load_timing->connect_timing.ssl_end); |
785 RemoteToLocalTimeTicks(converter, &load_timing->send_start); | 785 RemoteToLocalTimeTicks(converter, &load_timing->send_start); |
786 RemoteToLocalTimeTicks(converter, &load_timing->send_end); | 786 RemoteToLocalTimeTicks(converter, &load_timing->send_end); |
787 RemoteToLocalTimeTicks(converter, &load_timing->receive_headers_end); | 787 RemoteToLocalTimeTicks(converter, &load_timing->receive_headers_end); |
| 788 |
| 789 // Collect UMA on the inter-process skew. |
| 790 bool is_skew_additive = false; |
| 791 if (converter.IsSkewAdditiveForMetrics()) { |
| 792 is_skew_additive = true; |
| 793 base::TimeDelta skew = converter.GetSkewForMetrics(); |
| 794 if (skew >= base::TimeDelta()) { |
| 795 UMA_HISTOGRAM_TIMES( |
| 796 "InterProcessTimeTicks.BrowserAhead_BrowserToRenderer", skew); |
| 797 } else { |
| 798 UMA_HISTOGRAM_TIMES( |
| 799 "InterProcessTimeTicks.BrowserBehind_BrowserToRenderer", -skew); |
| 800 } |
| 801 } |
| 802 UMA_HISTOGRAM_BOOLEAN( |
| 803 "InterProcessTimeTicks.IsSkewAdditive_BrowserToRenderer", |
| 804 is_skew_additive); |
788 } | 805 } |
789 | 806 |
790 base::TimeTicks ResourceDispatcher::ToRendererCompletionTime( | 807 base::TimeTicks ResourceDispatcher::ToRendererCompletionTime( |
791 const PendingRequestInfo& request_info, | 808 const PendingRequestInfo& request_info, |
792 const base::TimeTicks& browser_completion_time) const { | 809 const base::TimeTicks& browser_completion_time) const { |
793 if (request_info.completion_time.is_null()) { | 810 if (request_info.completion_time.is_null()) { |
794 return browser_completion_time; | 811 return browser_completion_time; |
795 } | 812 } |
796 | 813 |
797 // TODO(simonjam): The optimal lower bound should be the most recent value of | 814 // TODO(simonjam): The optimal lower bound should be the most recent value of |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 877 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
861 while (!queue->empty()) { | 878 while (!queue->empty()) { |
862 IPC::Message* message = queue->front(); | 879 IPC::Message* message = queue->front(); |
863 ReleaseResourcesInDataMessage(*message); | 880 ReleaseResourcesInDataMessage(*message); |
864 queue->pop_front(); | 881 queue->pop_front(); |
865 delete message; | 882 delete message; |
866 } | 883 } |
867 } | 884 } |
868 | 885 |
869 } // namespace content | 886 } // namespace content |
OLD | NEW |