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

Side by Side Diff: third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp

Issue 2863183003: DevTools: report adding mutation event listener as a violations. (Closed)
Patch Set: same Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/PerformanceMonitor.h" 5 #include "core/frame/PerformanceMonitor.h"
6 6
7 #include "bindings/core/v8/ScheduledAction.h" 7 #include "bindings/core/v8/ScheduledAction.h"
8 #include "bindings/core/v8/ScriptEventListener.h" 8 #include "bindings/core/v8/ScriptEventListener.h"
9 #include "bindings/core/v8/SourceLocation.h" 9 #include "bindings/core/v8/SourceLocation.h"
10 #include "core/CoreProbeSink.h" 10 #include "core/CoreProbeSink.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 Violation violation, 277 Violation violation,
278 const String& text, 278 const String& text,
279 double time, 279 double time,
280 std::unique_ptr<SourceLocation> location) { 280 std::unique_ptr<SourceLocation> location) {
281 ClientThresholds* client_thresholds = subscriptions_.at(violation); 281 ClientThresholds* client_thresholds = subscriptions_.at(violation);
282 if (!client_thresholds) 282 if (!client_thresholds)
283 return; 283 return;
284 if (!location) 284 if (!location)
285 location = SourceLocation::Capture(context); 285 location = SourceLocation::Capture(context);
286 for (const auto& it : *client_thresholds) { 286 for (const auto& it : *client_thresholds) {
287 if (it.value < time) { 287 if (it.value < time)
288 if (!location)
289 location = SourceLocation::Capture(context);
290 it.key->ReportGenericViolation(violation, text, time, location.get()); 288 it.key->ReportGenericViolation(violation, text, time, location.get());
291 }
292 } 289 }
293 } 290 }
294 291
295 DEFINE_TRACE(PerformanceMonitor) { 292 DEFINE_TRACE(PerformanceMonitor) {
296 visitor->Trace(local_root_); 293 visitor->Trace(local_root_);
297 visitor->Trace(task_execution_context_); 294 visitor->Trace(task_execution_context_);
298 visitor->Trace(subscriptions_); 295 visitor->Trace(subscriptions_);
299 } 296 }
300 297
301 } // namespace blink 298 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/EventUtil.cpp ('k') | third_party/WebKit/Source/core/inspector/InspectorLogAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698