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

Unified Diff: third_party/WebKit/Source/core/timing/Performance.cpp

Issue 2383413002: Add OriginTrial flag for Long Task Observer (Closed)
Patch Set: sync and rebase Created 4 years, 2 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: 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 bbb617ff75498c5bb00a0059568234b30777b897..e889ac82cefa28884970f236afa537ae4f8bd814 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 {
@@ -86,6 +87,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(frame());
m_longTaskInspectorAgent->enable();
} else if (!hasObserverFor(PerformanceEntry::LongTask) &&

Powered by Google App Engine
This is Rietveld 408576698