| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 GetSupportedSchemeType(frame->document().url()); | 877 GetSupportedSchemeType(frame->document().url()); |
| 878 if (scheme_type == 0) | 878 if (scheme_type == 0) |
| 879 return false; | 879 return false; |
| 880 | 880 |
| 881 // Don't dump stats for the NTP, as PageLoadHistograms should only be recorded | 881 // Don't dump stats for the NTP, as PageLoadHistograms should only be recorded |
| 882 // for pages visited due to an explicit user navigation. | 882 // for pages visited due to an explicit user navigation. |
| 883 if (SearchBouncer::GetInstance()->IsNewTabPage(frame->document().url())) { | 883 if (SearchBouncer::GetInstance()->IsNewTabPage(frame->document().url())) { |
| 884 return false; | 884 return false; |
| 885 } | 885 } |
| 886 | 886 |
| 887 // Ignore multipart requests. | |
| 888 if (frame->dataSource()->response().isMultipartPayload()) | |
| 889 return false; | |
| 890 | |
| 891 return true; | 887 return true; |
| 892 } | 888 } |
| 893 | 889 |
| 894 void PageLoadHistograms::Dump(WebFrame* frame) { | 890 void PageLoadHistograms::Dump(WebFrame* frame) { |
| 895 if (!ShouldDump(frame)) | 891 if (!ShouldDump(frame)) |
| 896 return; | 892 return; |
| 897 | 893 |
| 898 URLPattern::SchemeMasks scheme_type = | 894 URLPattern::SchemeMasks scheme_type = |
| 899 GetSupportedSchemeType(frame->document().url()); | 895 GetSupportedSchemeType(frame->document().url()); |
| 900 | 896 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 | 1040 |
| 1045 DCHECK(document_state); | 1041 DCHECK(document_state); |
| 1046 DCHECK(ds); | 1042 DCHECK(ds); |
| 1047 GURL url(ds->request().url()); | 1043 GURL url(ds->request().url()); |
| 1048 Time start = document_state->start_load_time(); | 1044 Time start = document_state->start_load_time(); |
| 1049 Time finish = document_state->finish_load_time(); | 1045 Time finish = document_state->finish_load_time(); |
| 1050 // TODO(mbelshe): should we log more stats? | 1046 // TODO(mbelshe): should we log more stats? |
| 1051 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " | 1047 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " |
| 1052 << url.spec(); | 1048 << url.spec(); |
| 1053 } | 1049 } |
| OLD | NEW |