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

Unified Diff: chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h

Issue 2901383002: Buffer cross frame paint timing updates. (Closed)
Patch Set: address comment 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h b/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h
index 47f6e4f5171e0534183f852a14dad6a3af9cfc08..7af5111c47c11b938278e220db08013185f497a2 100644
--- a/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h
+++ b/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h
@@ -6,9 +6,11 @@
#define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UPDATE_DISPATCHER_H_
#include <map>
+#include <memory>
#include "base/macros.h"
#include "base/time/time.h"
+#include "base/timer/timer.h"
#include "chrome/common/page_load_metrics/page_load_metrics.mojom.h"
namespace content {
@@ -65,6 +67,8 @@ enum PageLoadTimingStatus {
};
extern const char kPageLoadTimingStatus[];
+extern const char kHistogramOutOfOrderTiming[];
+extern const char kHistogramOutOfOrderTimingBuffered[];
} // namespace internal
@@ -101,6 +105,8 @@ class PageLoadMetricsUpdateDispatcher {
void DidFinishSubFrameNavigation(
content::NavigationHandle* navigation_handle);
+ void ShutDown();
+
const mojom::PageLoadTiming& timing() const {
return *(current_merged_page_timing_.get());
}
@@ -122,12 +128,7 @@ class PageLoadMetricsUpdateDispatcher {
void UpdateMainFrameMetadata(const mojom::PageLoadMetadata& new_metadata);
void UpdateSubFrameMetadata(const mojom::PageLoadMetadata& subframe_metadata);
- // Merge values from |new_paint_timing| into |pending_merged_page_timing_|,
- // offsetting any new timings by the |navigation_start_offset|.
- void MergePaintTiming(base::TimeDelta navigation_start_offset,
- const mojom::PaintTiming& new_paint_timing,
- bool is_main_frame);
-
+ void MaybeDispatchTimingUpdates(bool did_merge_new_timing_value);
void DispatchTimingUpdates();
// The client is guaranteed to outlive this object.
@@ -136,6 +137,8 @@ class PageLoadMetricsUpdateDispatcher {
// Interface to chrome features. Must outlive the class.
PageLoadMetricsEmbedderInterface* const embedder_interface_;
+ std::unique_ptr<base::Timer> timer_;
+
// Time the navigation for this page load was initiated.
const base::TimeTicks navigation_start_;

Powered by Google App Engine
This is Rietveld 408576698