mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 91.0.4472.0 (#870763)
This commit is contained in:
@@ -56,7 +56,7 @@ void SyncValueStoreCache::RunWithValueStoreForExtension(
|
||||
// A neat way to implement unlimited storage; if the extension has the
|
||||
// unlimited storage permission, force through all calls to Set().
|
||||
if (extension->permissions_data()->HasAPIPermission(
|
||||
APIPermission::kUnlimitedStorage)) {
|
||||
mojom::APIPermissionID::kUnlimitedStorage)) {
|
||||
WeakUnlimitedSettingsStorage unlimited_storage(storage);
|
||||
std::move(callback).Run(&unlimited_storage);
|
||||
} else {
|
||||
|
@@ -128,7 +128,8 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
|
||||
|
||||
execute_tab_id_ = browser->GetIdentifier();
|
||||
details_ = std::move(details);
|
||||
set_host_id(HostID(HostID::EXTENSIONS, extension()->id()));
|
||||
set_host_id(
|
||||
mojom::HostID(mojom::HostID::HostType::kExtensions, extension()->id()));
|
||||
return set_init_result(SUCCESS);
|
||||
}
|
||||
|
||||
@@ -182,7 +183,7 @@ bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage(std::string* error) {
|
||||
execute_tab_id_, error)) {
|
||||
if (is_about_url &&
|
||||
extension()->permissions_data()->active_permissions().HasAPIPermission(
|
||||
APIPermission::kTab)) {
|
||||
mojom::APIPermissionID::kTab)) {
|
||||
*error = ErrorUtils::FormatErrorMessage(
|
||||
manifest_errors::kCannotAccessAboutUrl,
|
||||
rfh->GetLastCommittedURL().spec(),
|
||||
|
@@ -23,7 +23,7 @@ CefComponentExtensionResourceManager::CefComponentExtensionResourceManager() {
|
||||
base::Value dict(base::Value::Type::DICTIONARY);
|
||||
pdf_extension_util::AddStrings(
|
||||
pdf_extension_util::PdfViewerContext::kPdfViewer, &dict);
|
||||
pdf_extension_util::AddAdditionalData(&dict);
|
||||
pdf_extension_util::AddAdditionalData(/*enable_annotations=*/true, &dict);
|
||||
|
||||
ui::TemplateReplacements pdf_viewer_replacements;
|
||||
ui::TemplateReplacementsFromDictionaryValue(
|
||||
|
@@ -17,7 +17,7 @@ CefExtensionBackgroundHost::CefExtensionBackgroundHost(
|
||||
const Extension* extension,
|
||||
content::WebContents* host_contents,
|
||||
const GURL& url,
|
||||
ViewType host_type)
|
||||
mojom::ViewType host_type)
|
||||
: ExtensionHost(new CefExtensionHostDelegate(browser),
|
||||
extension,
|
||||
host_contents->GetBrowserContext(),
|
||||
@@ -28,7 +28,7 @@ CefExtensionBackgroundHost::CefExtensionBackgroundHost(
|
||||
DCHECK(!deleted_callback_.is_null());
|
||||
|
||||
// Only used for background pages.
|
||||
DCHECK(host_type == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE);
|
||||
DCHECK(host_type == mojom::ViewType::kExtensionBackgroundPage);
|
||||
}
|
||||
|
||||
CefExtensionBackgroundHost::~CefExtensionBackgroundHost() {
|
||||
|
@@ -29,7 +29,7 @@ class CefExtensionBackgroundHost : public ExtensionHost {
|
||||
const Extension* extension,
|
||||
content::WebContents* host_contents,
|
||||
const GURL& url,
|
||||
ViewType host_type);
|
||||
mojom::ViewType host_type);
|
||||
~CefExtensionBackgroundHost() override;
|
||||
|
||||
// content::WebContentsDelegate methods:
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
|
||||
#include "chrome/browser/extensions/extension_tab_util.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
@@ -81,10 +82,9 @@ class CefGetExtensionLoadFileCallbackImpl
|
||||
return;
|
||||
}
|
||||
|
||||
base::PostTaskAndReplyWithResult(
|
||||
base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
{base::ThreadPool(), base::MayBlock(),
|
||||
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
|
||||
{base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
|
||||
base::BindOnce(LoadFileFromStream, file, stream), std::move(callback));
|
||||
}
|
||||
|
||||
|
@@ -547,7 +547,8 @@ scoped_refptr<const Extension> CefExtensionSystem::CreateExtension(
|
||||
// Tests should continue to use the Manifest::COMMAND_LINE value here
|
||||
// Some Chrome APIs will cause undesired effects if this is incorrect
|
||||
// e.g.: alarms API has 1 minute minimum applied to Packed Extensions
|
||||
info.internal ? Manifest::COMPONENT : Manifest::COMMAND_LINE,
|
||||
info.internal ? mojom::ManifestLocation::kComponent
|
||||
: mojom::ManifestLocation::kCommandLine,
|
||||
*info.manifest, flags, utf8_error);
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,7 @@ CefExtensionViewHost::CefExtensionViewHost(AlloyBrowserHostImpl* browser,
|
||||
const Extension* extension,
|
||||
content::WebContents* host_contents,
|
||||
const GURL& url,
|
||||
ViewType host_type)
|
||||
mojom::ViewType host_type)
|
||||
: ExtensionHost(new CefExtensionHostDelegate(browser),
|
||||
extension,
|
||||
host_contents->GetBrowserContext(),
|
||||
@@ -33,8 +33,8 @@ CefExtensionViewHost::CefExtensionViewHost(AlloyBrowserHostImpl* browser,
|
||||
url,
|
||||
host_type) {
|
||||
// Only used for dialogs and popups.
|
||||
DCHECK(host_type == VIEW_TYPE_EXTENSION_DIALOG ||
|
||||
host_type == VIEW_TYPE_EXTENSION_POPUP);
|
||||
DCHECK(host_type == mojom::ViewType::kExtensionDialog ||
|
||||
host_type == mojom::ViewType::kExtensionPopup);
|
||||
}
|
||||
|
||||
CefExtensionViewHost::~CefExtensionViewHost() {}
|
||||
@@ -76,7 +76,7 @@ bool CefExtensionViewHost::PreHandleGestureEvent(
|
||||
}
|
||||
|
||||
WebContents* CefExtensionViewHost::GetVisibleWebContents() const {
|
||||
if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP)
|
||||
if (extension_host_type() == mojom::ViewType::kExtensionPopup)
|
||||
return host_contents();
|
||||
return nullptr;
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ class CefExtensionViewHost : public ExtensionHost,
|
||||
const Extension* extension,
|
||||
content::WebContents* host_contents,
|
||||
const GURL& url,
|
||||
ViewType host_type);
|
||||
mojom::ViewType host_type);
|
||||
~CefExtensionViewHost() override;
|
||||
|
||||
// ExtensionHost methods:
|
||||
|
@@ -264,8 +264,7 @@ bool CefExtensionsBrowserClient::CreateBackgroundExtensionHost(
|
||||
|
||||
// This triggers creation of the background host.
|
||||
create_params.extension = extension;
|
||||
create_params.extension_host_type =
|
||||
extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE;
|
||||
create_params.extension_host_type = mojom::ViewType::kExtensionBackgroundPage;
|
||||
|
||||
// Browser creation may fail under certain rare circumstances. Fail the
|
||||
// background host creation in that case.
|
||||
|
@@ -92,17 +92,17 @@ ValueStore::WriteResult CefValueStore::Set(
|
||||
if (!status_.ok())
|
||||
return WriteResult(CreateStatusCopy(status_));
|
||||
|
||||
std::unique_ptr<ValueStoreChangeList> changes(new ValueStoreChangeList());
|
||||
ValueStoreChangeList changes;
|
||||
for (base::DictionaryValue::Iterator it(settings); !it.IsAtEnd();
|
||||
it.Advance()) {
|
||||
base::Value* old_value = nullptr;
|
||||
base::Value* old_value = NULL;
|
||||
if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) ||
|
||||
!old_value->Equals(&it.value())) {
|
||||
changes->push_back(ValueStoreChange(
|
||||
it.key(),
|
||||
old_value ? base::Optional<base::Value>(old_value->Clone())
|
||||
: base::nullopt,
|
||||
it.value().Clone()));
|
||||
changes.emplace_back(it.key(),
|
||||
old_value
|
||||
? base::Optional<base::Value>(old_value->Clone())
|
||||
: base::nullopt,
|
||||
it.value().Clone());
|
||||
storage_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy());
|
||||
}
|
||||
}
|
||||
@@ -119,13 +119,11 @@ ValueStore::WriteResult CefValueStore::Remove(
|
||||
if (!status_.ok())
|
||||
return WriteResult(CreateStatusCopy(status_));
|
||||
|
||||
std::unique_ptr<ValueStoreChangeList> changes(new ValueStoreChangeList());
|
||||
for (std::vector<std::string>::const_iterator it = keys.begin();
|
||||
it != keys.end(); ++it) {
|
||||
ValueStoreChangeList changes;
|
||||
for (auto it = keys.cbegin(); it != keys.cend(); ++it) {
|
||||
std::unique_ptr<base::Value> old_value;
|
||||
if (storage_.RemoveWithoutPathExpansion(*it, &old_value)) {
|
||||
changes->push_back(
|
||||
ValueStoreChange(*it, std::move(*old_value), base::nullopt));
|
||||
changes.emplace_back(*it, std::move(*old_value), base::nullopt);
|
||||
}
|
||||
}
|
||||
return WriteResult(std::move(changes), CreateStatusCopy(status_));
|
||||
|
Reference in New Issue
Block a user