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

Side by Side Diff: chrome/common/notification_service.cc

Issue 159806: Make NotificationObserver leaks into LOG(INFO). (Closed)
Patch Set: Created 11 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/common/notification_service.h" 5 #include "chrome/common/notification_service.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/thread_local.h" 8 #include "base/thread_local.h"
9 9
10 static base::LazyInstance<base::ThreadLocalPointer<NotificationService> > 10 static base::LazyInstance<base::ThreadLocalPointer<NotificationService> >
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 NotificationService::~NotificationService() { 119 NotificationService::~NotificationService() {
120 lazy_tls_ptr.Pointer()->Set(NULL); 120 lazy_tls_ptr.Pointer()->Set(NULL);
121 121
122 #ifndef NDEBUG 122 #ifndef NDEBUG
123 for (int i = 0; i < NotificationType::NOTIFICATION_TYPE_COUNT; i++) { 123 for (int i = 0; i < NotificationType::NOTIFICATION_TYPE_COUNT; i++) {
124 if (observer_counts_[i] > 0) { 124 if (observer_counts_[i] > 0) {
125 // This may not be completely fixable -- see 125 // This may not be completely fixable -- see
126 // http://code.google.com/p/chromium/issues/detail?id=11010 . 126 // http://code.google.com/p/chromium/issues/detail?id=11010 .
127 // But any new leaks should be fixed. 127 // But any new leaks should be fixed.
128 LOG(WARNING) << observer_counts_[i] << " notification observer(s) leaked" 128 LOG(INFO) << observer_counts_[i] << " notification observer(s) leaked"
129 << " of notification type " << i; 129 << " of notification type " << i;
130 } 130 }
131 } 131 }
132 #endif 132 #endif
133 133
134 for (int i = 0; i < NotificationType::NOTIFICATION_TYPE_COUNT; i++) { 134 for (int i = 0; i < NotificationType::NOTIFICATION_TYPE_COUNT; i++) {
135 NotificationSourceMap omap = observers_[i]; 135 NotificationSourceMap omap = observers_[i];
136 for (NotificationSourceMap::iterator it = omap.begin(); 136 for (NotificationSourceMap::iterator it = omap.begin();
137 it != omap.end(); ++it) { 137 it != omap.end(); ++it) {
138 delete it->second; 138 delete it->second;
139 } 139 }
140 } 140 }
141 } 141 }
142 142
143 NotificationObserver::~NotificationObserver() {} 143 NotificationObserver::~NotificationObserver() {}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698