Index: chrome/renderer/page_load_metrics/page_timing_metrics_sender.cc |
diff --git a/chrome/renderer/page_load_metrics/page_timing_metrics_sender.cc b/chrome/renderer/page_load_metrics/page_timing_metrics_sender.cc |
index e016bb3251445b98216fb664624a3b9a22bd3572..1fa66beaf49fd587dc234db8bb34e35505cbff0c 100644 |
--- a/chrome/renderer/page_load_metrics/page_timing_metrics_sender.cc |
+++ b/chrome/renderer/page_load_metrics/page_timing_metrics_sender.cc |
@@ -7,9 +7,12 @@ |
#include <utility> |
#include "base/callback.h" |
+#include "base/feature_list.h" |
#include "base/time/time.h" |
#include "base/timer/timer.h" |
+#include "chrome/common/chrome_features.h" |
#include "chrome/common/page_load_metrics/page_load_metrics_messages.h" |
+#include "chrome/renderer/page_load_metrics/page_timing_sender.h" |
#include "ipc/ipc_sender.h" |
namespace page_load_metrics { |
@@ -22,10 +25,12 @@ const int kTimerDelayMillis = 1000; |
PageTimingMetricsSender::PageTimingMetricsSender( |
IPC::Sender* ipc_sender, |
int routing_id, |
+ PageTimingSender* page_timing_sender, |
std::unique_ptr<base::Timer> timer, |
const PageLoadTiming& initial_timing) |
: ipc_sender_(ipc_sender), |
routing_id_(routing_id), |
+ page_timing_sender_(page_timing_sender), |
timer_(std::move(timer)), |
last_timing_(initial_timing), |
metadata_(PageLoadMetadata()) { |
@@ -76,6 +81,10 @@ void PageTimingMetricsSender::EnsureSendTimer(int delay) { |
} |
void PageTimingMetricsSender::SendNow() { |
+ if (base::FeatureList::IsEnabled(features::kPageLoadMetricsMojofication)) { |
+ page_timing_sender_->SendTiming(last_timing_, metadata_); |
+ return; |
+ } |
ipc_sender_->Send(new PageLoadMetricsMsg_TimingUpdated( |
routing_id_, last_timing_, metadata_)); |
} |