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

Unified Diff: third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp

Issue 2478363003: PerformanceMonitor: do not leak performance objects through the monitor. (Closed)
Patch Set: rebaselined Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/timing/Performance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp
diff --git a/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp b/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp
index c4a82e0b65731d7e7e01be7def8b0fd8760070be..79c29beb4a2fbddbb550923788613bd85b9981c0 100644
--- a/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp
+++ b/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp
@@ -56,10 +56,7 @@ void PerformanceMonitor::performanceObserverAdded(Performance* performance) {
// static
void PerformanceMonitor::performanceObserverRemoved(Performance* performance) {
LocalFrame* frame = performance->frame();
- if (!frame) {
- // TODO: instrument local frame removal in order to clean up.
- return;
- }
+ DCHECK(frame);
PerformanceMonitor* monitor = frame->performanceMonitor();
monitor->m_webPerformanceObservers.remove(performance);
monitor->updateInstrumentation();
@@ -155,7 +152,11 @@ PerformanceMonitor* PerformanceMonitor::instrumentingMonitor(
PerformanceMonitor::PerformanceMonitor(LocalFrame* localRoot)
: m_localRoot(localRoot) {}
-PerformanceMonitor::~PerformanceMonitor() {}
+PerformanceMonitor::~PerformanceMonitor() {
+ m_webPerformanceObservers.clear();
+ m_loggingEnabled = false;
+ updateInstrumentation();
+}
void PerformanceMonitor::setLoggingEnabled(bool enabled) {
m_loggingEnabled = enabled;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/timing/Performance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698