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

Side by Side Diff: chrome/browser/extensions/api/alarms/alarm_manager.cc

Issue 140613002: Cleanup: Replace &LazyInstance::Get() with LazyInstance::Pointer(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
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/alarms/alarm_manager.h" 5 #include "chrome/browser/extensions/api/alarms/alarm_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 void AlarmManager::SetClockForTesting(base::Clock* clock) { 213 void AlarmManager::SetClockForTesting(base::Clock* clock) {
214 clock_.reset(clock); 214 clock_.reset(clock);
215 } 215 }
216 216
217 static base::LazyInstance<ProfileKeyedAPIFactory<AlarmManager> > 217 static base::LazyInstance<ProfileKeyedAPIFactory<AlarmManager> >
218 g_factory = LAZY_INSTANCE_INITIALIZER; 218 g_factory = LAZY_INSTANCE_INITIALIZER;
219 219
220 // static 220 // static
221 ProfileKeyedAPIFactory<AlarmManager>* AlarmManager::GetFactoryInstance() { 221 ProfileKeyedAPIFactory<AlarmManager>* AlarmManager::GetFactoryInstance() {
222 return &g_factory.Get(); 222 return g_factory.Pointer();
223 } 223 }
224 224
225 // static 225 // static
226 AlarmManager* AlarmManager::Get(Profile* profile) { 226 AlarmManager* AlarmManager::Get(Profile* profile) {
227 return ProfileKeyedAPIFactory<AlarmManager>::GetForProfile(profile); 227 return ProfileKeyedAPIFactory<AlarmManager>::GetForProfile(profile);
228 } 228 }
229 229
230 void AlarmManager::RemoveAlarmIterator(const AlarmIterator& iter) { 230 void AlarmManager::RemoveAlarmIterator(const AlarmIterator& iter) {
231 AlarmList& list = iter.first->second; 231 AlarmList& list = iter.first->second;
232 list.erase(iter.second); 232 list.erase(iter.second);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 if (create_info.period_in_minutes.get()) { 461 if (create_info.period_in_minutes.get()) {
462 js_alarm->period_in_minutes.reset( 462 js_alarm->period_in_minutes.reset(
463 new double(*create_info.period_in_minutes)); 463 new double(*create_info.period_in_minutes));
464 } 464 }
465 } 465 }
466 466
467 Alarm::~Alarm() { 467 Alarm::~Alarm() {
468 } 468 }
469 469
470 } // namespace extensions 470 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698