| 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 #include "chrome/renderer/page_load_histograms.h" | 5 #include "chrome/renderer/page_load_histograms.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 int websearch_chrome_joint_experiment_id = kNoExperiment; | 900 int websearch_chrome_joint_experiment_id = kNoExperiment; |
| 901 bool is_preview = false; | 901 bool is_preview = false; |
| 902 if (came_from_websearch) { | 902 if (came_from_websearch) { |
| 903 websearch_chrome_joint_experiment_id = | 903 websearch_chrome_joint_experiment_id = |
| 904 GetQueryStringBasedExperiment(GURL(frame->document().referrer())); | 904 GetQueryStringBasedExperiment(GURL(frame->document().referrer())); |
| 905 is_preview = ViaHeaderContains(frame, "1.1 Google Instant Proxy Preview"); | 905 is_preview = ViaHeaderContains(frame, "1.1 Google Instant Proxy Preview"); |
| 906 } | 906 } |
| 907 | 907 |
| 908 MaybeDumpFirstLayoutHistograms(); | 908 MaybeDumpFirstLayoutHistograms(); |
| 909 | 909 |
| 910 content::RenderFrame* render_frame = |
| 911 content::RenderFrame::FromWebFrame(frame); |
| 912 |
| 910 // Metrics based on the timing information recorded for the Navigation Timing | 913 // Metrics based on the timing information recorded for the Navigation Timing |
| 911 // API - http://www.w3.org/TR/navigation-timing/. | 914 // API - http://www.w3.org/TR/navigation-timing/. |
| 912 DumpHistograms( | 915 DumpHistograms(frame->performance(), document_state, |
| 913 frame->performance(), document_state, data_reduction_proxy_was_used, | 916 data_reduction_proxy_was_used, render_frame->IsUsingLoFi(), |
| 914 false /* TODO: render_frame->IsLoFiOn() */, came_from_websearch, | 917 came_from_websearch, websearch_chrome_joint_experiment_id, |
| 915 websearch_chrome_joint_experiment_id, is_preview, scheme_type); | 918 is_preview, scheme_type); |
| 916 | 919 |
| 917 // Old metrics based on the timing information stored in DocumentState. These | 920 // Old metrics based on the timing information stored in DocumentState. These |
| 918 // are deprecated and should go away. | 921 // are deprecated and should go away. |
| 919 DumpDeprecatedHistograms(frame->performance(), document_state, | 922 DumpDeprecatedHistograms(frame->performance(), document_state, |
| 920 data_reduction_proxy_was_used, | 923 data_reduction_proxy_was_used, |
| 921 came_from_websearch, | 924 came_from_websearch, |
| 922 websearch_chrome_joint_experiment_id, | 925 websearch_chrome_joint_experiment_id, |
| 923 is_preview, | 926 is_preview, |
| 924 scheme_type); | 927 scheme_type); |
| 925 | 928 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 | 1027 |
| 1025 DCHECK(document_state); | 1028 DCHECK(document_state); |
| 1026 DCHECK(ds); | 1029 DCHECK(ds); |
| 1027 GURL url(ds->request().url()); | 1030 GURL url(ds->request().url()); |
| 1028 Time start = document_state->start_load_time(); | 1031 Time start = document_state->start_load_time(); |
| 1029 Time finish = document_state->finish_load_time(); | 1032 Time finish = document_state->finish_load_time(); |
| 1030 // TODO(mbelshe): should we log more stats? | 1033 // TODO(mbelshe): should we log more stats? |
| 1031 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " | 1034 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " |
| 1032 << url.spec(); | 1035 << url.spec(); |
| 1033 } | 1036 } |
| OLD | NEW |