| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/threading/thread_local.h" |
| 9 #include "chrome/common/notification_observer.h" | 9 #include "chrome/common/notification_observer.h" |
| 10 | 10 |
| 11 static base::LazyInstance<base::ThreadLocalPointer<NotificationService> > | 11 static base::LazyInstance<base::ThreadLocalPointer<NotificationService> > |
| 12 lazy_tls_ptr(base::LINKER_INITIALIZED); | 12 lazy_tls_ptr(base::LINKER_INITIALIZED); |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 NotificationService* NotificationService::current() { | 15 NotificationService* NotificationService::current() { |
| 16 return lazy_tls_ptr.Pointer()->Get(); | 16 return lazy_tls_ptr.Pointer()->Get(); |
| 17 } | 17 } |
| 18 | 18 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 NotificationSourceMap omap = observers_[i]; | 142 NotificationSourceMap omap = observers_[i]; |
| 143 for (NotificationSourceMap::iterator it = omap.begin(); | 143 for (NotificationSourceMap::iterator it = omap.begin(); |
| 144 it != omap.end(); ++it) | 144 it != omap.end(); ++it) |
| 145 delete it->second; | 145 delete it->second; |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 NotificationObserver::NotificationObserver() {} | 149 NotificationObserver::NotificationObserver() {} |
| 150 | 150 |
| 151 NotificationObserver::~NotificationObserver() {} | 151 NotificationObserver::~NotificationObserver() {} |
| OLD | NEW |