Update to Chromium version 93.0.4577.0 (#902210)

This commit is contained in:
Marshall Greenblatt
2021-07-23 12:40:13 -04:00
parent 1ffa5528b3
commit b4ea0496e7
141 changed files with 1188 additions and 1061 deletions

View File

@@ -8,6 +8,7 @@
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "components/zoom/zoom_controller.h"
@@ -381,8 +382,16 @@ bool ExecuteCodeInTabFunction::LoadFile(const std::string& file,
void ExecuteCodeInTabFunction::LoadFileComplete(
const std::string& file,
std::unique_ptr<std::string> data) {
std::vector<std::unique_ptr<std::string>> data_list;
absl::optional<std::string> error;
const bool success = !!data.get();
DidLoadAndLocalizeFile(file, success, std::move(data));
if (success) {
DCHECK(data);
data_list.push_back(std::move(data));
} else {
error = base::StringPrintf("Failed to load file '%s'.", file.c_str());
}
DidLoadAndLocalizeFile(file, std::move(data_list), std::move(error));
}
bool TabsInsertCSSFunction::ShouldInsertCSS() const {

View File

@@ -4,6 +4,7 @@
#include "libcef/browser/extensions/component_extension_resource_manager.h"
#include "base/containers/contains.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/values.h"

View File

@@ -35,8 +35,9 @@ CefExtensionBackgroundHost::~CefExtensionBackgroundHost() {
std::move(deleted_callback_).Run();
}
bool CefExtensionBackgroundHost::ShouldTransferNavigation(
bool is_main_frame_navigation) {
bool CefExtensionBackgroundHost::
ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) {
// Block navigations that cause the main frame to navigate to non-extension
// content (i.e. to web content).
return !is_main_frame_navigation;

View File

@@ -33,7 +33,8 @@ class CefExtensionBackgroundHost : public ExtensionHost {
~CefExtensionBackgroundHost() override;
// content::WebContentsDelegate methods:
bool ShouldTransferNavigation(bool is_main_frame_navigation) override;
bool ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) override;
private:
// Callback that will be executed on host deletion.

View File

@@ -61,7 +61,7 @@ bool CefExtensionViewHost::IsBackgroundPage() const {
return false;
}
bool CefExtensionViewHost::ShouldTransferNavigation(
bool CefExtensionViewHost::ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) {
// Block navigations that cause the main frame to navigate to non-extension
// content (i.e. to web content).

View File

@@ -40,7 +40,8 @@ class CefExtensionViewHost : public ExtensionHost,
bool IsBackgroundPage() const override;
// content::WebContentsDelegate methods:
bool ShouldTransferNavigation(bool is_main_frame_navigation) override;
bool ShouldAllowRendererInitiatedCrossProcessNavigation(
bool is_main_frame_navigation) override;
bool PreHandleGestureEvent(content::WebContents* source,
const blink::WebGestureEvent& event) override;

View File

@@ -18,6 +18,7 @@
#include "components/pdf/browser/pdf_web_contents_helper.h"
#include "components/zoom/zoom_controller.h"
#include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h"
#include "printing/mojom/print.mojom.h"
namespace extensions {

View File

@@ -173,12 +173,11 @@ void CefExtensionsBrowserClient::LoadResourceFromResourceBundle(
mojo::PendingReceiver<network::mojom::URLLoader> loader,
const base::FilePath& resource_relative_path,
const int resource_id,
const std::string& content_security_policy,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
bool send_cors_header) {
scoped_refptr<net::HttpResponseHeaders> headers,
mojo::PendingRemote<network::mojom::URLLoaderClient> client) {
chrome_url_request_util::LoadResourceFromResourceBundle(
request, std::move(loader), resource_relative_path, resource_id,
content_security_policy, std::move(client), send_cors_header);
std::move(headers), std::move(client));
}
bool CefExtensionsBrowserClient::AllowCrossRendererResourceLoad(

View File

@@ -51,9 +51,8 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
mojo::PendingReceiver<network::mojom::URLLoader> loader,
const base::FilePath& resource_relative_path,
const int resource_id,
const std::string& content_security_policy,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
bool send_cors_header) override;
scoped_refptr<net::HttpResponseHeaders> headers,
mojo::PendingRemote<network::mojom::URLLoaderClient> client) override;
bool AllowCrossRendererResourceLoad(
const network::ResourceRequest& request,
network::mojom::RequestDestination destination,

View File

@@ -60,11 +60,10 @@ ValueStore::ReadResult CefValueStore::Get(
return ReadResult(CreateStatusCopy(status_));
auto settings = std::make_unique<base::DictionaryValue>();
for (std::vector<std::string>::const_iterator it = keys.begin();
it != keys.end(); ++it) {
base::Value* value = nullptr;
if (storage_.GetWithoutPathExpansion(*it, &value)) {
settings->SetWithoutPathExpansion(*it, value->CreateDeepCopy());
for (const auto& key : keys) {
base::Value* value = storage_.FindKey(key);
if (value) {
settings->SetKey(key, value->Clone());
}
}
return ReadResult(std::move(settings), CreateStatusCopy(status_));
@@ -95,15 +94,14 @@ ValueStore::WriteResult CefValueStore::Set(
ValueStoreChangeList changes;
for (base::DictionaryValue::Iterator it(settings); !it.IsAtEnd();
it.Advance()) {
base::Value* old_value = NULL;
if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) ||
!old_value->Equals(&it.value())) {
base::Value* old_value = storage_.FindKey(it.key());
if (!old_value || *old_value != it.value()) {
changes.emplace_back(it.key(),
old_value
? absl::optional<base::Value>(old_value->Clone())
: absl::nullopt,
it.value().Clone());
storage_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy());
storage_.SetKey(it.key(), it.value().Clone());
}
}
return WriteResult(std::move(changes), CreateStatusCopy(status_));
@@ -120,10 +118,10 @@ ValueStore::WriteResult CefValueStore::Remove(
return WriteResult(CreateStatusCopy(status_));
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.emplace_back(*it, std::move(*old_value), absl::nullopt);
for (auto const& key : keys) {
absl::optional<base::Value> old_value = storage_.ExtractKey(key);
if (old_value.has_value()) {
changes.emplace_back(key, std::move(*old_value), absl::nullopt);
}
}
return WriteResult(std::move(changes), CreateStatusCopy(status_));