Commit 687054d6 authored by Ben Kelly's avatar Ben Kelly Committed by Commit Bot

ServiceWorker: Remove foreground priority feature.

Remove the ServiceWorkerForegroundPriority feature since it has been
successfully launched to 100% in Chrome 74.

Bug: 928904
Change-Id: I64059e14b9eed99763db842fef248b5813b082de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1633049Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664017}
parent 9fde8605
...@@ -24,7 +24,6 @@ namespace { ...@@ -24,7 +24,6 @@ namespace {
const base::Feature* kFeaturesExposedToJava[] = { const base::Feature* kFeaturesExposedToJava[] = {
&features::kBackgroundMediaRendererHasModerateBinding, &features::kBackgroundMediaRendererHasModerateBinding,
&kEnhancedSelectionInsertionHandle, &kEnhancedSelectionInsertionHandle,
&features::kServiceWorkerForegroundPriority,
&kServiceGroupImportance, &kServiceGroupImportance,
}; };
......
...@@ -188,9 +188,7 @@ ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( ...@@ -188,9 +188,7 @@ ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest(
bool ChildProcessLauncherPriority::is_background() const { bool ChildProcessLauncherPriority::is_background() const {
return !visible && !has_media_stream && !boost_for_pending_views && return !visible && !has_media_stream && !boost_for_pending_views &&
!(has_foreground_service_worker && !has_foreground_service_worker;
base::FeatureList::IsEnabled(
features::kServiceWorkerForegroundPriority));
} }
bool ChildProcessLauncherPriority::operator==( bool ChildProcessLauncherPriority::operator==(
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
#include "content/public/common/child_process_host.h" #include "content/public/common/child_process_host.h"
#include "content/public/common/content_client.h" #include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "ipc/ipc_message.h" #include "ipc/ipc_message.h"
#include "mojo/public/cpp/bindings/strong_binding.h" #include "mojo/public/cpp/bindings/strong_binding.h"
...@@ -278,8 +277,6 @@ bool HasSentStartWorker(EmbeddedWorkerInstance::StartingPhase phase) { ...@@ -278,8 +277,6 @@ bool HasSentStartWorker(EmbeddedWorkerInstance::StartingPhase phase) {
void NotifyForegroundServiceWorkerOnUIThread(bool added, int process_id) { void NotifyForegroundServiceWorkerOnUIThread(bool added, int process_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(
base::FeatureList::IsEnabled(features::kServiceWorkerForegroundPriority));
RenderProcessHost* rph = RenderProcessHost::FromID(process_id); RenderProcessHost* rph = RenderProcessHost::FromID(process_id);
if (!rph) if (!rph)
...@@ -1190,8 +1187,6 @@ void EmbeddedWorkerInstance::SetNetworkFactoryForTesting( ...@@ -1190,8 +1187,6 @@ void EmbeddedWorkerInstance::SetNetworkFactoryForTesting(
void EmbeddedWorkerInstance::NotifyForegroundServiceWorkerAdded() { void EmbeddedWorkerInstance::NotifyForegroundServiceWorkerAdded() {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(
base::FeatureList::IsEnabled(features::kServiceWorkerForegroundPriority));
if (!process_handle_ || foreground_notified_) if (!process_handle_ || foreground_notified_)
return; return;
...@@ -1205,9 +1200,6 @@ void EmbeddedWorkerInstance::NotifyForegroundServiceWorkerAdded() { ...@@ -1205,9 +1200,6 @@ void EmbeddedWorkerInstance::NotifyForegroundServiceWorkerAdded() {
void EmbeddedWorkerInstance::NotifyForegroundServiceWorkerRemoved() { void EmbeddedWorkerInstance::NotifyForegroundServiceWorkerRemoved() {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(
!foreground_notified_ ||
base::FeatureList::IsEnabled(features::kServiceWorkerForegroundPriority));
if (!process_handle_ || !foreground_notified_) if (!process_handle_ || !foreground_notified_)
return; return;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
#include "content/public/browser/page_navigator.h" #include "content/public/browser/page_navigator.h"
#include "content/public/common/content_client.h" #include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/result_codes.h" #include "content/public/common/result_codes.h"
#include "net/http/http_response_headers.h" #include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h" #include "net/http/http_response_info.h"
...@@ -2114,8 +2113,6 @@ ServiceWorkerVersion::TakePausedStateOfChangedScript(const GURL& script_url) { ...@@ -2114,8 +2113,6 @@ ServiceWorkerVersion::TakePausedStateOfChangedScript(const GURL& script_url) {
bool ServiceWorkerVersion::ShouldRequireForegroundPriority( bool ServiceWorkerVersion::ShouldRequireForegroundPriority(
int worker_process_id) const { int worker_process_id) const {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!base::FeatureList::IsEnabled(features::kServiceWorkerForegroundPriority))
return false;
// Currently FetchEvents are the only type of event we need to really process // Currently FetchEvents are the only type of event we need to really process
// at foreground priority. If the service worker does not have a FetchEvent // at foreground priority. If the service worker does not have a FetchEvent
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "content/browser/service_worker/service_worker_registration.h" #include "content/browser/service_worker/service_worker_registration.h"
#include "content/browser/service_worker/service_worker_test_utils.h" #include "content/browser/service_worker/service_worker_test_utils.h"
#include "content/common/service_worker/service_worker_utils.h" #include "content/common/service_worker/service_worker_utils.h"
#include "content/public/common/content_features.h"
#include "content/public/test/mock_render_process_host.h" #include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_service.mojom.h" #include "content/public/test/test_service.mojom.h"
...@@ -1192,9 +1191,6 @@ TEST_F(ServiceWorkerVersionTest, BadOrigin) { ...@@ -1192,9 +1191,6 @@ TEST_F(ServiceWorkerVersionTest, BadOrigin) {
TEST_F(ServiceWorkerVersionTest, TEST_F(ServiceWorkerVersionTest,
ForegroundServiceWorkerCountUpdatedByControllee) { ForegroundServiceWorkerCountUpdatedByControllee) {
base::test::ScopedFeatureList scoped_list;
scoped_list.InitAndEnableFeature(features::kServiceWorkerForegroundPriority);
// Start the worker before we have a controllee. // Start the worker before we have a controllee.
base::Optional<blink::ServiceWorkerStatusCode> status; base::Optional<blink::ServiceWorkerStatusCode> status;
base::RunLoop run_loop; base::RunLoop run_loop;
...@@ -1230,9 +1226,6 @@ TEST_F(ServiceWorkerVersionTest, ...@@ -1230,9 +1226,6 @@ TEST_F(ServiceWorkerVersionTest,
TEST_F(ServiceWorkerVersionTest, TEST_F(ServiceWorkerVersionTest,
ForegroundServiceWorkerCountNotUpdatedBySameProcessControllee) { ForegroundServiceWorkerCountNotUpdatedBySameProcessControllee) {
base::test::ScopedFeatureList scoped_list;
scoped_list.InitAndEnableFeature(features::kServiceWorkerForegroundPriority);
// Start the worker before we have a controllee. // Start the worker before we have a controllee.
base::Optional<blink::ServiceWorkerStatusCode> status; base::Optional<blink::ServiceWorkerStatusCode> status;
base::RunLoop run_loop; base::RunLoop run_loop;
...@@ -1258,9 +1251,6 @@ TEST_F(ServiceWorkerVersionTest, ...@@ -1258,9 +1251,6 @@ TEST_F(ServiceWorkerVersionTest,
TEST_F(ServiceWorkerVersionTest, TEST_F(ServiceWorkerVersionTest,
ForegroundServiceWorkerCountUpdatedByControlleeProcessIdChange) { ForegroundServiceWorkerCountUpdatedByControlleeProcessIdChange) {
base::test::ScopedFeatureList scoped_list;
scoped_list.InitAndEnableFeature(features::kServiceWorkerForegroundPriority);
// Start the worker before we have a controllee. // Start the worker before we have a controllee.
base::Optional<blink::ServiceWorkerStatusCode> status; base::Optional<blink::ServiceWorkerStatusCode> status;
base::RunLoop run_loop; base::RunLoop run_loop;
...@@ -1313,9 +1303,6 @@ TEST_F(ServiceWorkerVersionTest, ...@@ -1313,9 +1303,6 @@ TEST_F(ServiceWorkerVersionTest,
TEST_F(ServiceWorkerVersionTest, TEST_F(ServiceWorkerVersionTest,
ForegroundServiceWorkerCountUpdatedByWorkerStatus) { ForegroundServiceWorkerCountUpdatedByWorkerStatus) {
base::test::ScopedFeatureList scoped_list;
scoped_list.InitAndEnableFeature(features::kServiceWorkerForegroundPriority);
// Add a controllee in a different process from the service worker. // Add a controllee in a different process from the service worker.
auto remote_endpoint = ActivateWithControllee(); auto remote_endpoint = ActivateWithControllee();
...@@ -1358,9 +1345,6 @@ class ServiceWorkerVersionNoFetchHandlerTest : public ServiceWorkerVersionTest { ...@@ -1358,9 +1345,6 @@ class ServiceWorkerVersionNoFetchHandlerTest : public ServiceWorkerVersionTest {
TEST_F(ServiceWorkerVersionNoFetchHandlerTest, TEST_F(ServiceWorkerVersionNoFetchHandlerTest,
ForegroundServiceWorkerCountNotUpdated) { ForegroundServiceWorkerCountNotUpdated) {
base::test::ScopedFeatureList scoped_list;
scoped_list.InitAndEnableFeature(features::kServiceWorkerForegroundPriority);
// Start the worker before we have a controllee. // Start the worker before we have a controllee.
base::Optional<blink::ServiceWorkerStatusCode> status; base::Optional<blink::ServiceWorkerStatusCode> status;
base::RunLoop run_loop; base::RunLoop run_loop;
......
...@@ -501,9 +501,6 @@ public final class ChildProcessLauncherHelperImpl { ...@@ -501,9 +501,6 @@ public final class ChildProcessLauncherHelperImpl {
boolean mediaRendererHasModerate = ContentFeatureList.isEnabled( boolean mediaRendererHasModerate = ContentFeatureList.isEnabled(
ContentFeatureList.BACKGROUND_MEDIA_RENDERER_HAS_MODERATE_BINDING); ContentFeatureList.BACKGROUND_MEDIA_RENDERER_HAS_MODERATE_BINDING);
boolean serviceWorkerForegroundPriority =
ContentFeatureList.isEnabled(ContentFeatureList.SERVICE_WORKER_FOREGROUND_PRIORITY);
@ChildProcessImportance @ChildProcessImportance
int newEffectiveImportance; int newEffectiveImportance;
if ((visible && frameDepth == 0) || importance == ChildProcessImportance.IMPORTANT if ((visible && frameDepth == 0) || importance == ChildProcessImportance.IMPORTANT
...@@ -511,8 +508,7 @@ public final class ChildProcessLauncherHelperImpl { ...@@ -511,8 +508,7 @@ public final class ChildProcessLauncherHelperImpl {
newEffectiveImportance = ChildProcessImportance.IMPORTANT; newEffectiveImportance = ChildProcessImportance.IMPORTANT;
} else if ((visible && frameDepth > 0 && intersectsViewport) || boostForPendingViews } else if ((visible && frameDepth > 0 && intersectsViewport) || boostForPendingViews
|| importance == ChildProcessImportance.MODERATE || importance == ChildProcessImportance.MODERATE
|| (hasMediaStream && mediaRendererHasModerate) || (hasMediaStream && mediaRendererHasModerate) || hasForegroundServiceWorker) {
|| (hasForegroundServiceWorker && serviceWorkerForegroundPriority)) {
newEffectiveImportance = ChildProcessImportance.MODERATE; newEffectiveImportance = ChildProcessImportance.MODERATE;
} else { } else {
newEffectiveImportance = ChildProcessImportance.NORMAL; newEffectiveImportance = ChildProcessImportance.NORMAL;
......
...@@ -38,8 +38,5 @@ public abstract class ContentFeatureList { ...@@ -38,8 +38,5 @@ public abstract class ContentFeatureList {
public static final String SERVICE_GROUP_IMPORTANCE = "ServiceGroupImportance"; public static final String SERVICE_GROUP_IMPORTANCE = "ServiceGroupImportance";
public static final String SERVICE_WORKER_FOREGROUND_PRIORITY =
"ServiceWorkerForegroundPriority";
private static native boolean nativeIsEnabled(String featureName); private static native boolean nativeIsEnabled(String featureName);
} }
...@@ -406,11 +406,6 @@ const base::Feature kSendBeaconThrowForBlobWithNonSimpleType{ ...@@ -406,11 +406,6 @@ const base::Feature kSendBeaconThrowForBlobWithNonSimpleType{
"SendBeaconThrowForBlobWithNonSimpleType", "SendBeaconThrowForBlobWithNonSimpleType",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
// Keep processes with service workers controlling clients from other
// processes at foreground priority. (crbug.com/928904)
const base::Feature kServiceWorkerForegroundPriority{
"ServiceWorkerForegroundPriority", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables long running message dispatch for service workers. // Enables long running message dispatch for service workers.
// This is a temporary addition only to be used for the Android Messages // This is a temporary addition only to be used for the Android Messages
// integration with ChromeOS (http://crbug.com/823256). // integration with ChromeOS (http://crbug.com/823256).
......
...@@ -99,7 +99,6 @@ CONTENT_EXPORT extern const base::Feature ...@@ -99,7 +99,6 @@ CONTENT_EXPORT extern const base::Feature
CONTENT_EXPORT extern const base::Feature kScrollAnchorSerialization; CONTENT_EXPORT extern const base::Feature kScrollAnchorSerialization;
CONTENT_EXPORT extern const base::Feature CONTENT_EXPORT extern const base::Feature
kSendBeaconThrowForBlobWithNonSimpleType; kSendBeaconThrowForBlobWithNonSimpleType;
CONTENT_EXPORT extern const base::Feature kServiceWorkerForegroundPriority;
CONTENT_EXPORT extern const base::Feature kServiceWorkerLongRunningMessage; CONTENT_EXPORT extern const base::Feature kServiceWorkerLongRunningMessage;
CONTENT_EXPORT extern const base::Feature kServiceWorkerPaymentApps; CONTENT_EXPORT extern const base::Feature kServiceWorkerPaymentApps;
CONTENT_EXPORT extern const base::Feature kSharedArrayBuffer; CONTENT_EXPORT extern const base::Feature kSharedArrayBuffer;
......
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