mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-09 00:28:59 +01:00
Enable NetworkService by default (see issue #2622).
The NetworkService can still be disabled for a limited time by specifying the `--disable-features=NetworkService` command-line flag.
This commit is contained in:
parent
9ddb013875
commit
6011d45e38
@ -10,6 +10,7 @@
|
|||||||
#include "libcef/browser/prefs/pref_store.h"
|
#include "libcef/browser/prefs/pref_store.h"
|
||||||
#include "libcef/browser/prefs/renderer_prefs.h"
|
#include "libcef/browser/prefs/renderer_prefs.h"
|
||||||
#include "libcef/common/cef_switches.h"
|
#include "libcef/common/cef_switches.h"
|
||||||
|
#include "libcef/common/net_service/util.h"
|
||||||
|
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
@ -171,7 +172,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
|
|||||||
SSLConfigServiceManager::RegisterPrefs(registry.get());
|
SSLConfigServiceManager::RegisterPrefs(registry.get());
|
||||||
update_client::RegisterPrefs(registry.get());
|
update_client::RegisterPrefs(registry.get());
|
||||||
|
|
||||||
if (!command_line->HasSwitch(switches::kEnableNetworkService)) {
|
if (!net_service::IsEnabled()) {
|
||||||
CefURLRequestContextGetter::RegisterPrefs(registry.get());
|
CefURLRequestContextGetter::RegisterPrefs(registry.get());
|
||||||
} else if (!profile) {
|
} else if (!profile) {
|
||||||
SystemNetworkContextManager::RegisterPrefs(registry.get());
|
SystemNetworkContextManager::RegisterPrefs(registry.get());
|
||||||
|
@ -116,9 +116,6 @@ const char kEnablePreferenceTesting[] = "enable-preference-testing";
|
|||||||
// Enable date-based expiration of built in network security information.
|
// Enable date-based expiration of built in network security information.
|
||||||
const char kEnableNetSecurityExpiration[] = "enable-net-security-expiration";
|
const char kEnableNetSecurityExpiration[] = "enable-net-security-expiration";
|
||||||
|
|
||||||
// Enable the NetworkService.
|
|
||||||
const char kEnableNetworkService[] = "enable-network-service";
|
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
// Path to the framework directory.
|
// Path to the framework directory.
|
||||||
const char kFrameworkDirPath[] = "framework-dir-path";
|
const char kFrameworkDirPath[] = "framework-dir-path";
|
||||||
|
@ -52,7 +52,6 @@ extern const char kPluginPolicy_Detect[];
|
|||||||
extern const char kPluginPolicy_Block[];
|
extern const char kPluginPolicy_Block[];
|
||||||
extern const char kEnablePreferenceTesting[];
|
extern const char kEnablePreferenceTesting[];
|
||||||
extern const char kEnableNetSecurityExpiration[];
|
extern const char kEnableNetSecurityExpiration[];
|
||||||
extern const char kEnableNetworkService[];
|
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
extern const char kFrameworkDirPath[];
|
extern const char kFrameworkDirPath[];
|
||||||
|
@ -46,7 +46,6 @@
|
|||||||
#include "extensions/common/constants.h"
|
#include "extensions/common/constants.h"
|
||||||
#include "ipc/ipc_buildflags.h"
|
#include "ipc/ipc_buildflags.h"
|
||||||
#include "pdf/pdf_ppapi.h"
|
#include "pdf/pdf_ppapi.h"
|
||||||
#include "services/network/public/cpp/features.h"
|
|
||||||
#include "services/service_manager/sandbox/switches.h"
|
#include "services/service_manager/sandbox/switches.h"
|
||||||
#include "ui/base/layout.h"
|
#include "ui/base/layout.h"
|
||||||
#include "ui/base/resource/resource_bundle.h"
|
#include "ui/base/resource/resource_bundle.h"
|
||||||
@ -567,14 +566,6 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable NetworkService for now
|
|
||||||
// TODO(cef): Implement the required changes for network service
|
|
||||||
if (network::features::kNetworkService.default_state ==
|
|
||||||
base::FEATURE_ENABLED_BY_DEFAULT &&
|
|
||||||
!command_line->HasSwitch(switches::kEnableNetworkService)) {
|
|
||||||
disable_features.push_back(network::features::kNetworkService.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!disable_features.empty()) {
|
if (!disable_features.empty()) {
|
||||||
DCHECK(!base::FeatureList::GetInstance());
|
DCHECK(!base::FeatureList::GetInstance());
|
||||||
std::string disable_features_str =
|
std::string disable_features_str =
|
||||||
|
@ -272,7 +272,8 @@ bool IsNetworkServiceEnabled() {
|
|||||||
if (state == -1) {
|
if (state == -1) {
|
||||||
CefRefPtr<CefCommandLine> command_line =
|
CefRefPtr<CefCommandLine> command_line =
|
||||||
CefCommandLine::GetGlobalCommandLine();
|
CefCommandLine::GetGlobalCommandLine();
|
||||||
state = command_line->HasSwitch("enable-network-service") ? 1 : 0;
|
const std::string& value = command_line->GetSwitchValue("disable-features");
|
||||||
|
state = value.find("NetworkService") == std::string::npos ? 1 : 0;
|
||||||
}
|
}
|
||||||
return state ? true : false;
|
return state ? true : false;
|
||||||
}
|
}
|
||||||
|
@ -1272,7 +1272,7 @@ class RequestTestRunner : public base::RefCountedThreadSafe<RequestTestRunner> {
|
|||||||
// on stop redirects.
|
// on stop redirects.
|
||||||
settings_.response = CefResponse::Create();
|
settings_.response = CefResponse::Create();
|
||||||
settings_.response->SetStatus(302);
|
settings_.response->SetStatus(302);
|
||||||
if (IsNetworkServiceEnabled()) {
|
if (IsNetworkServiceEnabled() && is_browser_process_) {
|
||||||
settings_.response->SetStatusText("Found");
|
settings_.response->SetStatusText("Found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user