Commit 9c6dc328 authored by Nidhi Jaju's avatar Nidhi Jaju Committed by Commit Bot

Remove ServiceWorkerUtils::IsImportedScriptUpdateCheckEnabled()

As the check is no longer needed, it can be removed from the codebase.

Bug: N/A
Change-Id: Ic655e0092bbe34592b2b5179c2debdf80ef590cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414312Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarMakoto Shimazu <shimazu@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Reviewed-by: default avatarAdam Langley <agl@chromium.org>
Commit-Queue: Nidhi Jaju <nidhijaju127@gmail.com>
Cr-Commit-Position: refs/heads/master@{#808111}
parent ffdfceb6
......@@ -53,7 +53,6 @@
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/service_worker/service_worker_utils.h"
#include "url/gurl.h"
namespace {
......@@ -599,13 +598,11 @@ IN_PROC_BROWSER_TEST_F(VariationsHttpHeadersBrowserTest, ServiceWorkerScript) {
EXPECT_TRUE(
HasReceivedHeader(GetGoogleUrlWithPath(worker_path), "X-Client-Data"));
if (blink::ServiceWorkerUtils::IsImportedScriptUpdateCheckEnabled()) {
// And on import script requests to Google.
EXPECT_TRUE(HasReceivedHeader(
GetGoogleUrlWithPath("/service_worker/empty.js"), "X-Client-Data"));
// But not on requests not to Google.
EXPECT_FALSE(HasReceivedHeader(absolute_import, "X-Client-Data"));
}
// And on import script requests to Google.
EXPECT_TRUE(HasReceivedHeader(
GetGoogleUrlWithPath("/service_worker/empty.js"), "X-Client-Data"));
// But not on requests not to Google.
EXPECT_FALSE(HasReceivedHeader(absolute_import, "X-Client-Data"));
}
// Verify in an integration test that the variations header (X-Client-Data) is
......
......@@ -17,7 +17,6 @@
#include "content/public/test/test_browser_context.h"
#include "content/test/fake_network_url_loader_factory.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "third_party/blink/public/common/service_worker/service_worker_utils.h"
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
namespace content {
......@@ -48,11 +47,8 @@ EmbeddedWorkerTestHelper::EmbeddedWorkerTestHelper(
user_data_directory, std::move(database_task_runner),
/*quota_manager_proxy=*/nullptr, special_storage_policy, nullptr,
url_loader_factory_getter_.get(),
blink::ServiceWorkerUtils::IsImportedScriptUpdateCheckEnabled()
? wrapper_
->CreateNonNetworkPendingURLLoaderFactoryBundleForUpdateCheck(
browser_context_.get())
: nullptr);
wrapper_->CreateNonNetworkPendingURLLoaderFactoryBundleForUpdateCheck(
browser_context_.get()));
wrapper_->process_manager()->SetProcessIdForTest(mock_render_process_id());
wrapper_->process_manager()->SetNewProcessIdForTest(new_render_process_id());
if (!ServiceWorkerContext::IsServiceWorkerOnUIEnabled())
......
......@@ -49,7 +49,6 @@
#include "storage/browser/quota/quota_manager_proxy.h"
#include "storage/browser/quota/special_storage_policy.h"
#include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
#include "third_party/blink/public/common/service_worker/service_worker_utils.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration.mojom.h"
namespace content {
......@@ -247,11 +246,9 @@ void ServiceWorkerContextWrapper::Init(
{base::MayBlock(), base::TaskShutdownBehavior::BLOCK_SHUTDOWN});
std::unique_ptr<blink::PendingURLLoaderFactoryBundle>
non_network_pending_loader_factory_bundle_for_update_check;
if (blink::ServiceWorkerUtils::IsImportedScriptUpdateCheckEnabled()) {
non_network_pending_loader_factory_bundle_for_update_check =
CreateNonNetworkPendingURLLoaderFactoryBundleForUpdateCheck(
storage_partition_->browser_context());
}
non_network_pending_loader_factory_bundle_for_update_check =
CreateNonNetworkPendingURLLoaderFactoryBundleForUpdateCheck(
storage_partition_->browser_context());
RunOrPostTaskOnCoreThread(
FROM_HERE,
......@@ -1886,7 +1883,6 @@ std::unique_ptr<blink::PendingURLLoaderFactoryBundle>
ServiceWorkerContextWrapper::
CreateNonNetworkPendingURLLoaderFactoryBundleForUpdateCheck(
BrowserContext* browser_context) {
DCHECK(blink::ServiceWorkerUtils::IsImportedScriptUpdateCheckEnabled());
ContentBrowserClient::NonNetworkURLLoaderFactoryDeprecatedMap
non_network_factories;
GetContentClient()
......
......@@ -31,7 +31,6 @@
#include "net/cert/cert_status_flags.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/blink/public/common/loader/throttling_url_loader.h"
#include "third_party/blink/public/common/service_worker/service_worker_utils.h"
namespace content {
......@@ -172,7 +171,6 @@ ServiceWorkerUpdatedScriptLoader::CreateAndStart(
const network::ResourceRequest& original_request,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
scoped_refptr<ServiceWorkerVersion> version) {
DCHECK(blink::ServiceWorkerUtils::IsImportedScriptUpdateCheckEnabled());
return base::WrapUnique(new ServiceWorkerUpdatedScriptLoader(
options, original_request, std::move(client), version));
}
......
......@@ -149,7 +149,6 @@ source_set("common") {
"scheduler/web_scheduler_tracked_feature.cc",
"service_worker/service_worker_status_code.cc",
"service_worker/service_worker_type_converters.cc",
"service_worker/service_worker_utils.cc",
"switches.cc",
"thread_safe_browser_interface_broker_proxy.cc",
"tokens/tokens_mojom_traits.cc",
......
// Copyright 2018 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.
#include "third_party/blink/public/common/service_worker/service_worker_utils.h"
#include "base/feature_list.h"
#include "third_party/blink/public/common/features.h"
namespace blink {
bool ServiceWorkerUtils::IsImportedScriptUpdateCheckEnabled() {
return true;
}
} // namespace blink
......@@ -38,8 +38,6 @@ BLINK_COMMON_EXPORT extern const char kServiceWorkerEagerCodeCacheStrategy[];
class ServiceWorkerUtils {
public:
static bool BLINK_COMMON_EXPORT IsImportedScriptUpdateCheckEnabled();
static EagerCodeCacheStrategy BLINK_COMMON_EXPORT GetEagerCodeCacheStrategy();
};
......
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