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

Side by Side Diff: extensions/browser/api/audio/audio_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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/audio/audio_api.h" 5 #include "extensions/browser/api/audio/audio_api.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 29 matching lines...) Expand all
40 40
41 bool CanReceiveDeprecatedAudioEvent(content::BrowserContext* context, 41 bool CanReceiveDeprecatedAudioEvent(content::BrowserContext* context,
42 const Extension* extension, 42 const Extension* extension,
43 Event* event, 43 Event* event,
44 const base::DictionaryValue* filter) { 44 const base::DictionaryValue* filter) {
45 return CanUseDeprecatedAudioApi(extension); 45 return CanUseDeprecatedAudioApi(extension);
46 } 46 }
47 47
48 } // namespace 48 } // namespace
49 49
50 static base::LazyInstance<BrowserContextKeyedAPIFactory<AudioAPI> > g_factory = 50 static base::LazyInstance<
51 BrowserContextKeyedAPIFactory<AudioAPI>>::DestructorAtExit g_factory =
51 LAZY_INSTANCE_INITIALIZER; 52 LAZY_INSTANCE_INITIALIZER;
52 53
53 // static 54 // static
54 BrowserContextKeyedAPIFactory<AudioAPI>* AudioAPI::GetFactoryInstance() { 55 BrowserContextKeyedAPIFactory<AudioAPI>* AudioAPI::GetFactoryInstance() {
55 return g_factory.Pointer(); 56 return g_factory.Pointer();
56 } 57 }
57 58
58 AudioAPI::AudioAPI(content::BrowserContext* context) 59 AudioAPI::AudioAPI(content::BrowserContext* context)
59 : browser_context_(context), service_(AudioService::CreateInstance()) { 60 : browser_context_(context), service_(AudioService::CreateInstance()) {
60 service_->AddObserver(this); 61 service_->AddObserver(this);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 280
280 bool value = false; 281 bool value = false;
281 if (!service->GetMute(params->stream_type == audio::STREAM_TYPE_INPUT, 282 if (!service->GetMute(params->stream_type == audio::STREAM_TYPE_INPUT,
282 &value)) { 283 &value)) {
283 return RespondNow(Error("Could not get mute state.")); 284 return RespondNow(Error("Could not get mute state."));
284 } 285 }
285 return RespondNow(ArgumentList(audio::GetMute::Results::Create(value))); 286 return RespondNow(ArgumentList(audio::GetMute::Results::Create(value)));
286 } 287 }
287 288
288 } // namespace extensions 289 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/alarms/alarm_manager.cc ('k') | extensions/browser/api/bluetooth/bluetooth_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698