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

Side by Side Diff: extensions/browser/api/alarms/alarm_manager.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
« no previous file with comments | « device/bluetooth/bluetooth_socket_thread.cc ('k') | extensions/browser/api/audio/audio_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_socket_thread.cc ('k') | extensions/browser/api/audio/audio_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698