Skip to content

Commit

Permalink
Reland "[Flash] Remove PPP_Flash_BrowserOperations API"
Browse files Browse the repository at this point in the history
This is a reland of acfed35

Original change's description:
> [Flash] Remove PPP_Flash_BrowserOperations API
>
> This also removes plugin data and settings persistence, which isn't
> needed if the Flash plugin doesn't exist (it used to persist its own
> data on command from the browser.)
>
> Adds a TODO to figure out how we will remove plugin data now that
> Flash is deprecated.
>
> Bug: chromium:1064652,chromium:1135773,chromium:1135779
> Change-Id: I2eb1e30856071190cba29cea98cdd86a37722f95
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2450057
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Anthony LaForge <laforge@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#816370}

TBR=sky@chromium.org,tsepez@chromium.org,laforge@chromium.org

Bug: chromium:1064652
Bug: chromium:1135773
Bug: chromium:1135779
Change-Id: I3e602eb6915d84becc9e104eb273c924f3cec87f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2468179
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816681}
  • Loading branch information
Bill Budge authored and Commit Bot committed Oct 13, 2020
1 parent df45189 commit 781e9e3
Show file tree
Hide file tree
Showing 53 changed files with 49 additions and 3,892 deletions.
8 changes: 0 additions & 8 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5753,14 +5753,10 @@ static_library("browser") {

if (enable_plugins) {
sources += [
"browsing_data/browsing_data_flash_lso_helper.cc",
"browsing_data/browsing_data_flash_lso_helper.h",
"metrics/plugin_metrics_provider.cc",
"metrics/plugin_metrics_provider.h",
"pepper_broker_infobar_delegate.cc",
"pepper_broker_infobar_delegate.h",
"pepper_flash_settings_manager.cc",
"pepper_flash_settings_manager.h",
"plugins/chrome_content_browser_client_plugins_part.cc",
"plugins/chrome_content_browser_client_plugins_part.h",
"plugins/chrome_plugin_service_filter.cc",
Expand All @@ -5775,8 +5771,6 @@ static_library("browser") {
"plugins/flash_temporary_permission_tracker_factory.h",
"plugins/hung_plugin_infobar_delegate.cc",
"plugins/hung_plugin_infobar_delegate.h",
"plugins/plugin_data_remover_helper.cc",
"plugins/plugin_data_remover_helper.h",
"plugins/plugin_finder.cc",
"plugins/plugin_finder.h",
"plugins/plugin_info_host_impl.cc",
Expand Down Expand Up @@ -6418,8 +6412,6 @@ static_library("test_support") {
"autofill/mock_autofill_popup_controller.h",
"autofill/mock_manual_filling_controller.cc",
"autofill/mock_manual_filling_controller.h",
"browsing_data/mock_browsing_data_flash_lso_helper.cc",
"browsing_data/mock_browsing_data_flash_lso_helper.h",
"browsing_data/mock_browsing_data_media_license_helper.cc",
"browsing_data/mock_browsing_data_media_license_helper.h",
"browsing_data/mock_browsing_data_quota_helper.cc",
Expand Down
116 changes: 0 additions & 116 deletions chrome/browser/browsing_data/browsing_data_flash_lso_helper.cc

This file was deleted.

38 changes: 0 additions & 38 deletions chrome/browser/browsing_data/browsing_data_flash_lso_helper.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/browsing_data_file_system_util.h"
#include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
#include "chrome/browser/browsing_data/cookies_tree_model.h"
#include "chrome/browser/browsing_data/counters/cache_counter.h"
Expand Down Expand Up @@ -560,7 +559,6 @@ class BrowsingDataRemoverBrowserTest : public InProcessBrowserTest {
new browsing_data::SharedWorkerHelper(storage_partition,
profile->GetResourceContext()),
new browsing_data::CacheStorageHelper(cache_storage_context),
BrowsingDataFlashLSOHelper::Create(profile),
BrowsingDataMediaLicenseHelper::Create(file_system_context));
base::RunLoop run_loop;
CookiesTreeObserver observer(run_loop.QuitClosure());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@
#include "device/fido/mac/credential_store.h"
#endif // defined(OS_MAC)

#if BUILDFLAG(ENABLE_PLUGINS)
#include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h"
#endif // BUILDFLAG(ENABLE_PLUGINS)

using base::UserMetricsAction;
using content::BrowserContext;
using content::BrowserThread;
Expand Down Expand Up @@ -268,10 +264,6 @@ bool DoesOriginMatchEmbedderMask(uint64_t origin_type_mask,
ChromeBrowsingDataRemoverDelegate::ChromeBrowsingDataRemoverDelegate(
BrowserContext* browser_context)
: profile_(Profile::FromBrowserContext(browser_context))
#if BUILDFLAG(ENABLE_PLUGINS)
,
flash_lso_helper_(BrowsingDataFlashLSOHelper::Create(browser_context))
#endif
#if defined(OS_ANDROID)
,
webapp_registry_(new WebappRegistry())
Expand Down Expand Up @@ -1038,16 +1030,6 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
}
}

//////////////////////////////////////////////////////////////////////////////
// DATA_TYPE_PLUGINS
// Plugins are known to //content and their bulk deletion is implemented in
// PluginDataRemover. However, the filtered deletion uses
// BrowsingDataFlashLSOHelper which (currently) has strong dependencies
// on //chrome.
// TODO(msramek): Investigate these dependencies and move the plugin deletion
// to BrowsingDataRemoverImpl in //content. Note that code in //content
// can simply take advantage of PluginDataRemover directly to delete plugin
// data in bulk.
#if BUILDFLAG(ENABLE_PLUGINS)
// Plugin is data not separated for protected and unprotected web origins. We
// check the origin_type_mask_ to prevent unintended deletion.
Expand All @@ -1057,25 +1039,8 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
base::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData"));

if (filter_builder->MatchesAllOriginsAndDomains()) {
DCHECK(!plugin_data_remover_);
plugin_data_remover_.reset(content::PluginDataRemover::Create(profile_));
base::WaitableEvent* event =
plugin_data_remover_->StartRemoving(delete_begin_);

base::WaitableEventWatcher::EventCallback watcher_callback =
base::BindOnce(
&ChromeBrowsingDataRemoverDelegate::OnWaitableEventSignaled,
weak_ptr_factory_.GetWeakPtr(),
CreateTaskCompletionClosure(TracingDataType::kPluginData));
watcher_.StartWatching(event, std::move(watcher_callback),
base::SequencedTaskRunnerHandle::Get());
} else {
// TODO(msramek): Store filters from the currently executed task on the
// object to avoid having to copy them to callback methods.
flash_lso_helper_->StartFetching(base::BindOnce(
&ChromeBrowsingDataRemoverDelegate::OnSitesWithFlashDataFetched,
weak_ptr_factory_.GetWeakPtr(), filter_builder->BuildPluginFilter(),
CreateTaskCompletionClosure(TracingDataType::kFlashLsoHelper)));
// TODO(bbudge) Figure out how to delete Flash plugin data without a
// Flash plugin.
}
}
#endif
Expand All @@ -1087,21 +1052,6 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
// Licenses.
base::RecordAction(UserMetricsAction("ClearBrowsingData_ContentLicenses"));

#if BUILDFLAG(ENABLE_PLUGINS)
// Flash does not support filtering by domain, so skip this if clearing only
// a specified set of sites.
if (filter_builder->GetMode() != BrowsingDataFilterBuilder::Mode::kDelete) {
// Will be completed in OnDeauthorizeFlashContentLicensesCompleted()
OnTaskStarted(TracingDataType::kFlashDeauthorization);
if (!pepper_flash_settings_manager_.get()) {
pepper_flash_settings_manager_.reset(
new PepperFlashSettingsManager(this, profile_));
}
deauthorize_flash_content_licenses_request_id_ =
pepper_flash_settings_manager_->DeauthorizeContentLicenses(prefs);
}
#endif // BUILDFLAG(ENABLE_PLUGINS)

#if defined(OS_CHROMEOS)
// On Chrome OS, delete any content protection platform keys.
// Platform keys do not support filtering by domain, so skip this if
Expand Down Expand Up @@ -1318,13 +1268,6 @@ void ChromeBrowsingDataRemoverDelegate::OverrideWebappRegistryForTesting(
}
#endif

#if BUILDFLAG(ENABLE_PLUGINS)
void ChromeBrowsingDataRemoverDelegate::OverrideFlashLSOHelperForTesting(
scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper) {
flash_lso_helper_ = flash_lso_helper;
}
#endif

void ChromeBrowsingDataRemoverDelegate::
OverrideDomainReliabilityClearerForTesting(
DomainReliabilityClearer clearer) {
Expand All @@ -1344,40 +1287,3 @@ void ChromeBrowsingDataRemoverDelegate::OnClearPlatformKeys(
std::move(done).Run();
}
#endif

#if BUILDFLAG(ENABLE_PLUGINS)
void ChromeBrowsingDataRemoverDelegate::OnWaitableEventSignaled(
base::OnceClosure done,
base::WaitableEvent* waitable_event) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
plugin_data_remover_.reset();
watcher_.StopWatching();
std::move(done).Run();
}

void ChromeBrowsingDataRemoverDelegate::OnSitesWithFlashDataFetched(
base::RepeatingCallback<bool(const std::string&)> plugin_filter,
base::OnceClosure done,
const std::vector<std::string>& sites) {
std::vector<std::string> sites_to_delete;
for (const std::string& site : sites) {
if (plugin_filter.Run(site))
sites_to_delete.push_back(site);
}

base::RepeatingClosure barrier =
base::BarrierClosure(sites_to_delete.size(), std::move(done));

for (const std::string& site : sites_to_delete) {
flash_lso_helper_->DeleteFlashLSOsForSite(site, barrier);
}
}

void ChromeBrowsingDataRemoverDelegate::
OnDeauthorizeFlashContentLicensesCompleted(uint32_t request_id,
bool /* success */) {
DCHECK_EQ(request_id, deauthorize_flash_content_licenses_request_id_);
OnTaskComplete(TracingDataType::kFlashDeauthorization,
/*data_type_mask=*/0, /*success=*/true);
}
#endif
Loading

0 comments on commit 781e9e3

Please sign in to comment.