Chromium Code Reviews| Index: media/base/media_android.cc |
| diff --git a/media/base/media_android.cc b/media/base/media_android.cc |
| index 8008d48fe2d01b60b2cc5b7c245103fa21bf02c7..4639f44d88ab635fec5b0997ea5be3fefc424fad 100644 |
| --- a/media/base/media_android.cc |
| +++ b/media/base/media_android.cc |
| @@ -7,30 +7,24 @@ |
| #include <cpu-features.h> |
| #include "base/android/jni_android.h" |
| -#include "base/logging.h" |
| +#include "base/files/file_path.h" |
| #include "media/base/android/media_jni_registrar.h" |
| namespace media { |
| +namespace internal { |
| -// Caches the result of the check for NEON support. |
| -static bool g_media_library_is_initialized = false; |
| +bool InitializeMediaLibraryInternal(const base::FilePath& module_dir, |
| + bool for_testing) { |
|
scherkus (not reviewing)
2013/05/03 17:44:43
this is the only place where |for_testing| is used
|
| + if (for_testing) { |
| + // Register JNI bindings for android. |
| + JNIEnv* env = base::android::AttachCurrentThread(); |
| + RegisterJni(env); |
| + } |
| -bool InitializeMediaLibrary(const base::FilePath& module_dir) { |
| // No real initialization is necessary but we do need to check if |
| // Neon is supported because the FFT library requires Neon. |
| - g_media_library_is_initialized = (android_getCpuFeatures() & |
| - ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
| - return g_media_library_is_initialized; |
| -} |
| - |
| -void InitializeMediaLibraryForTesting() { |
| - // Register JNI bindings for android. |
| - JNIEnv* env = base::android::AttachCurrentThread(); |
| - RegisterJni(env); |
| -} |
| - |
| -bool IsMediaLibraryInitialized() { |
| - return g_media_library_is_initialized; |
| + return (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
| } |
| +} // namespace internal |
| } // namespace media |