mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	Update to Chromium version 95.0.4638.0 (#920003)
Known issues: - Windows ARM64 builds are currently failing due to https://crbug.com/1242884#c31
This commit is contained in:
		| @@ -8,9 +8,11 @@ | ||||
| #include <stddef.h> | ||||
|  | ||||
| #include <limits> | ||||
| #include <utility> | ||||
|  | ||||
| #include "content/public/browser/browser_thread.h" | ||||
| #include "extensions/browser/api/storage/backend_task_runner.h" | ||||
| #include "extensions/browser/api/storage/value_store_util.h" | ||||
| #include "extensions/browser/api/storage/weak_unlimited_settings_storage.h" | ||||
| #include "extensions/browser/value_store/value_store_factory.h" | ||||
| #include "extensions/common/api/storage.h" | ||||
| @@ -37,8 +39,8 @@ SettingsStorageQuotaEnforcer::Limits GetLocalQuotaLimits() { | ||||
| }  // namespace | ||||
|  | ||||
| SyncValueStoreCache::SyncValueStoreCache( | ||||
|     const scoped_refptr<ValueStoreFactory>& factory) | ||||
|     : storage_factory_(factory), quota_(GetLocalQuotaLimits()) { | ||||
|     scoped_refptr<value_store::ValueStoreFactory> factory) | ||||
|     : storage_factory_(std::move(factory)), quota_(GetLocalQuotaLimits()) { | ||||
|   DCHECK_CURRENTLY_ON(BrowserThread::UI); | ||||
| } | ||||
|  | ||||
| @@ -51,7 +53,7 @@ void SyncValueStoreCache::RunWithValueStoreForExtension( | ||||
|     scoped_refptr<const Extension> extension) { | ||||
|   DCHECK(IsOnBackendSequence()); | ||||
|  | ||||
|   ValueStore* storage = GetStorage(extension.get()); | ||||
|   value_store::ValueStore* storage = GetStorage(extension.get()); | ||||
|  | ||||
|   // A neat way to implement unlimited storage; if the extension has the | ||||
|   // unlimited storage permission, force through all calls to Set(). | ||||
| @@ -67,29 +69,34 @@ void SyncValueStoreCache::RunWithValueStoreForExtension( | ||||
| void SyncValueStoreCache::DeleteStorageSoon(const std::string& extension_id) { | ||||
|   DCHECK(IsOnBackendSequence()); | ||||
|   storage_map_.erase(extension_id); | ||||
|   storage_factory_->DeleteSettings(settings_namespace::SYNC, | ||||
|                                    ValueStoreFactory::ModelType::APP, | ||||
|                                    extension_id); | ||||
|   storage_factory_->DeleteSettings(settings_namespace::SYNC, | ||||
|                                    ValueStoreFactory::ModelType::EXTENSION, | ||||
|                                    extension_id); | ||||
|  | ||||
|   value_store_util::DeleteValueStore(settings_namespace::SYNC, | ||||
|                                      value_store_util::ModelType::APP, | ||||
|                                      extension_id, storage_factory_); | ||||
|  | ||||
|   value_store_util::DeleteValueStore(settings_namespace::SYNC, | ||||
|                                      value_store_util::ModelType::EXTENSION, | ||||
|                                      extension_id, storage_factory_); | ||||
| } | ||||
|  | ||||
| ValueStore* SyncValueStoreCache::GetStorage(const Extension* extension) { | ||||
|   StorageMap::iterator iter = storage_map_.find(extension->id()); | ||||
| value_store::ValueStore* SyncValueStoreCache::GetStorage( | ||||
|     const Extension* extension) { | ||||
|   auto iter = storage_map_.find(extension->id()); | ||||
|   if (iter != storage_map_.end()) | ||||
|     return iter->second.get(); | ||||
|  | ||||
|   ValueStoreFactory::ModelType model_type = | ||||
|       extension->is_app() ? ValueStoreFactory::ModelType::APP | ||||
|                           : ValueStoreFactory::ModelType::EXTENSION; | ||||
|   std::unique_ptr<ValueStore> store = storage_factory_->CreateSettingsStore( | ||||
|       settings_namespace::SYNC, model_type, extension->id()); | ||||
|   value_store_util::ModelType model_type = | ||||
|       extension->is_app() ? value_store_util::ModelType::APP | ||||
|                           : value_store_util::ModelType::EXTENSION; | ||||
|   std::unique_ptr<value_store::ValueStore> store = | ||||
|       value_store_util::CreateSettingsStore(settings_namespace::LOCAL, | ||||
|                                             model_type, extension->id(), | ||||
|                                             storage_factory_); | ||||
|   std::unique_ptr<SettingsStorageQuotaEnforcer> storage( | ||||
|       new SettingsStorageQuotaEnforcer(quota_, std::move(store))); | ||||
|   DCHECK(storage.get()); | ||||
|  | ||||
|   ValueStore* storage_ptr = storage.get(); | ||||
|   value_store::ValueStore* storage_ptr = storage.get(); | ||||
|   storage_map_[extension->id()] = std::move(storage); | ||||
|   return storage_ptr; | ||||
| } | ||||
|   | ||||
| @@ -14,10 +14,11 @@ | ||||
| #include "extensions/browser/api/storage/settings_storage_quota_enforcer.h" | ||||
| #include "extensions/browser/api/storage/value_store_cache.h" | ||||
|  | ||||
| namespace extensions { | ||||
|  | ||||
| namespace value_store { | ||||
| class ValueStoreFactory; | ||||
| } | ||||
|  | ||||
| namespace extensions { | ||||
| namespace cef { | ||||
|  | ||||
| // Based on LocalValueStoreCache | ||||
| @@ -25,7 +26,8 @@ namespace cef { | ||||
| // another for extensions. Each backend takes care of persistence. | ||||
| class SyncValueStoreCache : public ValueStoreCache { | ||||
|  public: | ||||
|   explicit SyncValueStoreCache(const scoped_refptr<ValueStoreFactory>& factory); | ||||
|   explicit SyncValueStoreCache( | ||||
|       scoped_refptr<value_store::ValueStoreFactory> factory); | ||||
|   ~SyncValueStoreCache() override; | ||||
|  | ||||
|   // ValueStoreCache implementation: | ||||
| @@ -35,12 +37,13 @@ class SyncValueStoreCache : public ValueStoreCache { | ||||
|   void DeleteStorageSoon(const std::string& extension_id) override; | ||||
|  | ||||
|  private: | ||||
|   using StorageMap = std::map<std::string, std::unique_ptr<ValueStore>>; | ||||
|   using StorageMap = | ||||
|       std::map<std::string, std::unique_ptr<value_store::ValueStore>>; | ||||
|  | ||||
|   ValueStore* GetStorage(const Extension* extension); | ||||
|   value_store::ValueStore* GetStorage(const Extension* extension); | ||||
|  | ||||
|   // The Factory to use for creating new ValueStores. | ||||
|   const scoped_refptr<ValueStoreFactory> storage_factory_; | ||||
|   const scoped_refptr<value_store::ValueStoreFactory> storage_factory_; | ||||
|  | ||||
|   // Quota limits (see SettingsStorageQuotaEnforcer). | ||||
|   const SettingsStorageQuotaEnforcer::Limits quota_; | ||||
| @@ -50,6 +53,7 @@ class SyncValueStoreCache : public ValueStoreCache { | ||||
|  | ||||
|   DISALLOW_COPY_AND_ASSIGN(SyncValueStoreCache); | ||||
| }; | ||||
|  | ||||
| }  // namespace cef | ||||
| }  // namespace extensions | ||||
|  | ||||
|   | ||||
| @@ -78,7 +78,7 @@ TabsCreateFunction::TabsCreateFunction() : cef_details_(this) {} | ||||
|  | ||||
| ExtensionFunction::ResponseAction TabsCreateFunction::Run() { | ||||
|   std::unique_ptr<tabs::Create::Params> params( | ||||
|       tabs::Create::Params::Create(*args_)); | ||||
|       tabs::Create::Params::Create(args())); | ||||
|   EXTENSION_FUNCTION_VALIDATE(params.get()); | ||||
|  | ||||
|   CefExtensionFunctionDetails::OpenTabParams options; | ||||
| @@ -119,7 +119,7 @@ content::WebContents* BaseAPIFunction::GetWebContents(int tab_id) { | ||||
|  | ||||
| ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { | ||||
|   std::unique_ptr<tabs::Update::Params> params( | ||||
|       tabs::Update::Params::Create(*args_)); | ||||
|       tabs::Update::Params::Create(args())); | ||||
|   EXTENSION_FUNCTION_VALIDATE(params.get()); | ||||
|  | ||||
|   tab_id_ = params->tab_id ? *params->tab_id : -1; | ||||
| @@ -256,11 +256,10 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() { | ||||
|   if (init_result_) | ||||
|     return init_result_.value(); | ||||
|  | ||||
|   const auto list_view = args_->GetList(); | ||||
|   if (list_view.size() < 2) | ||||
|   if (args().size() < 2) | ||||
|     return set_init_result(VALIDATION_FAILURE); | ||||
|  | ||||
|   const auto& tab_id_value = list_view[0]; | ||||
|   const auto& tab_id_value = args()[0]; | ||||
|   // |tab_id| is optional so it's ok if it's not there. | ||||
|   int tab_id = -1; | ||||
|   if (tab_id_value.is_int()) { | ||||
| @@ -272,7 +271,7 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() { | ||||
|   } | ||||
|  | ||||
|   // |details| are not optional. | ||||
|   const base::Value& details_value = list_view[1]; | ||||
|   const base::Value& details_value = args()[1]; | ||||
|   if (!details_value.is_dict()) | ||||
|     return set_init_result(VALIDATION_FAILURE); | ||||
|   std::unique_ptr<InjectDetails> details(new InjectDetails()); | ||||
| @@ -414,7 +413,7 @@ bool TabsRemoveCSSFunction::ShouldRemoveCSS() const { | ||||
|  | ||||
| ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() { | ||||
|   std::unique_ptr<tabs::SetZoom::Params> params( | ||||
|       tabs::SetZoom::Params::Create(*args_)); | ||||
|       tabs::SetZoom::Params::Create(args())); | ||||
|   EXTENSION_FUNCTION_VALIDATE(params); | ||||
|  | ||||
|   int tab_id = params->tab_id ? *params->tab_id : -1; | ||||
| @@ -444,7 +443,7 @@ ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() { | ||||
|  | ||||
| ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() { | ||||
|   std::unique_ptr<tabs::GetZoom::Params> params( | ||||
|       tabs::GetZoom::Params::Create(*args_)); | ||||
|       tabs::GetZoom::Params::Create(args())); | ||||
|   EXTENSION_FUNCTION_VALIDATE(params); | ||||
|  | ||||
|   int tab_id = params->tab_id ? *params->tab_id : -1; | ||||
| @@ -463,7 +462,7 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { | ||||
|   using api::tabs::ZoomSettings; | ||||
|  | ||||
|   std::unique_ptr<tabs::SetZoomSettings::Params> params( | ||||
|       tabs::SetZoomSettings::Params::Create(*args_)); | ||||
|       tabs::SetZoomSettings::Params::Create(args())); | ||||
|   EXTENSION_FUNCTION_VALIDATE(params); | ||||
|  | ||||
|   int tab_id = params->tab_id ? *params->tab_id : -1; | ||||
| @@ -512,7 +511,7 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { | ||||
|  | ||||
| ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() { | ||||
|   std::unique_ptr<tabs::GetZoomSettings::Params> params( | ||||
|       tabs::GetZoomSettings::Params::Create(*args_)); | ||||
|       tabs::GetZoomSettings::Params::Create(args())); | ||||
|   EXTENSION_FUNCTION_VALIDATE(params); | ||||
|  | ||||
|   int tab_id = params->tab_id ? *params->tab_id : -1; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user