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

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

Issue 2383413002: Add OriginTrial flag for Long Task Observer (Closed)
Patch Set: move origin trial check to Performance::updateLongTaskInstrumentation 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 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();

Powered by Google App Engine
This is Rietveld 408576698