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

Unified Diff: chrome/renderer/page_load_metrics/metrics_render_frame_observer.h

Issue 2823523003: [Page Load Metrics] PageLoadMetrics Mojofication. (Closed)
Patch Set: Add Finch trial check and rebase Created 3 years, 8 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/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);
};

Powered by Google App Engine
This is Rietveld 408576698