| OLD | NEW |
| 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 Loading... |
| 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() {} |
| OLD | NEW |