Index: third_party/WebKit/Source/core/timing/Performance.cpp |
diff --git a/third_party/WebKit/Source/core/timing/Performance.cpp b/third_party/WebKit/Source/core/timing/Performance.cpp |
index 4d7ebcccf09214341b4dbe144e8f8454664639b1..a2521509bdcf3b00b84c86b8bd8a4579ad4f7685 100644 |
--- a/third_party/WebKit/Source/core/timing/Performance.cpp |
+++ b/third_party/WebKit/Source/core/timing/Performance.cpp |
@@ -36,6 +36,7 @@ |
#include "core/inspector/InspectedFrames.h" |
#include "core/inspector/InspectorWebPerfAgent.h" |
#include "core/loader/DocumentLoader.h" |
+#include "core/origin_trials/OriginTrials.h" |
#include "core/timing/PerformanceTiming.h" |
namespace blink { |
@@ -97,6 +98,9 @@ PerformanceTiming* Performance::timing() const |
void Performance::updateLongTaskInstrumentation() |
{ |
if (hasObserverFor(PerformanceEntry::LongTask) && !m_longTaskInspectorAgent) { |
+ if (!frame() || !frame()->document() |
+ || !OriginTrials::longTaskObserverEnabled(frame()->document())) |
+ return; |
m_longTaskInspectorAgent = new InspectorWebPerfAgent( |
InspectedFrames::create(frame())); |
m_longTaskInspectorAgent->enable(); |