Commit 35830c88 authored by Marshall Greenblatt's avatar Marshall Greenblatt
Browse files

Update to Chromium version 69.0.3464.0 (#567918)

parent 3c3045a5
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/69.0.3453.0',
'chromium_checkout': 'refs/tags/69.0.3464.0',
}
This diff is collapsed.
......@@ -474,7 +474,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
void RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) override;
content::MediaResponseCallback callback) override;
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
const GURL& security_origin,
content::MediaStreamType type) override;
......@@ -521,6 +521,20 @@ class CefBrowserHostImpl : public CefBrowserHost,
void RemoveObserver(Observer* observer);
bool HasObserver(Observer* observer) const;
class NavigationLock final {
private:
friend class CefBrowserHostImpl;
friend std::unique_ptr<NavigationLock>::deleter_type;
explicit NavigationLock(CefRefPtr<CefBrowserHostImpl> browser);
~NavigationLock();
CefRefPtr<CefBrowserHostImpl> browser_;
};
// Block navigation-related events on NavigationLock life span.
std::unique_ptr<NavigationLock> CreateNavigationLock();
private:
class DevToolsWebContentsObserver;
......@@ -580,6 +594,11 @@ class CefBrowserHostImpl : public CefBrowserHost,
void DestroyExtensionHost();
void OnExtensionHostDeleted();
// Returns true if navigation actions are currently locked.
bool navigation_locked() const;
// Action to be executed once the navigation lock is released.
void set_pending_navigation_action(base::OnceClosure action);
// Update or create a frame object. |frame_id| (renderer routing id) will be
// >= 0 if the frame currently exists in the renderer process. |frame_id| will
// be < 0 for the main frame if it has not yet navigated for the first time,
......@@ -686,9 +705,11 @@ class CefBrowserHostImpl : public CefBrowserHost,
// thread.
DestructionState destruction_state_;
// True if frame destruction is currently pending. Navigation should not occur
// while this flag is true.
bool frame_destruction_pending_;
// Navigation will not occur while |navigation_lock_count_| > 0.
// |pending_navigation_action_| will be executed when the lock is released.
// Only accessed on the UI thread.
int navigation_lock_count_ = 0;
base::OnceClosure pending_navigation_action_;
// True if the OS window hosting the browser has been destroyed. Only accessed
// on the UI thread.
......
......@@ -430,6 +430,11 @@ bool NavigationOnUIThread(
request->Set(params, is_main_frame);
request->SetReadOnly(true);
// Initiating a new navigation in OnBeforeBrowse will delete the
// InterceptNavigationThrottle that currently owns this callback,
// resulting in a crash. Use the lock to prevent that.
std::unique_ptr<CefBrowserHostImpl::NavigationLock> navigation_lock =
browser->CreateNavigationLock();
ignore_navigation = handler->OnBeforeBrowse(
browser.get(), frame, request.get(), params.has_user_gesture(),
params.is_redirect());
......
......@@ -42,7 +42,7 @@ void CefExtensionHostDelegate::CreateTab(
void CefExtensionHostDelegate::ProcessMediaAccessRequest(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback,
content::MediaResponseCallback callback,
const Extension* extension) {
// Never routed here from CefBrowserHostImpl.
NOTREACHED();
......
......@@ -28,7 +28,7 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate {
bool user_gesture) override;
void ProcessMediaAccessRequest(content::WebContents* web_contents,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback,
content::MediaResponseCallback callback,
const Extension* extension) override;
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
const GURL& security_origin,
......
......@@ -32,18 +32,18 @@ namespace {
class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
public:
typedef net::CompletionCallback CallbackType;
typedef net::CompletionOnceCallback CallbackType;
CefBeforeResourceLoadCallbackImpl(CefRefPtr<CefRequestImpl> cef_request,
GURL* new_url,
net::URLRequest* url_request,
bool force_google_safesearch,
const CallbackType& callback)
CallbackType callback)
: cef_request_(cef_request),
new_url_(new_url),
url_request_(url_request),
force_google_safesearch_(force_google_safesearch),
callback_(callback) {
callback_(std::move(callback)) {
DCHECK(new_url);
DCHECK(url_request_);
......@@ -56,13 +56,14 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
if (!callback_.is_null()) {
// The callback is still pending. Cancel it now.
if (CEF_CURRENTLY_ON_IOT()) {
RunNow(cef_request_, new_url_, url_request_, callback_,
RunNow(cef_request_, new_url_, url_request_, std::move(callback_),
force_google_safesearch_, false);
} else {
CEF_POST_TASK(
CEF_IOT, base::Bind(&CefBeforeResourceLoadCallbackImpl::RunNow,
cef_request_, new_url_, url_request_, callback_,
force_google_safesearch_, false));
CEF_POST_TASK(CEF_IOT,
base::Bind(&CefBeforeResourceLoadCallbackImpl::RunNow,
cef_request_, new_url_, url_request_,
base::Passed(std::move(callback_)),
force_google_safesearch_, false));
}
}
}
......@@ -79,12 +80,13 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
void ContinueNow(bool allow) {
CEF_REQUIRE_IOT();
if (!callback_.is_null()) {
RunNow(cef_request_, new_url_, url_request_, callback_,
RunNow(cef_request_, new_url_, url_request_, std::move(callback_),
force_google_safesearch_, allow);
Disconnect();
}
}
private:
void Disconnect() {
CEF_REQUIRE_IOT();
cef_request_ = nullptr;
......@@ -93,7 +95,6 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
callback_.Reset();
}
private:
// Used to disconnect the callback when the associated URLRequest is
// destroyed.
class Disconnector : public base::SupportsUserData::Data {
......@@ -114,7 +115,7 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
static void RunNow(CefRefPtr<CefRequestImpl> cef_request,
GURL* new_url,
net::URLRequest* request,
const CallbackType& callback,
CallbackType callback,
bool force_google_safesearch,
bool allow) {
CEF_REQUIRE_IOT();
......@@ -144,7 +145,7 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
if (force_google_safesearch && allow && new_url->is_empty())
safe_search_util::ForceGoogleSafeSearch(request, new_url);
callback.Run(allow ? net::OK : net::ERR_ABORTED);
std::move(callback).Run(allow ? net::OK : net::ERR_ABORTED);
}
}
......@@ -168,17 +169,18 @@ int CefBeforeResourceLoadCallbackImpl::kLocatorKey = 0;
class CefAuthCallbackImpl : public CefAuthCallback {
public:
CefAuthCallbackImpl(const net::NetworkDelegate::AuthCallback& callback,
net::AuthCredentials* credentials)
: callback_(callback), credentials_(credentials) {}
typedef net::NetworkDelegate::AuthCallback CallbackType;
CefAuthCallbackImpl(CallbackType callback, net::AuthCredentials* credentials)
: callback_(std::move(callback)), credentials_(credentials) {}
~CefAuthCallbackImpl() override {
if (!callback_.is_null()) {
// The auth callback is still pending. Cancel it now.
if (CEF_CURRENTLY_ON_IOT()) {
CancelNow(callback_);
CancelNow(std::move(callback_));
} else {
CEF_POST_TASK(CEF_IOT,
base::Bind(&CefAuthCallbackImpl::CancelNow, callback_));
CEF_POST_TASK(CEF_IOT, base::Bind(&CefAuthCallbackImpl::CancelNow,
base::Passed(std::move(callback_))));
}
}
}
......@@ -187,8 +189,8 @@ class CefAuthCallbackImpl : public CefAuthCallback {
if (CEF_CURRENTLY_ON_IOT()) {
if (!callback_.is_null()) {
credentials_->Set(username, password);
callback_.Run(net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_SET_AUTH);
callback_.Reset();
std::move(callback_).Run(
net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_SET_AUTH);
}
} else {
CEF_POST_TASK(CEF_IOT, base::Bind(&CefAuthCallbackImpl::Continue, this,
......@@ -199,23 +201,23 @@ class CefAuthCallbackImpl : public CefAuthCallback {
void Cancel() override {
if (CEF_CURRENTLY_ON_IOT()) {
if (!callback_.is_null()) {
CancelNow(callback_);
callback_.Reset();
CancelNow(std::move(callback_));
}
} else {
CEF_POST_TASK(CEF_IOT, base::Bind(&CefAuthCallbackImpl::Cancel, this));
}
}
void Disconnect() { callback_.Reset(); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
private:
static void CancelNow(const net::NetworkDelegate::AuthCallback& callback) {
static void CancelNow(CallbackType callback) {
CEF_REQUIRE_IOT();
callback.Run(net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION);
std::move(callback).Run(
net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION);
}
net::NetworkDelegate::AuthCallback callback_;
CallbackType callback_;
net::AuthCredentials* credentials_;
IMPLEMENT_REFCOUNTING(CefAuthCallbackImpl);
......@@ -277,10 +279,9 @@ std::unique_ptr<net::SourceStream> CefNetworkDelegate::CreateSourceStream(
return upstream;
}
int CefNetworkDelegate::OnBeforeURLRequest(
net::URLRequest* request,
const net::CompletionCallback& callback,
GURL* new_url) {
int CefNetworkDelegate::OnBeforeURLRequest(net::URLRequest* request,
net::CompletionOnceCallback callback,
GURL* new_url) {
if (net_util::IsInternalRequest(request))
return net::OK;
......@@ -312,7 +313,7 @@ int CefNetworkDelegate::OnBeforeURLRequest(
CefRefPtr<CefBeforeResourceLoadCallbackImpl> callbackImpl(
new CefBeforeResourceLoadCallbackImpl(requestPtr, new_url, request,
force_google_safesearch,
callback));
std::move(callback)));
// Give the client an opportunity to evaluate the request.
cef_return_value_t retval = handler->OnBeforeResourceLoad(
......@@ -338,7 +339,9 @@ int CefNetworkDelegate::OnBeforeURLRequest(
return net::OK;
}
void CefNetworkDelegate::OnCompleted(net::URLRequest* request, bool started) {
void CefNetworkDelegate::OnCompleted(net::URLRequest* request,
bool started,
int net_error) {
if (net_util::IsInternalRequest(request))
return;
......@@ -391,7 +394,7 @@ void CefNetworkDelegate::OnCompleted(net::URLRequest* request, bool started) {
net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired(
net::URLRequest* request,
const net::AuthChallengeInfo& auth_info,
const AuthCallback& callback,
AuthCallback callback,
net::AuthCredentials* credentials) {
if (net_util::IsInternalRequest(request))
return AUTH_REQUIRED_RESPONSE_NO_ACTION;
......@@ -406,14 +409,14 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired(
CefRefPtr<CefFrame> frame = browser->GetFrameForRequest(request);
CefRefPtr<CefAuthCallbackImpl> callbackPtr(
new CefAuthCallbackImpl(callback, credentials));
new CefAuthCallbackImpl(std::move(callback), credentials));
if (handler->GetAuthCredentials(
browser.get(), frame, auth_info.is_proxy,
auth_info.challenger.host(), auth_info.challenger.port(),
auth_info.realm, auth_info.scheme, callbackPtr.get())) {
return AUTH_REQUIRED_RESPONSE_IO_PENDING;
} else {
callbackPtr->Disconnect();
callback = callbackPtr->Disconnect();
}
}
}
......@@ -426,14 +429,14 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired(
CefRefPtr<CefURLRequestClient> client = user_data->GetClient();
if (client.get()) {
CefRefPtr<CefAuthCallbackImpl> callbackPtr(
new CefAuthCallbackImpl(callback, credentials));
new CefAuthCallbackImpl(std::move(callback), credentials));
if (client->GetAuthCredentials(
auth_info.is_proxy, auth_info.challenger.host(),
auth_info.challenger.port(), auth_info.realm, auth_info.scheme,
callbackPtr.get())) {
return AUTH_REQUIRED_RESPONSE_IO_PENDING;
} else {
callbackPtr->Disconnect();
callback = callbackPtr->Disconnect();
}
}
}
......
......@@ -30,14 +30,16 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
net::URLRequest* request,
std::unique_ptr<net::SourceStream> upstream) override;
int OnBeforeURLRequest(net::URLRequest* request,
const net::CompletionCallback& callback,
net::CompletionOnceCallback callback,
GURL* new_url) override;
AuthRequiredResponse OnAuthRequired(
net::URLRequest* request,
const net::AuthChallengeInfo& auth_info,
const AuthCallback& callback,
AuthCallback callback,
net::AuthCredentials* credentials) override;
void OnCompleted(net::URLRequest* request, bool started) override;
void OnCompleted(net::URLRequest* request,
bool started,
int net_error) override;
bool OnCanGetCookies(const net::URLRequest& request,
const net::CookieList& cookie_list) override;
bool OnCanSetCookie(const net::URLRequest& request,
......
......@@ -259,7 +259,9 @@ void CefPrintViewManager::OnRequestPrintPreview(
}
void CefPrintViewManager::OnMetafileReadyForPrinting(
const PrintHostMsg_DidPreviewDocument_Params& params) {
content::RenderFrameHost* render_frame_host,
const PrintHostMsg_DidPreviewDocument_Params& params,
const PrintHostMsg_PreviewIds& ids) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
StopWorker(params.document_cookie);
......
......@@ -14,9 +14,10 @@
namespace content {
class RenderFrameHost;
class RenderProcessHost;
}
} // namespace content
struct PrintHostMsg_DidPreviewDocument_Params;
struct PrintHostMsg_PreviewIds;
struct PrintHostMsg_RequestPrintPreview_Params;
namespace printing {
......@@ -52,7 +53,9 @@ class CefPrintViewManager
void OnDidShowPrintDialog(content::RenderFrameHost* rfh);
void OnRequestPrintPreview(const PrintHostMsg_RequestPrintPreview_Params&);
void OnMetafileReadyForPrinting(
const PrintHostMsg_DidPreviewDocument_Params&);
content::RenderFrameHost* render_frame_host,
const PrintHostMsg_DidPreviewDocument_Params& params,
const PrintHostMsg_PreviewIds& ids);
void TerminatePdfPrintJob();
......
......@@ -281,9 +281,9 @@ void CefPrintingMessageFilter::OnUpdatePrintSettingsReply(
}
}
void CefPrintingMessageFilter::OnCheckForCancel(int32_t preview_ui_id,
int preview_request_id,
bool* cancel) {
void CefPrintingMessageFilter::OnCheckForCancel(
const PrintHostMsg_PreviewIds& ids,
bool* cancel) {
*cancel = false;
}
......
......@@ -17,6 +17,7 @@
#include "content/public/browser/browser_message_filter.h"
#include "printing/buildflags/buildflags.h"
struct PrintHostMsg_PreviewIds;
struct PrintHostMsg_ScriptedPrint_Params;
class Profile;
......@@ -74,9 +75,7 @@ class CefPrintingMessageFilter : public content::BrowserMessageFilter {
IPC::Message* reply_msg);
// Check to see if print preview has been cancelled.
void OnCheckForCancel(int32_t preview_ui_id,
int preview_request_id,
bool* cancel);
void OnCheckForCancel(const PrintHostMsg_PreviewIds& ids, bool* cancel);
std::unique_ptr<KeyedServiceShutdownNotifier::Subscription>
printing_shutdown_notifier_;
......
......@@ -50,11 +50,11 @@ void CefSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) {}
void CefSpeechRecognitionManagerDelegate::OnRecognitionResults(
int session_id,
const std::vector<content::mojom::SpeechRecognitionResultPtr>& result) {}
const std::vector<blink::mojom::SpeechRecognitionResultPtr>& result) {}
void CefSpeechRecognitionManagerDelegate::OnRecognitionError(
int session_id,
const content::mojom::SpeechRecognitionError& error) {}
const blink::mojom::SpeechRecognitionError& error) {}
void CefSpeechRecognitionManagerDelegate::OnAudioLevelsChange(
int session_id,
......
......@@ -31,11 +31,11 @@ class CefSpeechRecognitionManagerDelegate
void OnRecognitionEnd(int session_id) override;
void OnRecognitionResults(
int session_id,
const std::vector<content::mojom::SpeechRecognitionResultPtr>& result)
const std::vector<blink::mojom::SpeechRecognitionResultPtr>& result)
override;
void OnRecognitionError(
int session_id,
const content::mojom::SpeechRecognitionError& error) override;
const blink::mojom::SpeechRecognitionError& error) override;
void OnAudioLevelsChange(int session_id,
float volume,
float noise_volume) override;
......
......@@ -17,8 +17,7 @@ CertPolicy::~CertPolicy() {}
// For an allowance, we consider a given |cert| to be a match to a saved
// allowed cert if the |error| is an exact match to or subset of the errors
// in the saved CertStatus.
bool CertPolicy::Check(const net::X509Certificate& cert,
net::CertStatus error) const {
bool CertPolicy::Check(const net::X509Certificate& cert, int error) const {
net::SHA256HashValue fingerprint = cert.CalculateChainFingerprint256();
const auto& allowed_iter = allowed_.find(fingerprint);
if ((allowed_iter != allowed_.end()) && (allowed_iter->second & error) &&
......@@ -28,8 +27,7 @@ bool CertPolicy::Check(const net::X509Certificate& cert,
return false;
}
void CertPolicy::Allow(const net::X509Certificate& cert,
net::CertStatus error) {
void CertPolicy::Allow(const net::X509Certificate& cert, int error) {
// If this same cert had already been saved with a different error status,
// this will replace it with the new error status.
net::SHA256HashValue fingerprint = cert.CalculateChainFingerprint256();
......@@ -59,7 +57,7 @@ bool CefSSLHostStateDelegate::DidHostRunInsecureContent(
void CefSSLHostStateDelegate::AllowCert(const std::string& host,
const net::X509Certificate& cert,
net::CertStatus error) {
int error) {
cert_policy_for_host_[host].Allow(cert, error);
}
......@@ -84,7 +82,7 @@ void CefSSLHostStateDelegate::Clear(
SSLHostStateDelegate::CertJudgment CefSSLHostStateDelegate::QueryPolicy(
const std::string& host,
const net::X509Certificate& cert,
net::CertStatus error,
int error,
bool* expired_previous_decision) {
return cert_policy_for_host_[host].Check(cert, error)
? SSLHostStateDelegate::ALLOWED
......
......@@ -10,7 +10,6 @@
#include "content/public/browser/ssl_host_state_delegate.h"
#include "net/base/hash_value.h"
#include "net/cert/cert_status_flags.h"
#include "net/cert/x509_certificate.h"
// Implementation based on android_webview/browser/aw_ssl_host_state_delegate.h.
......@@ -25,11 +24,11 @@ class CertPolicy {
// Returns true if the user has decided to proceed through the ssl error
// before. For a certificate to be allowed, it must not have any
// *additional* errors from when it was allowed.
bool Check(const net::X509Certificate& cert, net::CertStatus error) const;
bool Check(const net::X509Certificate& cert, int error) const;
// Causes the policy to allow this certificate for a given |error|. And
// remember the user's choice.
void Allow(const net::X509Certificate& cert, net::CertStatus error);
void Allow(const net::X509Certificate& cert, int error);
// Returns true if and only if there exists a user allow exception for some
// certificate.
......@@ -37,7 +36,7 @@ class CertPolicy {
private:
// The set of fingerprints of allowed certificates.
std::map<net::SHA256HashValue, net::CertStatus> allowed_;
std::map<net::SHA256HashValue, int> allowed_;
};
} // namespace internal
......@@ -50,13 +49,13 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate {
// SSLHostStateDelegate methods:
void AllowCert(const std::string& host,
const net::X509Certificate& cert,
net::CertStatus error) override;
int error) override;
void Clear(
const base::Callback<bool(const std::string&)>& host_filter) override;
content::SSLHostStateDelegate::CertJudgment QueryPolicy(
const std::string& host,
const net::X509Certificate& cert,
net::CertStatus error,
int error,
bool* expired_previous_decision) override;
void HostRanInsecureContent(const std::string& host,
int child_id,
......
......@@ -222,7 +222,7 @@ content::BrowserContext* CefStoragePartitionProxy::browser_context() const {
mojo::BindingId CefStoragePartitionProxy::Bind(
int process_id,
mojo::InterfaceRequest<content::mojom::StoragePartitionService> request) {
mojo::InterfaceRequest<blink::mojom::StoragePartitionService> request) {
return parent_->Bind(process_id, std::move(request));
}
......
......@@ -85,7 +85,7 @@ class CefStoragePartitionProxy : public content::StoragePartition {
content::BrowserContext* browser_context() const override;
mojo::BindingId Bind(
int process_id,
mojo::InterfaceRequest<content::mojom::StoragePartitionService> request)
mojo::InterfaceRequest<blink::mojom::StoragePartitionService> request)
override;
void set_site_for_service_worker(
const GURL& site_for_service_worker) override;
......
......@@ -173,7 +173,7 @@ void CefResponseImpl::SetResponseHeaders(
base::AutoLock lock_scope(lock_);
CHECK_READONLY_RETURN_VOID();
header_map_.empty();
header_map_.clear();
size_t iter = 0;
std::string name, value;
......
......@@ -173,7 +173,7 @@ void CefValueController::TakeFrom(CefValueController* other) {
DCHECK(reference_map_.find(it->first) == reference_map_.end());
reference_map_.insert(std::make_pair(it->first, it->second));
}
other->reference_map_.empty();
other->reference_map_.clear();
}
if (!other->dependency_map_.empty()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment