OLD | NEW |
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 "extensions/browser/api/alarms/alarm_manager.h" | 5 #include "extensions/browser/api/alarms/alarm_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 return make_pair(list, it); | 220 return make_pair(list, it); |
221 } | 221 } |
222 | 222 |
223 return make_pair(alarms_.end(), AlarmList::iterator()); | 223 return make_pair(alarms_.end(), AlarmList::iterator()); |
224 } | 224 } |
225 | 225 |
226 void AlarmManager::SetClockForTesting(base::Clock* clock) { | 226 void AlarmManager::SetClockForTesting(base::Clock* clock) { |
227 clock_.reset(clock); | 227 clock_.reset(clock); |
228 } | 228 } |
229 | 229 |
230 static base::LazyInstance<BrowserContextKeyedAPIFactory<AlarmManager>> | 230 static base::LazyInstance< |
231 g_factory = LAZY_INSTANCE_INITIALIZER; | 231 BrowserContextKeyedAPIFactory<AlarmManager>>::DestructorAtExit g_factory = |
| 232 LAZY_INSTANCE_INITIALIZER; |
232 | 233 |
233 // static | 234 // static |
234 BrowserContextKeyedAPIFactory<AlarmManager>* | 235 BrowserContextKeyedAPIFactory<AlarmManager>* |
235 AlarmManager::GetFactoryInstance() { | 236 AlarmManager::GetFactoryInstance() { |
236 return g_factory.Pointer(); | 237 return g_factory.Pointer(); |
237 } | 238 } |
238 | 239 |
239 // static | 240 // static |
240 AlarmManager* AlarmManager::Get(content::BrowserContext* browser_context) { | 241 AlarmManager* AlarmManager::Get(content::BrowserContext* browser_context) { |
241 return BrowserContextKeyedAPIFactory<AlarmManager>::Get(browser_context); | 242 return BrowserContextKeyedAPIFactory<AlarmManager>::Get(browser_context); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 if (create_info.period_in_minutes.get()) { | 480 if (create_info.period_in_minutes.get()) { |
480 js_alarm->period_in_minutes.reset( | 481 js_alarm->period_in_minutes.reset( |
481 new double(*create_info.period_in_minutes)); | 482 new double(*create_info.period_in_minutes)); |
482 } | 483 } |
483 } | 484 } |
484 | 485 |
485 Alarm::~Alarm() { | 486 Alarm::~Alarm() { |
486 } | 487 } |
487 | 488 |
488 } // namespace extensions | 489 } // namespace extensions |
OLD | NEW |