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

Unified Diff: media/gpu/avda_codec_allocator.cc

Issue 2668813002: Remove LazyInstance usage from media/ (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: media/gpu/avda_codec_allocator.cc
diff --git a/media/gpu/avda_codec_allocator.cc b/media/gpu/avda_codec_allocator.cc
index b8b5e7b95667ed2e938007dd5279269f3bd2b4cf..cf98d93d3c093444a5e8b7baad43f9661b882bd9 100644
--- a/media/gpu/avda_codec_allocator.cc
+++ b/media/gpu/avda_codec_allocator.cc
@@ -26,9 +26,6 @@ namespace media {
namespace {
-base::LazyInstance<AVDACodecAllocator>::Leaky g_avda_codec_allocator =
- LAZY_INSTANCE_INITIALIZER;
-
// Give tasks 800ms before considering them hung. MediaCodec.configure() calls
// typically take 100-200ms on a N5, so 800ms is expected to very rarely result
// in false positives. Also, false positives have low impact because we resume
@@ -75,7 +72,8 @@ bool AVDACodecAllocator::HangDetector::IsThreadLikelyHung() {
// static
AVDACodecAllocator* AVDACodecAllocator::Instance() {
- return g_avda_codec_allocator.Pointer();
+ static AVDACodecAllocator* allocator = new AVDACodecAllocator();
+ return allocator;
}
bool AVDACodecAllocator::StartThread(AVDACodecAllocatorClient* client) {

Powered by Google App Engine
This is Rietveld 408576698