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(); |
} |