Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/browser/page_load_metrics/observers/document_write_page_load_metrics_observer.cc

Issue 2859393002: Report page load timing information for child frames. (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/browser/page_load_metrics/observers/document_write_page_load_me trics_observer.h" 5 #include "chrome/browser/page_load_metrics/observers/document_write_page_load_me trics_observer.h"
6 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" 6 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h"
7 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" 7 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h"
8 8
9 namespace internal { 9 namespace internal {
10 const char kHistogramDocWriteFirstContentfulPaint[] = 10 const char kHistogramDocWriteFirstContentfulPaint[] =
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 const char kHistogramDocWriteBlockCount[] = 70 const char kHistogramDocWriteBlockCount[] =
71 "PageLoad.Clients.DocWrite.Block.Count"; 71 "PageLoad.Clients.DocWrite.Block.Count";
72 const char kHistogramDocWriteBlockReloadCount[] = 72 const char kHistogramDocWriteBlockReloadCount[] =
73 "PageLoad.Clients.DocWrite.Block.ReloadCount"; 73 "PageLoad.Clients.DocWrite.Block.ReloadCount";
74 const char kHistogramDocWriteBlockLoadingBehavior[] = 74 const char kHistogramDocWriteBlockLoadingBehavior[] =
75 "PageLoad.Clients.DocWrite.Block.DocumentWriteLoadingBehavior"; 75 "PageLoad.Clients.DocWrite.Block.DocumentWriteLoadingBehavior";
76 76
77 } // namespace internal 77 } // namespace internal
78 78
79 void DocumentWritePageLoadMetricsObserver::OnFirstContentfulPaint( 79 void DocumentWritePageLoadMetricsObserver::OnFirstContentfulPaintInPage(
80 const page_load_metrics::PageLoadTiming& timing, 80 const page_load_metrics::PageLoadTiming& timing,
81 const page_load_metrics::PageLoadExtraInfo& info) { 81 const page_load_metrics::PageLoadExtraInfo& info) {
82 if (info.main_frame_metadata.behavior_flags & 82 if (info.main_frame_metadata.behavior_flags &
83 blink::WebLoadingBehaviorFlag:: 83 blink::WebLoadingBehaviorFlag::
84 kWebLoadingBehaviorDocumentWriteEvaluator) { 84 kWebLoadingBehaviorDocumentWriteEvaluator) {
85 LogDocumentWriteEvaluatorFirstContentfulPaint(timing, info); 85 LogDocumentWriteEvaluatorFirstContentfulPaint(timing, info);
86 } 86 }
87 if (info.main_frame_metadata.behavior_flags & 87 if (info.main_frame_metadata.behavior_flags &
88 blink::WebLoadingBehaviorFlag::kWebLoadingBehaviorDocumentWriteBlock) { 88 blink::WebLoadingBehaviorFlag::kWebLoadingBehaviorDocumentWriteBlock) {
89 LogDocumentWriteBlockFirstContentfulPaint(timing, info); 89 LogDocumentWriteBlockFirstContentfulPaint(timing, info);
90 } 90 }
91 } 91 }
92 92
93 void DocumentWritePageLoadMetricsObserver::OnFirstMeaningfulPaint( 93 void DocumentWritePageLoadMetricsObserver::
94 const page_load_metrics::PageLoadTiming& timing, 94 OnFirstMeaningfulPaintInMainFrameDocument(
95 const page_load_metrics::PageLoadExtraInfo& info) { 95 const page_load_metrics::PageLoadTiming& timing,
96 const page_load_metrics::PageLoadExtraInfo& info) {
96 if (info.main_frame_metadata.behavior_flags & 97 if (info.main_frame_metadata.behavior_flags &
97 blink::WebLoadingBehaviorFlag:: 98 blink::WebLoadingBehaviorFlag::
98 kWebLoadingBehaviorDocumentWriteEvaluator) { 99 kWebLoadingBehaviorDocumentWriteEvaluator) {
99 LogDocumentWriteEvaluatorFirstMeaningfulPaint(timing, info); 100 LogDocumentWriteEvaluatorFirstMeaningfulPaint(timing, info);
100 } 101 }
101 if (info.main_frame_metadata.behavior_flags & 102 if (info.main_frame_metadata.behavior_flags &
102 blink::WebLoadingBehaviorFlag::kWebLoadingBehaviorDocumentWriteBlock) { 103 blink::WebLoadingBehaviorFlag::kWebLoadingBehaviorDocumentWriteBlock) {
103 LogDocumentWriteBlockFirstMeaningfulPaint(timing, info); 104 LogDocumentWriteBlockFirstMeaningfulPaint(timing, info);
104 } 105 }
105 } 106 }
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 parse_duration); 292 parse_duration);
292 PAGE_LOAD_HISTOGRAM( 293 PAGE_LOAD_HISTOGRAM(
293 internal::kBackgroundHistogramDocWriteBlockParseBlockedOnScriptLoad, 294 internal::kBackgroundHistogramDocWriteBlockParseBlockedOnScriptLoad,
294 timing.parse_timing.parse_blocked_on_script_load_duration.value()); 295 timing.parse_timing.parse_blocked_on_script_load_duration.value());
295 PAGE_LOAD_HISTOGRAM( 296 PAGE_LOAD_HISTOGRAM(
296 internal::kBackgroundDocWriteBlockParseBlockedOnScriptLoadDocumentWrite, 297 internal::kBackgroundDocWriteBlockParseBlockedOnScriptLoadDocumentWrite,
297 timing.parse_timing 298 timing.parse_timing
298 .parse_blocked_on_script_load_from_document_write_duration.value()); 299 .parse_blocked_on_script_load_from_document_write_duration.value());
299 } 300 }
300 } 301 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698