Chromium Code Reviews| 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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 908 int websearch_chrome_joint_experiment_id = kNoExperiment; | 908 int websearch_chrome_joint_experiment_id = kNoExperiment; |
| 909 bool is_preview = false; | 909 bool is_preview = false; |
| 910 if (came_from_websearch) { | 910 if (came_from_websearch) { |
| 911 websearch_chrome_joint_experiment_id = | 911 websearch_chrome_joint_experiment_id = |
| 912 GetQueryStringBasedExperiment(GURL(frame->document().referrer())); | 912 GetQueryStringBasedExperiment(GURL(frame->document().referrer())); |
| 913 is_preview = ViaHeaderContains(frame, "1.1 Google Instant Proxy Preview"); | 913 is_preview = ViaHeaderContains(frame, "1.1 Google Instant Proxy Preview"); |
| 914 } | 914 } |
| 915 | 915 |
| 916 MaybeDumpFirstLayoutHistograms(); | 916 MaybeDumpFirstLayoutHistograms(); |
| 917 | 917 |
| 918 content::RenderFrame* render_frame = | |
| 919 content::RenderFrame::FromWebFrame(frame); | |
| 920 | |
| 918 // Metrics based on the timing information recorded for the Navigation Timing | 921 // Metrics based on the timing information recorded for the Navigation Timing |
| 919 // API - http://www.w3.org/TR/navigation-timing/. | 922 // API - http://www.w3.org/TR/navigation-timing/. |
| 920 DumpHistograms( | 923 DumpHistograms(frame->performance(), document_state, |
| 921 frame->performance(), document_state, data_reduction_proxy_was_used, | 924 data_reduction_proxy_was_used, render_frame->IsLoFiOn(), |
|
mmenke
2015/09/29 16:35:57
Suggest UsingLoFi (Or IsUsingLoFi), think that mak
megjablon
2015/09/29 21:20:07
I like this better. Done.
| |
| 922 false /* TODO: render_frame->IsLoFiOn() */, came_from_websearch, | 925 came_from_websearch, websearch_chrome_joint_experiment_id, |
| 923 websearch_chrome_joint_experiment_id, is_preview, scheme_type); | 926 is_preview, scheme_type); |
| 924 | 927 |
| 925 // Old metrics based on the timing information stored in DocumentState. These | 928 // Old metrics based on the timing information stored in DocumentState. These |
| 926 // are deprecated and should go away. | 929 // are deprecated and should go away. |
| 927 DumpDeprecatedHistograms(frame->performance(), document_state, | 930 DumpDeprecatedHistograms(frame->performance(), document_state, |
| 928 data_reduction_proxy_was_used, | 931 data_reduction_proxy_was_used, |
| 929 came_from_websearch, | 932 came_from_websearch, |
| 930 websearch_chrome_joint_experiment_id, | 933 websearch_chrome_joint_experiment_id, |
| 931 is_preview, | 934 is_preview, |
| 932 scheme_type); | 935 scheme_type); |
| 933 | 936 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1032 | 1035 |
| 1033 DCHECK(document_state); | 1036 DCHECK(document_state); |
| 1034 DCHECK(ds); | 1037 DCHECK(ds); |
| 1035 GURL url(ds->request().url()); | 1038 GURL url(ds->request().url()); |
| 1036 Time start = document_state->start_load_time(); | 1039 Time start = document_state->start_load_time(); |
| 1037 Time finish = document_state->finish_load_time(); | 1040 Time finish = document_state->finish_load_time(); |
| 1038 // TODO(mbelshe): should we log more stats? | 1041 // TODO(mbelshe): should we log more stats? |
| 1039 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " | 1042 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " |
| 1040 << url.spec(); | 1043 << url.spec(); |
| 1041 } | 1044 } |
| OLD | NEW |