Commit 0be4d07b authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

NetworkService: Move some histograms over from IOThread.

IOThread is going away eventually, but we should still record the
histograms.

Bug: 853233
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: I46b2811a934bbab59066161327f7deb8e8991fd7
Reviewed-on: https://chromium-review.googlesource.com/1102717
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: default avatarDavid Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568050}
parent 226be1d6
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
...@@ -111,11 +108,6 @@ ...@@ -111,11 +108,6 @@
#include "chromeos/network/host_resolver_impl_chromeos.h" #include "chromeos/network/host_resolver_impl_chromeos.h"
#endif #endif
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
#include "crypto/openssl_util.h"
#include "third_party/boringssl/src/include/openssl/cpu.h"
#endif
using content::BrowserThread; using content::BrowserThread;
class SafeBrowsingURLRequestContext; class SafeBrowsingURLRequestContext;
...@@ -398,16 +390,6 @@ void IOThread::Init() { ...@@ -398,16 +390,6 @@ void IOThread::Init() {
base::Bind(&ObserveKeychainEvents)); base::Bind(&ObserveKeychainEvents));
#endif #endif
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
crypto::EnsureOpenSSLInit();
// Measure CPUs with broken NEON units. See https://crbug.com/341598.
UMA_HISTOGRAM_BOOLEAN("Net.HasBrokenNEON", CRYPTO_has_broken_NEON());
// Measure Android kernels with missing AT_HWCAP2 auxv fields. See
// https://crbug.com/boringssl/46.
UMA_HISTOGRAM_BOOLEAN("Net.NeedsHWCAP2Workaround",
CRYPTO_needs_hwcap2_workaround());
#endif
ConstructSystemRequestContext(); ConstructSystemRequestContext();
} }
...@@ -515,10 +497,6 @@ void IOThread::ConstructSystemRequestContext() { ...@@ -515,10 +497,6 @@ void IOThread::ConstructSystemRequestContext() {
builder->SetCertVerifier( builder->SetCertVerifier(
network::IgnoreErrorsCertVerifier::MaybeWrapCertVerifier( network::IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
command_line, switches::kUserDataDir, std::move(cert_verifier))); command_line, switches::kUserDataDir, std::move(cert_verifier)));
UMA_HISTOGRAM_BOOLEAN(
"Net.Certificate.IgnoreCertificateErrorsSPKIListPresent",
command_line.HasSwitch(
network::switches::kIgnoreCertificateErrorsSPKIList));
SetUpProxyService(builder.get()); SetUpProxyService(builder.get());
......
...@@ -152,6 +152,13 @@ component("network_service") { ...@@ -152,6 +152,13 @@ component("network_service") {
] ]
} }
if (is_android) {
deps += [
"//crypto",
"//third_party/boringssl",
]
}
if (is_win) { if (is_win) {
deps += [ "//sandbox/win:sandbox" ] deps += [ "//sandbox/win:sandbox" ]
} }
......
...@@ -14,4 +14,5 @@ include_rules = [ ...@@ -14,4 +14,5 @@ include_rules = [
"+services/proxy_resolver/public/mojom", "+services/proxy_resolver/public/mojom",
"+services/service_manager/public", "+services/service_manager/public",
"+services/service_manager/sandbox", "+services/service_manager/sandbox",
"+third_party/boringssl/src/include",
] ]
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/metrics/field_trial_params.h" #include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_macros.h"
#include "base/task_scheduler/post_task.h" #include "base/task_scheduler/post_task.h"
#include "base/values.h" #include "base/values.h"
#include "build/build_config.h" #include "build/build_config.h"
...@@ -36,6 +37,11 @@ ...@@ -36,6 +37,11 @@
#include "services/network/public/cpp/network_switches.h" #include "services/network/public/cpp/network_switches.h"
#include "services/network/url_request_context_builder_mojo.h" #include "services/network/url_request_context_builder_mojo.h"
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
#include "crypto/openssl_util.h"
#include "third_party/boringssl/src/include/openssl/cpu.h"
#endif
namespace network { namespace network {
namespace { namespace {
...@@ -101,10 +107,30 @@ NetworkService::NetworkService( ...@@ -101,10 +107,30 @@ NetworkService::NetworkService(
Bind(std::move(request)); Bind(std::move(request));
} }
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
// Make sure OpenSSL is initialized before using it to histogram data.
crypto::EnsureOpenSSLInit();
// Measure CPUs with broken NEON units. See https://crbug.com/341598.
UMA_HISTOGRAM_BOOLEAN("Net.HasBrokenNEON", CRYPTO_has_broken_NEON());
// Measure Android kernels with missing AT_HWCAP2 auxv fields. See
// https://crbug.com/boringssl/46.
UMA_HISTOGRAM_BOOLEAN("Net.NeedsHWCAP2Workaround",
CRYPTO_needs_hwcap2_workaround());
#endif
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
// Record this once per session, though the switch is appled on a
// per-NetworkContext basis.
UMA_HISTOGRAM_BOOLEAN(
"Net.Certificate.IgnoreCertificateErrorsSPKIListPresent",
command_line->HasSwitch(
network::switches::kIgnoreCertificateErrorsSPKIList));
network_change_manager_ = std::make_unique<NetworkChangeManager>( network_change_manager_ = std::make_unique<NetworkChangeManager>(
CreateNetworkChangeNotifierIfNeeded()); CreateNetworkChangeNotifierIfNeeded());
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (net_log) { if (net_log) {
net_log_ = net_log; net_log_ = net_log;
} else { } else {
......
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