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

Side by Side Diff: media/mojo/services/renderer_config.cc

Issue 684983004: Move LazyInstance initializers out of function scope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_video
Patch Set: Created 6 years, 1 month 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 | « media/audio/audio_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/mojo/services/renderer_config.h" 5 #include "media/mojo/services/renderer_config.h"
6 6
7 namespace media { 7 namespace media {
8 8
9 namespace internal { 9 namespace internal {
10 extern scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig(); 10 extern scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig();
11 } // namespace internal 11 } // namespace internal
12 12
13 static base::LazyInstance<RendererConfig>::Leaky g_platform_config =
14 LAZY_INSTANCE_INITIALIZER;
15
13 // static 16 // static
14 RendererConfig* RendererConfig::Get() { 17 RendererConfig* RendererConfig::Get() {
15 static base::LazyInstance<RendererConfig>::Leaky li = 18 return g_platform_config.Pointer();
16 LAZY_INSTANCE_INITIALIZER;
17 return li.Pointer();
18 } 19 }
19 20
20 ScopedVector<AudioDecoder> RendererConfig::GetAudioDecoders( 21 ScopedVector<AudioDecoder> RendererConfig::GetAudioDecoders(
21 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, 22 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
22 const LogCB& media_log_cb) { 23 const LogCB& media_log_cb) {
23 return renderer_config_->GetAudioDecoders(media_task_runner, media_log_cb); 24 return renderer_config_->GetAudioDecoders(media_task_runner, media_log_cb);
24 } 25 }
25 26
26 ScopedVector<VideoDecoder> RendererConfig::GetVideoDecoders( 27 ScopedVector<VideoDecoder> RendererConfig::GetVideoDecoders(
27 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, 28 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
(...skipping 10 matching lines...) Expand all
38 } 39 }
39 40
40 RendererConfig::RendererConfig() 41 RendererConfig::RendererConfig()
41 : renderer_config_(internal::CreatePlatformRendererConfig().Pass()) { 42 : renderer_config_(internal::CreatePlatformRendererConfig().Pass()) {
42 } 43 }
43 44
44 RendererConfig::~RendererConfig() { 45 RendererConfig::~RendererConfig() {
45 } 46 }
46 47
47 } // namespace media 48 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698