OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 4719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4730 static bool use_cache_histogram1(FieldTrialList::Find("CacheSize") && | 4730 static bool use_cache_histogram1(FieldTrialList::Find("CacheSize") && |
4731 !FieldTrialList::Find("CacheSize")->group_name().empty()); | 4731 !FieldTrialList::Find("CacheSize")->group_name().empty()); |
4732 if (use_cache_histogram1 && NavigationState::LINK_LOAD_NORMAL <= load_type && | 4732 if (use_cache_histogram1 && NavigationState::LINK_LOAD_NORMAL <= load_type && |
4733 NavigationState::LINK_LOAD_CACHE_ONLY >= load_type) { | 4733 NavigationState::LINK_LOAD_CACHE_ONLY >= load_type) { |
4734 // TODO(mbelshe): Do we really want BeginToFinishDoc here? It seems like | 4734 // TODO(mbelshe): Do we really want BeginToFinishDoc here? It seems like |
4735 // StartToFinish or BeginToFinish would be better. | 4735 // StartToFinish or BeginToFinish would be better. |
4736 PLT_HISTOGRAM(FieldTrial::MakeName( | 4736 PLT_HISTOGRAM(FieldTrial::MakeName( |
4737 "PLT.BeginToFinishDoc_LinkLoad", "CacheSize"), begin_to_finish_doc); | 4737 "PLT.BeginToFinishDoc_LinkLoad", "CacheSize"), begin_to_finish_doc); |
4738 } | 4738 } |
4739 | 4739 |
4740 // Histograms to determine if SPDY has an impact. | 4740 |
| 4741 GURL url = GURL(main_frame->url()); |
| 4742 |
| 4743 // Histograms to determine if SPDY has an impact for https traffic. |
4741 // TODO(mbelshe): After we've seen the difference between BeginToFinish | 4744 // TODO(mbelshe): After we've seen the difference between BeginToFinish |
4742 // and StartToFinish, consider removing one or the other. | 4745 // and StartToFinish, consider removing one or the other. |
4743 static bool use_spdy_histogram(FieldTrialList::Find("SpdyImpact") && | 4746 static bool use_spdy_histogram(FieldTrialList::Find("SpdyImpact") && |
4744 !FieldTrialList::Find("SpdyImpact")->group_name().empty()); | 4747 !FieldTrialList::Find("SpdyImpact")->group_name().empty()); |
4745 // Spdy requests triggered by alternate protocol are excluded here. | 4748 if (use_spdy_histogram && url.SchemeIs("https") && |
4746 // This is because when alternate protocol is avaiable, FieldTrial will | 4749 navigation_state->was_npn_negotiated()) { |
4747 // either use npn_spdy or pure http, not npn_http via TLS. That will cause | |
4748 // bias for npn_spdy and npn_http. | |
4749 if (use_spdy_histogram && navigation_state->was_npn_negotiated() && | |
4750 !navigation_state->was_alternate_protocol_available()) { | |
4751 UMA_HISTOGRAM_ENUMERATION( | 4750 UMA_HISTOGRAM_ENUMERATION( |
4752 FieldTrial::MakeName("PLT.Abandoned", "SpdyImpact"), | 4751 FieldTrial::MakeName("PLT.Abandoned", "SpdyImpact"), |
4753 abandoned_page ? 1 : 0, 2); | 4752 abandoned_page ? 1 : 0, 2); |
4754 switch (load_type) { | 4753 switch (load_type) { |
4755 case NavigationState::LINK_LOAD_NORMAL: | 4754 case NavigationState::LINK_LOAD_NORMAL: |
4756 PLT_HISTOGRAM(FieldTrial::MakeName( | 4755 PLT_HISTOGRAM(FieldTrial::MakeName( |
4757 "PLT.BeginToFinish_LinkLoadNormal_SpdyTrial", "SpdyImpact"), | 4756 "PLT.BeginToFinish_LinkLoadNormal_SpdyTrial", "SpdyImpact"), |
4758 begin_to_finish); | 4757 begin_to_finish); |
4759 PLT_HISTOGRAM(FieldTrial::MakeName( | 4758 PLT_HISTOGRAM(FieldTrial::MakeName( |
4760 "PLT.StartToFinish_LinkLoadNormal_SpdyTrial", "SpdyImpact"), | 4759 "PLT.StartToFinish_LinkLoadNormal_SpdyTrial", "SpdyImpact"), |
(...skipping 11 matching lines...) Expand all Loading... |
4772 start_to_finish); | 4771 start_to_finish); |
4773 PLT_HISTOGRAM(FieldTrial::MakeName( | 4772 PLT_HISTOGRAM(FieldTrial::MakeName( |
4774 "PLT.StartToCommit_NormalLoad_SpdyTrial", "SpdyImpact"), | 4773 "PLT.StartToCommit_NormalLoad_SpdyTrial", "SpdyImpact"), |
4775 start_to_commit); | 4774 start_to_commit); |
4776 break; | 4775 break; |
4777 default: | 4776 default: |
4778 break; | 4777 break; |
4779 } | 4778 } |
4780 } | 4779 } |
4781 | 4780 |
4782 // Histograms to compare the impact of alternate protocol: when the | 4781 // Histograms to compare the impact of alternate protocol over http traffic: |
4783 // protocol(spdy) is used vs. when it is ignored and http is used. | 4782 // when spdy is used vs. when http is used. |
4784 if (navigation_state->was_alternate_protocol_available()) { | 4783 if (url.SchemeIs("http") && |
| 4784 navigation_state->was_alternate_protocol_available()) { |
4785 if (!navigation_state->was_npn_negotiated()) { | 4785 if (!navigation_state->was_npn_negotiated()) { |
4786 // This means that even there is alternate protocols for npn_http or | 4786 // This means that even there is alternate protocols for npn_http or |
4787 // npn_spdy, they are not taken (due to the fieldtrial). | 4787 // npn_spdy, they are not taken (due to the fieldtrial). |
4788 switch (load_type) { | 4788 switch (load_type) { |
4789 case NavigationState::LINK_LOAD_NORMAL: | 4789 case NavigationState::LINK_LOAD_NORMAL: |
4790 PLT_HISTOGRAM( | 4790 PLT_HISTOGRAM( |
4791 "PLT.StartToFinish_LinkLoadNormal_AlternateProtocol_http", | 4791 "PLT.StartToFinish_LinkLoadNormal_AlternateProtocol_http", |
4792 start_to_finish); | 4792 start_to_finish); |
4793 PLT_HISTOGRAM( | 4793 PLT_HISTOGRAM( |
4794 "PLT.StartToCommit_LinkLoadNormal_AlternateProtocol_http", | 4794 "PLT.StartToCommit_LinkLoadNormal_AlternateProtocol_http", |
(...skipping 28 matching lines...) Expand all Loading... |
4823 "PLT.StartToCommit_NormalLoad_AlternateProtocol_spdy", | 4823 "PLT.StartToCommit_NormalLoad_AlternateProtocol_spdy", |
4824 start_to_commit); | 4824 start_to_commit); |
4825 break; | 4825 break; |
4826 default: | 4826 default: |
4827 break; | 4827 break; |
4828 } | 4828 } |
4829 } | 4829 } |
4830 } | 4830 } |
4831 | 4831 |
4832 // Record page load time and abandonment rates for proxy cases. | 4832 // Record page load time and abandonment rates for proxy cases. |
4833 GURL url = GURL(main_frame->url()); | |
4834 if (navigation_state->was_fetched_via_proxy()) { | 4833 if (navigation_state->was_fetched_via_proxy()) { |
4835 if (url.SchemeIs("https")) { | 4834 if (url.SchemeIs("https")) { |
4836 PLT_HISTOGRAM("PLT.StartToFinish.Proxy.https", start_to_finish); | 4835 PLT_HISTOGRAM("PLT.StartToFinish.Proxy.https", start_to_finish); |
4837 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.Proxy.https", | 4836 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.Proxy.https", |
4838 abandoned_page ? 1 : 0, 2); | 4837 abandoned_page ? 1 : 0, 2); |
4839 } else { | 4838 } else { |
4840 PLT_HISTOGRAM("PLT.StartToFinish.Proxy.http", start_to_finish); | 4839 PLT_HISTOGRAM("PLT.StartToFinish.Proxy.http", start_to_finish); |
4841 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.Proxy.http", | 4840 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.Proxy.http", |
4842 abandoned_page ? 1 : 0, 2); | 4841 abandoned_page ? 1 : 0, 2); |
4843 } | 4842 } |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5202 // the origins of the two domains are different. This can be treated as a | 5201 // the origins of the two domains are different. This can be treated as a |
5203 // top level navigation and routed back to the host. | 5202 // top level navigation and routed back to the host. |
5204 WebKit::WebFrame* opener = frame->opener(); | 5203 WebKit::WebFrame* opener = frame->opener(); |
5205 if (opener) { | 5204 if (opener) { |
5206 if (url.GetOrigin() != GURL(opener->url()).GetOrigin()) | 5205 if (url.GetOrigin() != GURL(opener->url()).GetOrigin()) |
5207 return true; | 5206 return true; |
5208 } | 5207 } |
5209 } | 5208 } |
5210 return false; | 5209 return false; |
5211 } | 5210 } |
5212 | |
OLD | NEW |