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 <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 case DocumentState::LINK_LOAD_CACHE_ONLY: | 487 case DocumentState::LINK_LOAD_CACHE_ONLY: |
488 PLT_HISTOGRAM("PLT.BeginToFinishDoc_LinkLoadCacheOnly", | 488 PLT_HISTOGRAM("PLT.BeginToFinishDoc_LinkLoadCacheOnly", |
489 begin_to_finish_doc); | 489 begin_to_finish_doc); |
490 PLT_HISTOGRAM("PLT.BeginToFinish_LinkLoadCacheOnly", | 490 PLT_HISTOGRAM("PLT.BeginToFinish_LinkLoadCacheOnly", |
491 begin_to_finish_all_loads); | 491 begin_to_finish_all_loads); |
492 break; | 492 break; |
493 default: | 493 default: |
494 break; | 494 break; |
495 } | 495 } |
496 | 496 |
497 if (document_state->was_prefetcher()) { | |
498 PLT_HISTOGRAM("PLT.BeginToFinishDoc_ContentPrefetcher", | |
499 begin_to_finish_doc); | |
500 PLT_HISTOGRAM("PLT.BeginToFinish_ContentPrefetcher", | |
501 begin_to_finish_all_loads); | |
502 } | |
503 if (document_state->was_referred_by_prefetcher()) { | |
504 PLT_HISTOGRAM("PLT.BeginToFinishDoc_ContentPrefetcherReferrer", | |
505 begin_to_finish_doc); | |
506 PLT_HISTOGRAM("PLT.BeginToFinish_ContentPrefetcherReferrer", | |
507 begin_to_finish_all_loads); | |
508 } | |
509 | |
510 const bool use_webrequest_histogram = WasWebRequestUsedBySomeExtensions(); | 497 const bool use_webrequest_histogram = WasWebRequestUsedBySomeExtensions(); |
511 if (use_webrequest_histogram) { | 498 if (use_webrequest_histogram) { |
512 switch (load_type) { | 499 switch (load_type) { |
513 case DocumentState::NORMAL_LOAD: | 500 case DocumentState::NORMAL_LOAD: |
514 PLT_HISTOGRAM( | 501 PLT_HISTOGRAM( |
515 "PLT.BeginToFinish_NormalLoad_ExtensionWebRequest", | 502 "PLT.BeginToFinish_NormalLoad_ExtensionWebRequest", |
516 begin_to_finish_all_loads); | 503 begin_to_finish_all_loads); |
517 break; | 504 break; |
518 case DocumentState::LINK_LOAD_NORMAL: | 505 case DocumentState::LINK_LOAD_NORMAL: |
519 PLT_HISTOGRAM( | 506 PLT_HISTOGRAM( |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 Time start = document_state->start_load_time(); | 618 Time start = document_state->start_load_time(); |
632 Time finish = document_state->finish_load_time(); | 619 Time finish = document_state->finish_load_time(); |
633 // TODO(mbelshe): should we log more stats? | 620 // TODO(mbelshe): should we log more stats? |
634 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " | 621 VLOG(1) << "PLT: " << (finish - start).InMilliseconds() << "ms " |
635 << url.spec(); | 622 << url.spec(); |
636 } | 623 } |
637 | 624 |
638 void PageLoadHistograms::OnDestruct() { | 625 void PageLoadHistograms::OnDestruct() { |
639 delete this; | 626 delete this; |
640 } | 627 } |
OLD | NEW |