diff --git a/chrome/browser/plugins/plugin_info_host_impl_unittest.cc b/chrome/browser/plugins/plugin_info_host_impl_unittest.cc index 22b45e23f7e4a..2197ac44cc991 100644 --- a/chrome/browser/plugins/plugin_info_host_impl_unittest.cc +++ b/chrome/browser/plugins/plugin_info_host_impl_unittest.cc @@ -79,7 +79,6 @@ class PluginInfoHostImplTest : public ::testing::Test { PluginInfoHostImplTest() : foo_plugin_path_(FILE_PATH_LITERAL("/path/to/foo")), bar_plugin_path_(FILE_PATH_LITERAL("/path/to/bar")), - fake_flash_path_(FILE_PATH_LITERAL("/path/to/fake/flash")), context_(0, &profile_), host_content_settings_map_( HostContentSettingsMapFactory::GetForProfile(&profile_)) {} @@ -102,14 +101,6 @@ class PluginInfoHostImplTest : public ::testing::Test { bar_plugin.type = content::WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS; PluginService::GetInstance()->RegisterInternalPlugin(bar_plugin, false); - content::WebPluginInfo fake_flash( - base::ASCIIToUTF16(content::kFlashPluginName), fake_flash_path_, - u"100.0", u"Fake Flash Description."); - mime_type.mime_type = "application/x-shockwave-flash"; - fake_flash.mime_types.push_back(mime_type); - fake_flash.type = content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS; - PluginService::GetInstance()->RegisterInternalPlugin(fake_flash, false); - PluginService::GetInstance()->SetFilter(&filter_); #if !defined(OS_WIN) @@ -136,7 +127,6 @@ class PluginInfoHostImplTest : public ::testing::Test { base::FilePath foo_plugin_path_; base::FilePath bar_plugin_path_; - base::FilePath fake_flash_path_; FakePluginServiceFilter filter_; private: diff --git a/chrome/browser/plugins/plugin_utils.cc b/chrome/browser/plugins/plugin_utils.cc index a0b3175223f3e..7999b960694ab 100644 --- a/chrome/browser/plugins/plugin_utils.cc +++ b/chrome/browser/plugins/plugin_utils.cc @@ -6,7 +6,6 @@ #include "base/values.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/plugin_utils.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings_types.h" #include "components/content_settings/core/common/content_settings_utils.h" @@ -35,13 +34,6 @@ void PluginUtils::GetPluginContentSetting( ContentSetting* setting, bool* is_default, bool* is_managed) { - // Not JS means Flash. Flash is deprecated. - if (!ShouldUseJavaScriptSettingForPlugin(plugin)) { - *is_default = true; - *setting = CONTENT_SETTING_BLOCK; - return; - } - GURL main_frame_url = main_frame_origin.GetURL(); std::unique_ptr<base::Value> value; content_settings::SettingInfo info; diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index 14cb7b790b7bb..8b3cfdd7a95cc 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn @@ -461,8 +461,6 @@ static_library("common") { if (enable_plugins) { sources += [ - "plugin_utils.cc", - "plugin_utils.h", "ppapi_utils.cc", "ppapi_utils.h", ] diff --git a/chrome/common/plugin_utils.cc b/chrome/common/plugin_utils.cc deleted file mode 100644 index 9c143751282da..0000000000000 --- a/chrome/common/plugin_utils.cc +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2016 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 "chrome/common/plugin_utils.h" - -#include "base/strings/utf_string_conversions.h" -#include "content/public/common/content_constants.h" -#include "content/public/common/webplugininfo.h" - -bool ShouldUseJavaScriptSettingForPlugin(const content::WebPluginInfo& plugin) { - if (plugin.name == base::ASCIIToUTF16(content::kFlashPluginName)) - return false; - - // Since all the UI surfaces for Plugin content settings display "Flash", - // treat all other plugins as JavaScript. These include all of: - // - Internally registered plugins such as: - // - NaCl - // - Widevine - // - PDF - // - Custom plugins loaded from the command line - return true; -} diff --git a/chrome/common/plugin_utils.h b/chrome/common/plugin_utils.h deleted file mode 100644 index 4cc9f7a3048cd..0000000000000 --- a/chrome/common/plugin_utils.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 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 CHROME_COMMON_PLUGIN_UTILS_H_ -#define CHROME_COMMON_PLUGIN_UTILS_H_ - -namespace content { -struct WebPluginInfo; -} - -// Returns true if |plugin| should use the JavaScript Content Settings. -bool ShouldUseJavaScriptSettingForPlugin(const content::WebPluginInfo& plugin); - -#endif // CHROME_COMMON_PLUGIN_UTILS_H_ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc index 97c20a21694a7..b5f844ccf5407 100644 --- a/chrome/common/webui_url_constants.cc +++ b/chrome/common/webui_url_constants.cc @@ -674,8 +674,6 @@ const char* const kChromeDebugURLs[] = { blink::kChromeUIMemoryExhaustURL, blink::kChromeUIMemoryPressureCriticalURL, blink::kChromeUIMemoryPressureModerateURL, - blink::kChromeUIPpapiFlashCrashURL, - blink::kChromeUIPpapiFlashHangURL, #if defined(OS_WIN) blink::kChromeUIBrowserHeapCorruptionURL, blink::kChromeUIHeapCorruptionCrashURL, diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index ed33e92701947..471d2c26190fe 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -218,7 +218,6 @@ #endif // BUILDFLAG(ENABLE_PDF) #if BUILDFLAG(ENABLE_PLUGINS) -#include "chrome/common/plugin_utils.h" #include "chrome/renderer/plugins/chrome_plugin_placeholder.h" #include "ppapi/shared_impl/ppapi_switches.h" // nogncheck crbug.com/1125897 #else @@ -915,16 +914,6 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame, original_params); } } else { - // Flash is deprecated in M87 and removed in M88+. If a plugin uses flash, - // its status will be |PluginStatus::kNotFound|. If for some reason the - // status is different, we should not treat it as JavaScript plugin but - // return a deprecated message. - if (!ShouldUseJavaScriptSettingForPlugin(info)) { - return NonLoadablePluginPlaceholder::CreateFlashDeprecatedPlaceholder( - render_frame, original_params) - ->plugin(); - } - // TODO(bauerb): This should be in content/. WebPluginParams params(original_params); for (const auto& mime_type : info.mime_types) { diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index 5e8479ee0be4d..76a9fd0561311 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -15,7 +15,6 @@ #include "base/files/file_path.h" #include "base/location.h" #include "base/logging.h" -#include "base/metrics/histogram_macros.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -50,16 +49,6 @@ namespace content { namespace { -// This enum is used to collect Flash usage data. -enum FlashUsage { - // Number of browser processes that have started at least one PPAPI Flash - // process during their lifetime. - START_PPAPI_FLASH_AT_LEAST_ONCE = 1, - // Total number of browser processes. - TOTAL_BROWSER_PROCESSES, - FLASH_USAGE_ENUM_COUNT -}; - // Callback set on the PluginList to assert that plugin loading happens on the // correct thread. void WillLoadPluginsCallback(base::SequenceChecker* sequence_checker) { @@ -88,20 +77,9 @@ PluginServiceImpl* PluginServiceImpl::GetInstance() { return base::Singleton<PluginServiceImpl>::get(); } -PluginServiceImpl::PluginServiceImpl() : filter_(nullptr) { - // Collect the total number of browser processes (which create - // PluginServiceImpl objects, to be precise). The number is used to normalize - // the number of processes which start at least one NPAPI/PPAPI Flash process. - static bool counted = false; - if (!counted) { - counted = true; - UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", TOTAL_BROWSER_PROCESSES, - FLASH_USAGE_ENUM_COUNT); - } -} +PluginServiceImpl::PluginServiceImpl() = default; -PluginServiceImpl::~PluginServiceImpl() { -} +PluginServiceImpl::~PluginServiceImpl() = default; void PluginServiceImpl::Init() { plugin_list_task_runner_ = base::ThreadPool::CreateSequencedTaskRunner( @@ -208,15 +186,6 @@ PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( if (plugin_host) return plugin_host; - // Record when PPAPI Flash process is started for the first time. - static bool counted = false; - if (!counted && info->name == kFlashPluginName) { - counted = true; - UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", - START_PPAPI_FLASH_AT_LEAST_ONCE, - FLASH_USAGE_ENUM_COUNT); - } - // Avoid fork bomb. if (origin_lock.has_value() && CountPpapiPluginProcessesForProfile( plugin_path, profile_data_directory) >= diff --git a/content/browser/plugin_service_impl.h b/content/browser/plugin_service_impl.h index a249259d38560..b2d2412a7ff1a 100644 --- a/content/browser/plugin_service_impl.h +++ b/content/browser/plugin_service_impl.h @@ -136,7 +136,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService { int max_ppapi_processes_per_profile_ = kDefaultMaxPpapiProcessesPerProfile; // Weak pointer; set during the startup on UI thread and must outlive us. - PluginServiceFilter* filter_; + PluginServiceFilter* filter_ = nullptr; // Used to load plugins from disk. scoped_refptr<base::SequencedTaskRunner> plugin_list_task_runner_; diff --git a/content/browser/renderer_host/debug_urls.cc b/content/browser/renderer_host/debug_urls.cc index 69209b3d165b9..4975287fc9218 100644 --- a/content/browser/renderer_host/debug_urls.cc +++ b/content/browser/renderer_host/debug_urls.cc @@ -55,22 +55,6 @@ const char kAsanCorruptHeapBlock[] = "/browser-corrupt-heap-block"; const char kAsanCorruptHeap[] = "/browser-corrupt-heap"; #endif -void HandlePpapiFlashDebugURL(const GURL& url) { -#if BUILDFLAG(ENABLE_PLUGINS) - bool crash = url == blink::kChromeUIPpapiFlashCrashURL; - - std::vector<PpapiPluginProcessHost*> hosts; - PpapiPluginProcessHost::FindByName(base::UTF8ToUTF16(kFlashPluginName), - &hosts); - for (auto iter = hosts.begin(); iter != hosts.end(); ++iter) { - if (crash) - (*iter)->Send(new PpapiMsg_Crash()); - else - (*iter)->Send(new PpapiMsg_Hang()); - } -#endif -} - bool IsAsanDebugURL(const GURL& url) { if (!(url.is_valid() && url.SchemeIs(kChromeUIScheme) && url.DomainIs(kAsanCrashDomain) && url.has_path())) { @@ -212,13 +196,6 @@ bool HandleDebugURL(const GURL& url, return true; } - if (url == blink::kChromeUIPpapiFlashCrashURL || - url == blink::kChromeUIPpapiFlashHangURL) { - GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&HandlePpapiFlashDebugURL, url)); - return true; - } - if (url == blink::kChromeUIMemoryPressureCriticalURL) { base::MemoryPressureListener::NotifyMemoryPressure( base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL); diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index ed722d14487cb..e874f0409d3ca 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -11,7 +11,6 @@ #include "base/command_line.h" #include "base/cpu.h" -#include "base/debug/alias.h" #include "base/debug/crash_logging.h" #include "base/files/file_util.h" #include "base/logging.h" @@ -19,7 +18,6 @@ #include "base/rand_util.h" #include "base/strings/utf_string_conversions.h" #include "base/task/single_thread_task_runner.h" -#include "base/threading/platform_thread.h" #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" @@ -136,8 +134,6 @@ bool PpapiThread::OnControlMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(PpapiMsg_LoadPlugin, OnLoadPlugin) IPC_MESSAGE_HANDLER(PpapiMsg_CreateChannel, OnCreateChannel) IPC_MESSAGE_HANDLER(PpapiMsg_SetNetworkState, OnSetNetworkState) - IPC_MESSAGE_HANDLER(PpapiMsg_Crash, OnCrash) - IPC_MESSAGE_HANDLER(PpapiMsg_Hang, OnHang) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -355,24 +351,6 @@ void PpapiThread::OnSetNetworkState(bool online) { ns->SetOnLine(PP_FromBool(online)); } -void PpapiThread::OnCrash() { - // Intentionally crash upon the request of the browser. - // - // Linker's ICF feature may merge this function with other functions with the - // same definition and it may confuse the crash report processing system. - static int static_variable_to_make_this_function_unique = 0; - base::debug::Alias(&static_variable_to_make_this_function_unique); - - volatile int* null_pointer = nullptr; - *null_pointer = 0; -} - -void PpapiThread::OnHang() { - // Intentionally hang upon the request of the browser. - for (;;) - base::PlatformThread::Sleep(base::Seconds(1)); -} - bool PpapiThread::SetupChannel(base::ProcessId renderer_pid, int renderer_child_id, bool incognito, diff --git a/content/ppapi_plugin/ppapi_thread.h b/content/ppapi_plugin/ppapi_thread.h index a631431a7246e..27c219dc2dad5 100644 --- a/content/ppapi_plugin/ppapi_thread.h +++ b/content/ppapi_plugin/ppapi_thread.h @@ -95,8 +95,6 @@ class PpapiThread : public ChildThreadImpl, int renderer_child_id, bool incognito); void OnSetNetworkState(bool online); - void OnCrash(); - void OnHang(); // Sets up the channel to the given renderer. If |renderer_pid| is // base::kNullProcessId, the channel is set up to the browser. On success, diff --git a/content/public/common/content_constants.cc b/content/public/common/content_constants.cc index 88f1e915a9738..234d24a5d25e5 100644 --- a/content/public/common/content_constants.cc +++ b/content/public/common/content_constants.cc @@ -18,8 +18,6 @@ const base::FilePath::CharType kPepperDataDirname[] = const char kBrowserPluginMimeType[] = "application/browser-plugin"; -const char kFlashPluginName[] = "Shockwave Flash"; - const size_t kMaxURLDisplayChars = 32 * 1024; #if BUILDFLAG(GOOGLE_CHROME_BRANDING) diff --git a/content/public/common/content_constants.h b/content/public/common/content_constants.h index 6b8e119a40b68..e0f987f9cd1ed 100644 --- a/content/public/common/content_constants.h +++ b/content/public/common/content_constants.h @@ -27,8 +27,6 @@ CONTENT_EXPORT extern const base::FilePath::CharType kPepperDataDirname[]; // The MIME type used for the browser plugin. CONTENT_EXPORT extern const char kBrowserPluginMimeType[]; -CONTENT_EXPORT extern const char kFlashPluginName[]; - // The maximum number of characters in the URL that we're willing to accept // in the browser process. It is set low enough to avoid damage to the browser // but high enough that a web site can abuse location.hash for a little storage. diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index b608ee662bda9..7a9c887d9270e 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -599,12 +599,6 @@ IPC_MESSAGE_CONTROL3(PpapiMsg_CreateChannel, IPC_MESSAGE_CONTROL1(PpapiMsg_InitializeNaClDispatcher, ppapi::PpapiNaClPluginArgs /* args */) -// Instructs the plugin process to crash. -IPC_MESSAGE_CONTROL0(PpapiMsg_Crash) - -// Instructs the plugin process to hang. -IPC_MESSAGE_CONTROL0(PpapiMsg_Hang) - // Each plugin may be referenced by multiple renderers. We need the instance // IDs to be unique within a plugin, despite coming from different renderers, // and unique within a renderer, despite going to different plugins. This means diff --git a/third_party/blink/common/chrome_debug_urls.cc b/third_party/blink/common/chrome_debug_urls.cc index 95a801066d920..f857e7d570f86 100644 --- a/third_party/blink/common/chrome_debug_urls.cc +++ b/third_party/blink/common/chrome_debug_urls.cc @@ -43,8 +43,6 @@ const char kChromeUIMemoryPressureModerateURL[] = "chrome://memory-pressure-moderate/"; const char kChromeUINetworkErrorURL[] = "chrome://network-error/"; const char kChromeUINetworkErrorsListingURL[] = "chrome://network-errors/"; -const char kChromeUIPpapiFlashCrashURL[] = "chrome://ppapiflashcrash/"; -const char kChromeUIPpapiFlashHangURL[] = "chrome://ppapiflashhang/"; const char kChromeUIProcessInternalsURL[] = "chrome://process-internals"; #if defined(OS_ANDROID) const char kChromeUIGpuJavaCrashURL[] = "chrome://gpu-java-crash/"; diff --git a/third_party/blink/public/common/chrome_debug_urls.h b/third_party/blink/public/common/chrome_debug_urls.h index 0a7ff1dd11fe3..4cd3e9a98ddac 100644 --- a/third_party/blink/public/common/chrome_debug_urls.h +++ b/third_party/blink/public/common/chrome_debug_urls.h @@ -38,8 +38,6 @@ BLINK_COMMON_EXPORT extern const char kChromeUIMemoryPressureCriticalURL[]; BLINK_COMMON_EXPORT extern const char kChromeUIMemoryPressureModerateURL[]; BLINK_COMMON_EXPORT extern const char kChromeUINetworkErrorsListingURL[]; BLINK_COMMON_EXPORT extern const char kChromeUINetworkErrorURL[]; -BLINK_COMMON_EXPORT extern const char kChromeUIPpapiFlashCrashURL[]; -BLINK_COMMON_EXPORT extern const char kChromeUIPpapiFlashHangURL[]; BLINK_COMMON_EXPORT extern const char kChromeUIProcessInternalsURL[]; #if defined(OS_ANDROID) BLINK_COMMON_EXPORT extern const char kChromeUIGpuJavaCrashURL[]; diff --git a/tools/metrics/histograms/metadata/plugin/histograms.xml b/tools/metrics/histograms/metadata/plugin/histograms.xml index 499bc459f9e9b..4da8b4b4c7b3a 100644 --- a/tools/metrics/histograms/metadata/plugin/histograms.xml +++ b/tools/metrics/histograms/metadata/plugin/histograms.xml @@ -29,6 +29,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. <histogram name="Plugin.FlashUsage" enum="FlashUsage" expires_after="2022-04-24"> + <obsolete> + Removed Oct 2021. + </obsolete> <owner>yzshen@chromium.org</owner> <owner>thestig@chromium.org</owner> <summary>Collects Flash usage data.</summary>