Update to Chromium version 90.0.4430.0 (#857950)

- Linux ARM builds require use_vaapi=false (see https://crbug.com/1185348)
- Windows official builds require use_thin_lto=false (see https://crbug.com/1177001)
This commit is contained in:
Marshall Greenblatt
2021-03-04 17:36:57 -05:00
parent 1587d6da03
commit 74db00fc89
134 changed files with 1245 additions and 1204 deletions

View File

@@ -237,12 +237,6 @@ void AlloyContentRendererClient::RenderThreadStarted() {
pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get());
}
for (auto& origin_or_hostname_pattern :
network::SecureOriginAllowlist::GetInstance().GetCurrentAllowlist()) {
blink::WebSecurityPolicy::AddOriginToTrustworthySafelist(
blink::WebString::FromUTF8(origin_or_hostname_pattern));
}
if (extensions::ExtensionsEnabled())
extensions_renderer_client_->RenderThreadStarted();
}

View File

@@ -8,7 +8,6 @@
#include "libcef/common/net/net_resource_provider.h"
#include "base/no_destructor.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "net/base/net_module.h"
#include "services/service_manager/public/cpp/connector.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"

View File

@@ -14,7 +14,6 @@
#include "chrome/common/renderer_configuration.mojom.h"
#include "components/content_settings/core/common/content_settings.h"
#include "content/public/renderer/render_thread_observer.h"
#include "mojo/public/cpp/bindings/associated_binding_set.h"
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
// This class sends and receives control messages in the renderer process.

View File

@@ -13,7 +13,6 @@
#include "chrome/common/google_url_loader_throttle.h"
#include "content/public/common/content_features.h"
#include "content/public/renderer/render_frame.h"
#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/loader/resource_type_util.h"
#include "third_party/blink/public/platform/web_url.h"
@@ -59,23 +58,6 @@ CefURLLoaderThrottleProviderImpl::CreateThrottles(
DCHECK(!is_frame_resource ||
type_ == content::URLLoaderThrottleProviderType::kFrame);
if (extensions::ExtensionsEnabled() &&
type_ == content::URLLoaderThrottleProviderType::kFrame &&
request_destination == network::mojom::RequestDestination::kObject) {
content::RenderFrame* render_frame =
content::RenderFrame::FromRoutingID(render_frame_id);
auto mime_handlers =
extensions::MimeHandlerViewContainer::FromRenderFrame(render_frame);
GURL gurl(request.Url());
for (auto* handler : mime_handlers) {
auto throttle = handler->MaybeCreatePluginThrottle(gurl);
if (throttle) {
throttles.push_back(std::move(throttle));
break;
}
}
}
throttles.push_back(std::make_unique<GoogleURLLoaderThrottle>(
AlloyRenderThreadObserver::GetDynamicParams()));

View File

@@ -30,6 +30,7 @@
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/loader/frame_load_request.h"
#include "third_party/blink/renderer/core/script/classic_script.h"
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
@@ -101,6 +102,12 @@ std::string DumpDocumentText(blink::WebLocalFrame* frame) {
return blink::WebString(web_element->innerText()).Utf8();
}
std::string DumpDocumentMarkup(blink::WebLocalFrame* frame) {
const auto& string = blink::CreateMarkup(
blink::To<blink::WebLocalFrameImpl>(frame)->GetFrame()->GetDocument());
return string.Utf8();
}
cef_dom_node_type_t GetNodeType(const blink::WebNode& node) {
const blink::Node* web_node = node.ConstUnwrap<blink::Node>();
switch (web_node->getNodeType()) {
@@ -174,11 +181,7 @@ v8::Local<v8::Value> ExecuteV8ScriptAndReturnValue(
const blink::WebString& source_url,
int start_line,
v8::Local<v8::Context> context,
v8::Isolate* isolate,
v8::TryCatch& tryCatch) {
// Based on ScriptController::executeScriptAndReturnValue
DCHECK(isolate);
if (start_line < 1)
start_line = 1;
@@ -193,12 +196,14 @@ v8::Local<v8::Value> ExecuteV8ScriptAndReturnValue(
WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line),
WTF::OrdinalNumber::FromZeroBasedInt(0)));
auto* script = blink::MakeGarbageCollected<blink::ClassicScript>(
ssc, ssc.Url(), blink::ScriptFetchOptions(),
blink::SanitizeScriptErrors::kDoNotSanitize);
// The Rethrow() message is unused due to kDoNotSanitize but it still needs
// to be non-nullopt for exceptions to be re-thrown as expected.
auto result = blink::V8ScriptRunner::CompileAndRunScript(
isolate, blink::ScriptState::From(context), frame->DomWindow(), ssc,
ssc.Url(), blink::SanitizeScriptErrors::kDoNotSanitize,
blink::ScriptFetchOptions(),
blink::ScriptState::From(context), script,
blink::ExecuteScriptPolicy::kExecuteScriptWhenScriptsDisabled,
blink::V8ScriptRunner::RethrowErrorsOption::Rethrow(""));

View File

@@ -42,6 +42,8 @@ BLINK_EXPORT void GoForward(blink::WebView* view);
// Returns the text of the document element.
BLINK_EXPORT std::string DumpDocumentText(blink::WebLocalFrame* frame);
// Returns the markup of the document element.
BLINK_EXPORT std::string DumpDocumentMarkup(blink::WebLocalFrame* frame);
// Expose additional actions on WebNode.
BLINK_EXPORT cef_dom_node_type_t GetNodeType(const blink::WebNode& node);
@@ -65,7 +67,6 @@ BLINK_EXPORT v8::Local<v8::Value> ExecuteV8ScriptAndReturnValue(
const blink::WebString& source_url,
int start_line,
v8::Local<v8::Context> context,
v8::Isolate* isolate,
v8::TryCatch& tryCatch);
BLINK_EXPORT bool IsScriptForbidden();

View File

@@ -58,32 +58,32 @@ CefRefPtr<CefBrowserHost> CefBrowserImpl::GetHost() {
bool CefBrowserImpl::CanGoBack() {
CEF_REQUIRE_RT_RETURN(false);
return blink_glue::CanGoBack(render_view()->GetWebView());
return blink_glue::CanGoBack(GetWebView());
}
void CefBrowserImpl::GoBack() {
CEF_REQUIRE_RT_RETURN_VOID();
blink_glue::GoBack(render_view()->GetWebView());
blink_glue::GoBack(GetWebView());
}
bool CefBrowserImpl::CanGoForward() {
CEF_REQUIRE_RT_RETURN(false);
return blink_glue::CanGoForward(render_view()->GetWebView());
return blink_glue::CanGoForward(GetWebView());
}
void CefBrowserImpl::GoForward() {
CEF_REQUIRE_RT_RETURN_VOID();
blink_glue::GoForward(render_view()->GetWebView());
blink_glue::GoForward(GetWebView());
}
bool CefBrowserImpl::IsLoading() {
CEF_REQUIRE_RT_RETURN(false);
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame)
return main_frame->ToWebLocalFrame()->IsLoading();
}
@@ -93,8 +93,8 @@ bool CefBrowserImpl::IsLoading() {
void CefBrowserImpl::Reload() {
CEF_REQUIRE_RT_RETURN_VOID();
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
main_frame->ToWebLocalFrame()->StartReload(
blink::WebFrameLoadType::kReload);
@@ -105,8 +105,8 @@ void CefBrowserImpl::Reload() {
void CefBrowserImpl::ReloadIgnoreCache() {
CEF_REQUIRE_RT_RETURN_VOID();
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
main_frame->ToWebLocalFrame()->StartReload(
blink::WebFrameLoadType::kReloadBypassingCache);
@@ -117,8 +117,8 @@ void CefBrowserImpl::ReloadIgnoreCache() {
void CefBrowserImpl::StopLoad() {
CEF_REQUIRE_RT_RETURN_VOID();
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
main_frame->ToWebLocalFrame()->DeprecatedStopLoading();
}
@@ -147,8 +147,8 @@ bool CefBrowserImpl::IsPopup() {
bool CefBrowserImpl::HasDocument() {
CEF_REQUIRE_RT_RETURN(false);
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
return !main_frame->ToWebLocalFrame()->GetDocument().IsNull();
}
@@ -159,8 +159,8 @@ bool CefBrowserImpl::HasDocument() {
CefRefPtr<CefFrame> CefBrowserImpl::GetMainFrame() {
CEF_REQUIRE_RT_RETURN(nullptr);
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
return GetWebFrameImpl(main_frame->ToWebLocalFrame()).get();
}
@@ -171,9 +171,8 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetMainFrame() {
CefRefPtr<CefFrame> CefBrowserImpl::GetFocusedFrame() {
CEF_REQUIRE_RT_RETURN(nullptr);
if (render_view()->GetWebView() &&
render_view()->GetWebView()->FocusedFrame()) {
return GetWebFrameImpl(render_view()->GetWebView()->FocusedFrame()).get();
if (GetWebView() && GetWebView()->FocusedFrame()) {
return GetWebFrameImpl(GetWebView()->FocusedFrame()).get();
}
return nullptr;
}
@@ -187,7 +186,7 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(int64 identifier) {
CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(const CefString& name) {
CEF_REQUIRE_RT_RETURN(nullptr);
blink::WebView* web_view = render_view()->GetWebView();
blink::WebView* web_view = GetWebView();
if (web_view) {
const blink::WebString& frame_name =
blink::WebString::FromUTF16(name.ToString16());
@@ -220,9 +219,9 @@ size_t CefBrowserImpl::GetFrameCount() {
int count = 0;
if (render_view()->GetWebView()) {
for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame();
frame; frame = frame->TraverseNext()) {
if (GetWebView()) {
for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
count++;
}
}
@@ -236,9 +235,9 @@ void CefBrowserImpl::GetFrameIdentifiers(std::vector<int64>& identifiers) {
if (identifiers.size() > 0)
identifiers.clear();
if (render_view()->GetWebView()) {
for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame();
frame; frame = frame->TraverseNext()) {
if (GetWebView()) {
for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
if (frame->IsWebLocalFrame())
identifiers.push_back(
render_frame_util::GetIdentifier(frame->ToWebLocalFrame()));
@@ -252,9 +251,9 @@ void CefBrowserImpl::GetFrameNames(std::vector<CefString>& names) {
if (names.size() > 0)
names.clear();
if (render_view()->GetWebView()) {
for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame();
frame; frame = frame->TraverseNext()) {
if (GetWebView()) {
for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
if (frame->IsWebLocalFrame())
names.push_back(render_frame_util::GetName(frame->ToWebLocalFrame()));
}
@@ -268,7 +267,7 @@ CefBrowserImpl::CefBrowserImpl(content::RenderView* render_view,
int browser_id,
bool is_popup,
bool is_windowless)
: content::RenderViewObserver(render_view),
: blink::WebViewObserver(render_view->GetWebView()),
browser_id_(browser_id),
is_popup_(is_popup),
is_windowless_(is_windowless) {}
@@ -293,8 +292,8 @@ CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(
CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) {
if (frame_id == blink_glue::kInvalidFrameId) {
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
return GetWebFrameImpl(main_frame->ToWebLocalFrame());
}
@@ -307,10 +306,10 @@ CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) {
if (it != frames_.end())
return it->second;
if (render_view()->GetWebView()) {
if (GetWebView()) {
// Check if the frame exists but we don't know about it yet.
for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame();
frame; frame = frame->TraverseNext()) {
for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
if (frame->IsWebLocalFrame() &&
render_frame_util::GetIdentifier(frame->ToWebLocalFrame()) ==
frame_id) {
@@ -379,7 +378,7 @@ void CefBrowserImpl::OnLoadingStateChange(bool isLoading) {
if (handler.get()) {
CefRefPtr<CefLoadHandler> load_handler = handler->GetLoadHandler();
if (load_handler.get()) {
blink::WebView* web_view = render_view()->GetWebView();
blink::WebView* web_view = GetWebView();
const bool canGoBack = blink_glue::CanGoBack(web_view);
const bool canGoForward = blink_glue::CanGoForward(web_view);

View File

@@ -19,19 +19,23 @@
#include "libcef/common/tracker.h"
#include "libcef/renderer/frame_impl.h"
#include "content/public/renderer/render_view_observer.h"
#include "third_party/blink/public/web/web_view_observer.h"
namespace blink {
class WebFrame;
class WebNode;
} // namespace blink
namespace content {
class RenderView;
}
// Renderer plumbing for CEF features. There is a one-to-one relationship
// between RenderView on the renderer side and RenderViewHost on the browser
// side.
//
// RenderViewObserver: Interface for observing RenderView notifications.
class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver {
class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
public:
// Returns the browser associated with the specified RenderView.
static CefRefPtr<CefBrowserImpl> GetBrowserForView(content::RenderView* view);
@@ -78,7 +82,7 @@ class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver {
bool is_popup() const { return is_popup_; }
bool is_windowless() const { return is_windowless_; }
// RenderViewObserver methods.
// blink::WebViewObserver methods.
void OnDestruct() override;
void FrameDetached(int64_t frame_id);

View File

@@ -33,10 +33,10 @@
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/render_view_observer.h"
#include "services/network/public/mojom/cors_origin_pattern.mojom.h"
#include "third_party/blink/public/web/web_security_policy.h"
#include "third_party/blink/public/web/web_view.h"
#include "third_party/blink/public/web/web_view_observer.h"
namespace {
@@ -45,12 +45,12 @@ CefBrowserManager* g_manager = nullptr;
} // namespace
// Placeholder object for guest views.
class CefGuestView : public content::RenderViewObserver {
class CefGuestView : public blink::WebViewObserver {
public:
CefGuestView(CefBrowserManager* manager,
content::RenderView* render_view,
bool is_windowless)
: content::RenderViewObserver(render_view),
: blink::WebViewObserver(render_view->GetWebView()),
manager_(manager),
is_windowless_(is_windowless) {}
@@ -138,9 +138,8 @@ CefRefPtr<CefBrowserImpl> CefBrowserManager::GetBrowserForMainFrame(
blink::WebFrame* frame) {
BrowserMap::const_iterator it = browsers_.begin();
for (; it != browsers_.end(); ++it) {
content::RenderView* render_view = it->second->render_view();
if (render_view && render_view->GetWebView() &&
render_view->GetWebView()->MainFrame() == frame) {
auto web_view = it->second->GetWebView();
if (web_view && web_view->MainFrame() == frame) {
return it->second;
}
}

View File

@@ -390,8 +390,8 @@ CefRect CefDOMNodeImpl::GetElementBounds() {
}
WebElement element = node_.To<blink::WebElement>();
blink::WebRect rc = element.BoundsInViewport();
rect.Set(rc.x, rc.y, rc.width, rc.height);
const auto& rc = element.BoundsInViewport();
rect.Set(rc.x(), rc.y(), rc.width(), rc.height());
return rect;
}

View File

@@ -15,7 +15,7 @@
#include "chrome/common/url_constants.h"
#include "content/public/renderer/render_frame.h"
#include "extensions/common/constants.h"
#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h"
#include "extensions/renderer/guest_view/mime_handler_view/post_message_support.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"

View File

@@ -35,6 +35,7 @@
#include "content/public/renderer/render_view.h"
#include "content/renderer/render_frame_impl.h"
#include "third_party/blink/public/mojom/frame/frame.mojom-blink.h"
#include "third_party/blink/public/platform/web_back_forward_cache_loader_helper.h"
#include "third_party/blink/public/platform/web_data.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
@@ -98,8 +99,7 @@ void CefFrameImpl::ViewSource() {
void CefFrameImpl::GetSource(CefRefPtr<CefStringVisitor> visitor) {
CEF_REQUIRE_RT_RETURN_VOID();
if (frame_) {
const CefString& content =
std::string(blink::WebFrameContentDumper::DumpAsMarkup(frame_).Utf8());
const CefString& content = blink_glue::DumpDocumentMarkup(frame_);
visitor->Visit(content);
}
}
@@ -309,7 +309,7 @@ std::unique_ptr<blink::WebURLLoader> CefFrameImpl::CreateURLLoader() {
blink::WebURLRequest(),
blink_glue::CreateResourceLoadingTaskRunnerHandle(frame_),
blink_glue::CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle(frame_),
std::move(keep_alive_handle));
std::move(keep_alive_handle), blink::WebBackForwardCacheLoaderHelper());
}
std::unique_ptr<blink::ResourceLoadInfoNotifierWrapper>
@@ -490,7 +490,7 @@ void CefFrameImpl::OnRequest(const Cef_Request_Params& params) {
DCHECK(!command.empty());
if (base::LowerCaseEqualsASCII(command, "getsource")) {
response = blink::WebFrameContentDumper::DumpAsMarkup(frame_).Utf8();
response = blink_glue::DumpDocumentMarkup(frame_);
success = true;
} else if (base::LowerCaseEqualsASCII(command, "gettext")) {
response = blink_glue::DumpDocumentText(frame_);

View File

@@ -1104,7 +1104,7 @@ bool CefV8ContextImpl::Eval(const CefString& code,
try_catch.SetVerbose(true);
v8::Local<v8::Value> func_rv = blink_glue::ExecuteV8ScriptAndReturnValue(
source, source_url, start_line, context, isolate, try_catch);
source, source_url, start_line, context, try_catch);
if (try_catch.HasCaught()) {
exception = new CefV8ExceptionImpl(context, try_catch.Message());