Commit 2f450a83 authored by Rayan Kanso's avatar Rayan Kanso Committed by Commit Bot

[Background Fetch] Create a feature flag for uploads.

Bug: 774054
Change-Id: I42ce8c29699701aec0df0de806ca5077bf49a056
Reviewed-on: https://chromium-review.googlesource.com/c/1297144Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602407}
parent 02acf1bb
...@@ -495,6 +495,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( ...@@ -495,6 +495,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (!base::FeatureList::IsEnabled(features::kBackgroundFetch)) if (!base::FeatureList::IsEnabled(features::kBackgroundFetch))
WebRuntimeFeatures::EnableBackgroundFetch(false); WebRuntimeFeatures::EnableBackgroundFetch(false);
WebRuntimeFeatures::EnableBackgroundFetchUploads(
base::FeatureList::IsEnabled(features::kBackgroundFetchUploads));
WebRuntimeFeatures::EnableNoHoverAfterLayoutChange( WebRuntimeFeatures::EnableNoHoverAfterLayoutChange(
base::FeatureList::IsEnabled(features::kNoHoverAfterLayoutChange)); base::FeatureList::IsEnabled(features::kNoHoverAfterLayoutChange));
......
...@@ -53,6 +53,10 @@ const base::Feature kAwaitOptimization{"AwaitOptimization", ...@@ -53,6 +53,10 @@ const base::Feature kAwaitOptimization{"AwaitOptimization",
const base::Feature kBackgroundFetch{"BackgroundFetch", const base::Feature kBackgroundFetch{"BackgroundFetch",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Enables using uploads in a Background Fetch.
const base::Feature kBackgroundFetchUploads{"BackgroundFetchUploads",
base::FEATURE_DISABLED_BY_DEFAULT};
// Enable incremental marking for Blink's heap managed by the Oilpan garbage // Enable incremental marking for Blink's heap managed by the Oilpan garbage
// collector. // collector.
const base::Feature kBlinkHeapIncrementalMarking{ const base::Feature kBlinkHeapIncrementalMarking{
......
...@@ -26,6 +26,7 @@ CONTENT_EXPORT extern const base::Feature kAudioServiceLaunchOnStartup; ...@@ -26,6 +26,7 @@ CONTENT_EXPORT extern const base::Feature kAudioServiceLaunchOnStartup;
CONTENT_EXPORT extern const base::Feature kAudioServiceOutOfProcess; CONTENT_EXPORT extern const base::Feature kAudioServiceOutOfProcess;
CONTENT_EXPORT extern const base::Feature kAwaitOptimization; CONTENT_EXPORT extern const base::Feature kAwaitOptimization;
CONTENT_EXPORT extern const base::Feature kBackgroundFetch; CONTENT_EXPORT extern const base::Feature kBackgroundFetch;
CONTENT_EXPORT extern const base::Feature kBackgroundFetchUploads;
CONTENT_EXPORT extern const base::Feature kBlinkHeapIncrementalMarking; CONTENT_EXPORT extern const base::Feature kBlinkHeapIncrementalMarking;
CONTENT_EXPORT extern const base::Feature kBlinkHeapUnifiedGarbageCollection; CONTENT_EXPORT extern const base::Feature kBlinkHeapUnifiedGarbageCollection;
CONTENT_EXPORT extern const base::Feature kBloatedRendererDetection; CONTENT_EXPORT extern const base::Feature kBloatedRendererDetection;
......
...@@ -80,6 +80,7 @@ class WebRuntimeFeatures { ...@@ -80,6 +80,7 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableAllowActivationDelegationAttr(bool); BLINK_PLATFORM_EXPORT static void EnableAllowActivationDelegationAttr(bool);
BLINK_PLATFORM_EXPORT static void EnableAudioOutputDevices(bool); BLINK_PLATFORM_EXPORT static void EnableAudioOutputDevices(bool);
BLINK_PLATFORM_EXPORT static void EnableBackgroundFetch(bool); BLINK_PLATFORM_EXPORT static void EnableBackgroundFetch(bool);
BLINK_PLATFORM_EXPORT static void EnableBackgroundFetchUploads(bool);
BLINK_PLATFORM_EXPORT static void EnableBlinkHeapIncrementalMarking(bool); BLINK_PLATFORM_EXPORT static void EnableBlinkHeapIncrementalMarking(bool);
BLINK_PLATFORM_EXPORT static void EnableBlinkHeapUnifiedGarbageCollection( BLINK_PLATFORM_EXPORT static void EnableBlinkHeapUnifiedGarbageCollection(
bool); bool);
......
...@@ -150,8 +150,8 @@ ScriptPromise BackgroundFetchManager::fetch( ...@@ -150,8 +150,8 @@ ScriptPromise BackgroundFetchManager::fetch(
UMA_HISTOGRAM_BOOLEAN("BackgroundFetch.HasRequestsWithBody", UMA_HISTOGRAM_BOOLEAN("BackgroundFetch.HasRequestsWithBody",
has_requests_with_body); has_requests_with_body);
// TODO(crbug.com/789854): Stop bailing here once we support uploads. if (has_requests_with_body &&
if (has_requests_with_body) { !RuntimeEnabledFeatures::BackgroundFetchUploadsEnabled()) {
return ScriptPromise::Reject( return ScriptPromise::Reject(
script_state, V8ThrowException::CreateTypeError( script_state, V8ThrowException::CreateTypeError(
script_state->GetIsolate(), script_state->GetIsolate(),
......
...@@ -572,4 +572,8 @@ void WebRuntimeFeatures::EnableBackgroundFetch(bool enable) { ...@@ -572,4 +572,8 @@ void WebRuntimeFeatures::EnableBackgroundFetch(bool enable) {
RuntimeEnabledFeatures::SetBackgroundFetchEnabled(enable); RuntimeEnabledFeatures::SetBackgroundFetchEnabled(enable);
} }
void WebRuntimeFeatures::EnableBackgroundFetchUploads(bool enable) {
RuntimeEnabledFeatures::SetBackgroundFetchUploadsEnabled(enable);
}
} // namespace blink } // namespace blink
...@@ -117,6 +117,10 @@ ...@@ -117,6 +117,10 @@
origin_trial_feature_name: "BackgroundFetch", origin_trial_feature_name: "BackgroundFetch",
status: "experimental", status: "experimental",
}, },
{
name: "BackgroundFetchUploads",
status: "experimental",
},
{ {
name: "BackgroundVideoTrackOptimization", name: "BackgroundVideoTrackOptimization",
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