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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 2808010: Add field trial stats for alternate_protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 | « chrome/renderer/navigation_state.h ('k') | net/http/http_network_transaction.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 (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 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 if (frame->isViewSourceModeEnabled()) 2998 if (frame->isViewSourceModeEnabled())
2999 return; 2999 return;
3000 3000
3001 NavigationState* navigation_state = 3001 NavigationState* navigation_state =
3002 NavigationState::FromDataSource(frame->provisionalDataSource()); 3002 NavigationState::FromDataSource(frame->provisionalDataSource());
3003 CHECK(navigation_state); 3003 CHECK(navigation_state);
3004 3004
3005 // Record page load flags. 3005 // Record page load flags.
3006 navigation_state->set_was_fetched_via_spdy(response.wasFetchedViaSPDY()); 3006 navigation_state->set_was_fetched_via_spdy(response.wasFetchedViaSPDY());
3007 navigation_state->set_was_npn_negotiated(response.wasNpnNegotiated()); 3007 navigation_state->set_was_npn_negotiated(response.wasNpnNegotiated());
3008 navigation_state->set_was_alternate_protocol_available(
3009 response.wasAlternateProtocolAvailable());
3008 navigation_state->set_was_fetched_via_proxy(response.wasFetchedViaProxy()); 3010 navigation_state->set_was_fetched_via_proxy(response.wasFetchedViaProxy());
3009 3011
3010 // Consider loading an alternate error page for 404 responses. 3012 // Consider loading an alternate error page for 404 responses.
3011 if (response.httpStatusCode() != 404) 3013 if (response.httpStatusCode() != 404)
3012 return; 3014 return;
3013 3015
3014 // Can we even load an alternate error page for this URL? 3016 // Can we even load an alternate error page for this URL?
3015 if (!GetAlternateErrorPageURL(response.url(), HTTP_404).is_valid()) 3017 if (!GetAlternateErrorPageURL(response.url(), HTTP_404).is_valid())
3016 return; 3018 return;
3017 3019
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after
4708 // StartToFinish or BeginToFinish would be better. 4710 // StartToFinish or BeginToFinish would be better.
4709 PLT_HISTOGRAM(FieldTrial::MakeName( 4711 PLT_HISTOGRAM(FieldTrial::MakeName(
4710 "PLT.BeginToFinishDoc_LinkLoad", "CacheSize"), begin_to_finish_doc); 4712 "PLT.BeginToFinishDoc_LinkLoad", "CacheSize"), begin_to_finish_doc);
4711 } 4713 }
4712 4714
4713 // Histograms to determine if SPDY has an impact. 4715 // Histograms to determine if SPDY has an impact.
4714 // TODO(mbelshe): After we've seen the difference between BeginToFinish 4716 // TODO(mbelshe): After we've seen the difference between BeginToFinish
4715 // and StartToFinish, consider removing one or the other. 4717 // and StartToFinish, consider removing one or the other.
4716 static bool use_spdy_histogram(FieldTrialList::Find("SpdyImpact") && 4718 static bool use_spdy_histogram(FieldTrialList::Find("SpdyImpact") &&
4717 !FieldTrialList::Find("SpdyImpact")->group_name().empty()); 4719 !FieldTrialList::Find("SpdyImpact")->group_name().empty());
4718 if (use_spdy_histogram && navigation_state->was_npn_negotiated()) { 4720 // Spdy requests triggered by alternate protocol are excluded here.
4721 // This is because when alternate protocol is avaiable, FieldTrial will
4722 // either use npn_spdy or pure http, not npn_http via TLS. That will cause
4723 // bias for npn_spdy and npn_http.
4724 if (use_spdy_histogram && navigation_state->was_npn_negotiated() &&
4725 !navigation_state->was_alternate_protocol_available()) {
4719 UMA_HISTOGRAM_ENUMERATION( 4726 UMA_HISTOGRAM_ENUMERATION(
4720 FieldTrial::MakeName("PLT.Abandoned", "SpdyImpact"), 4727 FieldTrial::MakeName("PLT.Abandoned", "SpdyImpact"),
4721 abandoned_page ? 1 : 0, 2); 4728 abandoned_page ? 1 : 0, 2);
4722 switch (load_type) { 4729 switch (load_type) {
4723 case NavigationState::LINK_LOAD_NORMAL: 4730 case NavigationState::LINK_LOAD_NORMAL:
4724 PLT_HISTOGRAM(FieldTrial::MakeName( 4731 PLT_HISTOGRAM(FieldTrial::MakeName(
4725 "PLT.BeginToFinish_LinkLoadNormal_SpdyTrial", "SpdyImpact"), 4732 "PLT.BeginToFinish_LinkLoadNormal_SpdyTrial", "SpdyImpact"),
4726 begin_to_finish); 4733 begin_to_finish);
4727 PLT_HISTOGRAM(FieldTrial::MakeName( 4734 PLT_HISTOGRAM(FieldTrial::MakeName(
4728 "PLT.StartToFinish_LinkLoadNormal_SpdyTrial", "SpdyImpact"), 4735 "PLT.StartToFinish_LinkLoadNormal_SpdyTrial", "SpdyImpact"),
(...skipping 11 matching lines...) Expand all
4740 start_to_finish); 4747 start_to_finish);
4741 PLT_HISTOGRAM(FieldTrial::MakeName( 4748 PLT_HISTOGRAM(FieldTrial::MakeName(
4742 "PLT.StartToCommit_NormalLoad_SpdyTrial", "SpdyImpact"), 4749 "PLT.StartToCommit_NormalLoad_SpdyTrial", "SpdyImpact"),
4743 start_to_commit); 4750 start_to_commit);
4744 break; 4751 break;
4745 default: 4752 default:
4746 break; 4753 break;
4747 } 4754 }
4748 } 4755 }
4749 4756
4757 // Histograms to compare the impact of alternate protocol: when the
4758 // protocol(spdy) is used vs. when it is ignored and http is used.
4759 if (navigation_state->was_alternate_protocol_available()) {
4760 if (!navigation_state->was_npn_negotiated()) {
4761 // This means that even there is alternate protocols for npn_http or
4762 // npn_spdy, they are not taken (due to the fieldtrial).
4763 switch (load_type) {
4764 case NavigationState::LINK_LOAD_NORMAL:
4765 PLT_HISTOGRAM(
4766 "PLT.StartToFinish_LinkLoadNormal_AlternateProtocol_http",
4767 start_to_finish);
4768 PLT_HISTOGRAM(
4769 "PLT.StartToCommit_LinkLoadNormal_AlternateProtocol_http",
4770 start_to_commit);
4771 break;
4772 case NavigationState::NORMAL_LOAD:
4773 PLT_HISTOGRAM(
4774 "PLT.StartToFinish_NormalLoad_AlternateProtocol_http",
4775 start_to_finish);
4776 PLT_HISTOGRAM(
4777 "PLT.StartToCommit_NormalLoad_AlternateProtocol_http",
4778 start_to_commit);
4779 break;
4780 default:
4781 break;
4782 }
4783 } else if (navigation_state->was_fetched_via_spdy()) {
4784 switch (load_type) {
4785 case NavigationState::LINK_LOAD_NORMAL:
4786 PLT_HISTOGRAM(
4787 "PLT.StartToFinish_LinkLoadNormal_AlternateProtocol_spdy",
4788 start_to_finish);
4789 PLT_HISTOGRAM(
4790 "PLT.StartToCommit_LinkLoadNormal_AlternateProtocol_spdy",
4791 start_to_commit);
4792 break;
4793 case NavigationState::NORMAL_LOAD:
4794 PLT_HISTOGRAM(
4795 "PLT.StartToFinish_NormalLoad_AlternateProtocol_spdy",
4796 start_to_finish);
4797 PLT_HISTOGRAM(
4798 "PLT.StartToCommit_NormalLoad_AlternateProtocol_spdy",
4799 start_to_commit);
4800 break;
4801 default:
4802 break;
4803 }
4804 }
4805 }
4806
4750 // Record page load time and abandonment rates for proxy cases. 4807 // Record page load time and abandonment rates for proxy cases.
4751 GURL url = GURL(main_frame->url()); 4808 GURL url = GURL(main_frame->url());
4752 if (navigation_state->was_fetched_via_proxy()) { 4809 if (navigation_state->was_fetched_via_proxy()) {
4753 if (url.SchemeIs("https")) { 4810 if (url.SchemeIs("https")) {
4754 PLT_HISTOGRAM("PLT.StartToFinish.Proxy.https", start_to_finish); 4811 PLT_HISTOGRAM("PLT.StartToFinish.Proxy.https", start_to_finish);
4755 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.Proxy.https", 4812 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.Proxy.https",
4756 abandoned_page ? 1 : 0, 2); 4813 abandoned_page ? 1 : 0, 2);
4757 } else { 4814 } else {
4758 PLT_HISTOGRAM("PLT.StartToFinish.Proxy.http", start_to_finish); 4815 PLT_HISTOGRAM("PLT.StartToFinish.Proxy.http", start_to_finish);
4759 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.Proxy.http", 4816 UMA_HISTOGRAM_ENUMERATION("PLT.Abandoned.Proxy.http",
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
5192 webkit_glue::FormData form; 5249 webkit_glue::FormData form;
5193 const WebInputElement element = node.toConst<WebInputElement>(); 5250 const WebInputElement element = node.toConst<WebInputElement>();
5194 if (!form_manager_.FindFormWithFormControlElement( 5251 if (!form_manager_.FindFormWithFormControlElement(
5195 element, FormManager::REQUIRE_NONE, &form)) 5252 element, FormManager::REQUIRE_NONE, &form))
5196 return; 5253 return;
5197 5254
5198 autofill_action_ = action; 5255 autofill_action_ = action;
5199 Send(new ViewHostMsg_FillAutoFillFormData( 5256 Send(new ViewHostMsg_FillAutoFillFormData(
5200 routing_id_, autofill_query_id_, form, value, label)); 5257 routing_id_, autofill_query_id_, form, value, label));
5201 } 5258 }
OLDNEW
« no previous file with comments | « chrome/renderer/navigation_state.h ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698