Commit 8e47fd58 authored by Adam Langley's avatar Adam Langley

Revert of "Revert of "Move the call to CRYPTO_set_NEON_capable up.""

This reverts commit 02f7bf13 and
thus effectively relands fa906382. That
commit was suspected of breaking the EME tests but reverting it didn't
unbreak anything.

https://codereview.chromium.org/899463002/

Cr-Commit-Position: refs/heads/master@{#314375}
parent f1a8ec76
...@@ -48,6 +48,18 @@ class OpenSSLInitSingleton { ...@@ -48,6 +48,18 @@ class OpenSSLInitSingleton {
private: private:
friend struct DefaultSingletonTraits<OpenSSLInitSingleton>; friend struct DefaultSingletonTraits<OpenSSLInitSingleton>;
OpenSSLInitSingleton() { OpenSSLInitSingleton() {
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
const bool has_neon =
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
// CRYPTO_set_NEON_capable is called before |SSL_library_init| because this
// stops BoringSSL from probing for NEON support via SIGILL in the case
// that getauxval isn't present.
CRYPTO_set_NEON_capable(has_neon);
// See https://code.google.com/p/chromium/issues/detail?id=341598
base::CPU cpu;
CRYPTO_set_NEON_functional(!cpu.has_broken_neon());
#endif
SSL_load_error_strings(); SSL_load_error_strings();
SSL_library_init(); SSL_library_init();
int num_locks = CRYPTO_num_locks(); int num_locks = CRYPTO_num_locks();
...@@ -56,16 +68,6 @@ class OpenSSLInitSingleton { ...@@ -56,16 +68,6 @@ class OpenSSLInitSingleton {
locks_.push_back(new base::Lock()); locks_.push_back(new base::Lock());
CRYPTO_set_locking_callback(LockingCallback); CRYPTO_set_locking_callback(LockingCallback);
CRYPTO_THREADID_set_callback(CurrentThreadId); CRYPTO_THREADID_set_callback(CurrentThreadId);
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
const bool has_neon =
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
if (has_neon)
CRYPTO_set_NEON_capable(1);
// See https://code.google.com/p/chromium/issues/detail?id=341598
base::CPU cpu;
CRYPTO_set_NEON_functional(!cpu.has_broken_neon());
#endif
} }
~OpenSSLInitSingleton() { ~OpenSSLInitSingleton() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment