Update to Chromium version 79.0.3945.1 (#706915)

This commit is contained in:
Daniel Nitsche
2019-11-12 11:11:44 -05:00
committed by Marshall Greenblatt
parent b9fc93955c
commit 115f760821
103 changed files with 662 additions and 756 deletions

View File

@@ -61,7 +61,7 @@ void GoBack(blink::WebView* view) {
blink::WebViewImpl* view_impl = reinterpret_cast<blink::WebViewImpl*>(view);
if (view_impl->Client()->HistoryBackListCount() > 0) {
main_frame->ToWebLocalFrame()->Client()->NavigateBackForwardSoon(
-1, true /* has_user_gesture */, false /* from_script */);
-1, true /* has_user_gesture */);
}
}
}
@@ -75,7 +75,7 @@ void GoForward(blink::WebView* view) {
blink::WebViewImpl* view_impl = reinterpret_cast<blink::WebViewImpl*>(view);
if (view_impl->Client()->HistoryForwardListCount() > 0) {
main_frame->ToWebLocalFrame()->Client()->NavigateBackForwardSoon(
1, true /* has_user_gesture */, false /* from_script */);
1, true /* has_user_gesture */);
}
}
}

View File

@@ -576,28 +576,6 @@ bool CefContentRendererClient::OverrideCreatePlugin(
return true;
}
bool CefContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
const GURL& url,
const std::string& http_method,
bool is_initial_navigation,
bool is_server_redirect) {
DCHECK(!frame->Parent());
// For now, we skip the rest for POST submissions. This is because
// http://crbug.com/101395 is more likely to cause compatibility issues
// with hosted apps and extensions than WebUI pages. We will remove this
// check when cross-process POST submissions are supported.
if (http_method != "GET")
return false;
if (extensions::ExtensionsEnabled()) {
return extensions::CefExtensionsRendererClient::ShouldFork(
frame, url, is_initial_navigation, is_server_redirect);
}
return false;
}
void CefContentRendererClient::WillSendRequest(
blink::WebLocalFrame* frame,
ui::PageTransition transition_type,

View File

@@ -111,11 +111,6 @@ class CefContentRendererClient
bool OverrideCreatePlugin(content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
blink::WebPlugin** plugin) override;
bool ShouldFork(blink::WebLocalFrame* frame,
const GURL& url,
const std::string& http_method,
bool is_initial_navigation,
bool is_server_redirect) override;
void WillSendRequest(blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
const blink::WebURL& url,

View File

@@ -43,54 +43,6 @@ void IsGuestViewApiAvailableToScriptContext(
}
}
// Returns true if the frame is navigating to an URL either into or out of an
// extension app's extent.
bool CrossesExtensionExtents(blink::WebLocalFrame* frame,
const GURL& new_url,
bool is_extension_url,
bool is_initial_navigation) {
DCHECK(!frame->Parent());
GURL old_url(frame->GetDocument().Url());
extensions::RendererExtensionRegistry* extension_registry =
extensions::RendererExtensionRegistry::Get();
// If old_url is still empty and this is an initial navigation, then this is
// a window.open operation. We should look at the opener URL. Note that the
// opener is a local frame in this case.
if (is_initial_navigation && old_url.is_empty() && frame->Opener()) {
blink::WebLocalFrame* opener_frame = frame->Opener()->ToWebLocalFrame();
// We want to compare against the URL that determines the type of
// process. Use the URL of the opener's local frame root, which will
// correctly handle any site isolation modes (e.g. --site-per-process).
blink::WebLocalFrame* local_root = opener_frame->LocalRoot();
old_url = local_root->GetDocument().Url();
// If we're about to open a normal web page from a same-origin opener stuck
// in an extension process (other than the Chrome Web Store), we want to
// keep it in process to allow the opener to script it.
blink::WebDocument opener_document = opener_frame->GetDocument();
blink::WebSecurityOrigin opener_origin =
opener_document.GetSecurityOrigin();
bool opener_is_extension_url =
!opener_origin.IsUnique() && extension_registry->GetExtensionOrAppByURL(
opener_document.Url()) != nullptr;
const Extension* opener_top_extension =
extension_registry->GetExtensionOrAppByURL(old_url);
bool opener_is_web_store =
opener_top_extension &&
opener_top_extension->id() == extensions::kWebStoreAppId;
if (!is_extension_url && !opener_is_extension_url && !opener_is_web_store &&
CefExtensionsRendererClient::IsStandaloneExtensionProcess() &&
opener_origin.CanRequest(blink::WebURL(new_url)))
return false;
}
return extensions::CrossesExtensionProcessBoundary(
*extension_registry->GetMainThreadExtensionSet(), old_url, new_url);
}
} // namespace
CefExtensionsRendererClient::CefExtensionsRendererClient() {}
@@ -225,35 +177,6 @@ bool CefExtensionsRendererClient::IsStandaloneExtensionProcess() {
extensions::switches::kExtensionProcess);
}
// static
bool CefExtensionsRendererClient::ShouldFork(blink::WebLocalFrame* frame,
const GURL& url,
bool is_initial_navigation,
bool is_server_redirect) {
const extensions::RendererExtensionRegistry* extension_registry =
extensions::RendererExtensionRegistry::Get();
// Determine if the new URL is an extension (excluding bookmark apps).
const extensions::Extension* new_url_extension =
extensions::GetNonBookmarkAppExtension(
*extension_registry->GetMainThreadExtensionSet(), url);
bool is_extension_url = !!new_url_extension;
// If the navigation would cross an app extent boundary, we also need
// to defer to the browser to ensure process isolation. This is not
// necessary for server redirects, which will be transferred to a new
// process by the browser process when they are ready to commit. It is
// necessary for client redirects, which won't be transferred in the same
// way.
if (!is_server_redirect &&
CrossesExtensionExtents(frame, url, is_extension_url,
is_initial_navigation)) {
return true;
}
return false;
}
// static
content::BrowserPluginDelegate*
CefExtensionsRendererClient::CreateBrowserPluginDelegate(

View File

@@ -72,10 +72,6 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame);
static bool IsStandaloneExtensionProcess();
static bool ShouldFork(blink::WebLocalFrame* frame,
const GURL& url,
bool is_initial_navigation,
bool is_server_redirect);
static content::BrowserPluginDelegate* CreateBrowserPluginDelegate(
content::RenderFrame* render_frame,
const content::WebPluginInfo& info,

View File

@@ -342,8 +342,8 @@ void CefFrameImpl::OnDraggableRegionsChanged() {
std::vector<Cef_DraggableRegion_Params> regions;
for (size_t i = 0; i < webregions.size(); ++i) {
Cef_DraggableRegion_Params region;
browser_->render_view()->ConvertViewportToWindowViaWidget(
&webregions[i].bounds);
auto render_frame = content::RenderFrameImpl::FromWebFrame(frame_);
render_frame->ConvertViewportToWindow(&webregions[i].bounds);
region.bounds = webregions[i].bounds;
region.draggable = webregions[i].draggable;
regions.push_back(region);

View File

@@ -57,10 +57,9 @@ void CefRenderFrameObserver::DidCommitProvisionalLoad(
OnLoadStart();
}
void CefRenderFrameObserver::DidFailProvisionalLoad(
const blink::WebURLError& error) {
void CefRenderFrameObserver::DidFailProvisionalLoad() {
if (frame_) {
OnLoadError(error);
OnLoadError();
}
}
@@ -224,17 +223,19 @@ void CefRenderFrameObserver::OnLoadStart() {
}
}
void CefRenderFrameObserver::OnLoadError(const blink::WebURLError& error) {
void CefRenderFrameObserver::OnLoadError() {
CefRefPtr<CefApp> app = CefContentClient::Get()->application();
if (app.get()) {
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
if (handler.get()) {
CefRefPtr<CefLoadHandler> load_handler = handler->GetLoadHandler();
// Error codes were removed from DidFailProvisionalLoad() so we now always
// pass the same value.
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();
static_cast<cef_errorcode_t>(net::ERR_ABORTED);
const std::string& errorText = net::ErrorToString(errorCode);
const GURL failedUrl(frame_->GetURL().c_str());
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
CefRefPtr<CefBrowserImpl> browserPtr =
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());

View File

@@ -26,7 +26,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
mojo::ScopedMessagePipeHandle* interface_pipe) override;
void DidCommitProvisionalLoad(bool is_same_document_navigation,
ui::PageTransition transition) override;
void DidFailProvisionalLoad(const blink::WebURLError& error) override;
void DidFailProvisionalLoad() override;
void DidFinishLoad() override;
void FrameDetached() override;
void FrameFocused() override;
@@ -45,7 +45,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
private:
void OnLoadStart();
void OnLoadError(const blink::WebURLError& error);
void OnLoadError();
service_manager::BinderRegistry registry_;
CefFrameImpl* frame_ = nullptr;

View File

@@ -86,7 +86,7 @@ void CefRenderThreadObserver::UnregisterMojoInterfaces(
void CefRenderThreadObserver::SetInitialConfiguration(
bool is_incognito_process,
chrome::mojom::ChromeOSListenerRequest chromeos_listener_request) {
mojo::PendingReceiver<chrome::mojom::ChromeOSListener> chromeos_listener) {
is_incognito_process_ = is_incognito_process;
}
@@ -105,8 +105,9 @@ void CefRenderThreadObserver::SetFieldTrialGroup(
}
void CefRenderThreadObserver::OnRendererConfigurationAssociatedRequest(
chrome::mojom::RendererConfigurationAssociatedRequest request) {
renderer_configuration_bindings_.AddBinding(this, std::move(request));
mojo::PendingAssociatedReceiver<chrome::mojom::RendererConfiguration>
receiver) {
renderer_configuration_receivers_.Add(this, std::move(receiver));
}
void CefRenderThreadObserver::OnModifyCrossOriginWhitelistEntry(

View File

@@ -13,6 +13,7 @@
#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"
namespace visitedlink {
class VisitedLinkSlave;
@@ -46,9 +47,10 @@ class CefRenderThreadObserver : public content::RenderThreadObserver,
blink::AssociatedInterfaceRegistry* associated_interfaces) override;
// chrome::mojom::RendererConfiguration:
void SetInitialConfiguration(bool is_incognito_process,
chrome::mojom::ChromeOSListenerRequest
chromeos_listener_request) override;
void SetInitialConfiguration(
bool is_incognito_process,
mojo::PendingReceiver<chrome::mojom::ChromeOSListener> chromeos_listener)
override;
void SetConfiguration(chrome::mojom::DynamicParamsPtr params) override;
void SetContentSettingRules(
const RendererContentSettingRules& rules) override;
@@ -56,7 +58,8 @@ class CefRenderThreadObserver : public content::RenderThreadObserver,
const std::string& group_name) override;
void OnRendererConfigurationAssociatedRequest(
chrome::mojom::RendererConfigurationAssociatedRequest request);
mojo::PendingAssociatedReceiver<chrome::mojom::RendererConfiguration>
receiver);
// Message handlers called on the render thread.
void OnModifyCrossOriginWhitelistEntry(
@@ -68,8 +71,8 @@ class CefRenderThreadObserver : public content::RenderThreadObserver,
std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_;
mojo::AssociatedBindingSet<chrome::mojom::RendererConfiguration>
renderer_configuration_bindings_;
mojo::AssociatedReceiverSet<chrome::mojom::RendererConfiguration>
renderer_configuration_receivers_;
DISALLOW_COPY_AND_ASSIGN(CefRenderThreadObserver);
};

View File

@@ -55,15 +55,13 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
int64_t total_decoded_body_length) override;
void DidStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle response_body) override;
bool WillFollowRedirect(
const WebURL& new_url,
const WebURL& new_site_for_cookies,
const base::Optional<blink::WebSecurityOrigin>& new_top_frame_origin,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,
const WebURLResponse& passed_redirect_response,
bool& report_raw_headers) override;
bool WillFollowRedirect(const WebURL& new_url,
const WebURL& new_site_for_cookies,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,
const WebURLResponse& passed_redirect_response,
bool& report_raw_headers) override;
protected:
// The context_ pointer will outlive this object.
@@ -395,7 +393,6 @@ void CefWebURLLoaderClient::DidStartLoadingResponseBody(
bool CefWebURLLoaderClient::WillFollowRedirect(
const WebURL& new_url,
const WebURL& new_site_for_cookies,
const base::Optional<blink::WebSecurityOrigin>& new_top_frame_origin,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,