mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 76.0.3809.0 (#665002)
OSR tests will be fixed by a follow-up merge of Viz support (see issue #2575).
This commit is contained in:
committed by
Marshall Greenblatt
parent
5892ffc382
commit
cc0db5f166
@@ -355,19 +355,6 @@ void CefBrowserImpl::OnDestruct() {
|
||||
CefContentRendererClient::Get()->OnBrowserDestroyed(this);
|
||||
}
|
||||
|
||||
void CefBrowserImpl::DidFailProvisionalLoad(blink::WebLocalFrame* frame,
|
||||
const blink::WebURLError& error) {
|
||||
OnLoadError(frame, error);
|
||||
}
|
||||
|
||||
void CefBrowserImpl::DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
|
||||
bool is_new_navigation) {
|
||||
if (frame->Parent() == nullptr) {
|
||||
OnLoadingStateChange(true);
|
||||
}
|
||||
OnLoadStart(frame);
|
||||
}
|
||||
|
||||
void CefBrowserImpl::FrameDetached(int64_t frame_id) {
|
||||
if (!frames_.empty()) {
|
||||
// Remove the frame from the map.
|
||||
@@ -412,37 +399,3 @@ void CefBrowserImpl::OnLoadingStateChange(bool isLoading) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserImpl::OnLoadStart(blink::WebLocalFrame* frame) {
|
||||
CefRefPtr<CefApp> app = CefContentClient::Get()->application();
|
||||
if (app.get()) {
|
||||
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
|
||||
if (handler.get()) {
|
||||
CefRefPtr<CefLoadHandler> load_handler = handler->GetLoadHandler();
|
||||
if (load_handler.get()) {
|
||||
CefRefPtr<CefFrameImpl> cef_frame = GetWebFrameImpl(frame);
|
||||
load_handler->OnLoadStart(this, cef_frame.get(), TT_EXPLICIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserImpl::OnLoadError(blink::WebLocalFrame* frame,
|
||||
const blink::WebURLError& error) {
|
||||
CefRefPtr<CefApp> app = CefContentClient::Get()->application();
|
||||
if (app.get()) {
|
||||
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
|
||||
if (handler.get()) {
|
||||
CefRefPtr<CefLoadHandler> load_handler = handler->GetLoadHandler();
|
||||
if (load_handler.get()) {
|
||||
CefRefPtr<CefFrameImpl> cef_frame = GetWebFrameImpl(frame);
|
||||
const cef_errorcode_t errorCode =
|
||||
static_cast<cef_errorcode_t>(error.reason());
|
||||
const std::string& errorText = net::ErrorToString(error.reason());
|
||||
const GURL& failedUrl = error.url();
|
||||
load_handler->OnLoadError(this, cef_frame.get(), errorCode, errorText,
|
||||
failedUrl.spec());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -83,20 +83,11 @@ class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver {
|
||||
|
||||
// RenderViewObserver methods.
|
||||
void OnDestruct() override;
|
||||
void DidFailProvisionalLoad(blink::WebLocalFrame* frame,
|
||||
const blink::WebURLError& error) override;
|
||||
void DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
|
||||
bool is_new_navigation) override;
|
||||
|
||||
void FrameDetached(int64_t frame_id);
|
||||
|
||||
void OnLoadingStateChange(bool isLoading);
|
||||
|
||||
private:
|
||||
void OnLoadStart(blink::WebLocalFrame* frame);
|
||||
void OnLoadError(blink::WebLocalFrame* frame,
|
||||
const blink::WebURLError& error);
|
||||
|
||||
// ID of the browser that this RenderView is associated with. During loading
|
||||
// of cross-origin requests multiple RenderViews may be associated with the
|
||||
// same browser ID.
|
||||
|
@@ -292,7 +292,11 @@ void CefContentRendererClient::WebKitInitialized() {
|
||||
blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(
|
||||
gurl, blink::WebString::FromUTF8(entry.target_protocol),
|
||||
blink::WebString::FromUTF8(entry.target_domain),
|
||||
entry.allow_target_subdomains,
|
||||
/*destination_port=*/0,
|
||||
entry.allow_target_subdomains
|
||||
? network::mojom::CorsDomainMatchMode::kAllowSubdomains
|
||||
: network::mojom::CorsDomainMatchMode::kDisallowSubdomains,
|
||||
network::mojom::CorsPortMatchMode::kAllowAnyPort,
|
||||
network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
|
||||
}
|
||||
cross_origin_whitelist_entries_.clear();
|
||||
@@ -418,7 +422,8 @@ void CefContentRendererClient::RenderThreadStarted() {
|
||||
pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get());
|
||||
}
|
||||
|
||||
for (auto& origin_or_hostname_pattern : network::GetSecureOriginAllowlist()) {
|
||||
for (auto& origin_or_hostname_pattern :
|
||||
network::SecureOriginAllowlist::GetInstance().GetCurrentAllowlist()) {
|
||||
blink::WebSecurityPolicy::AddOriginToTrustworthySafelist(
|
||||
blink::WebString::FromUTF8(origin_or_hostname_pattern));
|
||||
}
|
||||
|
@@ -51,16 +51,16 @@ bool CefPrintRenderFrameHelperDelegate::OverridePrint(
|
||||
if (!frame->GetDocument().IsPluginDocument())
|
||||
return false;
|
||||
|
||||
auto mime_handlers = extensions::MimeHandlerViewContainer::FromRenderFrame(
|
||||
content::RenderFrame::FromWebFrame(frame));
|
||||
if (!mime_handlers.empty()) {
|
||||
auto* post_message_support =
|
||||
extensions::PostMessageSupport::FromWebLocalFrame(frame);
|
||||
if (post_message_support) {
|
||||
// This message is handled in chrome/browser/resources/pdf/pdf.js and
|
||||
// instructs the PDF plugin to print. This is to make window.print() on a
|
||||
// PDF plugin document correctly print the PDF. See
|
||||
// https://crbug.com/448720.
|
||||
base::DictionaryValue message;
|
||||
message.SetString("type", "print");
|
||||
mime_handlers.front()->PostMessageFromValue(message);
|
||||
post_message_support->PostMessageFromValue(message);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@@ -230,13 +230,6 @@ CefString CefFrameImpl::GetURL() {
|
||||
|
||||
if (frame_) {
|
||||
GURL gurl = frame_->GetDocument().Url();
|
||||
if (gurl.is_empty()) {
|
||||
// For popups the main document URL will be empty during loading. Return
|
||||
// the provisional document URL instead.
|
||||
blink::WebDocumentLoader* loader = frame_->GetProvisionalDocumentLoader();
|
||||
if (loader)
|
||||
gurl = loader->GetUrl();
|
||||
}
|
||||
url = gurl.spec();
|
||||
}
|
||||
return url;
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "libcef/renderer/v8_impl.h"
|
||||
|
||||
#include "content/public/renderer/render_frame.h"
|
||||
#include "content/public/renderer/render_view.h"
|
||||
#include "third_party/blink/public/web/blink.h"
|
||||
#include "third_party/blink/public/web/web_document.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
@@ -41,6 +42,28 @@ void CefRenderFrameObserver::OnInterfaceRequestForFrame(
|
||||
registry_.TryBindInterface(interface_name, interface_pipe);
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::DidCommitProvisionalLoad(
|
||||
bool is_same_document_navigation,
|
||||
ui::PageTransition transition) {
|
||||
if (!frame_)
|
||||
return;
|
||||
|
||||
if (frame_->GetParent() == nullptr) {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
browserPtr->OnLoadingStateChange(true);
|
||||
}
|
||||
OnLoadStart();
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::DidFailProvisionalLoad(
|
||||
const blink::WebURLError& error) {
|
||||
if (frame_) {
|
||||
OnLoadError(error);
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::DidFinishLoad() {
|
||||
if (frame_) {
|
||||
frame_->OnDidFinishLoad();
|
||||
@@ -60,7 +83,11 @@ void CefRenderFrameObserver::FrameFocused() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::FocusedNodeChanged(const blink::WebNode& node) {
|
||||
void CefRenderFrameObserver::FocusedElementChanged(
|
||||
const blink::WebElement& element) {
|
||||
if (!frame_)
|
||||
return;
|
||||
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
@@ -76,18 +103,18 @@ void CefRenderFrameObserver::FocusedNodeChanged(const blink::WebNode& node) {
|
||||
|
||||
CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame);
|
||||
|
||||
if (node.IsNull()) {
|
||||
if (element.IsNull()) {
|
||||
handler->OnFocusedNodeChanged(browserPtr.get(), framePtr.get(), nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.GetDocument().IsNull())
|
||||
if (element.GetDocument().IsNull())
|
||||
return;
|
||||
|
||||
CefRefPtr<CefDOMDocumentImpl> documentImpl =
|
||||
new CefDOMDocumentImpl(browserPtr.get(), frame);
|
||||
handler->OnFocusedNodeChanged(browserPtr.get(), framePtr.get(),
|
||||
documentImpl->GetOrCreateNode(node));
|
||||
documentImpl->GetOrCreateNode(element));
|
||||
documentImpl->Detach();
|
||||
}
|
||||
|
||||
@@ -100,6 +127,9 @@ void CefRenderFrameObserver::DraggableRegionsChanged() {
|
||||
void CefRenderFrameObserver::DidCreateScriptContext(
|
||||
v8::Handle<v8::Context> context,
|
||||
int world_id) {
|
||||
if (!frame_)
|
||||
return;
|
||||
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
@@ -178,6 +208,43 @@ void CefRenderFrameObserver::AttachFrame(CefFrameImpl* frame) {
|
||||
frame_->OnAttached();
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::OnLoadStart() {
|
||||
CefRefPtr<CefApp> app = CefContentClient::Get()->application();
|
||||
if (app.get()) {
|
||||
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
|
||||
if (handler.get()) {
|
||||
CefRefPtr<CefLoadHandler> load_handler = handler->GetLoadHandler();
|
||||
if (load_handler.get()) {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
load_handler->OnLoadStart(browserPtr.get(), frame_, TT_EXPLICIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::OnLoadError(const blink::WebURLError& error) {
|
||||
CefRefPtr<CefApp> app = CefContentClient::Get()->application();
|
||||
if (app.get()) {
|
||||
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
|
||||
if (handler.get()) {
|
||||
CefRefPtr<CefLoadHandler> load_handler = handler->GetLoadHandler();
|
||||
if (load_handler.get()) {
|
||||
const cef_errorcode_t errorCode =
|
||||
static_cast<cef_errorcode_t>(error.reason());
|
||||
const std::string& errorText = net::ErrorToString(error.reason());
|
||||
const GURL& failedUrl = error.url();
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
load_handler->OnLoadError(browserPtr.get(), frame_, errorCode,
|
||||
errorText, failedUrl.spec());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
|
||||
#if defined(OS_WIN)
|
||||
#if defined(__clang__)
|
||||
|
@@ -10,7 +10,8 @@
|
||||
|
||||
namespace content {
|
||||
class RenderFrame;
|
||||
}
|
||||
class RenderView;
|
||||
} // namespace content
|
||||
|
||||
class CefFrameImpl;
|
||||
|
||||
@@ -23,10 +24,13 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
|
||||
void OnInterfaceRequestForFrame(
|
||||
const std::string& interface_name,
|
||||
mojo::ScopedMessagePipeHandle* interface_pipe) override;
|
||||
void DidCommitProvisionalLoad(bool is_same_document_navigation,
|
||||
ui::PageTransition transition) override;
|
||||
void DidFailProvisionalLoad(const blink::WebURLError& error) override;
|
||||
void DidFinishLoad() override;
|
||||
void FrameDetached() override;
|
||||
void FrameFocused() override;
|
||||
void FocusedNodeChanged(const blink::WebNode& node) override;
|
||||
void FocusedElementChanged(const blink::WebElement& element) override;
|
||||
void DraggableRegionsChanged() override;
|
||||
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -40,6 +44,9 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
|
||||
void AttachFrame(CefFrameImpl* frame);
|
||||
|
||||
private:
|
||||
void OnLoadStart();
|
||||
void OnLoadError(const blink::WebURLError& error);
|
||||
|
||||
service_manager::BinderRegistry registry_;
|
||||
CefFrameImpl* frame_ = nullptr;
|
||||
|
||||
|
@@ -68,7 +68,11 @@ void CefRenderThreadObserver::OnModifyCrossOriginWhitelistEntry(
|
||||
blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(
|
||||
gurl, blink::WebString::FromUTF8(params.target_protocol),
|
||||
blink::WebString::FromUTF8(params.target_domain),
|
||||
params.allow_target_subdomains,
|
||||
/*destination_port=*/0,
|
||||
params.allow_target_subdomains
|
||||
? network::mojom::CorsDomainMatchMode::kAllowSubdomains
|
||||
: network::mojom::CorsDomainMatchMode::kDisallowSubdomains,
|
||||
network::mojom::CorsPortMatchMode::kAllowAnyPort,
|
||||
network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
|
||||
} else {
|
||||
blink::WebSecurityPolicy::ClearOriginAccessListForOrigin(gurl);
|
||||
|
@@ -1942,9 +1942,11 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(const CefString& key) {
|
||||
|
||||
v8::TryCatch try_catch(isolate);
|
||||
try_catch.SetVerbose(true);
|
||||
v8::Local<v8::Value> ret_value = obj->Get(GetV8String(isolate, key));
|
||||
if (!HasCaught(context, try_catch) && !ret_value.IsEmpty())
|
||||
return new CefV8ValueImpl(isolate, context, ret_value);
|
||||
v8::MaybeLocal<v8::Value> ret_value =
|
||||
obj->Get(context, GetV8String(isolate, key));
|
||||
if (!HasCaught(context, try_catch) && !ret_value.IsEmpty()) {
|
||||
return new CefV8ValueImpl(isolate, context, ret_value.ToLocalChecked());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1970,9 +1972,11 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::GetValue(int index) {
|
||||
|
||||
v8::TryCatch try_catch(isolate);
|
||||
try_catch.SetVerbose(true);
|
||||
v8::Local<v8::Value> ret_value = obj->Get(v8::Number::New(isolate, index));
|
||||
if (!HasCaught(context, try_catch) && !ret_value.IsEmpty())
|
||||
return new CefV8ValueImpl(isolate, context, ret_value);
|
||||
v8::MaybeLocal<v8::Value> ret_value =
|
||||
obj->Get(context, v8::Number::New(isolate, index));
|
||||
if (!HasCaught(context, try_catch) && !ret_value.IsEmpty()) {
|
||||
return new CefV8ValueImpl(isolate, context, ret_value.ToLocalChecked());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2110,7 +2114,8 @@ bool CefV8ValueImpl::GetKeys(std::vector<CefString>& keys) {
|
||||
|
||||
uint32_t len = arr_keys->Length();
|
||||
for (uint32_t i = 0; i < len; ++i) {
|
||||
v8::Local<v8::Value> value = arr_keys->Get(v8::Integer::New(isolate, i));
|
||||
v8::Local<v8::Value> value =
|
||||
arr_keys->Get(context, v8::Integer::New(isolate, i)).ToLocalChecked();
|
||||
CefString str;
|
||||
GetCefString(isolate, value->ToString(context).ToLocalChecked(), str);
|
||||
keys.push_back(str);
|
||||
|
Reference in New Issue
Block a user