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

Unified Diff: media/base/win/mf_initializer.cc

Issue 2668813002: Remove LazyInstance usage from media/ (Closed)
Patch Set: Fix presubmit comments. Created 3 years, 10 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
« no previous file with comments | « media/base/win/mf_initializer.h ('k') | media/base/yuv_convert.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/win/mf_initializer.cc
diff --git a/media/base/win/mf_initializer.cc b/media/base/win/mf_initializer.cc
index ff62a451e92c79943ecb24d35646e3985e2b6c2b..e27da8fe4dd612f472455f46343150008c68633d 100644
--- a/media/base/win/mf_initializer.cc
+++ b/media/base/win/mf_initializer.cc
@@ -6,36 +6,13 @@
#include <mfapi.h>
-#include "base/lazy_instance.h"
-#include "base/macros.h"
+#include "base/logging.h"
namespace media {
-namespace {
-
-// LazyInstance to initialize the Media Foundation Library.
-class MFInitializer {
- public:
- MFInitializer()
- : mf_started_(MFStartup(MF_VERSION, MFSTARTUP_LITE) == S_OK) {}
-
- ~MFInitializer() {
- if (mf_started_)
- MFShutdown();
- }
-
- private:
- const bool mf_started_;
-
- DISALLOW_COPY_AND_ASSIGN(MFInitializer);
-};
-
-base::LazyInstance<MFInitializer> g_mf_initializer = LAZY_INSTANCE_INITIALIZER;
-
-} // namespace
-
void InitializeMediaFoundation() {
- g_mf_initializer.Get();
+ static HRESULT result = MFStartup(MF_VERSION, MFSTARTUP_LITE);
+ DCHECK_EQ(result, S_OK);
}
} // namespace media
« no previous file with comments | « media/base/win/mf_initializer.h ('k') | media/base/yuv_convert.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698