Commit e6b51727 authored by Adrienne Walker's avatar Adrienne Walker Committed by Commit Bot

Add base::Feature for AppCache (default on)

This is to enable developers to turn it off for testing what future
deprecation will look like.

Bug: 582750,1055010
Change-Id: I7ea0570ec6cda99ec8027219ba5f272d875b679c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2124237
Commit-Queue: enne <enne@chromium.org>
Reviewed-by: default avatarTao Bai <michaelbai@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755426}
parent 16b569f8
...@@ -409,7 +409,8 @@ void AwSettings::PopulateWebPreferencesLocked(JNIEnv* env, ...@@ -409,7 +409,8 @@ void AwSettings::PopulateWebPreferencesLocked(JNIEnv* env,
web_prefs->plugins_enabled = false; web_prefs->plugins_enabled = false;
web_prefs->application_cache_enabled = web_prefs->application_cache_enabled =
Java_AwSettings_getAppCacheEnabledLocked(env, obj); Java_AwSettings_getAppCacheEnabledLocked(env, obj) &&
content::StoragePartition::IsAppCacheEnabled();
web_prefs->local_storage_enabled = web_prefs->local_storage_enabled =
Java_AwSettings_getDomStorageEnabledLocked(env, obj); Java_AwSettings_getDomStorageEnabledLocked(env, obj);
......
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
#include "net/base/url_util.h" #include "net/base/url_util.h"
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
#include "services/network/public/cpp/features.h" #include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/clipboard.h" #include "ui/base/clipboard/clipboard.h"
#include "ui/base/device_form_factor.h" #include "ui/base/device_form_factor.h"
...@@ -487,7 +488,8 @@ const WebPreferences RenderViewHostImpl::ComputeWebPreferences() { ...@@ -487,7 +488,8 @@ const WebPreferences RenderViewHostImpl::ComputeWebPreferences() {
prefs.remote_fonts_enabled = prefs.remote_fonts_enabled =
!command_line.HasSwitch(switches::kDisableRemoteFonts); !command_line.HasSwitch(switches::kDisableRemoteFonts);
prefs.application_cache_enabled = true; prefs.application_cache_enabled =
base::FeatureList::IsEnabled(blink::features::kAppCache);
prefs.local_storage_enabled = prefs.local_storage_enabled =
!command_line.HasSwitch(switches::kDisableLocalStorage); !command_line.HasSwitch(switches::kDisableLocalStorage);
prefs.databases_enabled = prefs.databases_enabled =
......
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
#include "storage/browser/database/database_tracker.h" #include "storage/browser/database/database_tracker.h"
#include "storage/browser/quota/quota_manager.h" #include "storage/browser/quota/quota_manager.h"
#include "storage/browser/quota/quota_settings.h" #include "storage/browser/quota/quota_settings.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/quota/quota_types.mojom.h" #include "third_party/blink/public/mojom/quota/quota_types.mojom.h"
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
...@@ -2694,4 +2695,8 @@ void StoragePartition::SetDefaultQuotaSettingsForTesting( ...@@ -2694,4 +2695,8 @@ void StoragePartition::SetDefaultQuotaSettingsForTesting(
g_test_quota_settings = settings; g_test_quota_settings = settings;
} }
bool StoragePartition::IsAppCacheEnabled() {
return base::FeatureList::IsEnabled(blink::features::kAppCache);
}
} // namespace content } // namespace content
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "services/network/public/mojom/fetch_api.mojom.h" #include "services/network/public/mojom/fetch_api.mojom.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/messaging/message_port_channel.h" #include "third_party/blink/public/common/messaging/message_port_channel.h"
#include "third_party/blink/public/mojom/loader/fetch_client_settings_object.mojom.h" #include "third_party/blink/public/mojom/loader/fetch_client_settings_object.mojom.h"
#include "third_party/blink/public/mojom/script/script_type.mojom.h" #include "third_party/blink/public/mojom/script/script_type.mojom.h"
...@@ -293,11 +294,13 @@ SharedWorkerHost* SharedWorkerServiceImpl::CreateWorker( ...@@ -293,11 +294,13 @@ SharedWorkerHost* SharedWorkerServiceImpl::CreateWorker(
DCHECK(insertion_result.second); DCHECK(insertion_result.second);
SharedWorkerHost* host = insertion_result.first->get(); SharedWorkerHost* host = insertion_result.first->get();
auto appcache_handle = std::make_unique<AppCacheNavigationHandle>( base::WeakPtr<AppCacheHost> appcache_host;
appcache_service_.get(), worker_process_host->GetID()); if (base::FeatureList::IsEnabled(blink::features::kAppCache)) {
base::WeakPtr<AppCacheHost> appcache_host = auto appcache_handle = std::make_unique<AppCacheNavigationHandle>(
appcache_handle->host()->GetWeakPtr(); appcache_service_.get(), worker_process_host->GetID());
host->SetAppCacheHandle(std::move(appcache_handle)); appcache_host = appcache_handle->host()->GetWeakPtr();
host->SetAppCacheHandle(std::move(appcache_handle));
}
auto service_worker_handle = auto service_worker_handle =
std::make_unique<ServiceWorkerMainResourceHandle>( std::make_unique<ServiceWorkerMainResourceHandle>(
......
...@@ -341,6 +341,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() { ...@@ -341,6 +341,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{"AllowContentInitiatedDataUrlNavigations", {"AllowContentInitiatedDataUrlNavigations",
features::kAllowContentInitiatedDataUrlNavigations, features::kAllowContentInitiatedDataUrlNavigations,
kUseFeatureState}, kUseFeatureState},
{"AppCache", blink::features::kAppCache, kDisableOnly},
{"AudioWorkletRealtimeThread", {"AudioWorkletRealtimeThread",
blink::features::kAudioWorkletRealtimeThread, kEnableOnly}, blink::features::kAudioWorkletRealtimeThread, kEnableOnly},
{"BlockCredentialedSubresources", {"BlockCredentialedSubresources",
......
...@@ -272,6 +272,8 @@ class CONTENT_EXPORT StoragePartition { ...@@ -272,6 +272,8 @@ class CONTENT_EXPORT StoragePartition {
static void SetDefaultQuotaSettingsForTesting( static void SetDefaultQuotaSettingsForTesting(
const storage::QuotaSettings* settings); const storage::QuotaSettings* settings);
static bool IsAppCacheEnabled();
protected: protected:
virtual ~StoragePartition() {} virtual ~StoragePartition() {}
}; };
......
...@@ -494,5 +494,7 @@ const base::Feature kFlexNG{"FlexNG", base::FEATURE_DISABLED_BY_DEFAULT}; ...@@ -494,5 +494,7 @@ const base::Feature kFlexNG{"FlexNG", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kKeepScriptResourceAlive{"KeepScriptResourceAlive", const base::Feature kKeepScriptResourceAlive{"KeepScriptResourceAlive",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kAppCache{"AppCache", base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace features } // namespace features
} // namespace blink } // namespace blink
...@@ -165,6 +165,8 @@ BLINK_COMMON_EXPORT extern const base::Feature kFlexNG; ...@@ -165,6 +165,8 @@ BLINK_COMMON_EXPORT extern const base::Feature kFlexNG;
BLINK_COMMON_EXPORT extern const base::Feature kKeepScriptResourceAlive; BLINK_COMMON_EXPORT extern const base::Feature kKeepScriptResourceAlive;
BLINK_COMMON_EXPORT extern const base::Feature kAppCache;
} // namespace features } // namespace features
} // namespace blink } // namespace blink
......
...@@ -159,6 +159,7 @@ ...@@ -159,6 +159,7 @@
status: "experimental", status: "experimental",
}, },
{ {
// Enabled when blink::features::kAppCache is enabled.
name: "AppCache", name: "AppCache",
status: "stable", status: "stable",
}, },
......
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