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

Side by Side Diff: content/browser/notification_service_impl.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/notification_service_impl.h" 5 #include "content/browser/notification_service_impl.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/threading/thread_local.h" 8 #include "base/threading/thread_local.h"
9 #include "content/public/browser/notification_observer.h" 9 #include "content/public/browser/notification_observer.h"
10 #include "content/public/browser/notification_types.h" 10 #include "content/public/browser/notification_types.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 namespace { 14 namespace {
15 15
16 base::LazyInstance<base::ThreadLocalPointer<NotificationServiceImpl> > 16 base::LazyInstance<base::ThreadLocalPointer<NotificationServiceImpl>>::
17 lazy_tls_ptr = LAZY_INSTANCE_INITIALIZER; 17 DestructorAtExit lazy_tls_ptr = LAZY_INSTANCE_INITIALIZER;
18 18
19 } // namespace 19 } // namespace
20 20
21 // static 21 // static
22 NotificationServiceImpl* NotificationServiceImpl::current() { 22 NotificationServiceImpl* NotificationServiceImpl::current() {
23 return lazy_tls_ptr.Pointer()->Get(); 23 return lazy_tls_ptr.Pointer()->Get();
24 } 24 }
25 25
26 // static 26 // static
27 NotificationService* NotificationService::current() { 27 NotificationService* NotificationService::current() {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 for (int i = 0; i < static_cast<int>(observers_.size()); i++) { 147 for (int i = 0; i < static_cast<int>(observers_.size()); i++) {
148 NotificationSourceMap omap = observers_[i]; 148 NotificationSourceMap omap = observers_[i];
149 for (NotificationSourceMap::iterator it = omap.begin(); 149 for (NotificationSourceMap::iterator it = omap.begin();
150 it != omap.end(); ++it) 150 it != omap.end(); ++it)
151 delete it->second; 151 delete it->second;
152 } 152 }
153 } 153 }
154 154
155 } // namespace content 155 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698