| OLD | NEW |
| 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/dom/Document.h" | 10 #include "core/dom/Document.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 if (!clientThresholds) { | 189 if (!clientThresholds) { |
| 190 clientThresholds = new ClientThresholds(); | 190 clientThresholds = new ClientThresholds(); |
| 191 m_subscriptions.set(violation, clientThresholds); | 191 m_subscriptions.set(violation, clientThresholds); |
| 192 } | 192 } |
| 193 clientThresholds->set(client, threshold); | 193 clientThresholds->set(client, threshold); |
| 194 updateInstrumentation(); | 194 updateInstrumentation(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void PerformanceMonitor::unsubscribeAll(Client* client) { | 197 void PerformanceMonitor::unsubscribeAll(Client* client) { |
| 198 for (const auto& it : m_subscriptions) | 198 for (const auto& it : m_subscriptions) |
| 199 it.value->remove(client); | 199 it.value->erase(client); |
| 200 updateInstrumentation(); | 200 updateInstrumentation(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void PerformanceMonitor::shutdown() { | 203 void PerformanceMonitor::shutdown() { |
| 204 m_subscriptions.clear(); | 204 m_subscriptions.clear(); |
| 205 updateInstrumentation(); | 205 updateInstrumentation(); |
| 206 Platform::current()->currentThread()->removeTaskTimeObserver(this); | 206 Platform::current()->currentThread()->removeTaskTimeObserver(this); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void PerformanceMonitor::updateInstrumentation() { | 209 void PerformanceMonitor::updateInstrumentation() { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } | 360 } |
| 361 } | 361 } |
| 362 | 362 |
| 363 DEFINE_TRACE(PerformanceMonitor) { | 363 DEFINE_TRACE(PerformanceMonitor) { |
| 364 visitor->trace(m_localRoot); | 364 visitor->trace(m_localRoot); |
| 365 visitor->trace(m_taskExecutionContext); | 365 visitor->trace(m_taskExecutionContext); |
| 366 visitor->trace(m_subscriptions); | 366 visitor->trace(m_subscriptions); |
| 367 } | 367 } |
| 368 | 368 |
| 369 } // namespace blink | 369 } // namespace blink |
| OLD | NEW |