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

Side by Side Diff: chrome/browser/extensions/api/audio/audio_api.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) 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 "chrome/browser/extensions/api/audio/audio_api.h" 5 #include "chrome/browser/extensions/api/audio/audio_api.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/common/extensions/api/audio.h" 10 #include "chrome/common/extensions/api/audio.h"
11 #include "extensions/browser/event_router.h" 11 #include "extensions/browser/event_router.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 namespace audio = api::audio; 15 namespace audio = api::audio;
16 16
17 static base::LazyInstance<ProfileKeyedAPIFactory<AudioAPI> > 17 static base::LazyInstance<ProfileKeyedAPIFactory<AudioAPI> >
18 g_factory = LAZY_INSTANCE_INITIALIZER; 18 g_factory = LAZY_INSTANCE_INITIALIZER;
19 19
20 // static 20 // static
21 ProfileKeyedAPIFactory<AudioAPI>* AudioAPI::GetFactoryInstance() { 21 ProfileKeyedAPIFactory<AudioAPI>* AudioAPI::GetFactoryInstance() {
22 return &g_factory.Get(); 22 return g_factory.Pointer();
23 } 23 }
24 24
25 AudioAPI::AudioAPI(Profile* profile) 25 AudioAPI::AudioAPI(Profile* profile)
26 : profile_(profile), 26 : profile_(profile),
27 service_(AudioService::CreateInstance()) { 27 service_(AudioService::CreateInstance()) {
28 service_->AddObserver(this); 28 service_->AddObserver(this);
29 } 29 }
30 30
31 AudioAPI::~AudioAPI() { 31 AudioAPI::~AudioAPI() {
32 service_->RemoveObserver(this); 32 service_->RemoveObserver(this);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 if (!service->SetDeviceProperties(params->id, 98 if (!service->SetDeviceProperties(params->id,
99 params->properties.is_muted, 99 params->properties.is_muted,
100 volume_value, 100 volume_value,
101 gain_value)) 101 gain_value))
102 return false; 102 return false;
103 else 103 else
104 return true; 104 return true;
105 } 105 }
106 106
107 } // namespace extensions 107 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/api_resource_manager.h ('k') | chrome/browser/extensions/api/bookmarks/bookmarks_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698