diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 89155308388c4e..28afbb5e499ca6 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -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", @@ -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", @@ -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", diff --git a/chrome/browser/browsing_data/browsing_data_flash_lso_helper.cc b/chrome/browser/browsing_data/browsing_data_flash_lso_helper.cc deleted file mode 100644 index 3be1f6bac28b0a..00000000000000 --- a/chrome/browser/browsing_data/browsing_data_flash_lso_helper.cc +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) 2012 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/browser/browsing_data/browsing_data_flash_lso_helper.h" - -#include - -#include -#include - -#include "base/callback.h" -#include "base/logging.h" -#include "base/macros.h" -#include "chrome/browser/pepper_flash_settings_manager.h" - -namespace { - -class BrowsingDataFlashLSOHelperImpl - : public BrowsingDataFlashLSOHelper, - public PepperFlashSettingsManager::Client { - public: - explicit BrowsingDataFlashLSOHelperImpl( - content::BrowserContext* browser_context); - - // BrowsingDataFlashLSOHelper implementation: - void StartFetching(GetSitesWithFlashDataCallback callback) override; - void DeleteFlashLSOsForSite(const std::string& site, - base::OnceClosure callback) override; - - // PepperFlashSettingsManager::Client overrides: - void OnGetSitesWithDataCompleted( - uint32_t request_id, - const std::vector& sites) override; - void OnClearSiteDataCompleted(uint32_t request_id, bool success) override; - - private: - struct DeleteFlashLSOTask { - DeleteFlashLSOTask() {} - DeleteFlashLSOTask(const std::string& site, base::OnceClosure callback) - : site(site), callback(std::move(callback)) {} - - std::string site; - base::OnceClosure callback; - }; - - ~BrowsingDataFlashLSOHelperImpl() override; - - // Asynchronously fetches and deletes data and calls us back. - PepperFlashSettingsManager settings_manager_; - - // Identifies the request to fetch site data. - uint32_t get_sites_with_data_request_id_; - - // Contains the pending requests to clear site data. The key is the request - // ID, the value is the site for which to clear data and the callback to be - // called upon completion. - std::map clear_site_data_ids_; - - // Called when we have fetched the list of sites. - GetSitesWithFlashDataCallback callback_; - - DISALLOW_COPY_AND_ASSIGN(BrowsingDataFlashLSOHelperImpl); -}; - -BrowsingDataFlashLSOHelperImpl::BrowsingDataFlashLSOHelperImpl( - content::BrowserContext* browser_context) - : settings_manager_(this, browser_context), - get_sites_with_data_request_id_(0u) { -} - -BrowsingDataFlashLSOHelperImpl::~BrowsingDataFlashLSOHelperImpl() { -} - -void BrowsingDataFlashLSOHelperImpl::StartFetching( - GetSitesWithFlashDataCallback callback) { - DCHECK(callback_.is_null()); - callback_ = std::move(callback); - get_sites_with_data_request_id_ = settings_manager_.GetSitesWithData(); -} - -void BrowsingDataFlashLSOHelperImpl::DeleteFlashLSOsForSite( - const std::string& site, - base::OnceClosure callback) { - const uint64_t kClearAllData = 0; - uint32_t id = settings_manager_.ClearSiteData( - site, kClearAllData, std::numeric_limits::max()); - clear_site_data_ids_[id] = DeleteFlashLSOTask(site, std::move(callback)); -} - -void BrowsingDataFlashLSOHelperImpl::OnGetSitesWithDataCompleted( - uint32_t request_id, - const std::vector& sites) { - DCHECK_EQ(get_sites_with_data_request_id_, request_id); - std::move(callback_).Run(sites); -} - -void BrowsingDataFlashLSOHelperImpl::OnClearSiteDataCompleted( - uint32_t request_id, - bool success) { - auto entry = clear_site_data_ids_.find(request_id); - DCHECK(entry != clear_site_data_ids_.end()); - LOG_IF(ERROR, !success) << "Couldn't clear Flash LSO data for " - << entry->second.site; - if (!entry->second.callback.is_null()) - std::move(entry->second.callback).Run(); - clear_site_data_ids_.erase(entry); -} - -} // namespace - -// static -BrowsingDataFlashLSOHelper* BrowsingDataFlashLSOHelper::Create( - content::BrowserContext* browser_context) { - return new BrowsingDataFlashLSOHelperImpl(browser_context); -} diff --git a/chrome/browser/browsing_data/browsing_data_flash_lso_helper.h b/chrome/browser/browsing_data/browsing_data_flash_lso_helper.h deleted file mode 100644 index 40ba100d63b25d..00000000000000 --- a/chrome/browser/browsing_data/browsing_data_flash_lso_helper.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2012 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_BROWSER_BROWSING_DATA_BROWSING_DATA_FLASH_LSO_HELPER_H_ -#define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FLASH_LSO_HELPER_H_ - -#include -#include - -#include "base/callback_forward.h" -#include "base/memory/ref_counted.h" - -namespace content { -class BrowserContext; -} - -// This class asynchronously fetches information about Flash LSOs and can delete -// them. -class BrowsingDataFlashLSOHelper - : public base::RefCounted { - public: - typedef base::OnceCallback&)> - GetSitesWithFlashDataCallback; - - static BrowsingDataFlashLSOHelper* Create( - content::BrowserContext* browser_context); - - virtual void StartFetching(GetSitesWithFlashDataCallback callback) = 0; - virtual void DeleteFlashLSOsForSite(const std::string& site, - base::OnceClosure callback) = 0; - - protected: - friend class base::RefCounted; - virtual ~BrowsingDataFlashLSOHelper() {} -}; - -#endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FLASH_LSO_HELPER_H_ diff --git a/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc b/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc index 39c5cd916bf899..91f3069234d61e 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc @@ -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" @@ -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()); diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc index aa62d15bf1a645..305b4452242cf1 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc @@ -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; @@ -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()) @@ -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. @@ -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 @@ -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 @@ -1318,13 +1268,6 @@ void ChromeBrowsingDataRemoverDelegate::OverrideWebappRegistryForTesting( } #endif -#if BUILDFLAG(ENABLE_PLUGINS) -void ChromeBrowsingDataRemoverDelegate::OverrideFlashLSOHelperForTesting( - scoped_refptr flash_lso_helper) { - flash_lso_helper_ = flash_lso_helper; -} -#endif - void ChromeBrowsingDataRemoverDelegate:: OverrideDomainReliabilityClearerForTesting( DomainReliabilityClearer clearer) { @@ -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 plugin_filter, - base::OnceClosure done, - const std::vector& sites) { - std::vector 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 diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h index 711cfda5b9b5f5..921a08cf4e0064 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h @@ -26,17 +26,11 @@ #include "ppapi/buildflags/buildflags.h" #include "services/network/public/mojom/network_context.mojom.h" -#if BUILDFLAG(ENABLE_PLUGINS) -#include "chrome/browser/pepper_flash_settings_manager.h" -#endif - -class BrowsingDataFlashLSOHelper; class Profile; class WebappRegistry; namespace content { class BrowserContext; -class PluginDataRemover; } namespace webrtc_event_logging { @@ -48,10 +42,6 @@ class WebRtcEventLogManager; class ChromeBrowsingDataRemoverDelegate : public content::BrowsingDataRemoverDelegate, public KeyedService -#if BUILDFLAG(ENABLE_PLUGINS) - , - public PepperFlashSettingsManager::Client -#endif { public: // This is an extension of content::BrowsingDataRemover::RemoveDataMask which @@ -198,12 +188,6 @@ class ChromeBrowsingDataRemoverDelegate std::unique_ptr webapp_registry); #endif -#if BUILDFLAG(ENABLE_PLUGINS) - // Used for testing. - void OverrideFlashLSOHelperForTesting( - scoped_refptr flash_lso_helper); -#endif - using DomainReliabilityClearer = base::RepeatingCallback plugin_filter, - base::OnceClosure done, - const std::vector& sites); - - // PepperFlashSettingsManager::Client implementation. - void OnDeauthorizeFlashContentLicensesCompleted(uint32_t request_id, - bool success) override; #endif // The profile for which the data will be deleted. @@ -333,20 +307,6 @@ class ChromeBrowsingDataRemoverDelegate // are finished. base::CancelableClosure slow_pending_tasks_closure_; -#if BUILDFLAG(ENABLE_PLUGINS) - // Used to delete plugin data. - std::unique_ptr plugin_data_remover_; - base::WaitableEventWatcher watcher_; - - // Used for per-site plugin data deletion. - scoped_refptr flash_lso_helper_; - - uint32_t deauthorize_flash_content_licenses_request_id_ = 0; - - // Used to deauthorize content licenses for Pepper Flash. - std::unique_ptr pepper_flash_settings_manager_; -#endif - DomainReliabilityClearer domain_reliability_clearer_; // Used if we need to clear history. diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc index 69098aba50a0ab..d081fd4cdb6a58 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc @@ -159,7 +159,6 @@ #endif // BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_PLUGINS) -#include "chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h" #include "chrome/browser/plugins/chrome_plugin_service_filter.h" #include "chrome/browser/plugins/plugin_utils.h" #endif // BUILDFLAG(ENABLE_PLUGINS) @@ -653,91 +652,6 @@ class RemovePermissionPromptCountsTest { DISALLOW_COPY_AND_ASSIGN(RemovePermissionPromptCountsTest); }; -#if BUILDFLAG(ENABLE_PLUGINS) -// A small modification to MockBrowsingDataFlashLSOHelper so that it responds -// immediately and does not wait for the Notify() call. Otherwise it would -// deadlock BrowsingDataRemoverImpl::RemoveImpl. -class TestBrowsingDataFlashLSOHelper : public MockBrowsingDataFlashLSOHelper { - public: - explicit TestBrowsingDataFlashLSOHelper(TestingProfile* profile) - : MockBrowsingDataFlashLSOHelper(profile) {} - - void StartFetching(GetSitesWithFlashDataCallback callback) override { - MockBrowsingDataFlashLSOHelper::StartFetching(std::move(callback)); - Notify(); - } - - private: - ~TestBrowsingDataFlashLSOHelper() override {} - - DISALLOW_COPY_AND_ASSIGN(TestBrowsingDataFlashLSOHelper); -}; - -class RemovePluginDataTester { - public: - explicit RemovePluginDataTester(TestingProfile* profile) - : helper_(new TestBrowsingDataFlashLSOHelper(profile)) { - static_cast( - profile->GetBrowsingDataRemoverDelegate()) - ->OverrideFlashLSOHelperForTesting(helper_); - } - - void AddDomain(const std::string& domain) { - helper_->AddFlashLSODomain(domain); - } - - const std::vector& GetDomains() { - // TestBrowsingDataFlashLSOHelper is synchronous, so we can immediately - // return the fetched domains. - helper_->StartFetching( - base::BindOnce(&RemovePluginDataTester::OnSitesWithFlashDataFetched, - base::Unretained(this))); - return domains_; - } - - private: - void OnSitesWithFlashDataFetched(const std::vector& sites) { - domains_ = sites; - } - - std::vector domains_; - scoped_refptr helper_; - - DISALLOW_COPY_AND_ASSIGN(RemovePluginDataTester); -}; - -// Waits until a change is observed in content settings. -class FlashContentSettingsChangeWaiter : public content_settings::Observer { - public: - explicit FlashContentSettingsChangeWaiter(Profile* profile) - : profile_(profile) { - HostContentSettingsMapFactory::GetForProfile(profile)->AddObserver(this); - } - ~FlashContentSettingsChangeWaiter() override { - HostContentSettingsMapFactory::GetForProfile(profile_)->RemoveObserver( - this); - } - - // content_settings::Observer: - void OnContentSettingChanged( - const ContentSettingsPattern& primary_pattern, - const ContentSettingsPattern& secondary_pattern, - ContentSettingsType content_type, - const std::string& resource_identifier) override { - if (content_type == ContentSettingsType::PLUGINS) - run_loop_.Quit(); - } - - void Wait() { run_loop_.Run(); } - - private: - Profile* profile_; - base::RunLoop run_loop_; - - DISALLOW_COPY_AND_ASSIGN(FlashContentSettingsChangeWaiter); -}; -#endif - // Custom matcher to test the equivalence of two URL filters. Since those are // blackbox predicates, we can only approximate the equivalence by testing // whether the filter give the same answer for several URLs. This is currently @@ -2806,84 +2720,6 @@ TEST_F(ChromeBrowsingDataRemoverDelegateTest, ClearPermissionPromptCounts) { } } -#if BUILDFLAG(ENABLE_PLUGINS) -// Check the |ContentSettingsType::PLUGINS_DATA| content setting is cleared -// with browsing data. -TEST_F(ChromeBrowsingDataRemoverDelegateTest, ClearFlashPreviouslyChanged) { - ChromePluginServiceFilter::GetInstance()->RegisterProfile(GetProfile()); - - HostContentSettingsMap* host_content_settings_map = - HostContentSettingsMapFactory::GetForProfile(GetProfile()); - - // PLUGINS_DATA gets cleared with history OR site usage data. - for (ChromeBrowsingDataRemoverDelegate::DataType data_type : - {ChromeBrowsingDataRemoverDelegate::DATA_TYPE_SITE_USAGE_DATA, - ChromeBrowsingDataRemoverDelegate::DATA_TYPE_HISTORY}) { - FlashContentSettingsChangeWaiter waiter(GetProfile()); - host_content_settings_map->SetContentSettingDefaultScope( - Origin1(), Origin1(), ContentSettingsType::PLUGINS, std::string(), - CONTENT_SETTING_ALLOW); - host_content_settings_map->SetContentSettingDefaultScope( - Origin2(), Origin2(), ContentSettingsType::PLUGINS, std::string(), - CONTENT_SETTING_BLOCK); - waiter.Wait(); - - // Check that as a result, the PLUGINS_DATA prefs were populated. - EXPECT_NE(nullptr, - host_content_settings_map->GetWebsiteSetting( - Origin1(), Origin1(), ContentSettingsType::PLUGINS_DATA, - std::string(), nullptr)); - EXPECT_NE(nullptr, - host_content_settings_map->GetWebsiteSetting( - Origin2(), Origin2(), ContentSettingsType::PLUGINS_DATA, - std::string(), nullptr)); - - std::unique_ptr filter( - BrowsingDataFilterBuilder::Create( - BrowsingDataFilterBuilder::Mode::kPreserve)); - BlockUntilOriginDataRemoved(AnHourAgo(), base::Time::Max(), data_type, - std::move(filter)); - EXPECT_EQ(nullptr, - host_content_settings_map->GetWebsiteSetting( - Origin1(), Origin1(), ContentSettingsType::PLUGINS_DATA, - std::string(), nullptr)); - EXPECT_EQ(nullptr, - host_content_settings_map->GetWebsiteSetting( - Origin2(), Origin2(), ContentSettingsType::PLUGINS_DATA, - std::string(), nullptr)); - } -} - -TEST_F(ChromeBrowsingDataRemoverDelegateTest, RemovePluginData) { - RemovePluginDataTester tester(GetProfile()); - - tester.AddDomain(Origin1().host()); - tester.AddDomain(Origin2().host()); - tester.AddDomain(Origin3().host()); - - std::vector expected = {Origin1().host(), Origin2().host(), - Origin3().host()}; - EXPECT_EQ(expected, tester.GetDomains()); - - // Delete data with a filter for the registrable domain of |Origin3()|. - std::unique_ptr filter_builder( - BrowsingDataFilterBuilder::Create( - BrowsingDataFilterBuilder::Mode::kDelete)); - filter_builder->AddRegisterableDomain(kTestRegisterableDomain3); - BlockUntilOriginDataRemoved( - base::Time(), base::Time::Max(), - ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA, - std::move(filter_builder)); - - // Plugin data for |Origin3().host()| should have been removed. - expected.pop_back(); - EXPECT_EQ(expected, tester.GetDomains()); - - // TODO(msramek): Mock PluginDataRemover and test the complete deletion - // of plugin data as well. -} -#endif - // Test that the remover clears language model data (normally added by the // LanguageDetectionDriver). TEST_F(ChromeBrowsingDataRemoverDelegateTest, diff --git a/chrome/browser/browsing_data/cookies_tree_model.cc b/chrome/browser/browsing_data/cookies_tree_model.cc index 6e9569b808ef38..34b1a171c001da 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.cc +++ b/chrome/browser/browsing_data/cookies_tree_model.cc @@ -21,7 +21,6 @@ #include "base/strings/utf_string_conversions.h" #include "build/build_config.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/browsing_data_quota_helper.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/profiles/profile.h" @@ -159,7 +158,6 @@ bool TypeIsProtected(CookieTreeNode::DetailedInfo::NodeType type) { // Fall through each below cases to return false. case CookieTreeNode::DetailedInfo::TYPE_COOKIE: case CookieTreeNode::DetailedInfo::TYPE_QUOTA: - case CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO: case CookieTreeNode::DetailedInfo::TYPE_MEDIA_LICENSE: return false; default: @@ -290,13 +288,6 @@ CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitCacheStorage( return *this; } -CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitFlashLSO( - const std::string& flash_lso_domain) { - Init(TYPE_FLASH_LSO); - this->flash_lso_domain = flash_lso_domain; - return *this; -} - CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitMediaLicense( const BrowsingDataMediaLicenseHelper::MediaLicenseInfo* media_license_info) { @@ -1163,38 +1154,6 @@ class CookieTreeCacheStoragesNode : public CookieTreeCollectionNode { DISALLOW_COPY_AND_ASSIGN(CookieTreeCacheStoragesNode); }; -/////////////////////////////////////////////////////////////////////////////// -// CookieTreeFlashLSONode - -class CookieTreeFlashLSONode : public CookieTreeNode { - public: - explicit CookieTreeFlashLSONode(const std::string& domain) - : domain_(domain) {} - ~CookieTreeFlashLSONode() override = default; - - // CookieTreeNode methods: - void DeleteStoredObjects() override { - // We are one level below the host node. - CookieTreeHostNode* host = static_cast(parent()); - CHECK_EQ(host->GetDetailedInfo().node_type, - CookieTreeNode::DetailedInfo::TYPE_HOST); - LocalDataContainer* container = GetModel()->data_container(); - container->flash_lso_helper_->DeleteFlashLSOsForSite(domain_, - base::OnceClosure()); - auto entry = std::find(container->flash_lso_domain_list_.begin(), - container->flash_lso_domain_list_.end(), domain_); - container->flash_lso_domain_list_.erase(entry); - } - DetailedInfo GetDetailedInfo() const override { - return DetailedInfo().InitFlashLSO(domain_); - } - - private: - std::string domain_; - - DISALLOW_COPY_AND_ASSIGN(CookieTreeFlashLSONode); -}; - /////////////////////////////////////////////////////////////////////////////// // CookieTreeMediaLicensesNode @@ -1345,16 +1304,6 @@ CookieTreeHostNode::GetOrCreateCacheStoragesNode() { return cache_storages_child_; } -CookieTreeFlashLSONode* CookieTreeHostNode::GetOrCreateFlashLSONode( - const std::string& domain) { - DCHECK_EQ(GetHost(), domain); - if (flash_lso_child_) - return flash_lso_child_; - flash_lso_child_ = new CookieTreeFlashLSONode(domain); - AddChildSortedByTitle(base::WrapUnique(flash_lso_child_)); - return flash_lso_child_; -} - CookieTreeMediaLicensesNode* CookieTreeHostNode::GetOrCreateMediaLicensesNode() { if (media_licenses_child_) @@ -1532,7 +1481,6 @@ void CookiesTreeModel::UpdateSearchResults(const base::string16& filter) { PopulateServiceWorkerUsageInfoWithFilter(data_container(), ¬ifier, filter); PopulateSharedWorkerInfoWithFilter(data_container(), ¬ifier, filter); PopulateCacheStorageUsageInfoWithFilter(data_container(), ¬ifier, filter); - PopulateFlashLSOInfoWithFilter(data_container(), ¬ifier, filter); PopulateMediaLicenseInfoWithFilter(data_container(), ¬ifier, filter); } @@ -1625,12 +1573,6 @@ void CookiesTreeModel::PopulateCacheStorageUsageInfo( base::string16()); } -void CookiesTreeModel::PopulateFlashLSOInfo( - LocalDataContainer* container) { - ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateFlashLSOInfoWithFilter(container, ¬ifier, base::string16()); -} - void CookiesTreeModel::PopulateMediaLicenseInfo(LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); PopulateMediaLicenseInfoWithFilter(container, ¬ifier, base::string16()); @@ -1923,27 +1865,6 @@ void CookiesTreeModel::PopulateQuotaInfoWithFilter( } } -void CookiesTreeModel::PopulateFlashLSOInfoWithFilter( - LocalDataContainer* container, - ScopedBatchUpdateNotifier* notifier, - const base::string16& filter) { - CookieTreeRootNode* root = static_cast(GetRoot()); - - if (container->flash_lso_domain_list_.empty()) - return; - - std::string filter_utf8 = base::UTF16ToUTF8(filter); - notifier->StartBatchUpdate(); - for (const std::string& domain : container->flash_lso_domain_list_) { - if (filter_utf8.empty() || domain.find(filter_utf8) != std::string::npos) { - // Create a fake origin for GetOrCreateHostNode(). - GURL origin("http://" + domain); - CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin); - host_node->GetOrCreateFlashLSONode(domain); - } - } -} - void CookiesTreeModel::PopulateMediaLicenseInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, @@ -2051,13 +1972,6 @@ std::unique_ptr CookiesTreeModel::CreateForProfile( profile->GetResourceContext()), new browsing_data::CacheStorageHelper( storage_partition->GetCacheStorageContext()), -#if defined(OS_ANDROID) - // Android doesn't have flash LSO hence it cannot be created for - // android build. - nullptr, -#else - BrowsingDataFlashLSOHelper::Create(profile), -#endif BrowsingDataMediaLicenseHelper::Create(file_system_context)); #if !defined(OS_ANDROID) diff --git a/chrome/browser/browsing_data/cookies_tree_model.h b/chrome/browser/browsing_data/cookies_tree_model.h index be7ea213e0ef99..ac0daf8dfe6c68 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.h +++ b/chrome/browser/browsing_data/cookies_tree_model.h @@ -35,7 +35,6 @@ class CookieTreeDatabaseNode; class CookieTreeDatabasesNode; class CookieTreeFileSystemNode; class CookieTreeFileSystemsNode; -class CookieTreeFlashLSONode; class CookieTreeHostNode; class CookieTreeIndexedDBNode; class CookieTreeIndexedDBsNode; @@ -100,7 +99,6 @@ class CookieTreeNode : public ui::TreeNode { TYPE_SHARED_WORKER, // This is used for CookieTreeSharedWorkerNode. TYPE_CACHE_STORAGES, // This is used for CookieTreeCacheStoragesNode. TYPE_CACHE_STORAGE, // This is used for CookieTreeCacheStorageNode. - TYPE_FLASH_LSO, // This is used for CookieTreeFlashLSONode. TYPE_MEDIA_LICENSES, // This is used for CookieTreeMediaLicensesNode. TYPE_MEDIA_LICENSE, // This is used for CookieTreeMediaLicenseNode. }; @@ -130,7 +128,6 @@ class CookieTreeNode : public ui::TreeNode { const browsing_data::SharedWorkerHelper::SharedWorkerInfo* shared_worker_info); DetailedInfo& InitCacheStorage(const content::StorageUsageInfo* usage_info); - DetailedInfo& InitFlashLSO(const std::string& flash_lso_domain); DetailedInfo& InitMediaLicense( const BrowsingDataMediaLicenseHelper::MediaLicenseInfo* media_license_info); @@ -146,7 +143,6 @@ class CookieTreeNode : public ui::TreeNode { const BrowsingDataQuotaHelper::QuotaInfo* quota_info = nullptr; const browsing_data::SharedWorkerHelper::SharedWorkerInfo* shared_worker_info = nullptr; - std::string flash_lso_domain; const BrowsingDataMediaLicenseHelper::MediaLicenseInfo* media_license_info = nullptr; }; @@ -235,7 +231,6 @@ class CookieTreeHostNode : public CookieTreeNode { CookieTreeCacheStoragesNode* GetOrCreateCacheStoragesNode(); CookieTreeQuotaNode* UpdateOrCreateQuotaNode( std::list::iterator quota_info); - CookieTreeFlashLSONode* GetOrCreateFlashLSONode(const std::string& domain); CookieTreeMediaLicensesNode* GetOrCreateMediaLicensesNode(); std::string canonicalized_host() const { return canonicalized_host_; } @@ -269,7 +264,6 @@ class CookieTreeHostNode : public CookieTreeNode { CookieTreeServiceWorkersNode* service_workers_child_ = nullptr; CookieTreeSharedWorkersNode* shared_workers_child_ = nullptr; CookieTreeCacheStoragesNode* cache_storages_child_ = nullptr; - CookieTreeFlashLSONode* flash_lso_child_ = nullptr; CookieTreeMediaLicensesNode* media_licenses_child_ = nullptr; // The URL for which this node was initially created. @@ -378,7 +372,6 @@ class CookiesTreeModel : public ui::TreeNodeModel { void PopulateServiceWorkerUsageInfo(LocalDataContainer* container); void PopulateSharedWorkerInfo(LocalDataContainer* container); void PopulateCacheStorageUsageInfo(LocalDataContainer* container); - void PopulateFlashLSOInfo(LocalDataContainer* container); void PopulateMediaLicenseInfo(LocalDataContainer* container); // Returns the Access Context Audit service provided to the cookies tree model @@ -456,9 +449,6 @@ class CookiesTreeModel : public ui::TreeNodeModel { LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, const base::string16& filter); - void PopulateFlashLSOInfoWithFilter(LocalDataContainer* container, - ScopedBatchUpdateNotifier* notifier, - const base::string16& filter); void PopulateMediaLicenseInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, const base::string16& filter); diff --git a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc index e4aea6557a861b..83a1755edf11bb 100644 --- a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc +++ b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc @@ -11,7 +11,6 @@ #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" -#include "chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h" #include "chrome/browser/browsing_data/mock_browsing_data_media_license_helper.h" #include "chrome/browser/browsing_data/mock_browsing_data_quota_helper.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" @@ -84,8 +83,6 @@ class CookiesTreeModelTest : public testing::Test { new browsing_data::MockSharedWorkerHelper(profile_.get()); mock_browsing_data_cache_storage_helper_ = new browsing_data::MockCacheStorageHelper(profile_.get()); - mock_browsing_data_flash_lso_helper_ = - new MockBrowsingDataFlashLSOHelper(profile_.get()); mock_browsing_data_media_license_helper_ = new MockBrowsingDataMediaLicenseHelper(profile_.get()); @@ -112,7 +109,6 @@ class CookiesTreeModelTest : public testing::Test { mock_browsing_data_session_storage_helper_ = nullptr; mock_browsing_data_local_storage_helper_ = nullptr; mock_browsing_data_database_helper_ = nullptr; - mock_browsing_data_flash_lso_helper_ = nullptr; mock_browsing_data_media_license_helper_ = nullptr; base::RunLoop().RunUntilIdle(); } @@ -128,7 +124,6 @@ class CookiesTreeModelTest : public testing::Test { mock_browsing_data_service_worker_helper_, mock_browsing_data_shared_worker_helper_, mock_browsing_data_cache_storage_helper_, - mock_browsing_data_flash_lso_helper_, mock_browsing_data_media_license_helper_); auto cookies_model = std::make_unique( @@ -158,8 +153,6 @@ class CookiesTreeModelTest : public testing::Test { mock_browsing_data_shared_worker_helper_->Notify(); mock_browsing_data_cache_storage_helper_->AddCacheStorageSamples(); mock_browsing_data_cache_storage_helper_->Notify(); - mock_browsing_data_flash_lso_helper_->AddFlashLSODomain("xyz.com"); - mock_browsing_data_flash_lso_helper_->Notify(); mock_browsing_data_media_license_helper_->AddMediaLicenseSamples(); mock_browsing_data_media_license_helper_->Notify(); @@ -168,7 +161,7 @@ class CookiesTreeModelTest : public testing::Test { "Initial State 3 cookies, 2 databases, 2 local storages, " "2 session storages, 2 indexed DBs, 3 filesystems, " "2 quotas, 2 service workers, 2 shared workers," - "2 cache storages, 1 Flash LSO, 2 media licenses"); + "2 cache storages, 2 media licenses"); // 71 because there's the root, then // cshost1 -> cache storage -> https://cshost1:1/ // cshost2 -> cache storage -> https://cshost2:2/ @@ -193,9 +186,8 @@ class CookiesTreeModelTest : public testing::Test { // swhost1 -> service worker -> https://swhost1:1 // swhost2 -> service worker -> https://swhost1:2 // sharedworkerhost1 -> shared worker -> https://sharedworkerhost1:1, - // sharedworkerhost2 -> shared worker -> https://sharedworkerhost2:2, - // xyz.com -> flash_lsos - EXPECT_EQ(71, cookies_model->GetRoot()->GetTotalNodeCount()); + // sharedworkerhost2 -> shared worker -> https://sharedworkerhost2:2 + EXPECT_EQ(69, cookies_model->GetRoot()->GetTotalNodeCount()); EXPECT_EQ("A,B,C", GetDisplayedCookies(cookies_model.get())); EXPECT_EQ("http://gdbhost1:1/,http://gdbhost2:2/", GetDisplayedDatabases(cookies_model.get())); @@ -217,7 +209,6 @@ class CookiesTreeModelTest : public testing::Test { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); } @@ -292,8 +283,6 @@ class CookiesTreeModelTest : public testing::Test { return node->GetDetailedInfo().quota_info->host + ","; case CookieTreeNode::DetailedInfo::TYPE_SHARED_WORKER: return node->GetDetailedInfo().shared_worker_info->worker.spec() + ","; - case CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO: - return node->GetDetailedInfo().flash_lso_domain + ","; case CookieTreeNode::DetailedInfo::TYPE_MEDIA_LICENSE: return node->GetDetailedInfo().media_license_info->origin.spec() + ","; default: @@ -369,11 +358,6 @@ class CookiesTreeModelTest : public testing::Test { CookieTreeNode::DetailedInfo::TYPE_CACHE_STORAGE); } - std::string GetDisplayedFlashLSOs(CookiesTreeModel* cookies_model) { - return GetDisplayedNodes( - cookies_model, CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO); - } - std::string GetDisplayedMediaLicenses(CookiesTreeModel* cookies_model) { return GetDisplayedNodes(cookies_model, CookieTreeNode::DetailedInfo::TYPE_MEDIA_LICENSE); @@ -420,8 +404,6 @@ class CookiesTreeModelTest : public testing::Test { mock_browsing_data_shared_worker_helper_; scoped_refptr mock_browsing_data_cache_storage_helper_; - scoped_refptr - mock_browsing_data_flash_lso_helper_; scoped_refptr mock_browsing_data_media_license_helper_; @@ -459,8 +441,6 @@ TEST_F(CookiesTreeModelTest, RemoveAll) { "https://sharedworkerhost1:1/app/worker.js," "https://sharedworkerhost2:2/worker.js", GetDisplayedSharedWorkers(cookies_model.get())); - EXPECT_EQ("xyz.com", - GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); } @@ -496,7 +476,6 @@ TEST_F(CookiesTreeModelTest, RemoveAll) { EXPECT_TRUE(mock_browsing_data_service_worker_helper_->AllDeleted()); EXPECT_TRUE(mock_browsing_data_shared_worker_helper_->AllDeleted()); EXPECT_TRUE(mock_browsing_data_cache_storage_helper_->AllDeleted()); - EXPECT_TRUE(mock_browsing_data_flash_lso_helper_->AllDeleted()); EXPECT_TRUE(mock_browsing_data_media_license_helper_->AllDeleted()); } } @@ -529,42 +508,10 @@ TEST_F(CookiesTreeModelTest, Remove) { // 19. `sharedworkerhost2` // 20. `swhost1` // 21. `swhost2` - // 22. `xyz.com` // // Here, we'll remove them one by one, starting from the end, and // check that the state makes sense. Initially there are 71 total nodes. - // xyz.com -> flash_lsos (2 nodes) - DeleteStoredObjects(cookies_model->GetRoot()->children()[22].get()); - { - SCOPED_TRACE("`xyz.com` removed."); - EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); - EXPECT_EQ("http://gdbhost1:1/,http://gdbhost2:2/", - GetDisplayedDatabases(cookies_model.get())); - EXPECT_EQ("http://host1:1/,http://host2:2/", - GetDisplayedLocalStorages(cookies_model.get())); - EXPECT_EQ("http://host1:1/,http://host2:2/", - GetDisplayedSessionStorages(cookies_model.get())); - EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", - GetDisplayedFileSystems(cookies_model.get())); - EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", - GetDisplayedIndexedDBs(cookies_model.get())); - EXPECT_EQ("quotahost1,quotahost2", - GetDisplayedQuotas(cookies_model.get())); - EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", - GetDisplayedServiceWorkers(cookies_model.get())); - EXPECT_EQ( - "https://sharedworkerhost1:1/app/worker.js," - "https://sharedworkerhost2:2/worker.js", - GetDisplayedSharedWorkers(cookies_model.get())); - EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", - GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); - EXPECT_EQ("https://media1/,https://media2/", - GetDisplayedMediaLicenses(cookies_model.get())); - EXPECT_EQ(69, cookies_model->GetRoot()->GetTotalNodeCount()); - } - // swhost2 -> service worker -> https://swhost1:2 (3 objects) DeleteStoredObjects(cookies_model->GetRoot()->children()[21].get()); { @@ -589,7 +536,6 @@ TEST_F(CookiesTreeModelTest, Remove) { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(66, cookies_model->GetRoot()->GetTotalNodeCount()); @@ -618,7 +564,6 @@ TEST_F(CookiesTreeModelTest, Remove) { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(63, cookies_model->GetRoot()->GetTotalNodeCount()); @@ -646,7 +591,6 @@ TEST_F(CookiesTreeModelTest, Remove) { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(60, cookies_model->GetRoot()->GetTotalNodeCount()); @@ -672,7 +616,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(57, cookies_model->GetRoot()->GetTotalNodeCount()); @@ -699,7 +642,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(55, cookies_model->GetRoot()->GetTotalNodeCount()); @@ -724,7 +666,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(53, cookies_model->GetRoot()->GetTotalNodeCount()); @@ -749,7 +690,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(50, cookies_model->GetRoot()->GetTotalNodeCount()); @@ -774,7 +714,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(47, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -798,7 +737,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(44, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -821,7 +759,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(41, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -845,7 +782,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(36, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -867,7 +803,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(31, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -887,7 +822,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(28, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -906,7 +840,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(25, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -926,7 +859,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(22, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -946,7 +878,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(19, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -965,7 +896,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(16, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -984,7 +914,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(13, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -1003,7 +932,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(10, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -1022,7 +950,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(7, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -1041,7 +968,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(4, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -1059,7 +985,6 @@ TEST_F(CookiesTreeModelTest, Remove) { EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); EXPECT_EQ(1, cookies_model->GetRoot()->GetTotalNodeCount()); } @@ -1076,7 +1001,7 @@ TEST_F(CookiesTreeModelTest, RemoveCookiesNode) { EXPECT_STREQ("B,C", GetDisplayedCookies(cookies_model.get()).c_str()); // 69 because in this case, the origin remains, although the COOKIES // node beneath it has been deleted. - EXPECT_EQ(69, cookies_model->GetRoot()->GetTotalNodeCount()); + EXPECT_EQ(67, cookies_model->GetRoot()->GetTotalNodeCount()); EXPECT_EQ("http://gdbhost1:1/,http://gdbhost2:2/", GetDisplayedDatabases(cookies_model.get())); EXPECT_EQ("http://host1:1/,http://host2:2/", @@ -1096,7 +1021,6 @@ TEST_F(CookiesTreeModelTest, RemoveCookiesNode) { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); } @@ -1124,10 +1048,9 @@ TEST_F(CookiesTreeModelTest, RemoveCookiesNode) { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); - EXPECT_EQ(67, cookies_model->GetRoot()->GetTotalNodeCount()); + EXPECT_EQ(65, cookies_model->GetRoot()->GetTotalNodeCount()); } DeleteStoredObjects( @@ -1153,10 +1076,9 @@ TEST_F(CookiesTreeModelTest, RemoveCookiesNode) { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); - EXPECT_EQ(65, cookies_model->GetRoot()->GetTotalNodeCount()); + EXPECT_EQ(63, cookies_model->GetRoot()->GetTotalNodeCount()); } } @@ -1188,12 +1110,11 @@ TEST_F(CookiesTreeModelTest, RemoveCookieNode) { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); - // 69 because in this case, the origin remains, although the COOKIES + // 67 because in this case, the origin remains, although the COOKIES // node beneath it has been deleted. - EXPECT_EQ(69, cookies_model->GetRoot()->GetTotalNodeCount()); + EXPECT_EQ(67, cookies_model->GetRoot()->GetTotalNodeCount()); } DeleteStoredObjects( @@ -1219,10 +1140,9 @@ TEST_F(CookiesTreeModelTest, RemoveCookieNode) { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); - EXPECT_EQ(67, cookies_model->GetRoot()->GetTotalNodeCount()); + EXPECT_EQ(65, cookies_model->GetRoot()->GetTotalNodeCount()); } DeleteStoredObjects( @@ -1248,10 +1168,9 @@ TEST_F(CookiesTreeModelTest, RemoveCookieNode) { GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); - EXPECT_EQ(65, cookies_model->GetRoot()->GetTotalNodeCount()); + EXPECT_EQ(63, cookies_model->GetRoot()->GetTotalNodeCount()); } } @@ -1266,7 +1185,6 @@ TEST_F(CookiesTreeModelTest, RemoveSingleCookieNode) { mock_browsing_data_service_worker_helper_, mock_browsing_data_shared_worker_helper_, mock_browsing_data_cache_storage_helper_, - mock_browsing_data_flash_lso_helper_, mock_browsing_data_media_license_helper_); CookiesTreeModel cookies_model(std::move(container), special_storage_policy()); @@ -1387,7 +1305,6 @@ TEST_F(CookiesTreeModelTest, RemoveSingleCookieNodeOf3) { mock_browsing_data_service_worker_helper_, mock_browsing_data_shared_worker_helper_, mock_browsing_data_cache_storage_helper_, - mock_browsing_data_flash_lso_helper_, mock_browsing_data_media_license_helper_); CookiesTreeModel cookies_model(std::move(container), special_storage_policy()); @@ -1514,7 +1431,6 @@ TEST_F(CookiesTreeModelTest, RemoveSecondOrigin) { mock_browsing_data_service_worker_helper_, mock_browsing_data_shared_worker_helper_, mock_browsing_data_cache_storage_helper_, - mock_browsing_data_flash_lso_helper_, mock_browsing_data_media_license_helper_); CookiesTreeModel cookies_model(std::move(container), special_storage_policy()); @@ -1558,7 +1474,6 @@ TEST_F(CookiesTreeModelTest, OriginOrdering) { mock_browsing_data_service_worker_helper_, mock_browsing_data_shared_worker_helper_, mock_browsing_data_cache_storage_helper_, - mock_browsing_data_flash_lso_helper_, mock_browsing_data_media_license_helper_); CookiesTreeModel cookies_model(std::move(container), special_storage_policy()); @@ -1607,7 +1522,6 @@ TEST_F(CookiesTreeModelTest, ContentSettings) { mock_browsing_data_service_worker_helper_, mock_browsing_data_shared_worker_helper_, mock_browsing_data_cache_storage_helper_, - mock_browsing_data_flash_lso_helper_, mock_browsing_data_media_license_helper_); CookiesTreeModel cookies_model(std::move(container), special_storage_policy()); @@ -1734,7 +1648,6 @@ TEST_F(CookiesTreeModelTest, CookiesFilter) { mock_browsing_data_service_worker_helper_, mock_browsing_data_shared_worker_helper_, mock_browsing_data_cache_storage_helper_, - mock_browsing_data_flash_lso_helper_, mock_browsing_data_media_license_helper_); CookiesTreeModel cookies_model(std::move(container), special_storage_policy()); @@ -1776,7 +1689,6 @@ TEST_F(CookiesTreeModelTest, CanonicalizeCookieSource) { mock_browsing_data_service_worker_helper_, mock_browsing_data_shared_worker_helper_, mock_browsing_data_cache_storage_helper_, - mock_browsing_data_flash_lso_helper_, mock_browsing_data_media_license_helper_); CookiesTreeModel cookies_model(std::move(container), special_storage_policy()); @@ -1864,7 +1776,6 @@ TEST_F(CookiesTreeModelTest, CookiesFilterWithoutSource) { mock_browsing_data_service_worker_helper_, mock_browsing_data_shared_worker_helper_, mock_browsing_data_cache_storage_helper_, - mock_browsing_data_flash_lso_helper_, mock_browsing_data_media_license_helper_); CookiesTreeModel cookies_model(std::move(container), special_storage_policy()); @@ -1875,61 +1786,6 @@ TEST_F(CookiesTreeModelTest, CookiesFilterWithoutSource) { EXPECT_EQ("A", GetDisplayedCookies(&cookies_model)); } -TEST_F(CookiesTreeModelTest, FlashFilter) { - std::unique_ptr cookies_model( - CreateCookiesTreeModelWithInitialSample()); - - cookies_model->UpdateSearchResults(base::string16(base::ASCIIToUTF16("xyz"))); - { - SCOPED_TRACE("Search for 'xyz'"); - EXPECT_EQ("", GetDisplayedCookies(cookies_model.get())); - EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); - EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); - EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); - EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); - EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); - EXPECT_EQ("", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); - EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); - } - - // Search for any domain containing 'y'. - cookies_model->UpdateSearchResults(base::string16(base::ASCIIToUTF16("y"))); - { - SCOPED_TRACE("Search for 'y'"); - EXPECT_EQ("", GetDisplayedCookies(cookies_model.get())); - EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); - EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); - EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); - EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); - EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); - EXPECT_EQ("", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); - EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); - } - - // Search for any domain containing 'abc' (which doesn't match anything). - cookies_model->UpdateSearchResults(base::string16(base::ASCIIToUTF16("abc"))); - { - SCOPED_TRACE("Search for 'abc'"); - EXPECT_EQ("", GetDisplayedCookies(cookies_model.get())); - EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); - EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); - EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); - EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); - EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); - EXPECT_EQ("", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); - EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); - } -} - TEST_F(CookiesTreeModelTest, MediaLicensesFilter) { std::unique_ptr cookies_model( CreateCookiesTreeModelWithInitialSample()); @@ -1947,7 +1803,6 @@ TEST_F(CookiesTreeModelTest, MediaLicensesFilter) { EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/", GetDisplayedMediaLicenses(cookies_model.get())); } @@ -1965,7 +1820,6 @@ TEST_F(CookiesTreeModelTest, MediaLicensesFilter) { EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); EXPECT_EQ("", GetDisplayedCacheStorages(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); } @@ -1994,7 +1848,6 @@ TEST_F(CookiesTreeModelTest, MediaLicensesFilter) { "https://sharedworkerhost1:1/app/worker.js," "https://sharedworkerhost2:2/worker.js", GetDisplayedSharedWorkers(cookies_model.get())); - EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); } @@ -2020,7 +1873,6 @@ TEST_F(CookiesTreeModelTest, MediaLicensesFilter) { GetDisplayedServiceWorkers(cookies_model.get())); EXPECT_EQ("https://sharedworkerhost1:1/app/worker.js", GetDisplayedSharedWorkers(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/", GetDisplayedMediaLicenses(cookies_model.get())); } @@ -2040,7 +1892,6 @@ TEST_F(CookiesTreeModelTest, MediaLicensesFilter) { EXPECT_EQ("", GetDisplayedCacheStorages(cookies_model.get())); EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); EXPECT_EQ("", GetDisplayedSharedWorkers(cookies_model.get())); - EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); EXPECT_EQ("https://media1/,https://media2/", GetDisplayedMediaLicenses(cookies_model.get())); } diff --git a/chrome/browser/browsing_data/counters/site_data_counting_helper.cc b/chrome/browser/browsing_data/counters/site_data_counting_helper.cc index 47e0891ffe681b..1e98a13c3acc04 100644 --- a/chrome/browser/browsing_data/counters/site_data_counting_helper.cc +++ b/chrome/browser/browsing_data/counters/site_data_counting_helper.cc @@ -6,7 +6,6 @@ #include "base/bind.h" #include "build/build_config.h" -#include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" #include "components/browsing_data/content/browsing_data_helper.h" @@ -91,17 +90,6 @@ void SiteDataCountingHelper::CountAndDestroySelfWhenFinished() { // TODO(772337): Enable session storage counting when deletion is fixed. } -#if BUILDFLAG(ENABLE_PLUGINS) - // Count origins with flash data. - flash_lso_helper_ = BrowsingDataFlashLSOHelper::Create(profile_); - if (flash_lso_helper_) { - tasks_ += 1; - flash_lso_helper_->StartFetching( - base::BindOnce(&SiteDataCountingHelper::SitesWithFlashDataCallback, - base::Unretained(this))); - } -#endif - #if defined(OS_ANDROID) // Count origins with media licenses on Android. tasks_ += 1; @@ -195,15 +183,6 @@ void SiteDataCountingHelper::GetLocalStorageUsageInfoCallback( Done(origins); } -void SiteDataCountingHelper::SitesWithFlashDataCallback( - const std::vector& sites) { - std::vector origins; - for (const std::string& site : sites) { - origins.push_back(GURL(site)); - } - Done(origins); -} - void SiteDataCountingHelper::SitesWithMediaLicensesCallback( const std::list& media_license_info_list) { diff --git a/chrome/browser/browsing_data/counters/site_data_counting_helper.h b/chrome/browser/browsing_data/counters/site_data_counting_helper.h index 650d0bf7454c43..6f225aa080ffc6 100644 --- a/chrome/browser/browsing_data/counters/site_data_counting_helper.h +++ b/chrome/browser/browsing_data/counters/site_data_counting_helper.h @@ -17,7 +17,6 @@ #include "third_party/blink/public/mojom/quota/quota_types.mojom-forward.h" class Profile; -class BrowsingDataFlashLSOHelper; class HostContentSettingsMap; namespace content { @@ -55,7 +54,6 @@ class SiteDataCountingHelper { const std::vector& infos); void GetQuotaOriginsCallback(const std::set& origin_set, blink::mojom::StorageType type); - void SitesWithFlashDataCallback(const std::vector& sites); void SitesWithMediaLicensesCallback( const std::list& media_license_info_list); @@ -68,7 +66,6 @@ class SiteDataCountingHelper { base::OnceCallback completion_callback_; int tasks_; std::set unique_hosts_; - scoped_refptr flash_lso_helper_; scoped_refptr media_license_helper_; }; diff --git a/chrome/browser/browsing_data/local_data_container.cc b/chrome/browser/browsing_data/local_data_container.cc index 3ec30b6189bce2..e0e0d7d4b6bcca 100644 --- a/chrome/browser/browsing_data/local_data_container.cc +++ b/chrome/browser/browsing_data/local_data_container.cc @@ -7,7 +7,6 @@ #include #include "base/bind.h" -#include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" #include "chrome/browser/browsing_data/cookies_tree_model.h" #include "content/public/browser/storage_usage_info.h" #include "net/cookies/canonical_cookie.h" @@ -27,7 +26,6 @@ LocalDataContainer::LocalDataContainer( scoped_refptr service_worker_helper, scoped_refptr shared_worker_helper, scoped_refptr cache_storage_helper, - scoped_refptr flash_lso_helper, scoped_refptr media_license_helper) : appcache_helper_(std::move(appcache_helper)), cookie_helper_(std::move(cookie_helper)), @@ -40,7 +38,6 @@ LocalDataContainer::LocalDataContainer( service_worker_helper_(std::move(service_worker_helper)), shared_worker_helper_(std::move(shared_worker_helper)), cache_storage_helper_(std::move(cache_storage_helper)), - flash_lso_helper_(std::move(flash_lso_helper)), media_license_helper_(std::move(media_license_helper)) {} LocalDataContainer::~LocalDataContainer() {} @@ -129,13 +126,6 @@ void LocalDataContainer::Init(CookiesTreeModel* model) { weak_ptr_factory_.GetWeakPtr())); } - if (flash_lso_helper_.get()) { - batches_started_++; - flash_lso_helper_->StartFetching( - base::BindOnce(&LocalDataContainer::OnFlashLSOInfoLoaded, - weak_ptr_factory_.GetWeakPtr())); - } - if (media_license_helper_.get()) { batches_started_++; media_license_helper_->StartFetching( @@ -225,13 +215,6 @@ void LocalDataContainer::OnCacheStorageModelInfoLoaded( model_->PopulateCacheStorageUsageInfo(this); } -void LocalDataContainer::OnFlashLSOInfoLoaded( - const FlashLSODomainList& domains) { - flash_lso_domain_list_ = domains; - DCHECK(model_); - model_->PopulateFlashLSOInfo(this); -} - void LocalDataContainer::OnMediaLicenseInfoLoaded( const MediaLicenseInfoList& media_license_info) { media_license_info_list_ = media_license_info; diff --git a/chrome/browser/browsing_data/local_data_container.h b/chrome/browser/browsing_data/local_data_container.h index 18bad03d71e053..0f67e34c0f5ec8 100644 --- a/chrome/browser/browsing_data/local_data_container.h +++ b/chrome/browser/browsing_data/local_data_container.h @@ -26,7 +26,6 @@ #include "components/browsing_data/content/service_worker_helper.h" #include "components/browsing_data/content/shared_worker_helper.h" -class BrowsingDataFlashLSOHelper; class CookiesTreeModel; class LocalDataContainer; @@ -60,7 +59,6 @@ class LocalDataContainer { std::list; using CacheStorageUsageInfoList = std::list; using AppCacheInfoList = std::list; - using FlashLSODomainList = std::vector; using MediaLicenseInfoList = std::list; @@ -76,7 +74,6 @@ class LocalDataContainer { scoped_refptr service_worker_helper, scoped_refptr shared_worker_helper, scoped_refptr cache_storage_helper, - scoped_refptr flash_data_helper, scoped_refptr media_license_helper); virtual ~LocalDataContainer(); @@ -98,7 +95,6 @@ class LocalDataContainer { friend class CookieTreeServiceWorkerNode; friend class CookieTreeSharedWorkerNode; friend class CookieTreeCacheStorageNode; - friend class CookieTreeFlashLSONode; // Callback methods to be invoked when fetching the data is complete. void OnAppCacheModelInfoLoaded(const AppCacheInfoList& appcache_info_list); @@ -118,7 +114,6 @@ class LocalDataContainer { void OnSharedWorkerInfoLoaded(const SharedWorkerInfoList& shared_worker_info); void OnCacheStorageModelInfoLoaded( const CacheStorageUsageInfoList& cache_storage_info); - void OnFlashLSOInfoLoaded(const FlashLSODomainList& domains); void OnMediaLicenseInfoLoaded(const MediaLicenseInfoList& media_license_info); // Pointers to the helper objects, needed to retreive all the types of locally @@ -134,7 +129,6 @@ class LocalDataContainer { scoped_refptr service_worker_helper_; scoped_refptr shared_worker_helper_; scoped_refptr cache_storage_helper_; - scoped_refptr flash_lso_helper_; scoped_refptr media_license_helper_; // Storage for all the data that was retrieved through the helper objects. @@ -150,7 +144,6 @@ class LocalDataContainer { ServiceWorkerUsageInfoList service_worker_info_list_; SharedWorkerInfoList shared_worker_info_list_; CacheStorageUsageInfoList cache_storage_info_list_; - FlashLSODomainList flash_lso_domain_list_; MediaLicenseInfoList media_license_info_list_; // A delegate, which must outlive this object. The update callbacks use the diff --git a/chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.cc b/chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.cc deleted file mode 100644 index 5d9058ff876397..00000000000000 --- a/chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2012 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/browser/browsing_data/mock_browsing_data_flash_lso_helper.h" - -#include - -#include "testing/gtest/include/gtest/gtest.h" - -MockBrowsingDataFlashLSOHelper::MockBrowsingDataFlashLSOHelper( - content::BrowserContext* browser_context) { -} -void MockBrowsingDataFlashLSOHelper::StartFetching( - GetSitesWithFlashDataCallback callback) { - ASSERT_FALSE(callback.is_null()); - ASSERT_TRUE(callback_.is_null()); - callback_ = std::move(callback); -} - -void MockBrowsingDataFlashLSOHelper::DeleteFlashLSOsForSite( - const std::string& site, - base::OnceClosure callback) { - auto entry = std::find(domains_.begin(), domains_.end(), site); - ASSERT_TRUE(entry != domains_.end()); - domains_.erase(entry); - if (!callback.is_null()) - std::move(callback).Run(); -} - -void MockBrowsingDataFlashLSOHelper::AddFlashLSODomain( - const std::string& domain) { - domains_.push_back(domain); -} - -void MockBrowsingDataFlashLSOHelper::Notify() { - std::move(callback_).Run(domains_); - callback_ = GetSitesWithFlashDataCallback(); -} - -bool MockBrowsingDataFlashLSOHelper::AllDeleted() { - return domains_.empty(); -} - -MockBrowsingDataFlashLSOHelper::~MockBrowsingDataFlashLSOHelper() { -} diff --git a/chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h b/chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h deleted file mode 100644 index 5a533a294e5b40..00000000000000 --- a/chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2012 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_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_FLASH_LSO_HELPER_H_ -#define CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_FLASH_LSO_HELPER_H_ - -#include -#include - -#include "base/callback.h" -#include "base/macros.h" -#include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" - -class MockBrowsingDataFlashLSOHelper : public BrowsingDataFlashLSOHelper { - public: - explicit MockBrowsingDataFlashLSOHelper( - content::BrowserContext* browser_context); - - // BrowsingDataFlashLSOHelper implementation: - void StartFetching(GetSitesWithFlashDataCallback callback) override; - void DeleteFlashLSOsForSite(const std::string& site, - base::OnceClosure callback) override; - - // Adds a domain sample. - void AddFlashLSODomain(const std::string& domain); - - // Notifies the callback. - void Notify(); - - // Returns true if the domain list is empty. - bool AllDeleted(); - - protected: - ~MockBrowsingDataFlashLSOHelper() override; - - private: - GetSitesWithFlashDataCallback callback_; - - std::vector domains_; - - DISALLOW_COPY_AND_ASSIGN(MockBrowsingDataFlashLSOHelper); -}; - -#endif // CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_FLASH_LSO_HELPER_H_ diff --git a/chrome/browser/browsing_data/site_data_size_collector.cc b/chrome/browser/browsing_data/site_data_size_collector.cc index a92479268c55ef..74142a71a5c397 100644 --- a/chrome/browser/browsing_data/site_data_size_collector.cc +++ b/chrome/browser/browsing_data/site_data_size_collector.cc @@ -35,8 +35,7 @@ SiteDataSizeCollector::SiteDataSizeCollector( browsing_data::IndexedDBHelper* indexed_db_helper, browsing_data::FileSystemHelper* file_system_helper, browsing_data::ServiceWorkerHelper* service_worker_helper, - browsing_data::CacheStorageHelper* cache_storage_helper, - BrowsingDataFlashLSOHelper* flash_lso_helper) + browsing_data::CacheStorageHelper* cache_storage_helper) : default_storage_partition_path_(default_storage_partition_path), appcache_helper_(appcache_helper), cookie_helper_(cookie_helper), @@ -46,7 +45,6 @@ SiteDataSizeCollector::SiteDataSizeCollector( file_system_helper_(file_system_helper), service_worker_helper_(service_worker_helper), cache_storage_helper_(cache_storage_helper), - flash_lso_helper_(flash_lso_helper), in_flight_operations_(0), total_bytes_(0) {} @@ -109,12 +107,6 @@ void SiteDataSizeCollector::Fetch(FetchCallback callback) { weak_ptr_factory_.GetWeakPtr())); in_flight_operations_++; } - if (flash_lso_helper_.get()) { - flash_lso_helper_->StartFetching( - base::BindOnce(&SiteDataSizeCollector::OnFlashLSOInfoLoaded, - weak_ptr_factory_.GetWeakPtr())); - in_flight_operations_++; - } // TODO(fukino): SITE_USAGE_DATA and WEB_APP_DATA should be counted too. // All data types included in REMOVE_SITE_USAGE_DATA should be counted. } @@ -201,25 +193,6 @@ void SiteDataSizeCollector::OnCacheStorageModelInfoLoaded( OnStorageSizeFetched(total_size); } -void SiteDataSizeCollector::OnFlashLSOInfoLoaded( - const FlashLSODomainList& domains) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - - // TODO(fukino): Flash is not the only plugin. We should check all types of - // plugin data. - if (domains.empty()) { - OnStorageSizeFetched(0); - return; - } - base::FilePath pepper_data_dir_path = default_storage_partition_path_ - .Append(content::kPepperDataDirname); - base::ThreadPool::PostTaskAndReplyWithResult( - FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, - base::BindOnce(&base::ComputeDirectorySize, pepper_data_dir_path), - base::BindOnce(&SiteDataSizeCollector::OnStorageSizeFetched, - weak_ptr_factory_.GetWeakPtr())); -} - void SiteDataSizeCollector::OnStorageSizeFetched(int64_t size) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (size > 0) diff --git a/chrome/browser/browsing_data/site_data_size_collector.h b/chrome/browser/browsing_data/site_data_size_collector.h index 231e58fc9b9ab3..2bc5928797afb4 100644 --- a/chrome/browser/browsing_data/site_data_size_collector.h +++ b/chrome/browser/browsing_data/site_data_size_collector.h @@ -10,7 +10,6 @@ #include #include "base/memory/weak_ptr.h" -#include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" #include "chrome/browser/profiles/profile.h" #include "components/browsing_data/content/appcache_helper.h" #include "components/browsing_data/content/cache_storage_helper.h" @@ -32,7 +31,6 @@ class SiteDataSizeCollector { std::list; using ServiceWorkerUsageInfoList = std::list; using CacheStorageUsageInfoList = std::list; - using FlashLSODomainList = std::vector; SiteDataSizeCollector( const base::FilePath& default_storage_partition_path, @@ -43,8 +41,7 @@ class SiteDataSizeCollector { browsing_data::IndexedDBHelper* indexed_db_helper, browsing_data::FileSystemHelper* file_system_helper, browsing_data::ServiceWorkerHelper* service_worker_helper, - browsing_data::CacheStorageHelper* cache_storage_helper, - BrowsingDataFlashLSOHelper* flash_lso_helper); + browsing_data::CacheStorageHelper* cache_storage_helper); virtual ~SiteDataSizeCollector(); using FetchCallback = base::OnceCallback; @@ -68,7 +65,6 @@ class SiteDataSizeCollector { const ServiceWorkerUsageInfoList& service_worker_info_list); void OnCacheStorageModelInfoLoaded( const CacheStorageUsageInfoList& cache_storage_info_list); - void OnFlashLSOInfoLoaded(const FlashLSODomainList& domains); // Callback for when the size is fetched from each storage backend. void OnStorageSizeFetched(int64_t size); @@ -86,7 +82,6 @@ class SiteDataSizeCollector { scoped_refptr file_system_helper_; scoped_refptr service_worker_helper_; scoped_refptr cache_storage_helper_; - scoped_refptr flash_lso_helper_; // Callback called when sizes of all site data are fetched and accumulated. FetchCallback fetch_callback_; diff --git a/chrome/browser/browsing_data/site_data_size_collector_unittest.cc b/chrome/browser/browsing_data/site_data_size_collector_unittest.cc index 6a241e000703b1..6fe27d5e29cc50 100644 --- a/chrome/browser/browsing_data/site_data_size_collector_unittest.cc +++ b/chrome/browser/browsing_data/site_data_size_collector_unittest.cc @@ -9,7 +9,6 @@ #include "base/files/file_util.h" #include "base/run_loop.h" #include "base/stl_util.h" -#include "chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h" #include "chrome/common/chrome_constants.h" #include "chrome/test/base/testing_profile.h" #include "components/browsing_data/content/mock_appcache_helper.h" @@ -27,12 +26,6 @@ namespace { const char kCookieFileData[] = "cookie_file_data"; -const base::FilePath::CharType kFlashDataFilename0[] = - FILE_PATH_LITERAL("flash_data_filename_0"); -const base::FilePath::CharType kFlashDataFilename1[] = - FILE_PATH_LITERAL("flash_data_filename_1"); -const char kFlashData0[] = "flash_data_zero"; -const char kFlashData1[] = "flash_data_one"; class SiteDataSizeCollectorTest : public testing::Test { public: @@ -58,18 +51,9 @@ class SiteDataSizeCollectorTest : public testing::Test { new browsing_data::MockServiceWorkerHelper(profile_.get()); mock_browsing_data_cache_storage_helper_ = new browsing_data::MockCacheStorageHelper(profile_.get()); - mock_browsing_data_flash_lso_helper_ = - new MockBrowsingDataFlashLSOHelper(profile_.get()); base::WriteFile(profile_->GetPath().Append(chrome::kCookieFilename), kCookieFileData, base::size(kCookieFileData)); - const base::FilePath flash_data_dir = profile_->GetPath().Append( - content::kPepperDataDirname); - base::CreateDirectory(flash_data_dir); - base::WriteFile(flash_data_dir.Append(kFlashDataFilename0), kFlashData0, - base::size(kFlashData0)); - base::WriteFile(flash_data_dir.Append(kFlashDataFilename1), kFlashData1, - base::size(kFlashData1)); fetched_size_ = -1; } @@ -83,7 +67,6 @@ class SiteDataSizeCollectorTest : public testing::Test { mock_browsing_data_session_storage_helper_ = nullptr; mock_browsing_data_local_storage_helper_ = nullptr; mock_browsing_data_database_helper_ = nullptr; - mock_browsing_data_flash_lso_helper_ = nullptr; } void FetchCallback(base::OnceClosure done, int64_t size) { @@ -114,14 +97,12 @@ class SiteDataSizeCollectorTest : public testing::Test { mock_browsing_data_service_worker_helper_; scoped_refptr mock_browsing_data_cache_storage_helper_; - scoped_refptr - mock_browsing_data_flash_lso_helper_; }; TEST_F(SiteDataSizeCollectorTest, FetchCookie) { SiteDataSizeCollector collector( profile_->GetPath(), mock_browsing_data_cookie_helper_.get(), nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); base::RunLoop run_loop; collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, @@ -140,7 +121,7 @@ TEST_F(SiteDataSizeCollectorTest, FetchCookie) { TEST_F(SiteDataSizeCollectorTest, FetchCookieWithoutEntry) { SiteDataSizeCollector collector( profile_->GetPath(), mock_browsing_data_cookie_helper_.get(), nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); // Fetched size should be 0 if there are no cookies. collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, @@ -152,7 +133,7 @@ TEST_F(SiteDataSizeCollectorTest, FetchCookieWithoutEntry) { TEST_F(SiteDataSizeCollectorTest, FetchDatabase) { SiteDataSizeCollector collector( profile_->GetPath(), nullptr, mock_browsing_data_database_helper_.get(), - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, base::Unretained(this), base::OnceClosure())); @@ -165,7 +146,7 @@ TEST_F(SiteDataSizeCollectorTest, FetchLocalStorage) { SiteDataSizeCollector collector( profile_->GetPath(), nullptr, nullptr, mock_browsing_data_local_storage_helper_.get(), nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr); + nullptr, nullptr); collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, base::Unretained(this), base::OnceClosure())); @@ -178,7 +159,7 @@ TEST_F(SiteDataSizeCollectorTest, FetchAppCache) { SiteDataSizeCollector collector(profile_->GetPath(), nullptr, nullptr, nullptr, mock_browsing_data_appcache_helper_.get(), - nullptr, nullptr, nullptr, nullptr, nullptr); + nullptr, nullptr, nullptr, nullptr); collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, base::Unretained(this), base::OnceClosure())); @@ -188,10 +169,9 @@ TEST_F(SiteDataSizeCollectorTest, FetchAppCache) { } TEST_F(SiteDataSizeCollectorTest, FetchIndexedDB) { - SiteDataSizeCollector collector(profile_->GetPath(), nullptr, nullptr, - nullptr, nullptr, - mock_browsing_data_indexed_db_helper_.get(), - nullptr, nullptr, nullptr, nullptr); + SiteDataSizeCollector collector( + profile_->GetPath(), nullptr, nullptr, nullptr, nullptr, + mock_browsing_data_indexed_db_helper_.get(), nullptr, nullptr, nullptr); collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, base::Unretained(this), base::OnceClosure())); @@ -203,7 +183,7 @@ TEST_F(SiteDataSizeCollectorTest, FetchIndexedDB) { TEST_F(SiteDataSizeCollectorTest, FetchFileSystem) { SiteDataSizeCollector collector( profile_->GetPath(), nullptr, nullptr, nullptr, nullptr, nullptr, - mock_browsing_data_file_system_helper_.get(), nullptr, nullptr, nullptr); + mock_browsing_data_file_system_helper_.get(), nullptr, nullptr); collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, base::Unretained(this), base::OnceClosure())); @@ -215,8 +195,7 @@ TEST_F(SiteDataSizeCollectorTest, FetchFileSystem) { TEST_F(SiteDataSizeCollectorTest, FetchServiceWorker) { SiteDataSizeCollector collector( profile_->GetPath(), nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - mock_browsing_data_service_worker_helper_.get(), - nullptr, nullptr); + mock_browsing_data_service_worker_helper_.get(), nullptr); collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, base::Unretained(this), base::OnceClosure())); @@ -228,7 +207,7 @@ TEST_F(SiteDataSizeCollectorTest, FetchServiceWorker) { TEST_F(SiteDataSizeCollectorTest, FetchCacheStorage) { SiteDataSizeCollector collector( profile_->GetPath(), nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, mock_browsing_data_cache_storage_helper_.get(), nullptr); + nullptr, mock_browsing_data_cache_storage_helper_.get()); collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, base::Unretained(this), base::OnceClosure())); @@ -237,43 +216,11 @@ TEST_F(SiteDataSizeCollectorTest, FetchCacheStorage) { EXPECT_EQ(3, fetched_size_); } -TEST_F(SiteDataSizeCollectorTest, FetchFlashLSO) { - SiteDataSizeCollector collector( - profile_->GetPath(), nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, mock_browsing_data_flash_lso_helper_.get()); - - base::RunLoop run_loop; - collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, - base::Unretained(this), - run_loop.QuitClosure())); - - // AddFlashLSODomain() actually doesn't write flash data to the file, only - // triggers the condition to take the file into account. - mock_browsing_data_flash_lso_helper_->AddFlashLSODomain("example.com"); - mock_browsing_data_flash_lso_helper_->Notify(); - // Wait until reading files on blocking pool finishes. - run_loop.Run(); - EXPECT_EQ( - static_cast(base::size(kFlashData0) + base::size(kFlashData1)), - fetched_size_); -} - -TEST_F(SiteDataSizeCollectorTest, FetchFlashLSOWithoutEntry) { - SiteDataSizeCollector collector( - profile_->GetPath(), nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, mock_browsing_data_flash_lso_helper_.get()); - - collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, - base::Unretained(this), base::OnceClosure())); - mock_browsing_data_flash_lso_helper_->Notify(); - EXPECT_EQ(0, fetched_size_); -} - TEST_F(SiteDataSizeCollectorTest, FetchMultiple) { SiteDataSizeCollector collector( profile_->GetPath(), nullptr, nullptr, nullptr, nullptr, mock_browsing_data_indexed_db_helper_.get(), nullptr, - mock_browsing_data_service_worker_helper_.get(), nullptr, nullptr); + mock_browsing_data_service_worker_helper_.get(), nullptr); collector.Fetch(base::BindOnce(&SiteDataSizeCollectorTest::FetchCallback, base::Unretained(this), base::OnceClosure())); diff --git a/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc b/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc index 5b625ca979e5de..e1893e988a5f74 100644 --- a/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc +++ b/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc @@ -35,7 +35,6 @@ #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #if BUILDFLAG(ENABLE_PLUGINS) -#include "chrome/browser/plugins/plugin_data_remover_helper.h" #include "chrome/browser/plugins/plugin_prefs.h" #endif @@ -387,8 +386,8 @@ bool BrowsingDataRemoverFunction::IsPauseSyncAllowed() { #if BUILDFLAG(ENABLE_PLUGINS) void BrowsingDataRemoverFunction::CheckRemovingPluginDataSupported( scoped_refptr plugin_prefs) { - if (!PluginDataRemoverHelper::IsSupported(plugin_prefs.get())) - removal_mask_ &= ~ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA; + // We don't support this after Flash deprecation. + removal_mask_ &= ~ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA; content::GetUIThreadTaskRunner({})->PostTask( FROM_HERE, diff --git a/chrome/browser/pepper_flash_settings_manager.cc b/chrome/browser/pepper_flash_settings_manager.cc deleted file mode 100644 index 13a9f0dbb5b4f7..00000000000000 --- a/chrome/browser/pepper_flash_settings_manager.cc +++ /dev/null @@ -1,1042 +0,0 @@ -// Copyright (c) 2012 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/browser/pepper_flash_settings_manager.h" - -#include -#include -#include - -#include "base/bind.h" -#include "base/compiler_specific.h" -#include "base/files/file_util.h" -#include "base/sequenced_task_runner_helpers.h" -#include "base/strings/utf_string_conversions.h" -#include "base/task/thread_pool.h" -#include "build/build_config.h" -#include "chrome/browser/plugins/plugin_prefs.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/renderer_host/pepper/device_id_fetcher.h" -#include "chrome/common/pref_names.h" -#include "components/pref_registry/pref_registry_syncable.h" -#include "components/prefs/pref_service.h" -#include "content/public/browser/browser_context.h" -#include "content/public/browser/browser_task_traits.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/browser/pepper_flash_settings_helper.h" -#include "content/public/browser/plugin_service.h" -#include "content/public/common/content_constants.h" -#include "content/public/common/webplugininfo.h" -#include "ipc/ipc_channel.h" -#include "ipc/ipc_listener.h" -#include "ppapi/proxy/ppapi_messages.h" -#include "url/gurl.h" - -using content::BrowserThread; - -class PepperFlashSettingsManager::Core - : public IPC::Listener, - public base::RefCountedThreadSafe { - public: - Core(base::WeakPtr manager, - content::BrowserContext* browser_context); - - void Initialize(); - - // Notifies the core that it has been detached. Afterwards, no method should - // be called any more. - void Detach(); - - void DeauthorizeContentLicenses(uint32_t request_id); - void GetPermissionSettings( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type); - void SetDefaultPermission(uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific); - void SetSitePermission(uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites); - void GetSitesWithData(uint32_t request_id); - void ClearSiteData(uint32_t request_id, - const std::string& site, - uint64_t flags, - uint64_t max_age); - - // IPC::Listener implementation. - bool OnMessageReceived(const IPC::Message& message) override; - void OnChannelError() override; - - private: - friend struct BrowserThread::DeleteOnThread; - friend class base::DeleteHelper; - - enum RequestType { - INVALID_REQUEST_TYPE = 0, - DEAUTHORIZE_CONTENT_LICENSES, - GET_PERMISSION_SETTINGS, - SET_DEFAULT_PERMISSION, - SET_SITE_PERMISSION, - GET_SITES_WITH_DATA, - CLEAR_SITE_DATA, - }; - - enum State { - STATE_UNINITIALIZED = 0, - STATE_INITIALIZED, - STATE_ERROR, - STATE_DETACHED, - }; - - struct PendingRequest { - PendingRequest() - : id(0), - type(INVALID_REQUEST_TYPE), - setting_type(PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_CAMERAMIC), - permission(PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT), - clear_site_specific(false), - flags(0), - max_age(0) { - } - - uint32_t id; - RequestType type; - - // Used by GET_PERMISSION_SETTINGS, SET_DEFAULT_PERMISSION and - // SET_SITE_PERMISSION. - PP_Flash_BrowserOperations_SettingType setting_type; - - // Used by SET_DEFAULT_PERMISSION. - PP_Flash_BrowserOperations_Permission permission; - bool clear_site_specific; - - // Used by SET_SITE_PERMISSION. - ppapi::FlashSiteSettings sites; - - // Used by CLEAR_SITE_DATA - std::string site; - uint64_t flags; - uint64_t max_age; - }; - - ~Core() override; - - void ConnectToChannel(bool success, const IPC::ChannelHandle& handle); - - void InitializeOnIOThread(); - void DeauthorizeContentLicensesOnIOThread(uint32_t request_id); - void DeauthorizeContentLicensesAsync(uint32_t request_id, - const base::FilePath& profile_path); - void DeauthorizeContentLicensesInPlugin(uint32_t request_id, bool success); - void GetPermissionSettingsOnIOThread( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type); - void SetDefaultPermissionOnIOThread( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific); - void SetSitePermissionOnIOThread( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites); - void GetSitesWithDataOnIOThread(uint32_t request_id); - void ClearSiteDataOnIOThread(uint32_t request_id, - const std::string& site, - uint64_t flags, - uint64_t max_age); - void DetachOnIOThread(); - - void NotifyErrorFromIOThread(); - - void NotifyDeauthorizeContentLicensesCompleted(uint32_t request_id, - bool success); - void NotifyGetPermissionSettingsCompleted( - uint32_t request_id, - bool success, - PP_Flash_BrowserOperations_Permission default_permission, - const ppapi::FlashSiteSettings& sites); - void NotifySetDefaultPermissionCompleted(uint32_t request_id, bool success); - void NotifySetSitePermissionCompleted(uint32_t request_id, bool success); - void NotifyGetSitesWithDataCompleted(uint32_t request_id, - const std::vector& sites); - void NotifyClearSiteDataCompleted(uint32_t request_id, bool success); - - void NotifyError( - const std::vector>& notifications); - - // Message handlers. - void OnDeauthorizeContentLicensesResult(uint32_t request_id, bool success); - void OnGetPermissionSettingsResult( - uint32_t request_id, - bool success, - PP_Flash_BrowserOperations_Permission default_permission, - const ppapi::FlashSiteSettings& sites); - void OnSetDefaultPermissionResult(uint32_t request_id, bool success); - void OnSetSitePermissionResult(uint32_t request_id, bool success); - void OnGetSitesWithDataResult(uint32_t request_id, - const std::vector& sites); - void OnClearSiteDataResult(uint32_t request_id, bool success); - - // Used only on the UI thread. - base::WeakPtr manager_; - - // Used only on the I/O thread. - base::FilePath plugin_data_path_; - - // The channel is NULL until we have opened a connection to the broker - // process. Used only on the I/O thread. - std::unique_ptr channel_; - - // Used only on the I/O thread. - State state_; - - // Requests that need to be sent once the channel to the broker process is - // established. Used only on the I/O thread. - std::vector pending_requests_; - // Requests that have been sent but haven't got replied. Used only on the - // I/O thread. - std::map pending_responses_; - - // Used only on the I/O thread. - scoped_refptr helper_; - - // Path for the current profile. Must be retrieved on the UI thread from the - // browser context when we start so we can use it later on the I/O thread. - base::FilePath browser_context_path_; - - scoped_refptr plugin_prefs_; -}; - -PepperFlashSettingsManager::Core::Core( - base::WeakPtr manager, - content::BrowserContext* browser_context) - : manager_(manager), - state_(STATE_UNINITIALIZED), - browser_context_path_(browser_context->GetPath()), - plugin_prefs_(PluginPrefs::GetForProfile( - Profile::FromBrowserContext(browser_context))) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); -} - -PepperFlashSettingsManager::Core::~Core() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); -} - -void PepperFlashSettingsManager::Core::Initialize() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::InitializeOnIOThread, this)); -} - -void PepperFlashSettingsManager::Core::Detach() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - // This call guarantees that one ref is retained until we get to the DETACHED - // state. This is important. Otherwise, if the ref count drops to zero on the - // UI thread (which posts a task to delete this object on the I/O thread) - // while the I/O thread doesn't know about it, methods on the I/O thread might - // increase the ref count again and cause double deletion. - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::DetachOnIOThread, this)); -} - -void PepperFlashSettingsManager::Core::DeauthorizeContentLicenses( - uint32_t request_id) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::DeauthorizeContentLicensesOnIOThread, - this, request_id)); -} - -void PepperFlashSettingsManager::Core::GetPermissionSettings( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::GetPermissionSettingsOnIOThread, this, - request_id, setting_type)); -} - -void PepperFlashSettingsManager::Core::SetDefaultPermission( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, - base::BindOnce(&Core::SetDefaultPermissionOnIOThread, this, request_id, - setting_type, permission, clear_site_specific)); -} - -void PepperFlashSettingsManager::Core::SetSitePermission( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::SetSitePermissionOnIOThread, this, - request_id, setting_type, sites)); -} - -void PepperFlashSettingsManager::Core::GetSitesWithData(uint32_t request_id) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, - base::BindOnce(&Core::GetSitesWithDataOnIOThread, this, request_id)); -} - -void PepperFlashSettingsManager::Core::ClearSiteData(uint32_t request_id, - const std::string& site, - uint64_t flags, - uint64_t max_age) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::ClearSiteDataOnIOThread, this, - request_id, site, flags, max_age)); -} - -bool PepperFlashSettingsManager::Core::OnMessageReceived( - const IPC::Message& message) { - IPC_BEGIN_MESSAGE_MAP(Core, message) - IPC_MESSAGE_HANDLER(PpapiHostMsg_DeauthorizeContentLicensesResult, - OnDeauthorizeContentLicensesResult) - IPC_MESSAGE_HANDLER(PpapiHostMsg_GetPermissionSettingsResult, - OnGetPermissionSettingsResult) - IPC_MESSAGE_HANDLER(PpapiHostMsg_SetDefaultPermissionResult, - OnSetDefaultPermissionResult) - IPC_MESSAGE_HANDLER(PpapiHostMsg_SetSitePermissionResult, - OnSetSitePermissionResult) - IPC_MESSAGE_HANDLER(PpapiHostMsg_GetSitesWithDataResult, - OnGetSitesWithDataResult) - IPC_MESSAGE_HANDLER(PpapiHostMsg_ClearSiteDataResult, - OnClearSiteDataResult) - IPC_MESSAGE_UNHANDLED_ERROR() - IPC_END_MESSAGE_MAP() - - return true; -} - -void PepperFlashSettingsManager::Core::OnChannelError() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (state_ == STATE_DETACHED) - return; - - NotifyErrorFromIOThread(); -} - -void PepperFlashSettingsManager::Core::ConnectToChannel( - bool success, - const IPC::ChannelHandle& handle) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (state_ == STATE_DETACHED) - return; - - DCHECK(state_ == STATE_UNINITIALIZED); - DCHECK(!channel_.get()); - - if (!success) { - DLOG(ERROR) << "Couldn't open plugin channel"; - NotifyErrorFromIOThread(); - return; - } - - channel_ = IPC::Channel::CreateClient(handle, this, - base::ThreadTaskRunnerHandle::Get()); - if (!channel_->Connect()) { - DLOG(ERROR) << "Couldn't connect to plugin"; - NotifyErrorFromIOThread(); - return; - } - - state_ = STATE_INITIALIZED; - - std::vector temp_pending_requests; - temp_pending_requests.swap(pending_requests_); - for (auto iter = temp_pending_requests.begin(); - iter != temp_pending_requests.end(); ++iter) { - switch (iter->type) { - case INVALID_REQUEST_TYPE: - NOTREACHED(); - break; - case DEAUTHORIZE_CONTENT_LICENSES: - DeauthorizeContentLicensesOnIOThread(iter->id); - break; - case GET_PERMISSION_SETTINGS: - GetPermissionSettingsOnIOThread(iter->id, iter->setting_type); - break; - case SET_DEFAULT_PERMISSION: - SetDefaultPermissionOnIOThread( - iter->id, iter->setting_type, iter->permission, - iter->clear_site_specific); - break; - case SET_SITE_PERMISSION: - SetSitePermissionOnIOThread(iter->id, iter->setting_type, iter->sites); - break; - case GET_SITES_WITH_DATA: - GetSitesWithDataOnIOThread(iter->id); - break; - case CLEAR_SITE_DATA: - ClearSiteDataOnIOThread(iter->id, iter->site, iter->flags, - iter->max_age); - break; - } - } -} - -void PepperFlashSettingsManager::Core::InitializeOnIOThread() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_EQ(STATE_UNINITIALIZED, state_); - - content::WebPluginInfo plugin_info; - if (!PepperFlashSettingsManager::IsPepperFlashInUse(plugin_prefs_.get(), - &plugin_info)) { - NotifyErrorFromIOThread(); - return; - } - - base::FilePath profile_path = - browser_context_path_.Append(content::kPepperDataDirname); -#if defined(OS_WIN) - plugin_data_path_ = profile_path.Append(plugin_info.name); -#else - plugin_data_path_ = profile_path.Append(base::UTF16ToUTF8(plugin_info.name)); -#endif - - helper_ = content::PepperFlashSettingsHelper::Create(); - helper_->OpenChannelToBroker(plugin_info.path, - base::BindOnce(&Core::ConnectToChannel, this)); -} - -void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesOnIOThread( - uint32_t request_id) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_NE(STATE_DETACHED, state_); - - if (state_ == STATE_UNINITIALIZED) { - PendingRequest request; - request.id = request_id; - request.type = DEAUTHORIZE_CONTENT_LICENSES; - pending_requests_.push_back(request); - return; - } - - pending_responses_.insert( - std::make_pair(request_id, DEAUTHORIZE_CONTENT_LICENSES)); - if (state_ == STATE_ERROR) { - NotifyErrorFromIOThread(); - return; - } - -#if defined(OS_CHROMEOS) - base::ThreadPool::PostTask( - FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, - base::BindOnce(&Core::DeauthorizeContentLicensesAsync, this, request_id, - browser_context_path_)); -#else - DeauthorizeContentLicensesInPlugin(request_id, true); -#endif -} - -// TODO(raymes): This is temporary code to migrate ChromeOS devices to the new -// scheme for generating device IDs. Delete this once we are sure most ChromeOS -// devices have been migrated. -void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesAsync( - uint32_t request_id, - const base::FilePath& profile_path) { - // ChromeOS used to store the device ID in a file but this is no longer used. - // Wipe that file. - const base::FilePath& device_id_path = - DeviceIDFetcher::GetLegacyDeviceIDPath(profile_path); - bool success = base::DeleteFile(device_id_path); - - content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::DeauthorizeContentLicensesInPlugin, this, - request_id, success)); -} - -void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesInPlugin( - uint32_t request_id, - bool success) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!success) { - NotifyErrorFromIOThread(); - return; - } - IPC::Message* msg = - new PpapiMsg_DeauthorizeContentLicenses(request_id, plugin_data_path_); - if (!channel_->Send(msg)) { - DLOG(ERROR) << "Couldn't send DeauthorizeContentLicenses message"; - // A failure notification for the current request will be sent since - // |pending_responses_| has been updated. - NotifyErrorFromIOThread(); - } -} - -void PepperFlashSettingsManager::Core::GetPermissionSettingsOnIOThread( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_NE(STATE_DETACHED, state_); - - if (state_ == STATE_UNINITIALIZED) { - PendingRequest request; - request.id = request_id; - request.type = GET_PERMISSION_SETTINGS; - request.setting_type = setting_type; - pending_requests_.push_back(request); - return; - } - - pending_responses_.insert( - std::make_pair(request_id, GET_PERMISSION_SETTINGS)); - if (state_ == STATE_ERROR) { - NotifyErrorFromIOThread(); - return; - } - - IPC::Message* msg = new PpapiMsg_GetPermissionSettings( - request_id, plugin_data_path_, setting_type); - if (!channel_->Send(msg)) { - DLOG(ERROR) << "Couldn't send GetPermissionSettings message"; - // A failure notification for the current request will be sent since - // |pending_responses_| has been updated. - NotifyErrorFromIOThread(); - } -} - -void PepperFlashSettingsManager::Core::SetDefaultPermissionOnIOThread( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_NE(STATE_DETACHED, state_); - - if (state_ == STATE_UNINITIALIZED) { - PendingRequest request; - request.id = request_id; - request.type = SET_DEFAULT_PERMISSION; - request.setting_type = setting_type; - request.permission = permission; - request.clear_site_specific = clear_site_specific; - pending_requests_.push_back(request); - return; - } - - pending_responses_.insert(std::make_pair(request_id, SET_DEFAULT_PERMISSION)); - if (state_ == STATE_ERROR) { - NotifyErrorFromIOThread(); - return; - } - - IPC::Message* msg = new PpapiMsg_SetDefaultPermission( - request_id, plugin_data_path_, setting_type, permission, - clear_site_specific); - if (!channel_->Send(msg)) { - DLOG(ERROR) << "Couldn't send SetDefaultPermission message"; - // A failure notification for the current request will be sent since - // |pending_responses_| has been updated. - NotifyErrorFromIOThread(); - } -} - -void PepperFlashSettingsManager::Core::SetSitePermissionOnIOThread( - uint32_t request_id, - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_NE(STATE_DETACHED, state_); - - if (state_ == STATE_UNINITIALIZED) { - pending_requests_.push_back(PendingRequest()); - PendingRequest& request = pending_requests_.back(); - request.id = request_id; - request.type = SET_SITE_PERMISSION; - request.setting_type = setting_type; - request.sites = sites; - return; - } - - pending_responses_.insert(std::make_pair(request_id, SET_SITE_PERMISSION)); - if (state_ == STATE_ERROR) { - NotifyErrorFromIOThread(); - return; - } - - IPC::Message* msg = new PpapiMsg_SetSitePermission( - request_id, plugin_data_path_, setting_type, sites); - if (!channel_->Send(msg)) { - DLOG(ERROR) << "Couldn't send SetSitePermission message"; - // A failure notification for the current request will be sent since - // |pending_responses_| has been updated. - NotifyErrorFromIOThread(); - } -} - -void PepperFlashSettingsManager::Core::GetSitesWithDataOnIOThread( - uint32_t request_id) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_NE(STATE_DETACHED, state_); - - if (state_ == STATE_UNINITIALIZED) { - pending_requests_.push_back(PendingRequest()); - PendingRequest& request = pending_requests_.back(); - request.id = request_id; - request.type = GET_SITES_WITH_DATA; - return; - } - - pending_responses_.insert(std::make_pair(request_id, GET_SITES_WITH_DATA)); - if (state_ == STATE_ERROR) { - NotifyErrorFromIOThread(); - return; - } - - IPC::Message* msg = new PpapiMsg_GetSitesWithData( - request_id, plugin_data_path_); - if (!channel_->Send(msg)) { - DLOG(ERROR) << "Couldn't send GetSitesWithData message"; - // A failure notification for the current request will be sent since - // |pending_responses_| has been updated. - NotifyErrorFromIOThread(); - } -} - -void PepperFlashSettingsManager::Core::ClearSiteDataOnIOThread( - uint32_t request_id, - const std::string& site, - uint64_t flags, - uint64_t max_age) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_NE(STATE_DETACHED, state_); - - if (state_ == STATE_UNINITIALIZED) { - pending_requests_.push_back(PendingRequest()); - PendingRequest& request = pending_requests_.back(); - request.id = request_id; - request.type = CLEAR_SITE_DATA; - request.site = site; - request.flags = flags; - request.max_age = max_age; - return; - } - - pending_responses_.insert(std::make_pair(request_id, CLEAR_SITE_DATA)); - if (state_ == STATE_ERROR) { - NotifyErrorFromIOThread(); - return; - } - - IPC::Message* msg = new PpapiMsg_ClearSiteData( - request_id, plugin_data_path_, site, flags, max_age); - if (!channel_->Send(msg)) { - DLOG(ERROR) << "Couldn't send ClearSiteData message"; - // A failure notification for the current request will be sent since - // |pending_responses_| has been updated. - NotifyErrorFromIOThread(); - } -} - -void PepperFlashSettingsManager::Core::DetachOnIOThread() { - state_ = STATE_DETACHED; -} - -void PepperFlashSettingsManager::Core::NotifyErrorFromIOThread() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (state_ == STATE_DETACHED) - return; - - state_ = STATE_ERROR; - std::vector> notifications; - for (auto iter = pending_requests_.begin(); iter != pending_requests_.end(); - ++iter) { - notifications.push_back(std::make_pair(iter->id, iter->type)); - } - pending_requests_.clear(); - notifications.insert(notifications.end(), pending_responses_.begin(), - pending_responses_.end()); - pending_responses_.clear(); - - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::NotifyError, this, notifications)); -} - -void PepperFlashSettingsManager::Core:: - NotifyDeauthorizeContentLicensesCompleted(uint32_t request_id, - bool success) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - if (manager_.get()) { - manager_->client_->OnDeauthorizeFlashContentLicensesCompleted(request_id, - success); - } -} - -void PepperFlashSettingsManager::Core::NotifyGetPermissionSettingsCompleted( - uint32_t request_id, - bool success, - PP_Flash_BrowserOperations_Permission default_permission, - const ppapi::FlashSiteSettings& sites) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - if (manager_.get()) { - manager_->client_->OnGetPermissionSettingsCompleted( - request_id, success, default_permission, sites); - } -} - -void PepperFlashSettingsManager::Core::NotifySetDefaultPermissionCompleted( - uint32_t request_id, - bool success) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - if (manager_.get()) { - manager_->client_->OnSetDefaultPermissionCompleted( - request_id, success); - } -} - -void PepperFlashSettingsManager::Core::NotifySetSitePermissionCompleted( - uint32_t request_id, - bool success) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - if (manager_.get()) { - manager_->client_->OnSetSitePermissionCompleted( - request_id, success); - } -} - -void PepperFlashSettingsManager::Core::NotifyGetSitesWithDataCompleted( - uint32_t request_id, - const std::vector& sites) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - if (manager_.get()) { - manager_->client_->OnGetSitesWithDataCompleted( - request_id, sites); - } -} - -void PepperFlashSettingsManager::Core::NotifyClearSiteDataCompleted( - uint32_t request_id, - bool success) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - if (manager_.get()) - manager_->client_->OnClearSiteDataCompleted(request_id, success); -} - -void PepperFlashSettingsManager::Core::NotifyError( - const std::vector>& notifications) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - scoped_refptr protector(this); - for (auto iter = notifications.begin(); iter != notifications.end(); ++iter) { - // Check |manager_| for each iteration in case it is destroyed in one of - // the callbacks. - if (!manager_.get()) - return; - - switch (iter->second) { - case INVALID_REQUEST_TYPE: - NOTREACHED(); - break; - case DEAUTHORIZE_CONTENT_LICENSES: - manager_->client_->OnDeauthorizeFlashContentLicensesCompleted( - iter->first, false); - break; - case GET_PERMISSION_SETTINGS: - manager_->client_->OnGetPermissionSettingsCompleted( - iter->first, false, PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT, - ppapi::FlashSiteSettings()); - break; - case SET_DEFAULT_PERMISSION: - manager_->client_->OnSetDefaultPermissionCompleted( - iter->first, false); - break; - case SET_SITE_PERMISSION: - manager_->client_->OnSetSitePermissionCompleted(iter->first, false); - break; - case GET_SITES_WITH_DATA: - manager_->client_->OnGetSitesWithDataCompleted( - iter->first, std::vector()); - break; - case CLEAR_SITE_DATA: - manager_->client_->OnClearSiteDataCompleted(iter->first, false); - break; - } - } - - if (manager_.get()) - manager_->OnError(this); -} - -void PepperFlashSettingsManager::Core::OnDeauthorizeContentLicensesResult( - uint32_t request_id, - bool success) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (state_ == STATE_DETACHED) - return; - - DLOG_IF(ERROR, !success) << "DeauthorizeContentLicenses returned error"; - - auto iter = pending_responses_.find(request_id); - if (iter == pending_responses_.end()) - return; - - DCHECK_EQ(iter->second, DEAUTHORIZE_CONTENT_LICENSES); - - pending_responses_.erase(iter); - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, - base::BindOnce(&Core::NotifyDeauthorizeContentLicensesCompleted, this, - request_id, success)); -} - -void PepperFlashSettingsManager::Core::OnGetPermissionSettingsResult( - uint32_t request_id, - bool success, - PP_Flash_BrowserOperations_Permission default_permission, - const ppapi::FlashSiteSettings& sites) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (state_ == STATE_DETACHED) - return; - - DLOG_IF(ERROR, !success) << "GetPermissionSettings returned error"; - - auto iter = pending_responses_.find(request_id); - if (iter == pending_responses_.end()) - return; - - DCHECK_EQ(iter->second, GET_PERMISSION_SETTINGS); - - pending_responses_.erase(iter); - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, - base::BindOnce(&Core::NotifyGetPermissionSettingsCompleted, this, - request_id, success, default_permission, sites)); -} - -void PepperFlashSettingsManager::Core::OnSetDefaultPermissionResult( - uint32_t request_id, - bool success) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (state_ == STATE_DETACHED) - return; - - DLOG_IF(ERROR, !success) << "SetDefaultPermission returned error"; - - auto iter = pending_responses_.find(request_id); - if (iter == pending_responses_.end()) - return; - - DCHECK_EQ(iter->second, SET_DEFAULT_PERMISSION); - - pending_responses_.erase(iter); - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::NotifySetDefaultPermissionCompleted, - this, request_id, success)); -} - -void PepperFlashSettingsManager::Core::OnSetSitePermissionResult( - uint32_t request_id, - bool success) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (state_ == STATE_DETACHED) - return; - - DLOG_IF(ERROR, !success) << "SetSitePermission returned error"; - - auto iter = pending_responses_.find(request_id); - if (iter == pending_responses_.end()) - return; - - DCHECK_EQ(iter->second, SET_SITE_PERMISSION); - - pending_responses_.erase(iter); - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::NotifySetSitePermissionCompleted, this, - request_id, success)); -} - -void PepperFlashSettingsManager::Core::OnGetSitesWithDataResult( - uint32_t request_id, - const std::vector& sites) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (state_ == STATE_DETACHED) - return; - - auto iter = pending_responses_.find(request_id); - if (iter == pending_responses_.end()) - return; - - DCHECK_EQ(iter->second, GET_SITES_WITH_DATA); - - pending_responses_.erase(iter); - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::NotifyGetSitesWithDataCompleted, this, - request_id, sites)); -} - -void PepperFlashSettingsManager::Core::OnClearSiteDataResult( - uint32_t request_id, - bool success) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (state_ == STATE_DETACHED) - return; - - DLOG_IF(ERROR, !success) << "ClearSiteData returned error"; - - auto iter = pending_responses_.find(request_id); - if (iter == pending_responses_.end()) - return; - - DCHECK_EQ(iter->second, CLEAR_SITE_DATA); - - pending_responses_.erase(iter); - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Core::NotifyClearSiteDataCompleted, this, - request_id, success)); -} - -PepperFlashSettingsManager::PepperFlashSettingsManager( - Client* client, - content::BrowserContext* browser_context) - : client_(client), browser_context_(browser_context), next_request_id_(1) { - DCHECK(client); - DCHECK(browser_context); -} - -PepperFlashSettingsManager::~PepperFlashSettingsManager() { - if (core_.get()) - core_->Detach(); -} - -// static -bool PepperFlashSettingsManager::IsPepperFlashInUse( - PluginPrefs* plugin_prefs, - content::WebPluginInfo* plugin_info) { - if (!plugin_prefs) - return false; - - content::PluginService* plugin_service = - content::PluginService::GetInstance(); - std::vector plugins; - plugin_service->GetPluginInfoArray( - GURL(), content::kFlashPluginSwfMimeType, false, &plugins, NULL); - - for (auto iter = plugins.begin(); iter != plugins.end(); ++iter) { - if (iter->is_pepper_plugin() && plugin_prefs->IsPluginEnabled(*iter)) { - if (plugin_info) - *plugin_info = *iter; - return true; - } - } - return false; -} - -// static -void PepperFlashSettingsManager::RegisterProfilePrefs( - user_prefs::PrefRegistrySyncable* registry) { - registry->RegisterBooleanPref(prefs::kPepperFlashSettingsEnabled, true); -} - -uint32_t PepperFlashSettingsManager::DeauthorizeContentLicenses( - PrefService* prefs) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - // Clear the device ID salt which has the effect of regenerating a device - // ID. Since this happens synchronously (and on the UI thread), we don't have - // to add it to a pending request. - prefs->ClearPref(prefs::kDRMSalt); - - EnsureCoreExists(); - uint32_t id = GetNextRequestId(); - core_->DeauthorizeContentLicenses(id); - return id; -} - -uint32_t PepperFlashSettingsManager::GetPermissionSettings( - PP_Flash_BrowserOperations_SettingType setting_type) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - EnsureCoreExists(); - uint32_t id = GetNextRequestId(); - core_->GetPermissionSettings(id, setting_type); - return id; -} - -uint32_t PepperFlashSettingsManager::SetDefaultPermission( - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - EnsureCoreExists(); - uint32_t id = GetNextRequestId(); - core_->SetDefaultPermission(id, setting_type, permission, - clear_site_specific); - return id; -} - -uint32_t PepperFlashSettingsManager::SetSitePermission( - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - EnsureCoreExists(); - uint32_t id = GetNextRequestId(); - core_->SetSitePermission(id, setting_type, sites); - return id; -} - -uint32_t PepperFlashSettingsManager::GetSitesWithData() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - EnsureCoreExists(); - uint32_t id = GetNextRequestId(); - core_->GetSitesWithData(id); - return id; -} - -uint32_t PepperFlashSettingsManager::ClearSiteData(const std::string& site, - uint64_t flags, - uint64_t max_age) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - EnsureCoreExists(); - uint32_t id = GetNextRequestId(); - core_->ClearSiteData(id, site, flags, max_age); - return id; -} - -uint32_t PepperFlashSettingsManager::GetNextRequestId() { - return next_request_id_++; -} - -void PepperFlashSettingsManager::EnsureCoreExists() { - if (!core_.get()) { - core_ = new Core(weak_ptr_factory_.GetWeakPtr(), browser_context_); - core_->Initialize(); - } -} - -void PepperFlashSettingsManager::OnError(Core* core) { - DCHECK(core); - if (core != core_.get()) - return; - - core_->Detach(); - core_.reset(); -} diff --git a/chrome/browser/pepper_flash_settings_manager.h b/chrome/browser/pepper_flash_settings_manager.h deleted file mode 100644 index 9cd2c5d16889c4..00000000000000 --- a/chrome/browser/pepper_flash_settings_manager.h +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) 2012 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_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ -#define CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ - -#include - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/memory/weak_ptr.h" -#include "ppapi/c/private/ppp_flash_browser_operations.h" -#include "ppapi/shared_impl/ppp_flash_browser_operations_shared.h" - -class PluginPrefs; -class PrefService; - -namespace content { -class BrowserContext; -struct WebPluginInfo; -} - -namespace user_prefs { -class PrefRegistrySyncable; -} - -// PepperFlashSettingsManager communicates with a PPAPI broker process to -// read/write Pepper Flash settings. -class PepperFlashSettingsManager { - public: - class Client { - public: - virtual ~Client() {} - - virtual void OnDeauthorizeFlashContentLicensesCompleted(uint32_t request_id, - bool success) {} - virtual void OnGetPermissionSettingsCompleted( - uint32_t request_id, - bool success, - PP_Flash_BrowserOperations_Permission default_permission, - const ppapi::FlashSiteSettings& sites) {} - - virtual void OnSetDefaultPermissionCompleted(uint32_t request_id, - bool success) {} - - virtual void OnSetSitePermissionCompleted(uint32_t request_id, - bool success) {} - - virtual void OnGetSitesWithDataCompleted( - uint32_t request_id, - const std::vector& sites) {} - - virtual void OnClearSiteDataCompleted(uint32_t request_id, bool success) {} - }; - - // |client| must outlive this object. It is guaranteed that |client| won't - // receive any notifications after this object goes away. - PepperFlashSettingsManager(Client* client, - content::BrowserContext* browser_context); - ~PepperFlashSettingsManager(); - - // |plugin_info| will be updated if it is not NULL and the method returns - // true. - static bool IsPepperFlashInUse(PluginPrefs* plugin_prefs, - content::WebPluginInfo* plugin_info); - - static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); - - // Requests to deauthorize content licenses. - // Client::OnDeauthorizeFlashContentLicensesCompleted() will be called when - // the operation is completed. - // The return value is the same as the request ID passed into - // Client::OnDeauthorizeFlashContentLicensesCompleted(). - uint32_t DeauthorizeContentLicenses(PrefService* prefs); - - // Gets permission settings. - // Client::OnGetPermissionSettingsCompleted() will be called when the - // operation is completed. - uint32_t GetPermissionSettings( - PP_Flash_BrowserOperations_SettingType setting_type); - - // Sets default permission. - // Client::OnSetDefaultPermissionCompleted() will be called when the - // operation is completed. - uint32_t SetDefaultPermission( - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific); - - // Sets site-specific permission. - // Client::OnSetSitePermissionCompleted() will be called when the operation - // is completed. - uint32_t SetSitePermission( - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites); - - // Gets a list of sites that have stored data. - // Client::OnGetSitesWithDataCompleted() will be called when the operation is - // completed. - uint32_t GetSitesWithData(); - - // Clears data for a certain site. - // Client::OnClearSiteDataompleted() will be called when the operation is - // completed. - uint32_t ClearSiteData(const std::string& site, - uint64_t flags, - uint64_t max_age); - - private: - // Core does most of the work. It is ref-counted so that its lifespan can be - // independent of the containing object's: - // - The manager can be deleted on the UI thread while the core still being - // used on the I/O thread. - // - The manager can delete the core when it encounters errors and create - // another one to handle new requests. - class Core; - - uint32_t GetNextRequestId(); - - void EnsureCoreExists(); - - // Notifies us that an error occurred in |core|. - void OnError(Core* core); - - // |client_| is not owned by this object and must outlive it. - Client* client_; - - // The browser context for the profile. - content::BrowserContext* browser_context_; - - scoped_refptr core_; - - uint32_t next_request_id_; - - base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(PepperFlashSettingsManager); -}; - -#endif // CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ diff --git a/chrome/browser/plugins/plugin_data_remover_helper.cc b/chrome/browser/plugins/plugin_data_remover_helper.cc deleted file mode 100644 index 0f7d6b78aefff1..00000000000000 --- a/chrome/browser/plugins/plugin_data_remover_helper.cc +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2012 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/browser/plugins/plugin_data_remover_helper.h" - -#include "chrome/browser/plugins/plugin_prefs.h" -#include "content/public/browser/plugin_data_remover.h" -#include "content/public/common/webplugininfo.h" - -// static -bool PluginDataRemoverHelper::IsSupported(PluginPrefs* plugin_prefs) { - std::vector plugins; - content::PluginDataRemover::GetSupportedPlugins(&plugins); - for (std::vector::const_iterator it = plugins.begin(); - it != plugins.end(); ++it) { - if (plugin_prefs->IsPluginEnabled(*it)) - return true; - } - return false; -} diff --git a/chrome/browser/plugins/plugin_data_remover_helper.h b/chrome/browser/plugins/plugin_data_remover_helper.h deleted file mode 100644 index 92eac319b866a1..00000000000000 --- a/chrome/browser/plugins/plugin_data_remover_helper.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2012 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_BROWSER_PLUGINS_PLUGIN_DATA_REMOVER_HELPER_H_ -#define CHROME_BROWSER_PLUGINS_PLUGIN_DATA_REMOVER_HELPER_H_ - -class PluginPrefs; - -class PluginDataRemoverHelper { - public: - // Like PluginDataRemover::IsSupported, but checks that the returned plugin - // is enabled by PluginPrefs. - static bool IsSupported(PluginPrefs* plugin_prefs); -}; - -#endif // CHROME_BROWSER_PLUGINS_PLUGIN_DATA_REMOVER_HELPER_H_ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 79e853cd1fa011..1576e232ba7ac1 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -192,7 +192,6 @@ #endif #if BUILDFLAG(ENABLE_PLUGINS) -#include "chrome/browser/pepper_flash_settings_manager.h" #include "chrome/browser/plugins/plugin_info_host_impl.h" #include "chrome/browser/plugins/plugins_resource_service.h" #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h" @@ -832,7 +831,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, #if BUILDFLAG(ENABLE_PLUGINS) DeviceIDFetcher::RegisterProfilePrefs(registry); - PepperFlashSettingsManager::RegisterProfilePrefs(registry); PluginInfoHostImpl::RegisterUserPrefs(registry); #endif diff --git a/chrome/browser/ui/views/collected_cookies_views.cc b/chrome/browser/ui/views/collected_cookies_views.cc index 951602a53d5c57..c57103d8961479 100644 --- a/chrome/browser/ui/views/collected_cookies_views.cc +++ b/chrome/browser/ui/views/collected_cookies_views.cc @@ -8,7 +8,6 @@ #include #include "base/macros.h" -#include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" #include "chrome/browser/browsing_data/cookies_tree_model.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/infobars/infobar_service.h" @@ -109,7 +108,7 @@ std::unique_ptr CreateCookiesTreeModel( shared_objects.local_storages(), shared_objects.session_storages(), shared_objects.appcaches(), shared_objects.indexed_dbs(), shared_objects.file_systems(), nullptr, shared_objects.service_workers(), - shared_objects.shared_workers(), shared_objects.cache_storages(), nullptr, + shared_objects.shared_workers(), shared_objects.cache_storages(), nullptr); return std::make_unique(std::move(container), nullptr); diff --git a/chrome/browser/ui/webui/cookies_tree_model_util.cc b/chrome/browser/ui/webui/cookies_tree_model_util.cc index 8d98f53e135891..f12d382118c72b 100644 --- a/chrome/browser/ui/webui/cookies_tree_model_util.cc +++ b/chrome/browser/ui/webui/cookies_tree_model_util.cc @@ -255,12 +255,6 @@ bool CookiesTreeModelUtil::GetCookieTreeNodeDictionary( usage_info.last_modified))); break; } - case CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO: { - dict->SetString(kKeyType, "flash_lso"); - - dict->SetString(kKeyDomain, node.GetDetailedInfo().flash_lso_domain); - break; - } case CookieTreeNode::DetailedInfo::TYPE_MEDIA_LICENSE: { dict->SetString(kKeyType, "media_license"); diff --git a/chrome/browser/ui/webui/settings/chromeos/calculator/size_calculator.cc b/chrome/browser/ui/webui/settings/chromeos/calculator/size_calculator.cc index 7c8d870bb91bc3..21bdb9b8d10174 100644 --- a/chrome/browser/ui/webui/settings/chromeos/calculator/size_calculator.cc +++ b/chrome/browser/ui/webui/settings/chromeos/calculator/size_calculator.cc @@ -11,7 +11,6 @@ #include "base/task/thread_pool.h" #include "base/values.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/chromeos/crostini/crostini_features.h" #include "chrome/browser/chromeos/file_manager/path_util.h" #include "chrome/browser/profiles/profile.h" @@ -184,8 +183,7 @@ void BrowsingDataSizeCalculator::PerformCalculation() { new browsing_data::ServiceWorkerHelper( storage_partition->GetServiceWorkerContext()), new browsing_data::CacheStorageHelper( - storage_partition->GetCacheStorageContext()), - BrowsingDataFlashLSOHelper::Create(profile_)); + storage_partition->GetCacheStorageContext())); } site_data_size_collector_->Fetch( base::BindOnce(&BrowsingDataSizeCalculator::OnGetBrowsingDataSize, diff --git a/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc b/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc index 602c0980873e70..6a9918dfa8736a 100644 --- a/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc +++ b/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc @@ -80,9 +80,6 @@ int GetCategoryLabelID(CookieTreeNode::DetailedInfo::NodeType node_type) { {CookieTreeNode::DetailedInfo::TYPE_CACHE_STORAGE, IDS_SETTINGS_COOKIES_CACHE_STORAGE}, - {CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO, - IDS_SETTINGS_COOKIES_FLASH_LSO}, - {CookieTreeNode::DetailedInfo::TYPE_MEDIA_LICENSES, IDS_SETTINGS_COOKIES_MEDIA_LICENSE}, {CookieTreeNode::DetailedInfo::TYPE_MEDIA_LICENSE, diff --git a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc index 3ddf0c9f5ef74a..fc70ad9cb1905a 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc @@ -19,7 +19,6 @@ #include "base/test/simple_test_clock.h" #include "base/values.h" #include "build/build_config.h" -#include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/test_extension_system.h" @@ -105,43 +104,6 @@ const struct PatternContentTypeTestCase { {{"http://127.0.0.1", "location"}, {true, ""}}, // Localhost is secure. {{"http://[::1]", "location"}, {true, ""}}}; -#if BUILDFLAG(ENABLE_PLUGINS) -// Waits until a change is observed in content settings. -class FlashContentSettingsChangeWaiter : public content_settings::Observer { - public: - explicit FlashContentSettingsChangeWaiter(Profile* profile) - : profile_(profile) { - HostContentSettingsMapFactory::GetForProfile(profile)->AddObserver(this); - } - FlashContentSettingsChangeWaiter(const FlashContentSettingsChangeWaiter&) = - delete; - FlashContentSettingsChangeWaiter& operator=( - const FlashContentSettingsChangeWaiter&) = delete; - ~FlashContentSettingsChangeWaiter() override { - HostContentSettingsMapFactory::GetForProfile(profile_)->RemoveObserver( - this); - } - - // content_settings::Observer: - void OnContentSettingChanged( - const ContentSettingsPattern& primary_pattern, - const ContentSettingsPattern& secondary_pattern, - ContentSettingsType content_type, - const std::string& resource_identifier) override { - if (content_type == ContentSettingsType::PLUGINS) - Proceed(); - } - - void Wait() { run_loop_.Run(); } - - private: - void Proceed() { run_loop_.Quit(); } - - Profile* profile_; - base::RunLoop run_loop_; -}; -#endif - std::string GenerateFakeAppId(const GURL& url) { return web_app::GenerateAppIdFromURL(url); } @@ -191,9 +153,7 @@ class SiteSettingsHandlerTest : public testing::Test { : kNotifications(site_settings::ContentSettingsTypeToGroupName( ContentSettingsType::NOTIFICATIONS)), kCookies(site_settings::ContentSettingsTypeToGroupName( - ContentSettingsType::COOKIES)), - kFlash(site_settings::ContentSettingsTypeToGroupName( - ContentSettingsType::PLUGINS)) { + ContentSettingsType::COOKIES)) { #if defined(OS_CHROMEOS) user_manager_enabler_ = std::make_unique( std::make_unique()); @@ -472,7 +432,6 @@ class SiteSettingsHandlerTest : public testing::Test { /*service_worker_helper=*/nullptr, /*data_shared_worker_helper=*/nullptr, /*cache_storage_helper=*/nullptr, - /*flash_lso_helper=*/nullptr, /*media_license_helper=*/nullptr); auto mock_cookies_tree_model = std::make_unique( std::move(container), profile()->GetExtensionSpecialStoragePolicy()); @@ -516,7 +475,6 @@ class SiteSettingsHandlerTest : public testing::Test { // Content setting group name for the relevant ContentSettingsType. const std::string kNotifications; const std::string kCookies; - const std::string kFlash; const ContentSettingsType kPermissionNotifications = ContentSettingsType::NOTIFICATIONS; @@ -571,7 +529,6 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) { get_all_sites_args.AppendString(kCallbackId); base::Value category_list(base::Value::Type::LIST); category_list.Append(kNotifications); - category_list.Append(kFlash); get_all_sites_args.Append(std::move(category_list)); // Test all sites is empty when there are no preferences. @@ -596,7 +553,8 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) { map->SetContentSettingDefaultScope(url1, url1, ContentSettingsType::NOTIFICATIONS, std::string(), CONTENT_SETTING_BLOCK); - map->SetContentSettingDefaultScope(url2, url2, ContentSettingsType::PLUGINS, + map->SetContentSettingDefaultScope(url2, url2, + ContentSettingsType::NOTIFICATIONS, std::string(), CONTENT_SETTING_ALLOW); handler()->HandleGetAllSites(&get_all_sites_args); @@ -624,7 +582,8 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) { // Add an additional exception belonging to a different eTLD+1. const GURL url3("https://example2.net"); - map->SetContentSettingDefaultScope(url3, url3, ContentSettingsType::PLUGINS, + map->SetContentSettingDefaultScope(url3, url3, + ContentSettingsType::NOTIFICATIONS, std::string(), CONTENT_SETTING_BLOCK); handler()->HandleGetAllSites(&get_all_sites_args); @@ -774,7 +733,6 @@ TEST_F(SiteSettingsHandlerTest, GetRecentSitePermissions) { get_recent_permissions_args.AppendString(kCallbackId); base::Value category_list(base::Value::Type::LIST); category_list.Append(kNotifications); - category_list.Append(kFlash); get_recent_permissions_args.Append(std::move(category_list)); get_recent_permissions_args.Append(3); @@ -839,26 +797,21 @@ TEST_F(SiteSettingsHandlerTest, GetRecentSitePermissions) { ASSERT_TRUE(data.arg2()->GetBool()); base::Value::ConstListView recent_permissions = data.arg3()->GetList(); - EXPECT_EQ(3UL, recent_permissions.size()); + EXPECT_EQ(2UL, recent_permissions.size()); EXPECT_EQ(url1.spec(), - recent_permissions[2].FindKey("origin")->GetString()); - EXPECT_EQ(url2.spec(), recent_permissions[1].FindKey("origin")->GetString()); EXPECT_EQ(url1.spec(), recent_permissions[0].FindKey("origin")->GetString()); EXPECT_TRUE(recent_permissions[0].FindKey("incognito")->GetBool()); EXPECT_FALSE(recent_permissions[1].FindKey("incognito")->GetBool()); - EXPECT_FALSE(recent_permissions[2].FindKey("incognito")->GetBool()); base::Value::ConstListView incognito_url1_permissions = recent_permissions[0].FindKey("recentPermissions")->GetList(); base::Value::ConstListView url1_permissions = - recent_permissions[2].FindKey("recentPermissions")->GetList(); - base::Value::ConstListView url2_permissions = recent_permissions[1].FindKey("recentPermissions")->GetList(); - EXPECT_EQ(2UL, incognito_url1_permissions.size()); + EXPECT_EQ(1UL, incognito_url1_permissions.size()); EXPECT_EQ(kNotifications, incognito_url1_permissions[0].FindKey("type")->GetString()); @@ -867,20 +820,9 @@ TEST_F(SiteSettingsHandlerTest, GetRecentSitePermissions) { EXPECT_EQ(kEmbargo, incognito_url1_permissions[0].FindKey("source")->GetString()); - EXPECT_EQ(kFlash, - incognito_url1_permissions[1].FindKey("type")->GetString()); - EXPECT_EQ(kAllowed, - incognito_url1_permissions[1].FindKey("setting")->GetString()); - EXPECT_EQ(kPreference, - incognito_url1_permissions[1].FindKey("source")->GetString()); - EXPECT_EQ(kNotifications, url1_permissions[0].FindKey("type")->GetString()); EXPECT_EQ(kBlocked, url1_permissions[0].FindKey("setting")->GetString()); EXPECT_EQ(kEmbargo, url1_permissions[0].FindKey("source")->GetString()); - - EXPECT_EQ(kFlash, url2_permissions[0].FindKey("type")->GetString()); - EXPECT_EQ(kAllowed, url2_permissions[0].FindKey("setting")->GetString()); - EXPECT_EQ(kPreference, url2_permissions[0].FindKey("source")->GetString()); } } @@ -1390,55 +1332,6 @@ TEST_F(SiteSettingsHandlerTest, GetAndSetOriginPermissions) { site_settings::SiteSettingSource::kDefault, 4U); } -#if BUILDFLAG(ENABLE_PLUGINS) -TEST_F(SiteSettingsHandlerTest, ChangingFlashSettingForSiteIsRemembered) { - ChromePluginServiceFilter::GetInstance()->RegisterProfile(profile()); - FlashContentSettingsChangeWaiter waiter(profile()); - - const std::string origin_with_port("https://www.example.com:443"); - // The display name won't show the port if it's default for that scheme. - const std::string origin("https://www.example.com"); - base::ListValue get_args; - get_args.AppendString(kCallbackId); - get_args.AppendString(origin_with_port); - const GURL url(origin_with_port); - - HostContentSettingsMap* map = - HostContentSettingsMapFactory::GetForProfile(profile()); - // Make sure the site being tested doesn't already have this marker set. - EXPECT_EQ(nullptr, - map->GetWebsiteSetting(url, url, ContentSettingsType::PLUGINS_DATA, - std::string(), nullptr)); - - // Change the Flash setting. - base::ListValue set_args; - set_args.AppendString(origin_with_port); - { - auto category_list = std::make_unique(); - category_list->AppendString(kFlash); - set_args.Append(std::move(category_list)); - } - set_args.AppendString( - content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK)); - handler()->HandleSetOriginPermissions(&set_args); - EXPECT_EQ(1U, web_ui()->call_data().size()); - waiter.Wait(); - - // Check that this site has now been marked for displaying Flash always, then - // clear it and check this works. - EXPECT_NE(nullptr, - map->GetWebsiteSetting(url, url, ContentSettingsType::PLUGINS_DATA, - std::string(), nullptr)); - base::ListValue clear_args; - clear_args.AppendString(origin_with_port); - handler()->HandleSetOriginPermissions(&set_args); - handler()->HandleClearFlashPref(&clear_args); - EXPECT_EQ(nullptr, - map->GetWebsiteSetting(url, url, ContentSettingsType::PLUGINS_DATA, - std::string(), nullptr)); -} -#endif - TEST_F(SiteSettingsHandlerTest, GetAndSetForInvalidURLs) { const std::string origin("arbitrary string"); EXPECT_FALSE(GURL(origin).is_valid()); diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc index fa4a67b6e10244..fd7a31ed1e597a 100644 --- a/chrome/test/ppapi/ppapi_browsertest.cc +++ b/chrome/test/ppapi/ppapi_browsertest.cc @@ -191,75 +191,6 @@ using content::RenderViewHost; // Interface tests. // -// Flaky, http://crbug.com/111355 -TEST_PPAPI_OUT_OF_PROCESS(DISABLED_Broker) - -IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Accept) { - // Accepting the infobar should grant permission to access the PPAPI broker. - InfoBarObserver observer(this); - observer.ExpectInfoBarAndAccept(true); - - // PPB_Broker_Trusted::IsAllowed should return false before the infobar is - // popped and true after the infobar is popped. - RunTest("Broker_IsAllowedPermissionDenied"); - RunTest("Broker_ConnectPermissionGranted"); - RunTest("Broker_IsAllowedPermissionGranted"); - - // It should also set a content settings exception for the site. - GURL url = GetTestFileUrl("Broker_ConnectPermissionGranted"); - HostContentSettingsMap* content_settings = - HostContentSettingsMapFactory::GetForProfile(browser()->profile()); - EXPECT_EQ(CONTENT_SETTING_ALLOW, - content_settings->GetContentSetting( - url, url, ContentSettingsType::PPAPI_BROKER, std::string())); -} - -IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Deny) { - // Canceling the infobar should deny permission to access the PPAPI broker. - InfoBarObserver observer(this); - observer.ExpectInfoBarAndAccept(false); - - // PPB_Broker_Trusted::IsAllowed should return false before and after the - // infobar is popped. - RunTest("Broker_IsAllowedPermissionDenied"); - RunTest("Broker_ConnectPermissionDenied"); - RunTest("Broker_IsAllowedPermissionDenied"); - - // It should also set a content settings exception for the site. - GURL url = GetTestFileUrl("Broker_ConnectPermissionDenied"); - HostContentSettingsMap* content_settings = - HostContentSettingsMapFactory::GetForProfile(browser()->profile()); - EXPECT_EQ(CONTENT_SETTING_BLOCK, - content_settings->GetContentSetting( - url, url, ContentSettingsType::PPAPI_BROKER, std::string())); -} - -IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Blocked) { - // Block access to the PPAPI broker. - HostContentSettingsMapFactory::GetForProfile(browser()->profile()) - ->SetDefaultContentSetting(ContentSettingsType::PPAPI_BROKER, - CONTENT_SETTING_BLOCK); - - // We shouldn't see an infobar. - InfoBarObserver observer(this); - - RunTest("Broker_ConnectPermissionDenied"); - RunTest("Broker_IsAllowedPermissionDenied"); -} - -IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Allowed) { - // Always allow access to the PPAPI broker. - HostContentSettingsMapFactory::GetForProfile(browser()->profile()) - ->SetDefaultContentSetting(ContentSettingsType::PPAPI_BROKER, - CONTENT_SETTING_ALLOW); - - // We shouldn't see an infobar. - InfoBarObserver observer(this); - - RunTest("Broker_ConnectPermissionGranted"); - RunTest("Broker_IsAllowedPermissionGranted"); -} - // Flaky on Windows https://crbug.com/1059468 #if !defined(OS_WIN) || !defined(ARCH_CPU_32_BITS) TEST_PPAPI_NACL(Console) diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index ea3dbb364ece87..88312d566ec15a 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -2304,12 +2304,8 @@ source_set("browser") { "media/session/pepper_playback_observer.h", "media/session/pepper_player_delegate.cc", "media/session/pepper_player_delegate.h", - "pepper_flash_settings_helper_impl.cc", - "pepper_flash_settings_helper_impl.h", "plugin_content_origin_allowlist.cc", "plugin_content_origin_allowlist.h", - "plugin_data_remover_impl.cc", - "plugin_data_remover_impl.h", "plugin_list.cc", "plugin_list.h", "plugin_private_storage_helper.cc", diff --git a/content/browser/pepper_flash_settings_helper_impl.cc b/content/browser/pepper_flash_settings_helper_impl.cc deleted file mode 100644 index 691edbe68baa7f..00000000000000 --- a/content/browser/pepper_flash_settings_helper_impl.cc +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2012 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 "content/browser/pepper_flash_settings_helper_impl.h" - -#include "base/files/file_path.h" -#include "content/browser/plugin_service_impl.h" -#include "content/public/browser/browser_thread.h" -#include "ipc/ipc_channel_handle.h" - -namespace content { - -// static -scoped_refptr PepperFlashSettingsHelper::Create() { - return new PepperFlashSettingsHelperImpl(); -} - -PepperFlashSettingsHelperImpl::PepperFlashSettingsHelperImpl() { -} - -PepperFlashSettingsHelperImpl::~PepperFlashSettingsHelperImpl() { -} - -void PepperFlashSettingsHelperImpl::OpenChannelToBroker( - const base::FilePath& path, - OpenChannelCallback callback) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - - if (!callback) - return; - if (callback_) - std::move(callback).Run(false, IPC::ChannelHandle()); - - // Balanced in OnPpapiChannelOpened(). We need to keep this object around - // until then. - AddRef(); - - callback_ = std::move(callback); - PluginServiceImpl* plugin_service = PluginServiceImpl::GetInstance(); - plugin_service->OpenChannelToPpapiBroker(0, 0, path, this); -} - -void PepperFlashSettingsHelperImpl::GetPpapiChannelInfo( - base::ProcessHandle* renderer_handle, - int* renderer_id) { - *renderer_handle = base::kNullProcessHandle; - *renderer_id = 0; -} - -void PepperFlashSettingsHelperImpl::OnPpapiChannelOpened( - const IPC::ChannelHandle& channel_handle, - base::ProcessId /* plugin_pid */, - int /* plugin_child_id */) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK(callback_); - - if (channel_handle.is_mojo_channel_handle()) - std::move(callback_).Run(true, channel_handle); - else - std::move(callback_).Run(false, IPC::ChannelHandle()); - - // Balance the AddRef() call in Initialize(). - Release(); -} - -bool PepperFlashSettingsHelperImpl::Incognito() { - return false; -} - -} // namespace content diff --git a/content/browser/pepper_flash_settings_helper_impl.h b/content/browser/pepper_flash_settings_helper_impl.h deleted file mode 100644 index e121732da53620..00000000000000 --- a/content/browser/pepper_flash_settings_helper_impl.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2012 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 CONTENT_BROWSER_PEPPER_FLASH_SETTINGS_HELPER_IMPL_H_ -#define CONTENT_BROWSER_PEPPER_FLASH_SETTINGS_HELPER_IMPL_H_ - -#include "base/compiler_specific.h" -#include "base/macros.h" -#include "content/browser/ppapi_plugin_process_host.h" -#include "content/public/browser/pepper_flash_settings_helper.h" - -namespace content { - -class CONTENT_EXPORT PepperFlashSettingsHelperImpl - : public PepperFlashSettingsHelper, - public PpapiPluginProcessHost::BrokerClient { - public: - PepperFlashSettingsHelperImpl(); - - // PepperFlashSettingsHelper implementation. - void OpenChannelToBroker(const base::FilePath& path, - OpenChannelCallback callback) override; - - // PpapiPluginProcessHost::BrokerClient implementation. - void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, - int* renderer_id) override; - void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, - base::ProcessId plugin_pid, - int plugin_child_id) override; - bool Incognito() override; - - protected: - ~PepperFlashSettingsHelperImpl() override; - - private: - OpenChannelCallback callback_; - DISALLOW_COPY_AND_ASSIGN(PepperFlashSettingsHelperImpl); -}; - -} // namespace content - -#endif // CONTENT_BROWSER_PEPPER_FLASH_SETTINGS_HELPER_IMPL_H_ diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc deleted file mode 100644 index 7bead7f2a0b66d..00000000000000 --- a/content/browser/plugin_data_remover_impl.cc +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) 2012 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 "content/browser/plugin_data_remover_impl.h" - -#include - -#include - -#include "base/bind.h" -#include "base/sequenced_task_runner_helpers.h" -#include "base/strings/utf_string_conversions.h" -#include "base/synchronization/waitable_event.h" -#include "base/version.h" -#include "build/build_config.h" -#include "content/browser/plugin_service_impl.h" -#include "content/common/child_process_host_impl.h" -#include "content/public/browser/browser_context.h" -#include "content/public/browser/browser_task_traits.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/common/child_process_host.h" -#include "content/public/common/content_constants.h" -#include "content/public/common/pepper_plugin_info.h" -#include "ppapi/proxy/ppapi_messages.h" - -namespace content { - -namespace { - -// The minimum Flash Player version that implements NPP_ClearSiteData. -const char kMinFlashVersion[] = "10.3"; -const int64_t kRemovalTimeoutMs = 10000; -const uint64_t kClearAllData = 0; - -} // namespace - -// static -PluginDataRemover* PluginDataRemover::Create(BrowserContext* browser_context) { - return new PluginDataRemoverImpl(browser_context); -} - -// static -void PluginDataRemover::GetSupportedPlugins( - std::vector* supported_plugins) { - bool allow_wildcard = false; - std::vector plugins; - PluginService::GetInstance()->GetPluginInfoArray( - GURL(), kFlashPluginSwfMimeType, allow_wildcard, &plugins, nullptr); - base::Version min_version(kMinFlashVersion); - for (auto it = plugins.begin(); it != plugins.end(); ++it) { - base::Version version; - WebPluginInfo::CreateVersionFromString(it->version, &version); - if (version.IsValid() && min_version.CompareTo(version) == -1) - supported_plugins->push_back(*it); - } -} - -class PluginDataRemoverImpl::Context - : public PpapiPluginProcessHost::BrokerClient, - public IPC::Listener, - public base::RefCountedThreadSafe { - public: - Context(base::Time begin_time, BrowserContext* browser_context) - : event_(new base::WaitableEvent( - base::WaitableEvent::ResetPolicy::MANUAL, - base::WaitableEvent::InitialState::NOT_SIGNALED)), - begin_time_(begin_time), - is_removing_(false), - browser_context_path_(browser_context->GetPath()) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - } - - void Init(const std::string& mime_type) { - GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&Context::InitOnIOThread, this, mime_type)); - GetIOThreadTaskRunner({})->PostDelayedTask( - FROM_HERE, base::BindOnce(&Context::OnTimeout, this), - base::TimeDelta::FromMilliseconds(kRemovalTimeoutMs)); - } - - void InitOnIOThread(const std::string& mime_type) { - PluginServiceImpl* plugin_service = PluginServiceImpl::GetInstance(); - - // Get the plugin file path. - std::vector plugins; - plugin_service->GetPluginInfoArray(GURL(), mime_type, false, &plugins, - nullptr); - - if (plugins.empty()) { - // May be empty for some tests and on the CrOS login OOBE screen. - event_->Signal(); - return; - } - - base::FilePath plugin_path = plugins[0].path; - - const PepperPluginInfo* pepper_info = - plugin_service->GetRegisteredPpapiPluginInfo(plugin_path); - if (!pepper_info) { - event_->Signal(); - return; - } - - DCHECK_CURRENTLY_ON(BrowserThread::IO); - is_removing_ = true; - - // Balanced in OnPpapiChannelOpened. - AddRef(); - plugin_name_ = pepper_info->name; - // Use the broker since we run this function outside the sandbox. - plugin_service->OpenChannelToPpapiBroker(0, 0, plugin_path, this); - } - - // Called when a timeout happens in order not to block the client - // indefinitely. - void OnTimeout() { - LOG_IF(ERROR, is_removing_) << "Timed out"; - SignalDone(); - } - - bool Incognito() override { return false; } - - // PpapiPluginProcessHost::BrokerClient implementation. - void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, - int* renderer_id) override { - *renderer_handle = base::kNullProcessHandle; - *renderer_id = 0; - } - - void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, - base::ProcessId /* peer_pid */, - int /* child_id */) override { - if (channel_handle.is_mojo_channel_handle()) - ConnectToChannel(channel_handle); - - // Balancing the AddRef call. - Release(); - } - - // IPC::Listener methods. - bool OnMessageReceived(const IPC::Message& message) override { - IPC_BEGIN_MESSAGE_MAP(Context, message) - IPC_MESSAGE_HANDLER(PpapiHostMsg_ClearSiteDataResult, - OnPpapiClearSiteDataResult) - IPC_MESSAGE_UNHANDLED_ERROR() - IPC_END_MESSAGE_MAP() - - return true; - } - - void OnChannelError() override { - if (is_removing_) { - NOTREACHED() << "Channel error"; - SignalDone(); - } - } - - base::WaitableEvent* event() { return event_.get(); } - - private: - friend struct BrowserThread::DeleteOnThread; - friend class base::DeleteHelper; - ~Context() override {} - - IPC::Message* CreatePpapiClearSiteDataMsg(uint64_t max_age) { - base::FilePath profile_path = - browser_context_path_.Append(kPepperDataDirname); - // TODO(vtl): This "duplicates" logic in webkit/plugins/ppapi/file_path.cc - // (which prepends the plugin name to the relative part of the path - // instead, with the absolute, profile-dependent part being enforced by - // the browser). -#if defined(OS_WIN) - base::FilePath plugin_data_path = - profile_path.Append(base::FilePath(base::UTF8ToUTF16(plugin_name_))); -#else - base::FilePath plugin_data_path = - profile_path.Append(base::FilePath(plugin_name_)); -#endif // defined(OS_WIN) - return new PpapiMsg_ClearSiteData(0u, plugin_data_path, std::string(), - kClearAllData, max_age); - } - - // Connects the client side of a newly opened plugin channel. - void ConnectToChannel(const IPC::ChannelHandle& handle) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - - // If we timed out, don't bother connecting. - if (!is_removing_) - return; - - DCHECK(!channel_.get()); - channel_ = IPC::Channel::CreateClient(handle, this, - base::ThreadTaskRunnerHandle::Get()); - if (!channel_->Connect()) { - NOTREACHED() << "Couldn't connect to plugin"; - SignalDone(); - return; - } - - uint64_t max_age = begin_time_.is_null() - ? std::numeric_limits::max() - : (base::Time::Now() - begin_time_).InSeconds(); - - IPC::Message* msg = CreatePpapiClearSiteDataMsg(max_age); - if (!channel_->Send(msg)) { - NOTREACHED() << "Couldn't send ClearSiteData message"; - SignalDone(); - return; - } - } - - // Handles the PpapiHostMsg_ClearSiteDataResult message. - void OnPpapiClearSiteDataResult(uint32_t request_id, bool success) { - DCHECK_EQ(0u, request_id); - LOG_IF(ERROR, !success) << "ClearSiteData returned error"; - SignalDone(); - } - - // Signals that we are finished with removing data (successful or not). This - // method is safe to call multiple times. - void SignalDone() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!is_removing_) - return; - is_removing_ = false; - event_->Signal(); - } - - std::unique_ptr event_; - // The point in time from which on we remove data. - base::Time begin_time_; - bool is_removing_; - - // Path for the current profile. Must be retrieved on the UI thread from the - // browser context when we start so we can use it later on the I/O thread. - base::FilePath browser_context_path_; - - // The name of the plugin. Use only on the I/O thread. - std::string plugin_name_; - - // The channel is NULL until we have opened a connection to the plugin - // process. - std::unique_ptr channel_; -}; - - -PluginDataRemoverImpl::PluginDataRemoverImpl(BrowserContext* browser_context) - : mime_type_(kFlashPluginSwfMimeType), - browser_context_(browser_context) { -} - -PluginDataRemoverImpl::~PluginDataRemoverImpl() { -} - -base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( - base::Time begin_time) { - DCHECK(!context_.get()); - context_ = new Context(begin_time, browser_context_); - context_->Init(mime_type_); - return context_->event(); -} - -} // namespace content diff --git a/content/browser/plugin_data_remover_impl.h b/content/browser/plugin_data_remover_impl.h deleted file mode 100644 index 7baa087c963170..00000000000000 --- a/content/browser/plugin_data_remover_impl.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2012 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 CONTENT_BROWSER_PLUGIN_DATA_REMOVER_IMPL_H_ -#define CONTENT_BROWSER_PLUGIN_DATA_REMOVER_IMPL_H_ - -#include - -#include "base/compiler_specific.h" -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/time/time.h" -#include "content/public/browser/plugin_data_remover.h" - -namespace content { - -class CONTENT_EXPORT PluginDataRemoverImpl : public PluginDataRemover { - public: - explicit PluginDataRemoverImpl(BrowserContext* browser_context); - ~PluginDataRemoverImpl() override; - - // PluginDataRemover implementation: - base::WaitableEvent* StartRemoving(base::Time begin_time) override; - - // The plugin whose data should be removed (usually Flash) is specified via - // its MIME type. This method sets a different MIME type in order to call a - // different plugin (for example in tests). - void set_mime_type(const std::string& mime_type) { mime_type_ = mime_type; } - - private: - class Context; - - std::string mime_type_; - - // The browser context for the profile. - BrowserContext* browser_context_; - - // This allows this object to be deleted on the UI thread while it's still - // being used on the IO thread. - scoped_refptr context_; - - DISALLOW_COPY_AND_ASSIGN(PluginDataRemoverImpl); -}; - -} // namespace content - -#endif // CONTENT_BROWSER_PLUGIN_DATA_REMOVER_IMPL_H_ diff --git a/content/ppapi_plugin/BUILD.gn b/content/ppapi_plugin/BUILD.gn index e1966704d411a4..48c2a73912b1c7 100644 --- a/content/ppapi_plugin/BUILD.gn +++ b/content/ppapi_plugin/BUILD.gn @@ -27,8 +27,6 @@ source_set("ppapi_plugin_sources") { ] sources = [ - "broker_process_dispatcher.cc", - "broker_process_dispatcher.h", "plugin_process_dispatcher.cc", "plugin_process_dispatcher.h", "ppapi_blink_platform_impl.cc", diff --git a/content/ppapi_plugin/broker_process_dispatcher.cc b/content/ppapi_plugin/broker_process_dispatcher.cc deleted file mode 100644 index 629394972a9c1f..00000000000000 --- a/content/ppapi_plugin/broker_process_dispatcher.cc +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) 2012 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 "content/ppapi_plugin/broker_process_dispatcher.h" - -#include - -#include - -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "base/strings/utf_string_conversions.h" -#include "build/build_config.h" -#include "content/child/child_process.h" -#include "ppapi/c/pp_bool.h" -#include "ppapi/c/private/ppp_flash_browser_operations.h" -#include "ppapi/proxy/ppapi_messages.h" - -namespace content { -namespace { - -// How long we wait before releasing the broker process. -const int kBrokerReleaseTimeSeconds = 30; - -std::string ConvertPluginDataPath(const base::FilePath& plugin_data_path) { - // The string is always 8-bit, convert on Windows. -#if defined(OS_WIN) - return base::WideToUTF8(plugin_data_path.value()); -#else - return plugin_data_path.value(); -#endif -} - -struct GetPermissionSettingsContext { - GetPermissionSettingsContext( - const base::WeakPtr in_dispatcher, - uint32_t in_request_id) - : dispatcher(in_dispatcher), request_id(in_request_id) {} - - base::WeakPtr dispatcher; - uint32_t request_id; -}; - -void GetPermissionSettingsCallback( - void* user_data, - PP_Bool success, - PP_Flash_BrowserOperations_Permission default_permission, - uint32_t site_count, - const PP_Flash_BrowserOperations_SiteSetting sites[]) { - std::unique_ptr context( - reinterpret_cast(user_data)); - - if (!context->dispatcher.get()) - return; - - ppapi::FlashSiteSettings site_vector; - if (success) { - site_vector.reserve(site_count); - for (uint32_t i = 0; i < site_count; ++i) { - if (!sites[i].site) { - success = PP_FALSE; - break; - } - site_vector.push_back( - ppapi::FlashSiteSetting(sites[i].site, sites[i].permission)); - } - - if (!success) - site_vector.clear(); - } - context->dispatcher->OnGetPermissionSettingsCompleted( - context->request_id, PP_ToBool(success), default_permission, site_vector); -} - -} // namespace - -BrokerProcessDispatcher::BrokerProcessDispatcher( - PP_GetInterface_Func get_plugin_interface, - PP_ConnectInstance_Func connect_instance, - bool peer_is_browser) - : ppapi::proxy::BrokerSideDispatcher(connect_instance), - get_plugin_interface_(get_plugin_interface), - flash_browser_operations_1_3_(nullptr), - flash_browser_operations_1_2_(nullptr), - flash_browser_operations_1_0_(nullptr), - peer_is_browser_(peer_is_browser) { - if (get_plugin_interface) { - flash_browser_operations_1_0_ = - static_cast( - get_plugin_interface_(PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_0)); - - flash_browser_operations_1_2_ = - static_cast( - get_plugin_interface_(PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_2)); - - flash_browser_operations_1_3_ = - static_cast( - get_plugin_interface_(PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_3)); - } -} - -BrokerProcessDispatcher::~BrokerProcessDispatcher() { - DVLOG(1) << "BrokerProcessDispatcher::~BrokerProcessDispatcher()"; - // Don't free the process right away. This timer allows the child process - // to be re-used if the user rapidly goes to a new page that requires this - // plugin. This is the case for common plugins where they may be used on a - // source and destination page of a navigation. We don't want to tear down - // and re-start processes each time in these cases. - process_ref_.ReleaseWithDelay( - base::TimeDelta::FromSeconds(kBrokerReleaseTimeSeconds)); -} - -bool BrokerProcessDispatcher::OnMessageReceived(const IPC::Message& msg) { - if (BrokerSideDispatcher::OnMessageReceived(msg)) - return true; - - if (!peer_is_browser_) { - // We might want to consider killing the peer instead is we see problems in - // the future. - return false; - } - - bool handled = true; - IPC_BEGIN_MESSAGE_MAP(BrokerProcessDispatcher, msg) - IPC_MESSAGE_HANDLER(PpapiMsg_GetSitesWithData, OnGetSitesWithData) - IPC_MESSAGE_HANDLER(PpapiMsg_ClearSiteData, OnClearSiteData) - IPC_MESSAGE_HANDLER(PpapiMsg_DeauthorizeContentLicenses, - OnDeauthorizeContentLicenses) - IPC_MESSAGE_HANDLER(PpapiMsg_GetPermissionSettings, - OnGetPermissionSettings) - IPC_MESSAGE_HANDLER(PpapiMsg_SetDefaultPermission, OnSetDefaultPermission) - IPC_MESSAGE_HANDLER(PpapiMsg_SetSitePermission, OnSetSitePermission) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() - return handled; -} - -void BrokerProcessDispatcher::OnGetPermissionSettingsCompleted( - uint32_t request_id, - bool success, - PP_Flash_BrowserOperations_Permission default_permission, - const ppapi::FlashSiteSettings& sites) { - Send(new PpapiHostMsg_GetPermissionSettingsResult( - request_id, success, default_permission, sites)); -} - -void BrokerProcessDispatcher::OnGetSitesWithData( - uint32_t request_id, - const base::FilePath& plugin_data_path) { - std::vector sites; - GetSitesWithData(plugin_data_path, &sites); - Send(new PpapiHostMsg_GetSitesWithDataResult(request_id, sites)); -} - -void BrokerProcessDispatcher::OnClearSiteData( - uint32_t request_id, - const base::FilePath& plugin_data_path, - const std::string& site, - uint64_t flags, - uint64_t max_age) { - Send(new PpapiHostMsg_ClearSiteDataResult( - request_id, ClearSiteData(plugin_data_path, site, flags, max_age))); -} - -void BrokerProcessDispatcher::OnDeauthorizeContentLicenses( - uint32_t request_id, - const base::FilePath& plugin_data_path) { - Send(new PpapiHostMsg_DeauthorizeContentLicensesResult( - request_id, DeauthorizeContentLicenses(plugin_data_path))); -} - -void BrokerProcessDispatcher::OnGetPermissionSettings( - uint32_t request_id, - const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type) { - if (flash_browser_operations_1_3_) { - std::string data_str = ConvertPluginDataPath(plugin_data_path); - // The GetPermissionSettingsContext object will be deleted in - // GetPermissionSettingsCallback(). - flash_browser_operations_1_3_->GetPermissionSettings( - data_str.c_str(), setting_type, &GetPermissionSettingsCallback, - new GetPermissionSettingsContext(AsWeakPtr(), request_id)); - return; - } - - if (flash_browser_operations_1_2_) { - std::string data_str = ConvertPluginDataPath(plugin_data_path); - // The GetPermissionSettingsContext object will be deleted in - // GetPermissionSettingsCallback(). - flash_browser_operations_1_2_->GetPermissionSettings( - data_str.c_str(), setting_type, &GetPermissionSettingsCallback, - new GetPermissionSettingsContext(AsWeakPtr(), request_id)); - return; - } - - OnGetPermissionSettingsCompleted( - request_id, false, PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT, - ppapi::FlashSiteSettings()); - return; -} - -void BrokerProcessDispatcher::OnSetDefaultPermission( - uint32_t request_id, - const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific) { - Send(new PpapiHostMsg_SetDefaultPermissionResult( - request_id, - SetDefaultPermission(plugin_data_path, setting_type, permission, - clear_site_specific))); -} - -void BrokerProcessDispatcher::OnSetSitePermission( - uint32_t request_id, - const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites) { - Send(new PpapiHostMsg_SetSitePermissionResult( - request_id, SetSitePermission(plugin_data_path, setting_type, sites))); -} - -void BrokerProcessDispatcher::GetSitesWithData( - const base::FilePath& plugin_data_path, - std::vector* site_vector) { - std::string data_str = ConvertPluginDataPath(plugin_data_path); - if (flash_browser_operations_1_3_) { - char** sites = nullptr; - flash_browser_operations_1_3_->GetSitesWithData(data_str.c_str(), &sites); - if (!sites) - return; - - for (size_t i = 0; sites[i]; ++i) - site_vector->push_back(sites[i]); - - flash_browser_operations_1_3_->FreeSiteList(sites); - } -} - -bool BrokerProcessDispatcher::ClearSiteData( - const base::FilePath& plugin_data_path, - const std::string& site, - uint64_t flags, - uint64_t max_age) { - std::string data_str = ConvertPluginDataPath(plugin_data_path); - if (flash_browser_operations_1_3_) { - flash_browser_operations_1_3_->ClearSiteData( - data_str.c_str(), site.empty() ? nullptr : site.c_str(), flags, - max_age); - return true; - } - - // TODO(viettrungluu): Remove this (and the 1.0 interface) sometime after M21 - // goes to Stable. - if (flash_browser_operations_1_2_) { - flash_browser_operations_1_2_->ClearSiteData( - data_str.c_str(), site.empty() ? nullptr : site.c_str(), flags, - max_age); - return true; - } - - if (flash_browser_operations_1_0_) { - flash_browser_operations_1_0_->ClearSiteData( - data_str.c_str(), site.empty() ? nullptr : site.c_str(), flags, - max_age); - return true; - } - - return false; -} - -bool BrokerProcessDispatcher::DeauthorizeContentLicenses( - const base::FilePath& plugin_data_path) { - if (flash_browser_operations_1_3_) { - std::string data_str = ConvertPluginDataPath(plugin_data_path); - return PP_ToBool(flash_browser_operations_1_3_->DeauthorizeContentLicenses( - data_str.c_str())); - } - - if (flash_browser_operations_1_2_) { - std::string data_str = ConvertPluginDataPath(plugin_data_path); - return PP_ToBool(flash_browser_operations_1_2_->DeauthorizeContentLicenses( - data_str.c_str())); - } - - return false; -} - -bool BrokerProcessDispatcher::SetDefaultPermission( - const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific) { - if (flash_browser_operations_1_3_) { - std::string data_str = ConvertPluginDataPath(plugin_data_path); - return PP_ToBool(flash_browser_operations_1_3_->SetDefaultPermission( - data_str.c_str(), setting_type, permission, - PP_FromBool(clear_site_specific))); - } - - if (flash_browser_operations_1_2_) { - std::string data_str = ConvertPluginDataPath(plugin_data_path); - return PP_ToBool(flash_browser_operations_1_2_->SetDefaultPermission( - data_str.c_str(), setting_type, permission, - PP_FromBool(clear_site_specific))); - } - - return false; -} - -bool BrokerProcessDispatcher::SetSitePermission( - const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites) { - if (sites.empty()) - return true; - - std::string data_str = ConvertPluginDataPath(plugin_data_path); - std::unique_ptr site_array( - new PP_Flash_BrowserOperations_SiteSetting[sites.size()]); - - for (size_t i = 0; i < sites.size(); ++i) { - site_array[i].site = sites[i].site.c_str(); - site_array[i].permission = sites[i].permission; - } - - if (flash_browser_operations_1_3_) { - PP_Bool result = flash_browser_operations_1_3_->SetSitePermission( - data_str.c_str(), setting_type, - static_cast(sites.size()), site_array.get()); - - return PP_ToBool(result); - } - - if (flash_browser_operations_1_2_) { - PP_Bool result = flash_browser_operations_1_2_->SetSitePermission( - data_str.c_str(), setting_type, - static_cast(sites.size()), site_array.get()); - - return PP_ToBool(result); - } - - return false; -} - -} // namespace content diff --git a/content/ppapi_plugin/broker_process_dispatcher.h b/content/ppapi_plugin/broker_process_dispatcher.h deleted file mode 100644 index 95401dd02375dd..00000000000000 --- a/content/ppapi_plugin/broker_process_dispatcher.h +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2012 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 CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ -#define CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ - -#include - -#include "base/macros.h" -#include "base/memory/weak_ptr.h" -#include "content/child/scoped_child_process_reference.h" -#include "ppapi/c/ppp.h" -#include "ppapi/proxy/broker_dispatcher.h" -#include "ppapi/shared_impl/ppp_flash_browser_operations_shared.h" - -namespace content { - -// Wrapper around a BrokerDispatcher that provides the necessary integration -// for plugin process management. This class is to avoid direct dependencies -// from the PPAPI proxy on the Chrome multiprocess infrastructure. -class BrokerProcessDispatcher - : public ppapi::proxy::BrokerSideDispatcher, - public base::SupportsWeakPtr { - public: - BrokerProcessDispatcher(PP_GetInterface_Func get_plugin_interface, - PP_ConnectInstance_Func connect_instance, - bool peer_is_browser); - ~BrokerProcessDispatcher() override; - - // IPC::Listener overrides. - bool OnMessageReceived(const IPC::Message& msg) override; - - void OnGetPermissionSettingsCompleted( - uint32_t request_id, - bool success, - PP_Flash_BrowserOperations_Permission default_permission, - const ppapi::FlashSiteSettings& sites); - - private: - void OnGetSitesWithData(uint32_t request_id, - const base::FilePath& plugin_data_path); - void OnClearSiteData(uint32_t request_id, - const base::FilePath& plugin_data_path, - const std::string& site, - uint64_t flags, - uint64_t max_age); - void OnDeauthorizeContentLicenses(uint32_t request_id, - const base::FilePath& plugin_data_path); - void OnGetPermissionSettings( - uint32_t request_id, - const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type); - void OnSetDefaultPermission( - uint32_t request_id, - const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific); - void OnSetSitePermission(uint32_t request_id, - const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites); - - // Returns a list of sites that have data stored. - void GetSitesWithData(const base::FilePath& plugin_data_path, - std::vector* sites); - - // Requests that the plugin clear data, returning true on success. - bool ClearSiteData(const base::FilePath& plugin_data_path, - const std::string& site, - uint64_t flags, - uint64_t max_age); - - bool DeauthorizeContentLicenses(const base::FilePath& plugin_data_path); - bool SetDefaultPermission(const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - bool clear_site_specific); - bool SetSitePermission(const base::FilePath& plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - const ppapi::FlashSiteSettings& sites); - - ScopedChildProcessReference process_ref_; - - PP_GetInterface_Func get_plugin_interface_; - - const PPP_Flash_BrowserOperations_1_3* flash_browser_operations_1_3_; - const PPP_Flash_BrowserOperations_1_2* flash_browser_operations_1_2_; - const PPP_Flash_BrowserOperations_1_0* flash_browser_operations_1_0_; - - bool peer_is_browser_; - - DISALLOW_COPY_AND_ASSIGN(BrokerProcessDispatcher); -}; - -} // namespace content - -#endif // CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc index dc737cbcca7405..7a6d15d50c02b2 100644 --- a/content/ppapi_plugin/ppapi_plugin_main.cc +++ b/content/ppapi_plugin/ppapi_plugin_main.cc @@ -23,7 +23,6 @@ #include "content/public/common/main_function_params.h" #include "ipc/ipc_sender.h" #include "ppapi/proxy/plugin_globals.h" -#include "ppapi/proxy/proxy_module.h" #include "services/tracing/public/cpp/trace_startup.h" #include "ui/base/ui_base_switches.h" diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index a20df3cef945e4..99075d55ca3c55 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -28,7 +28,6 @@ #include "components/discardable_memory/client/client_discardable_shared_memory_manager.h" #include "content/child/browser_font_resource_trusted.h" #include "content/child/child_process.h" -#include "content/ppapi_plugin/broker_process_dispatcher.h" #include "content/ppapi_plugin/plugin_process_dispatcher.h" #include "content/ppapi_plugin/ppapi_blink_platform_impl.h" #include "content/public/common/content_client.h" @@ -483,24 +482,13 @@ bool PpapiThread::SetupChannel(base::ProcessId renderer_pid, ppapi::proxy::ProxyChannel* dispatcher = nullptr; bool init_result = false; - if (is_broker_) { - bool peer_is_browser = renderer_pid == base::kNullProcessId; - BrokerProcessDispatcher* broker_dispatcher = - new BrokerProcessDispatcher(plugin_entry_points_.get_interface, - connect_instance_func_, peer_is_browser); - init_result = broker_dispatcher->InitBrokerWithChannel( - this, renderer_pid, pipe.handle0.release(), false); - dispatcher = broker_dispatcher; - } else { - DCHECK_NE(base::kNullProcessId, renderer_pid); - PluginProcessDispatcher* plugin_dispatcher = - new PluginProcessDispatcher(plugin_entry_points_.get_interface, - permissions_, - incognito); - init_result = plugin_dispatcher->InitPluginWithChannel( - this, renderer_pid, pipe.handle0.release(), false); - dispatcher = plugin_dispatcher; - } + DCHECK(!is_broker_); + DCHECK_NE(base::kNullProcessId, renderer_pid); + PluginProcessDispatcher* plugin_dispatcher = new PluginProcessDispatcher( + plugin_entry_points_.get_interface, permissions_, incognito); + init_result = plugin_dispatcher->InitPluginWithChannel( + this, renderer_pid, pipe.handle0.release(), false); + dispatcher = plugin_dispatcher; if (!init_result) { delete dispatcher; diff --git a/ppapi/api/private/ppp_flash_browser_operations.idl b/ppapi/api/private/ppp_flash_browser_operations.idl deleted file mode 100644 index eb1e9625fbe0d1..00000000000000 --- a/ppapi/api/private/ppp_flash_browser_operations.idl +++ /dev/null @@ -1,170 +0,0 @@ -/* Copyright 2012 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. - */ - -/** - * This file contains the PPP_Flash_BrowserOperations interface. - */ - -label Chrome { - M20 = 1.0, - M21 = 1.2, - M22 = 1.3 -}; - -[assert_size(4)] -enum PP_Flash_BrowserOperations_SettingType { - PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_CAMERAMIC = 0, - PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_PEERNETWORKING = 1, - PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_LAST = PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_PEERNETWORKING -}; - -[assert_size(4)] -enum PP_Flash_BrowserOperations_Permission { - // This value is only used with SetSitePermission(). - PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT = 0, - PP_FLASH_BROWSEROPERATIONS_PERMISSION_ALLOW = 1, - PP_FLASH_BROWSEROPERATIONS_PERMISSION_BLOCK = 2, - PP_FLASH_BROWSEROPERATIONS_PERMISSION_ASK = 3, - PP_FLASH_BROWSEROPERATIONS_PERMISSION_LAST = PP_FLASH_BROWSEROPERATIONS_PERMISSION_ASK -}; - -struct PP_Flash_BrowserOperations_SiteSetting { - cstr_t site; - PP_Flash_BrowserOperations_Permission permission; -}; - -typedef void PPB_Flash_BrowserOperations_GetSettingsCallback( - [inout] mem_t user_data, - [in] PP_Bool success, - [in] PP_Flash_BrowserOperations_Permission default_permission, - [in] uint32_t site_count, - [in, size_is(site_count)] PP_Flash_BrowserOperations_SiteSetting[] sites); - -/** - * This interface allows the browser to request the plugin do things. - */ -interface PPP_Flash_BrowserOperations { - /** - * This function allows the plugin to implement the "Clear site data" feature. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin data is - * stored. On UTF16 systems (Windows), this will be encoded as UTF-8. It will - * be an absolute path and will not have a directory separator (slash) at the - * end. - * @param[in] site String specifying which site to clear the data for. This - * will be null to clear data for all sites. - * @param[in] flags Currently always 0 in Chrome to clear all data. This may - * be extended in the future to clear only specific types of data. - * @param[in] max_age The maximum age in seconds to clear data for. This - * allows the plugin to implement "clear past hour" and "clear past data", - * etc. - * - * @return PP_TRUE on success, PP_FALSE on failure. - * - * See also the NPP_ClearSiteData function in NPAPI. - * https://wiki.mozilla.org/NPAPI:ClearSiteData - */ - PP_Bool ClearSiteData([in] str_t plugin_data_path, - [in] str_t site, - [in] uint64_t flags, - [in] uint64_t max_age); - - /** - * Requests the plugin to deauthorize content licenses. It prevents Flash from - * playing protected content, such as movies and music the user may have - * rented or purchased. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin settings are stored. - * - * @return PP_TRUE on success, PP_FALSE on failure. - */ - [version=1.2] - PP_Bool DeauthorizeContentLicenses([in] str_t plugin_data_path); - - /** - * Gets permission settings. callback will be called exactly once - * to return the settings. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin settings are stored. - * @param[in] setting_type What type of setting to retrieve. - * @param[in] callback The callback to return retrieved data. - * @param[inout] user_data An opaque pointer that will be passed to - * callback. - */ - [version=1.2] - void GetPermissionSettings( - [in] str_t plugin_data_path, - [in] PP_Flash_BrowserOperations_SettingType setting_type, - [in] PPB_Flash_BrowserOperations_GetSettingsCallback callback, - [inout] mem_t user_data); - - /** - * Sets default permission. It applies to all sites except those with - * site-specific settings. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin settings are stored. - * @param[in] setting_type What type of setting to set. - * @param[in] permission The default permission. - * @param[in] clear_site_specific Whether to remove all site-specific - * settings. - * - * @return PP_TRUE on success, PP_FALSE on failure. - */ - [version=1.2] - PP_Bool SetDefaultPermission( - [in] str_t plugin_data_path, - [in] PP_Flash_BrowserOperations_SettingType setting_type, - [in] PP_Flash_BrowserOperations_Permission permission, - [in] PP_Bool clear_site_specific); - - /** - * Sets site-specific permission. If a site has already got site-specific - * permission and it is not in sites, it won't be affected. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin settings are stored. - * @param[in] setting_type What type of setting to set. - * @param[in] site_count How many items are there in sites. - * @param[in] sites The site-specific settings. If a site is specified with - * PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT permission, it - * will be removed from the site-specific list. - * - * @return PP_TRUE on success, PP_FALSE on failure. - */ - [version=1.2] - PP_Bool SetSitePermission( - [in] str_t plugin_data_path, - [in] PP_Flash_BrowserOperations_SettingType setting_type, - [in] uint32_t site_count, - [in, size_is(site_count)] PP_Flash_BrowserOperations_SiteSetting[] sites); - - /** - * Returns a list of sites that have stored data, for use with the - * "Clear site data" feature. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin data is stored. - * @param[out] sites A NULL-terminated array of sites that have stored data. - * Use FreeSiteList on the array when done. - * - * See also the NPP_GetSitesWithData function in NPAPI: - * https://wiki.mozilla.org/NPAPI:ClearSiteData - */ - [version=1.3] - void GetSitesWithData([in] str_t plugin_data_path, - [out] str_t[] sites); - - /** - * Frees the list of sites returned by GetSitesWithData. - * - * @param[in] sites A NULL-terminated array of strings. - */ - [version=1.3] - void FreeSiteList([inout] str_t[] sites); -}; diff --git a/ppapi/c/BUILD.gn b/ppapi/c/BUILD.gn index 065dbfe8380ebe..17d00a5d9d6668 100644 --- a/ppapi/c/BUILD.gn +++ b/ppapi/c/BUILD.gn @@ -134,7 +134,6 @@ source_set("c") { "private/ppb_uma_private.h", "private/ppb_x509_certificate_private.h", "private/ppp_find_private.h", - "private/ppp_flash_browser_operations.h", "private/ppp_instance_private.h", "private/ppp_pdf.h", "private/ppp_pexe_stream_handler.h", diff --git a/ppapi/c/private/ppp_flash_browser_operations.h b/ppapi/c/private/ppp_flash_browser_operations.h deleted file mode 100644 index 9bfc8388bb1016..00000000000000 --- a/ppapi/c/private/ppp_flash_browser_operations.h +++ /dev/null @@ -1,238 +0,0 @@ -/* Copyright 2012 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. - */ - -/* From private/ppp_flash_browser_operations.idl, - * modified Wed Oct 25 09:44:49 2017. - */ - -#ifndef PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ -#define PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ - -#include "ppapi/c/pp_bool.h" -#include "ppapi/c/pp_macros.h" -#include "ppapi/c/pp_stdint.h" - -#define PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_0 \ - "PPP_Flash_BrowserOperations;1.0" -#define PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_2 \ - "PPP_Flash_BrowserOperations;1.2" -#define PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_3 \ - "PPP_Flash_BrowserOperations;1.3" -#define PPP_FLASH_BROWSEROPERATIONS_INTERFACE \ - PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_3 - -/** - * @file - * This file contains the PPP_Flash_BrowserOperations interface. - */ - - -/** - * @addtogroup Enums - * @{ - */ -typedef enum { - PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_CAMERAMIC = 0, - PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_PEERNETWORKING = 1, - PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_LAST = - PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_PEERNETWORKING -} PP_Flash_BrowserOperations_SettingType; -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_BrowserOperations_SettingType, 4); - -typedef enum { - /* This value is only used with SetSitePermission(). */ - PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT = 0, - PP_FLASH_BROWSEROPERATIONS_PERMISSION_ALLOW = 1, - PP_FLASH_BROWSEROPERATIONS_PERMISSION_BLOCK = 2, - PP_FLASH_BROWSEROPERATIONS_PERMISSION_ASK = 3, - PP_FLASH_BROWSEROPERATIONS_PERMISSION_LAST = - PP_FLASH_BROWSEROPERATIONS_PERMISSION_ASK -} PP_Flash_BrowserOperations_Permission; -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_BrowserOperations_Permission, 4); -/** - * @} - */ - -/** - * @addtogroup Structs - * @{ - */ -struct PP_Flash_BrowserOperations_SiteSetting { - const char* site; - PP_Flash_BrowserOperations_Permission permission; -}; -/** - * @} - */ - -/** - * @addtogroup Typedefs - * @{ - */ -typedef void (*PPB_Flash_BrowserOperations_GetSettingsCallback)( - void* user_data, - PP_Bool success, - PP_Flash_BrowserOperations_Permission default_permission, - uint32_t site_count, - const struct PP_Flash_BrowserOperations_SiteSetting sites[]); -/** - * @} - */ - -/** - * @addtogroup Interfaces - * @{ - */ -/** - * This interface allows the browser to request the plugin do things. - */ -struct PPP_Flash_BrowserOperations_1_3 { - /** - * This function allows the plugin to implement the "Clear site data" feature. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin data is - * stored. On UTF16 systems (Windows), this will be encoded as UTF-8. It will - * be an absolute path and will not have a directory separator (slash) at the - * end. - * @param[in] site String specifying which site to clear the data for. This - * will be null to clear data for all sites. - * @param[in] flags Currently always 0 in Chrome to clear all data. This may - * be extended in the future to clear only specific types of data. - * @param[in] max_age The maximum age in seconds to clear data for. This - * allows the plugin to implement "clear past hour" and "clear past data", - * etc. - * - * @return PP_TRUE on success, PP_FALSE on failure. - * - * See also the NPP_ClearSiteData function in NPAPI. - * https://wiki.mozilla.org/NPAPI:ClearSiteData - */ - PP_Bool (*ClearSiteData)(const char* plugin_data_path, - const char* site, - uint64_t flags, - uint64_t max_age); - /** - * Requests the plugin to deauthorize content licenses. It prevents Flash from - * playing protected content, such as movies and music the user may have - * rented or purchased. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin settings are stored. - * - * @return PP_TRUE on success, PP_FALSE on failure. - */ - PP_Bool (*DeauthorizeContentLicenses)(const char* plugin_data_path); - /** - * Gets permission settings. callback will be called exactly once - * to return the settings. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin settings are stored. - * @param[in] setting_type What type of setting to retrieve. - * @param[in] callback The callback to return retrieved data. - * @param[inout] user_data An opaque pointer that will be passed to - * callback. - */ - void (*GetPermissionSettings)( - const char* plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - PPB_Flash_BrowserOperations_GetSettingsCallback callback, - void* user_data); - /** - * Sets default permission. It applies to all sites except those with - * site-specific settings. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin settings are stored. - * @param[in] setting_type What type of setting to set. - * @param[in] permission The default permission. - * @param[in] clear_site_specific Whether to remove all site-specific - * settings. - * - * @return PP_TRUE on success, PP_FALSE on failure. - */ - PP_Bool (*SetDefaultPermission)( - const char* plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - PP_Bool clear_site_specific); - /** - * Sets site-specific permission. If a site has already got site-specific - * permission and it is not in sites, it won't be affected. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin settings are stored. - * @param[in] setting_type What type of setting to set. - * @param[in] site_count How many items are there in sites. - * @param[in] sites The site-specific settings. If a site is specified with - * PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT permission, it - * will be removed from the site-specific list. - * - * @return PP_TRUE on success, PP_FALSE on failure. - */ - PP_Bool (*SetSitePermission)( - const char* plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - uint32_t site_count, - const struct PP_Flash_BrowserOperations_SiteSetting sites[]); - /** - * Returns a list of sites that have stored data, for use with the - * "Clear site data" feature. - * - * @param[in] plugin_data_path String containing the directory where the - * plugin data is stored. - * @param[out] sites A NULL-terminated array of sites that have stored data. - * Use FreeSiteList on the array when done. - * - * See also the NPP_GetSitesWithData function in NPAPI: - * https://wiki.mozilla.org/NPAPI:ClearSiteData - */ - void (*GetSitesWithData)(const char* plugin_data_path, char*** sites); - /** - * Frees the list of sites returned by GetSitesWithData. - * - * @param[in] sites A NULL-terminated array of strings. - */ - void (*FreeSiteList)(char* sites[]); -}; - -typedef struct PPP_Flash_BrowserOperations_1_3 PPP_Flash_BrowserOperations; - -struct PPP_Flash_BrowserOperations_1_0 { - PP_Bool (*ClearSiteData)(const char* plugin_data_path, - const char* site, - uint64_t flags, - uint64_t max_age); -}; - -struct PPP_Flash_BrowserOperations_1_2 { - PP_Bool (*ClearSiteData)(const char* plugin_data_path, - const char* site, - uint64_t flags, - uint64_t max_age); - PP_Bool (*DeauthorizeContentLicenses)(const char* plugin_data_path); - void (*GetPermissionSettings)( - const char* plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - PPB_Flash_BrowserOperations_GetSettingsCallback callback, - void* user_data); - PP_Bool (*SetDefaultPermission)( - const char* plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - PP_Flash_BrowserOperations_Permission permission, - PP_Bool clear_site_specific); - PP_Bool (*SetSitePermission)( - const char* plugin_data_path, - PP_Flash_BrowserOperations_SettingType setting_type, - uint32_t site_count, - const struct PP_Flash_BrowserOperations_SiteSetting sites[]); -}; -/** - * @} - */ - -#endif /* PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ */ - diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c index 430ee6ee064990..d13fd008253b6e 100644 --- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c +++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c @@ -3759,12 +3759,6 @@ static void Pnacl_M19_PPB_X509Certificate_Private_GetField(struct PP_Var* _struc /* Not generating wrapper methods for PPP_Find_Private_0_3 */ -/* Not generating wrapper methods for PPP_Flash_BrowserOperations_1_0 */ - -/* Not generating wrapper methods for PPP_Flash_BrowserOperations_1_2 */ - -/* Not generating wrapper methods for PPP_Flash_BrowserOperations_1_3 */ - /* Begin wrapper methods for PPP_Instance_Private_0_1 */ static struct PP_Var Pnacl_M18_PPP_Instance_Private_GetInstanceObject(PP_Instance instance) { @@ -4790,12 +4784,6 @@ static const struct PPB_X509Certificate_Private_0_1 Pnacl_Wrappers_PPB_X509Certi /* Not generating wrapper interface for PPP_Find_Private_0_3 */ -/* Not generating wrapper interface for PPP_Flash_BrowserOperations_1_0 */ - -/* Not generating wrapper interface for PPP_Flash_BrowserOperations_1_2 */ - -/* Not generating wrapper interface for PPP_Flash_BrowserOperations_1_3 */ - static const struct PPP_Instance_Private_0_1 Pnacl_Wrappers_PPP_Instance_Private_0_1 = { .GetInstanceObject = &Pnacl_M18_PPP_Instance_Private_GetInstanceObject }; diff --git a/ppapi/proxy/BUILD.gn b/ppapi/proxy/BUILD.gn index 63c770bf4e641d..e0052bd60911e4 100644 --- a/ppapi/proxy/BUILD.gn +++ b/ppapi/proxy/BUILD.gn @@ -138,8 +138,6 @@ component("proxy") { "proxy_channel.cc", "proxy_channel.h", "proxy_completion_callback_factory.h", - "proxy_module.cc", - "proxy_module.h", "proxy_object_var.cc", "proxy_object_var.h", "resource_creation_proxy.cc", diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 43e9955b4944a8..0051604241dcc2 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -59,7 +59,6 @@ #include "ppapi/c/private/ppb_isolated_file_system_private.h" #include "ppapi/c/private/ppb_net_address_private.h" #include "ppapi/c/private/ppb_pdf.h" -#include "ppapi/c/private/ppp_flash_browser_operations.h" #include "ppapi/c/private/ppp_pdf.h" #include "ppapi/proxy/host_resolver_private_resource.h" #include "ppapi/proxy/network_list_resource.h" @@ -82,7 +81,6 @@ #include "ppapi/shared_impl/ppb_input_event_shared.h" #include "ppapi/shared_impl/ppb_tcp_socket_shared.h" #include "ppapi/shared_impl/ppb_view_shared.h" -#include "ppapi/shared_impl/ppp_flash_browser_operations_shared.h" #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h" #include "ppapi/shared_impl/socket_option_data.h" #include "ppapi/shared_impl/url_request_info_data.h" @@ -99,10 +97,6 @@ IPC_ENUM_TRAITS_MAX_VALUE(PP_AudioSampleRate, PP_AUDIOSAMPLERATE_LAST) IPC_ENUM_TRAITS_MAX_VALUE(PP_DeviceType_Dev, PP_DEVICETYPE_DEV_MAX) IPC_ENUM_TRAITS_MAX_VALUE(PP_FileSystemType, PP_FILESYSTEMTYPE_ISOLATED) IPC_ENUM_TRAITS_MAX_VALUE(PP_FileType, PP_FILETYPE_OTHER) -IPC_ENUM_TRAITS_MAX_VALUE(PP_Flash_BrowserOperations_Permission, - PP_FLASH_BROWSEROPERATIONS_PERMISSION_LAST) -IPC_ENUM_TRAITS_MAX_VALUE(PP_Flash_BrowserOperations_SettingType, - PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_LAST) IPC_ENUM_TRAITS_MAX_VALUE(PP_ImageDataFormat, PP_IMAGEDATAFORMAT_LAST) IPC_ENUM_TRAITS_MIN_MAX_VALUE(PP_InputEvent_MouseButton, PP_INPUTEVENT_MOUSEBUTTON_FIRST, @@ -442,11 +436,6 @@ IPC_STRUCT_TRAITS_BEGIN(ppapi::FileRefCreateInfo) IPC_STRUCT_TRAITS_MEMBER(file_system_plugin_resource) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(ppapi::FlashSiteSetting) - IPC_STRUCT_TRAITS_MEMBER(site) - IPC_STRUCT_TRAITS_MEMBER(permission) -IPC_STRUCT_TRAITS_END() - IPC_STRUCT_TRAITS_BEGIN(ppapi::MediaStreamAudioTrackShared::Attributes) IPC_STRUCT_TRAITS_MEMBER(buffers) IPC_STRUCT_TRAITS_MEMBER(duration) @@ -651,66 +640,6 @@ IPC_MESSAGE_CONTROL1(PpapiHostMsg_LogInterfaceUsage, IPC_MESSAGE_CONTROL1(PpapiMsg_SetNetworkState, bool /* online */) -// Requests a list of sites that have data stored from the plugin. The plugin -// process will respond with PpapiHostMsg_GetSitesWithDataResult. This is used -// for Flash. -IPC_MESSAGE_CONTROL2(PpapiMsg_GetSitesWithData, - uint32_t /* request_id */, - base::FilePath /* plugin_data_path */) -IPC_MESSAGE_CONTROL2(PpapiHostMsg_GetSitesWithDataResult, - uint32_t /* request_id */, - std::vector /* sites */) - -// Instructs the plugin to clear data for the given site & time. The plugin -// process will respond with PpapiHostMsg_ClearSiteDataResult. This is used -// for Flash. -IPC_MESSAGE_CONTROL5(PpapiMsg_ClearSiteData, - uint32_t /* request_id */, - base::FilePath /* plugin_data_path */, - std::string /* site */, - uint64_t /* flags */, - uint64_t /* max_age */) -IPC_MESSAGE_CONTROL2(PpapiHostMsg_ClearSiteDataResult, - uint32_t /* request_id */, - bool /* success */) - -IPC_MESSAGE_CONTROL2(PpapiMsg_DeauthorizeContentLicenses, - uint32_t /* request_id */, - base::FilePath /* plugin_data_path */) -IPC_MESSAGE_CONTROL2(PpapiHostMsg_DeauthorizeContentLicensesResult, - uint32_t /* request_id */, - bool /* success */) - -IPC_MESSAGE_CONTROL3(PpapiMsg_GetPermissionSettings, - uint32_t /* request_id */, - base::FilePath /* plugin_data_path */, - PP_Flash_BrowserOperations_SettingType /* setting_type */) -IPC_MESSAGE_CONTROL4( - PpapiHostMsg_GetPermissionSettingsResult, - uint32_t /* request_id */, - bool /* success */, - PP_Flash_BrowserOperations_Permission /* default_permission */, - ppapi::FlashSiteSettings /* sites */) - -IPC_MESSAGE_CONTROL5(PpapiMsg_SetDefaultPermission, - uint32_t /* request_id */, - base::FilePath /* plugin_data_path */, - PP_Flash_BrowserOperations_SettingType /* setting_type */, - PP_Flash_BrowserOperations_Permission /* permission */, - bool /* clear_site_specific */) -IPC_MESSAGE_CONTROL2(PpapiHostMsg_SetDefaultPermissionResult, - uint32_t /* request_id */, - bool /* success */) - -IPC_MESSAGE_CONTROL4(PpapiMsg_SetSitePermission, - uint32_t /* request_id */, - base::FilePath /* plugin_data_path */, - PP_Flash_BrowserOperations_SettingType /* setting_type */, - ppapi::FlashSiteSettings /* sites */) -IPC_MESSAGE_CONTROL2(PpapiHostMsg_SetSitePermissionResult, - uint32_t /* request_id */, - bool /* success */) - // Broker Process. IPC_SYNC_MESSAGE_CONTROL2_1(PpapiMsg_ConnectToPlugin, PP_Instance /* instance */, diff --git a/ppapi/proxy/ppapi_param_traits.h b/ppapi/proxy/ppapi_param_traits.h index 8e57cb6d2628f2..24b6e8efc1e5c8 100644 --- a/ppapi/proxy/ppapi_param_traits.h +++ b/ppapi/proxy/ppapi_param_traits.h @@ -34,7 +34,6 @@ struct PPBFlash_DrawGlyphs_Params; struct PPBURLLoader_UpdateProgress_Params; struct SerializedDirEntry; struct SerializedFontDescription; -class SerializedFlashMenu; class SerializedHandle; class SerializedVar; @@ -167,15 +166,6 @@ struct ParamTraits { static void Log(const param_type& p, std::string* l); }; -template<> -struct PPAPI_PROXY_EXPORT ParamTraits { - typedef ppapi::proxy::SerializedFlashMenu param_type; - static void Write(base::Pickle* m, const param_type& p); - static bool Read(const base::Pickle* m, - base::PickleIterator* iter, - param_type* r); - static void Log(const param_type& p, std::string* l); -}; #endif // !defined(OS_NACL) && !defined(NACL_WIN64) template<> diff --git a/ppapi/proxy/proxy_module.cc b/ppapi/proxy/proxy_module.cc deleted file mode 100644 index db32ac93e69d13..00000000000000 --- a/ppapi/proxy/proxy_module.cc +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2011 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 "ppapi/proxy/proxy_module.h" - -#include "base/memory/singleton.h" - -namespace ppapi { -namespace proxy { - -ProxyModule::ProxyModule() { -} - -ProxyModule::~ProxyModule() { -} - -// static -ProxyModule* ProxyModule::GetInstance() { - return base::Singleton::get(); -} - -const std::string& ProxyModule::GetFlashCommandLineArgs() { - return flash_command_line_args_; -} - -void ProxyModule::SetFlashCommandLineArgs(const std::string& args) { - flash_command_line_args_ = args; -} - -} // namespace proxy -} // namespace ppapi diff --git a/ppapi/proxy/proxy_module.h b/ppapi/proxy/proxy_module.h deleted file mode 100644 index 21f53b175d9a4b..00000000000000 --- a/ppapi/proxy/proxy_module.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2011 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 PPAPI_PROXY_PROXY_MODULE_H_ -#define PPAPI_PROXY_PROXY_MODULE_H_ - -#include - -#include "base/macros.h" -#include "ppapi/proxy/ppapi_proxy_export.h" - -namespace base { -template struct DefaultSingletonTraits; -} - -namespace ppapi { -namespace proxy { - -class PPAPI_PROXY_EXPORT ProxyModule { - public: - // The global singleton getter. - static ProxyModule* GetInstance(); - - // TODO(viettrungluu): Generalize this for use with other plugins if it proves - // necessary. (Currently, we can't do this easily, since we can't tell from - // |PpapiPluginMain()| which plugin will be loaded.) - const std::string& GetFlashCommandLineArgs(); - void SetFlashCommandLineArgs(const std::string& args); - - private: - friend struct base::DefaultSingletonTraits; - - std::string flash_command_line_args_; - - ProxyModule(); - ~ProxyModule(); - - DISALLOW_COPY_AND_ASSIGN(ProxyModule); -}; - -} // namespace proxy -} // namespace ppapi - -#endif // PPAPI_PROXY_PROXY_MODULE_H_ diff --git a/ppapi/shared_impl/BUILD.gn b/ppapi/shared_impl/BUILD.gn index 150d3112c2d654..24e5734ff5290d 100644 --- a/ppapi/shared_impl/BUILD.gn +++ b/ppapi/shared_impl/BUILD.gn @@ -87,7 +87,6 @@ component("shared_impl") { "ppb_var_shared.h", "ppb_view_shared.cc", "ppb_view_shared.h", - "ppp_flash_browser_operations_shared.h", "ppp_instance_combined.cc", "ppp_instance_combined.h", "proxy_lock.cc", diff --git a/ppapi/shared_impl/ppp_flash_browser_operations_shared.h b/ppapi/shared_impl/ppp_flash_browser_operations_shared.h deleted file mode 100644 index 7584390ea85250..00000000000000 --- a/ppapi/shared_impl/ppp_flash_browser_operations_shared.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2012 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 PPAPI_SHARED_IMPL_PPP_FLASH_BROWSER_OPERATIONS_SHARED_H_ -#define PPAPI_SHARED_IMPL_PPP_FLASH_BROWSER_OPERATIONS_SHARED_H_ - -#include -#include - -#include "ppapi/c/private/ppp_flash_browser_operations.h" - -namespace ppapi { - -struct FlashSiteSetting { - FlashSiteSetting() - : permission(PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT) {} - FlashSiteSetting(const std::string& in_site, - PP_Flash_BrowserOperations_Permission in_permission) - : site(in_site), permission(in_permission) {} - - std::string site; - PP_Flash_BrowserOperations_Permission permission; -}; - -typedef std::vector FlashSiteSettings; - -} // namespace ppapi - -#endif // PPAPI_SHARED_IMPL_PPP_FLASH_BROWSER_OPERATIONS_SHARED_H_ diff --git a/tools/determinism/deterministic_build_ignorelist.pyl b/tools/determinism/deterministic_build_ignorelist.pyl index 9470da1a5c2e56..cebd74516af6a7 100644 --- a/tools/determinism/deterministic_build_ignorelist.pyl +++ b/tools/determinism/deterministic_build_ignorelist.pyl @@ -27,6 +27,10 @@ 'nacl_test_data/glibc/pm_exit_status_test_libs/lib64/libppapi_cpp_lib.so', 'nacl_test_data/glibc/simple_libs/lib64/libppapi_cpp_lib.so', 'nacl_test_data/glibc/sysconf_nprocessors_onln_test_libs/lib64/libppapi_cpp_lib.so', + 'nacl_test_data/nonsfi/irt_exception_test_pnacl_newlib_x32_nonsfi.nexe', + 'nacl_test_data/nonsfi/irt_manifest_file_pnacl_newlib_x32_nonsfi.nexe', + 'ppapi_nacl_tests_pnacl_newlib_x64.nexe', + 'test_data/ppapi/tests/extensions/packaged_app/nonsfi/ppapi_tests_extensions_packaged_app_pnacl_newlib_x32_nonsfi.nexe', # https://crbug.com/1040247 'nacl_irt_x86_64.nexe',