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