Index: chrome/renderer/page_load_metrics/metrics_render_frame_observer.h |
diff --git a/chrome/renderer/page_load_metrics/metrics_render_frame_observer.h b/chrome/renderer/page_load_metrics/metrics_render_frame_observer.h |
index 3b9ad1e915cf3a676e7ba8a0557378eea7038a91..94a91121607fa411cdb9e54972752013a2ebb41d 100644 |
--- a/chrome/renderer/page_load_metrics/metrics_render_frame_observer.h |
+++ b/chrome/renderer/page_load_metrics/metrics_render_frame_observer.h |
@@ -8,7 +8,9 @@ |
#include <memory> |
#include "base/macros.h" |
+#include "chrome/common/page_load_metrics/page_load_metrics.mojom.h" |
#include "chrome/common/page_load_metrics/page_load_timing.h" |
+#include "chrome/renderer/page_load_metrics/page_timing_sender.h" |
#include "content/public/renderer/render_frame_observer.h" |
#include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" |
@@ -25,11 +27,16 @@ class PageTimingMetricsSender; |
// MetricsRenderFrameObserver is instantiated for each frame (main frames and |
// child frames). MetricsRenderFrameObserver dispatches timing and metadata |
// updates for main frames, but only metadata updates for child frames. |
-class MetricsRenderFrameObserver : public content::RenderFrameObserver { |
+class MetricsRenderFrameObserver : public content::RenderFrameObserver, |
+ public PageTimingSender { |
public: |
explicit MetricsRenderFrameObserver(content::RenderFrame* render_frame); |
~MetricsRenderFrameObserver() override; |
+ // PageTimingSender implementation |
+ void SendTiming(const PageLoadTiming& timing, |
+ const PageLoadMetadata& metadata) override; |
+ |
// RenderFrameObserver implementation |
void DidChangePerformanceTiming() override; |
void DidObserveLoadingBehavior( |
@@ -43,9 +50,6 @@ class MetricsRenderFrameObserver : public content::RenderFrameObserver { |
void FrameDetached() override; |
private: |
- // Will be null when we're not actively sending metrics. |
- std::unique_ptr<PageTimingMetricsSender> page_timing_metrics_sender_; |
- |
void SendMetrics(); |
virtual bool ShouldSendMetrics() const; |
virtual PageLoadTiming GetTiming() const; |
@@ -53,6 +57,10 @@ class MetricsRenderFrameObserver : public content::RenderFrameObserver { |
virtual bool HasNoRenderFrame() const; |
virtual bool IsMainFrame() const; |
+ // Will be null when we're not actively sending metrics. |
+ std::unique_ptr<PageTimingMetricsSender> page_timing_metrics_sender_; |
+ mojom::PageLoadMetricsAssociatedPtr page_load_metrics_; |
+ |
DISALLOW_COPY_AND_ASSIGN(MetricsRenderFrameObserver); |
}; |