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

Side by Side Diff: chrome/browser/extensions/api/history/history_api.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/history/history_api.h" 5 #include "chrome/browser/extensions/api/history/history_api.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 190
191 HistoryAPI::~HistoryAPI() { 191 HistoryAPI::~HistoryAPI() {
192 } 192 }
193 193
194 void HistoryAPI::Shutdown() { 194 void HistoryAPI::Shutdown() {
195 history_event_router_.reset(); 195 history_event_router_.reset();
196 EventRouter::Get(browser_context_)->UnregisterObserver(this); 196 EventRouter::Get(browser_context_)->UnregisterObserver(this);
197 } 197 }
198 198
199 static base::LazyInstance<BrowserContextKeyedAPIFactory<HistoryAPI> > 199 static base::LazyInstance<
200 g_factory = LAZY_INSTANCE_INITIALIZER; 200 BrowserContextKeyedAPIFactory<HistoryAPI>>::DestructorAtExit g_factory =
201 LAZY_INSTANCE_INITIALIZER;
201 202
202 // static 203 // static
203 BrowserContextKeyedAPIFactory<HistoryAPI>* HistoryAPI::GetFactoryInstance() { 204 BrowserContextKeyedAPIFactory<HistoryAPI>* HistoryAPI::GetFactoryInstance() {
204 return g_factory.Pointer(); 205 return g_factory.Pointer();
205 } 206 }
206 207
207 template <> 208 template <>
208 void BrowserContextKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies() { 209 void BrowserContextKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies() {
209 DependsOn(ActivityLog::GetFactoryInstance()); 210 DependsOn(ActivityLog::GetFactoryInstance());
210 DependsOn(HistoryServiceFactory::GetInstance()); 211 DependsOn(HistoryServiceFactory::GetInstance());
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 AddRef(); // Balanced in DeleteComplete(). 444 AddRef(); // Balanced in DeleteComplete().
444 return RespondLater(); // DeleteComplete() will be called asynchronously. 445 return RespondLater(); // DeleteComplete() will be called asynchronously.
445 } 446 }
446 447
447 void HistoryDeleteAllFunction::DeleteComplete() { 448 void HistoryDeleteAllFunction::DeleteComplete() {
448 Respond(NoArguments()); 449 Respond(NoArguments());
449 Release(); // Balanced in Run(). 450 Release(); // Balanced in Run().
450 } 451 }
451 452
452 } // namespace extensions 453 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698