Commit 3b4706e9 authored by David Bertoni's avatar David Bertoni Committed by Commit Bot

[Extensions] Remove obsolete service feature_util function.

This function has been returning "true" since 2016-05-17.

Bug: 978657
Change-Id: I7b8e64accaf36f30cf30177b680851ecacda5546
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1677261Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672587}
parent 2c327352
...@@ -81,10 +81,6 @@ ...@@ -81,10 +81,6 @@
#include "components/nacl/common/nacl_process_type.h" #include "components/nacl/common/nacl_process_type.h"
#endif #endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/common/features/feature_util.h"
#endif
#if BUILDFLAG(ENABLE_PLUGINS) #if BUILDFLAG(ENABLE_PLUGINS)
#include "content/public/common/pepper_plugin_info.h" #include "content/public/common/pepper_plugin_info.h"
#include "flapper_version.h" // nogncheck In SHARED_INTERMEDIATE_DIR. #include "flapper_version.h" // nogncheck In SHARED_INTERMEDIATE_DIR.
...@@ -633,8 +629,7 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) { ...@@ -633,8 +629,7 @@ void ChromeContentClient::AddAdditionalSchemes(Schemes* schemes) {
schemes->secure_schemes.push_back(chrome::kChromeNativeScheme); schemes->secure_schemes.push_back(chrome::kChromeNativeScheme);
#if BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_EXTENSIONS)
if (extensions::feature_util::ExtensionServiceWorkersEnabled()) schemes->service_worker_schemes.push_back(extensions::kExtensionScheme);
schemes->service_worker_schemes.push_back(extensions::kExtensionScheme);
// As far as Blink is concerned, they should be allowed to receive CORS // As far as Blink is concerned, they should be allowed to receive CORS
// requests. At the Extensions layer, requests will actually be blocked unless // requests. At the Extensions layer, requests will actually be blocked unless
......
...@@ -165,8 +165,6 @@ if (enable_extensions) { ...@@ -165,8 +165,6 @@ if (enable_extensions) {
"features/feature_provider.h", "features/feature_provider.h",
"features/feature_session_type.cc", "features/feature_session_type.cc",
"features/feature_session_type.h", "features/feature_session_type.h",
"features/feature_util.cc",
"features/feature_util.h",
"features/json_feature_provider_source.cc", "features/json_feature_provider_source.cc",
"features/json_feature_provider_source.h", "features/json_feature_provider_source.h",
"features/manifest_feature.cc", "features/manifest_feature.cc",
......
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
#include <memory> #include <memory>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/alias.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
...@@ -16,13 +18,30 @@ ...@@ -16,13 +18,30 @@
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "extensions/common/extensions_client.h" #include "extensions/common/extensions_client.h"
#include "extensions/common/features/feature.h" #include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_util.h"
#include "extensions/common/switches.h" #include "extensions/common/switches.h"
namespace extensions { namespace extensions {
namespace { namespace {
// Writes |message| to the stack so that it shows up in the minidump, then
// crashes the current process.
//
// The prefix "e::" is used so that the crash can be quickly located.
//
// This is provided in feature_util because for some reason features are prone
// to mysterious crashes in named map lookups. For example see crbug.com/365192
// and crbug.com/461915.
#define CRASH_WITH_MINIDUMP(message) \
{ \
std::string message_copy(message); \
char minidump[BUFSIZ]; \
base::debug::Alias(&minidump); \
base::snprintf(minidump, base::size(minidump), "e::%s:%d:\"%s\"", \
__FILE__, __LINE__, message_copy.c_str()); \
LOG(FATAL) << message_copy; \
}
class FeatureProviderStatic { class FeatureProviderStatic {
public: public:
FeatureProviderStatic() { FeatureProviderStatic() {
......
// Copyright 2015 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 "extensions/common/features/feature_util.h"
namespace extensions {
namespace feature_util {
bool ExtensionServiceWorkersEnabled() {
return true;
}
} // namespace feature_util
} // namespace extensions
// Copyright 2013 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.
#ifndef EXTENSIONS_COMMON_FEATURES_FEATURE_UTIL_H_
#define EXTENSIONS_COMMON_FEATURES_FEATURE_UTIL_H_
#include "base/debug/alias.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
// Writes |message| to the stack so that it shows up in the minidump, then
// crashes the current process.
//
// The prefix "e::" is used so that the crash can be quickly located.
//
// This is provided in feature_util because for some reason features are prone
// to mysterious crashes in named map lookups. For example see crbug.com/365192
// and crbug.com/461915.
#define CRASH_WITH_MINIDUMP(message) \
{ \
std::string message_copy(message); \
char minidump[BUFSIZ]; \
base::debug::Alias(&minidump); \
base::snprintf(minidump, base::size(minidump), "e::%s:%d:\"%s\"", \
__FILE__, __LINE__, message_copy.c_str()); \
LOG(FATAL) << message_copy; \
}
namespace extensions {
namespace feature_util {
// Returns true if service workers are enabled for extension schemes.
// TODO(lazyboy): Remove this function once extension Service Workers
// are enabled by default for a while.
bool ExtensionServiceWorkersEnabled();
} // namespace feature_util
} // namespace extensions
#endif // EXTENSIONS_COMMON_FEATURES_FEATURE_UTIL_H_
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "extensions/common/extension_api.h" #include "extensions/common/extension_api.h"
#include "extensions/common/features/feature_channel.h" #include "extensions/common/features/feature_channel.h"
#include "extensions/common/features/feature_provider.h" #include "extensions/common/features/feature_provider.h"
#include "extensions/common/features/feature_util.h"
#include "extensions/common/switches.h" #include "extensions/common/switches.h"
using crx_file::id_util::HashedIdInHex; using crx_file::id_util::HashedIdInHex;
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include "extensions/common/features/feature.h" #include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_channel.h" #include "extensions/common/features/feature_channel.h"
#include "extensions/common/features/feature_provider.h" #include "extensions/common/features/feature_provider.h"
#include "extensions/common/features/feature_util.h"
#include "extensions/common/manifest.h" #include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/background_info.h" #include "extensions/common/manifest_handlers/background_info.h"
...@@ -1011,11 +1010,9 @@ void Dispatcher::OnSetSessionInfo(version_info::Channel channel, ...@@ -1011,11 +1010,9 @@ void Dispatcher::OnSetSessionInfo(version_info::Channel channel,
SetCurrentFeatureSessionType(session_type); SetCurrentFeatureSessionType(session_type);
script_context_set_->set_is_lock_screen_context(is_lock_screen_context); script_context_set_->set_is_lock_screen_context(is_lock_screen_context);
if (feature_util::ExtensionServiceWorkersEnabled()) { // chrome-extension: resources should be allowed to register ServiceWorkers.
// chrome-extension: resources should be allowed to register ServiceWorkers. blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers(
blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers( blink::WebString::FromUTF8(extensions::kExtensionScheme));
blink::WebString::FromUTF8(extensions::kExtensionScheme));
}
blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingWasmEvalCSP( blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingWasmEvalCSP(
blink::WebString::FromUTF8(extensions::kExtensionScheme)); blink::WebString::FromUTF8(extensions::kExtensionScheme));
......
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