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

Unified Diff: media/cdm/external_clear_key_test_helper.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/cast/test/utility/udp_proxy_main.cc ('k') | media/filters/ffmpeg_glue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/external_clear_key_test_helper.cc
diff --git a/media/cdm/external_clear_key_test_helper.cc b/media/cdm/external_clear_key_test_helper.cc
index 06bc20ca0876b81d143c39fe488db3e9003a216c..d8c36798427bf46f8ecdb0a9b054007061ab373f 100644
--- a/media/cdm/external_clear_key_test_helper.cc
+++ b/media/cdm/external_clear_key_test_helper.cc
@@ -4,6 +4,7 @@
#include "media/cdm/external_clear_key_test_helper.h"
+#include "base/debug/leak_annotations.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/native_library.h"
@@ -51,6 +52,14 @@ void ExternalClearKeyTestHelper::LoadLibrary() {
InitializeCdmFunc initialize_cdm_func = reinterpret_cast<InitializeCdmFunc>(
library_.GetFunctionPointer(MAKE_STRING(INITIALIZE_CDM_MODULE)));
ASSERT_TRUE(initialize_cdm_func) << "No INITIALIZE_CDM_MODULE in library";
+
+ // Loading and unloading this library leaks all static allocations; previously
+ // these were suppressed by a similar annotation in base::LazyInstance. With
+ // the switch to thread-safe statics, we lost the annotation.
+ //
+ // TODO(xhwang): Investigate if we are actually leaking memory during the
+ // normal process by which Chrome uses this library. http://crbug.com/691132.
+ ANNOTATE_SCOPED_MEMORY_LEAK;
initialize_cdm_func();
}
« no previous file with comments | « media/cast/test/utility/udp_proxy_main.cc ('k') | media/filters/ffmpeg_glue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698