
This is a reland of a5f1ceaa8a
This additionally wraps the DCHECKs in DCHECK_IS_ON() to prevent
the compiler from complaining.
BYPASS_POLICY_COMPATIBILITY_CHECK=No suitable default exists.
Original change's description:
> Add enterprise policy for enabling or disabling network sandbox.
>
> This CL adds a new enterprise policy `NetworkServiceSandboxEnabled`
> for force enabling or disabling the network service sandbox.
>
> This allows enterprises to force enable now to get feedback on any
> potential future compatibility issues during rollout, and will also
> permit opting out of the sandbox if any third party compatibility
> issues are encountered after rollout.
>
> If this policy is not set, then the default from content will be
> used.
>
> This CL also removes some DCHECKs in sandbox as control of whether
> network service sandbox is enabled is now fully in content.
>
> BUG=841001
> BYPASS_POLICY_COMPATIBILITY_CHECK=No suitable default exists.
>
> Change-Id: Icdbbadd71a7b93fab947a00e1a14e6bedbb8c8f1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198860
> Reviewed-by: Nasko Oskov <nasko@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Alex Gough <ajgo@chromium.org>
> Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
> Commit-Queue: Will Harris <wfh@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#928449}
Bug: 841001
Change-Id: I528dab0c8c3a3584aca91e8e73638a6a074b0118
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3207411
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#928719}
71 lines
2.3 KiB
C++
71 lines
2.3 KiB
C++
// Copyright 2019 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef CONTENT_BROWSER_NETWORK_SERVICE_INSTANCE_IMPL_H_
|
|
#define CONTENT_BROWSER_NETWORK_SERVICE_INSTANCE_IMPL_H_
|
|
|
|
#include "base/callback.h"
|
|
#include "base/callback_list.h"
|
|
#include "content/common/content_export.h"
|
|
|
|
namespace base {
|
|
class TimeDelta;
|
|
}
|
|
|
|
namespace content {
|
|
|
|
// Creates the network::NetworkService object on the IO thread directly instead
|
|
// of trying to go through the ServiceManager.
|
|
CONTENT_EXPORT void ForceCreateNetworkServiceDirectlyForTesting();
|
|
|
|
// Resets the interface ptr to the network service.
|
|
CONTENT_EXPORT void ResetNetworkServiceForTesting();
|
|
|
|
// Registers |handler| to run (on UI thread) after mojo::Remote<NetworkService>
|
|
// encounters an error. Note that there are no ordering guarantees wrt error
|
|
// handlers for other interfaces (e.g. mojo::Remote<NetworkContext> and/or
|
|
// mojo::Remote<URLLoaderFactory>).
|
|
//
|
|
// Can only be called on the UI thread. No-op if NetworkService is disabled.
|
|
CONTENT_EXPORT base::CallbackListSubscription
|
|
RegisterNetworkServiceCrashHandler(base::RepeatingClosure handler);
|
|
|
|
// Corresponds to the "NetworkServiceAvailability" histogram enumeration type in
|
|
// src/tools/metrics/histograms/enums.xml.
|
|
//
|
|
// DO NOT REORDER OR CHANGE THE MEANING OF THESE VALUES.
|
|
enum class NetworkServiceAvailability {
|
|
AVAILABLE = 0,
|
|
NOT_CREATED = 1,
|
|
NOT_BOUND = 2,
|
|
ENCOUNTERED_ERROR = 3,
|
|
NOT_RESPONDING = 4,
|
|
kMaxValue = NOT_RESPONDING
|
|
};
|
|
|
|
constexpr char kSSLKeyLogFileHistogram[] = "Net.SSLKeyLogFileUse";
|
|
|
|
// These values are persisted to logs. Entries should not be renumbered and
|
|
// numeric values should never be reused.
|
|
enum class SSLKeyLogFileAction {
|
|
kLogFileEnabled = 0,
|
|
kSwitchFound = 1,
|
|
kEnvVarFound = 2,
|
|
kMaxValue = kEnvVarFound,
|
|
};
|
|
|
|
// TODO(http://crbug.com/934317): Remove these when done debugging renderer
|
|
// hangs.
|
|
NetworkServiceAvailability GetNetworkServiceAvailability();
|
|
base::TimeDelta GetTimeSinceLastNetworkServiceCrash();
|
|
void PingNetworkService(base::OnceClosure closure);
|
|
|
|
// Shuts down the in-process network service or disconnects from the out-of-
|
|
// process one, allowing it to shut down.
|
|
CONTENT_EXPORT void ShutDownNetworkService();
|
|
|
|
} // namespace content
|
|
|
|
#endif // CONTENT_BROWSER_NETWORK_SERVICE_INSTANCE_IMPL_H_
|