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

Side by Side Diff: chrome/browser/extensions/api/messaging/message_service.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again 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 "chrome/browser/extensions/api/messaging/message_service.h" 5 #include "chrome/browser/extensions/api/messaging/message_service.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 weak_factory_(this) { 192 weak_factory_(this) {
193 DCHECK_CURRENTLY_ON(BrowserThread::UI); 193 DCHECK_CURRENTLY_ON(BrowserThread::UI);
194 } 194 }
195 195
196 MessageService::~MessageService() { 196 MessageService::~MessageService() {
197 DCHECK_CURRENTLY_ON(BrowserThread::UI); 197 DCHECK_CURRENTLY_ON(BrowserThread::UI);
198 198
199 channels_.clear(); 199 channels_.clear();
200 } 200 }
201 201
202 static base::LazyInstance<BrowserContextKeyedAPIFactory<MessageService> > 202 static base::LazyInstance<
203 g_factory = LAZY_INSTANCE_INITIALIZER; 203 BrowserContextKeyedAPIFactory<MessageService>>::DestructorAtExit g_factory =
204 LAZY_INSTANCE_INITIALIZER;
204 205
205 // static 206 // static
206 BrowserContextKeyedAPIFactory<MessageService>* 207 BrowserContextKeyedAPIFactory<MessageService>*
207 MessageService::GetFactoryInstance() { 208 MessageService::GetFactoryInstance() {
208 return g_factory.Pointer(); 209 return g_factory.Pointer();
209 } 210 }
210 211
211 // static 212 // static
212 MessageService* MessageService::Get(BrowserContext* context) { 213 MessageService* MessageService::Get(BrowserContext* context) {
213 return BrowserContextKeyedAPIFactory<MessageService>::Get(context); 214 return BrowserContextKeyedAPIFactory<MessageService>::Get(context);
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 MessageChannelMap::iterator channel_iter = channels_.find(channel_id); 988 MessageChannelMap::iterator channel_iter = channels_.find(channel_id);
988 if (channel_iter != channels_.end()) { 989 if (channel_iter != channels_.end()) {
989 for (const PendingMessage& message : queue) { 990 for (const PendingMessage& message : queue) {
990 DispatchMessage(message.first, channel_iter->second.get(), 991 DispatchMessage(message.first, channel_iter->second.get(),
991 message.second); 992 message.second);
992 } 993 }
993 } 994 }
994 } 995 }
995 996
996 } // namespace extensions 997 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698