Commit 725ed885 authored by Alexander Guettler's avatar Alexander Guettler Committed by Marshall Greenblatt
Browse files

Update to Chromium version 74.0.3729.0 (#638880)

- Windows: 10.0.17763.0 SDK is now required.
- Mac: 10.13 SDK is now required.
- Removed CefRequestContext::ResolveHostCached which is no longer supported by Chromium.
parent 58e1149c
......@@ -47,3 +47,4 @@ Thumbs.db
/docs
# CEF generated files
/include/cef_version.h
.ccls-cache/
\ No newline at end of file
......@@ -457,6 +457,8 @@ static_library("libcef_static") {
"libcef/browser/osr/render_widget_host_view_osr.h",
"libcef/browser/osr/software_output_device_osr.cc",
"libcef/browser/osr/software_output_device_osr.h",
"libcef/browser/osr/synthetic_gesture_target_osr.cc",
"libcef/browser/osr/synthetic_gesture_target_osr.h",
"libcef/browser/osr/web_contents_view_osr.cc",
"libcef/browser/osr/web_contents_view_osr.h",
"libcef/browser/path_util_impl.cc",
......
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/74.0.3706.0'
'chromium_checkout': 'refs/tags/74.0.3729.0'
}
......@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=cd2b70b906b9f07923d69d9ec0b32488125b0af3$
// $hash=f7f1ec971c726a6a74bcc7f5cee7a8eb1911078d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
......@@ -259,17 +259,6 @@ typedef struct _cef_request_context_t {
const cef_string_t* origin,
struct _cef_resolve_callback_t* callback);
///
// Attempts to resolve |origin| to a list of associated IP addresses using
// cached data. |resolved_ips| will be populated with the list of resolved IP
// addresses or NULL if no cached data is available. Returns ERR_NONE on
// success. This function must be called on the browser process IO thread.
///
cef_errorcode_t(CEF_CALLBACK* resolve_host_cached)(
struct _cef_request_context_t* self,
const cef_string_t* origin,
cef_string_list_t resolved_ips);
///
// Load an extension.
//
......
......@@ -139,7 +139,7 @@ class CefRefCount {
} \
\
private: \
CefRefCount ref_count_;
CefRefCount ref_count_
///
// Macro that provides a locking implementation. Use the Lock() and Unlock()
......
......@@ -270,17 +270,6 @@ class CefRequestContext : public virtual CefBaseRefCounted {
virtual void ResolveHost(const CefString& origin,
CefRefPtr<CefResolveCallback> callback) = 0;
///
// Attempts to resolve |origin| to a list of associated IP addresses using
// cached data. |resolved_ips| will be populated with the list of resolved IP
// addresses or empty if no cached data is available. Returns ERR_NONE on
// success. This method must be called on the browser process IO thread.
///
/*--cef(default_retval=ERR_FAILED)--*/
virtual cef_errorcode_t ResolveHostCached(
const CefString& origin,
std::vector<CefString>& resolved_ips) = 0;
///
// Load an extension.
//
......
......@@ -59,7 +59,7 @@ class CefButtonDelegate : public CefViewDelegate {
// Called when the state of |button| changes.
///
/*--cef()--*/
virtual void OnButtonStateChanged(CefRefPtr<CefButton> button){};
virtual void OnButtonStateChanged(CefRefPtr<CefButton> button) {}
};
#endif // CEF_INCLUDE_VIEWS_CEF_BUTTON_DELEGATE_H_
......@@ -500,6 +500,10 @@ const PrefService* CefBrowserContextImpl::GetPrefs() const {
return pref_service_.get();
}
SimpleFactoryKey* CefBrowserContextImpl::GetSimpleFactoryKey() const {
return nullptr;
}
CefRequestContextImpl* CefBrowserContextImpl::GetCefRequestContext() const {
return GetCefRequestContext(false);
}
......
......@@ -87,7 +87,9 @@ class CefBrowserContextImpl : public CefBrowserContext,
// Profile methods.
PrefService* GetPrefs() override;
bool AllowsBrowserWindows() const override { return false; }
const PrefService* GetPrefs() const override;
SimpleFactoryKey* GetSimpleFactoryKey() const override;
// CefBrowserContext methods.
CefRequestContextImpl* GetCefRequestContext() const override;
......
......@@ -208,10 +208,18 @@ PrefService* CefBrowserContextProxy::GetPrefs() {
return parent_->GetPrefs();
}
bool CefBrowserContextProxy::AllowsBrowserWindows() const {
return parent_->AllowsBrowserWindows();
}
const PrefService* CefBrowserContextProxy::GetPrefs() const {
return parent_->GetPrefs();
}
SimpleFactoryKey* CefBrowserContextProxy::GetSimpleFactoryKey() const {
return parent_->GetSimpleFactoryKey();
}
CefRequestContextImpl* CefBrowserContextProxy::GetCefRequestContext() const {
return request_context_;
}
......
......@@ -64,7 +64,9 @@ class CefBrowserContextProxy : public CefBrowserContext {
// Profile methods.
PrefService* GetPrefs() override;
bool AllowsBrowserWindows() const override;
const PrefService* GetPrefs() const override;
SimpleFactoryKey* GetSimpleFactoryKey() const override;
// CefBrowserContext methods.
CefRequestContextImpl* GetCefRequestContext() const override;
......
......@@ -512,7 +512,7 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForRequest(
return GetBrowserForFrame(render_process_id, render_frame_id);
}
const content::ResourceRequestInfo* request_info =
content::ResourceRequestInfo* request_info =
content::ResourceRequestInfo::ForRequest(request);
if (request_info)
return GetBrowserForFrameTreeNode(request_info->GetFrameTreeNodeId());
......@@ -1644,7 +1644,7 @@ void CefBrowserHostImpl::CancelContextMenu() {
CefRefPtr<CefFrame> CefBrowserHostImpl::GetFrameForRequest(
const net::URLRequest* request) {
CEF_REQUIRE_IOT();
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
if (!info)
return nullptr;
......@@ -2435,6 +2435,7 @@ bool CefBrowserHostImpl::TakeFocus(content::WebContents* source, bool reverse) {
}
bool CefBrowserHostImpl::HandleContextMenu(
content::RenderFrameHost* render_frame_host,
const content::ContextMenuParams& params) {
return HandleContextMenu(web_contents(), params);
}
......
......@@ -426,7 +426,9 @@ class CefBrowserHostImpl : public CefBrowserHost,
bool proceed,
bool* proceed_to_fire_unload) override;
bool TakeFocus(content::WebContents* source, bool reverse) override;
bool HandleContextMenu(const content::ContextMenuParams& params) override;
bool HandleContextMenu(content::RenderFrameHost* render_frame_host,
const content::ContextMenuParams& params) override;
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
......
......@@ -85,7 +85,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
CefBrowserInfo(int browser_id, bool is_popup);
int browser_id() const { return browser_id_; };
int browser_id() const { return browser_id_; }
bool is_popup() const { return is_popup_; }
bool is_windowless() const { return is_windowless_; }
......
......@@ -7,11 +7,16 @@
#include "libcef/common/content_client.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_pump_for_ui.h"
#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/message_loop/message_pump_mac.h"
#endif
#include "content/public/browser/browser_thread.h"
namespace {
// MessagePump implementation that delegates to OnScheduleMessagePumpWork() for
......@@ -82,23 +87,27 @@ CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() {
return nullptr;
}
std::unique_ptr<base::MessagePump> CreatePump() {
const CefSettings& settings = CefContext::Get()->settings();
if (settings.external_message_pump) {
std::unique_ptr<base::MessagePump> MessagePumpFactoryForUI() {
if (!content::BrowserThread::IsThreadInitialized(
content::BrowserThread::UI) ||
content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
CefRefPtr<CefBrowserProcessHandler> handler = GetBrowserProcessHandler();
if (handler)
return base::WrapUnique(new MessagePumpExternal(0.01f, handler));
return std::make_unique<MessagePumpExternal>(0.01f, handler);
}
return base::MessageLoop::CreateMessagePumpForType(
base::MessageLoop::TYPE_UI);
#if defined(OS_MACOSX)
return base::MessagePumpMac::Create();
#else
return std::make_unique<base::MessagePumpForUI>();
#endif
}
} // namespace
CefBrowserMessageLoop::CefBrowserMessageLoop()
: base::MessageLoopForUI(CreatePump()) {
BindToCurrentThread();
void InitMessagePumpFactoryForUI() {
const CefSettings& settings = CefContext::Get()->settings();
if (settings.external_message_pump) {
base::MessageLoop::InitMessagePumpForUIFactory(MessagePumpFactoryForUI);
}
}
CefBrowserMessageLoop::~CefBrowserMessageLoop() {}
......@@ -4,21 +4,7 @@
#ifndef CEF_LIBCEF_BROWSER_BROWSER_MESSAGE_LOOP_H_
#define CEF_LIBCEF_BROWSER_BROWSER_MESSAGE_LOOP_H_
#pragma once
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
// Class used to process events on the current message loop.
class CefBrowserMessageLoop : public base::MessageLoopForUI {
typedef base::MessageLoopForUI inherited;
public:
CefBrowserMessageLoop();
~CefBrowserMessageLoop() override;
private:
DISALLOW_COPY_AND_ASSIGN(CefBrowserMessageLoop);
};
void InitMessagePumpFactoryForUI();
#endif // CEF_LIBCEF_BROWSER_BROWSER_MESSAGE_LOOP_H_
......@@ -75,11 +75,11 @@ void ChromeBrowserProcessStub::Shutdown() {
void ChromeBrowserProcessStub::ResourceDispatcherHostCreated() {
NOTREACHED();
};
}
void ChromeBrowserProcessStub::EndSession() {
NOTREACHED();
};
}
void ChromeBrowserProcessStub::FlushLocalStateAndReply(
base::OnceClosure reply) {
......
......@@ -553,6 +553,34 @@ bool CefContentBrowserClient::ShouldUseProcessPerSite(
return true;
}
// Based on
// ChromeContentBrowserClientExtensionsPart::DoesSiteRequireDedicatedProcess.
bool CefContentBrowserClient::DoesSiteRequireDedicatedProcess(
content::BrowserContext* browser_context,
const GURL& effective_site_url) {
if (!extensions::ExtensionsEnabled())
return false;
extensions::ExtensionRegistry* registry =
extensions::ExtensionRegistry::Get(browser_context);
const extensions::Extension* extension =
registry->enabled_extensions().GetExtensionOrAppByURL(effective_site_url);
if (!extension)
return false;
// Always isolate Chrome Web Store.
if (extension->id() == extensions::kWebStoreAppId)
return true;
// Extensions should be isolated, except for hosted apps. Isolating hosted
// apps is a good idea, but ought to be a separate knob.
if (extension->is_hosted_app())
return false;
// Isolate all extensions.
return true;
}
bool CefContentBrowserClient::IsHandledURL(const GURL& url) {
if (!url.is_valid())
return false;
......@@ -1126,6 +1154,7 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory(
content::RenderFrameHost* frame,
int render_process_id,
bool is_navigation,
bool is_download,
const url::Origin& request_initiator,
network::mojom::URLLoaderFactoryRequest* factory_request,
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,
......@@ -1137,8 +1166,8 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory(
extensions::BrowserContextKeyedAPIFactory<extensions::WebRequestAPI>::Get(
browser_context);
bool use_proxy = web_request_api->MaybeProxyURLLoaderFactory(
browser_context, frame, render_process_id, is_navigation, factory_request,
header_client);
browser_context, frame, render_process_id, is_navigation, is_download,
factory_request, header_client);
if (bypass_redirect_checks)
*bypass_redirect_checks = use_proxy;
return use_proxy;
......@@ -1191,7 +1220,7 @@ blink::UserAgentMetadata CefContentBrowserClient::GetUserAgentMetadata() const {
blink::UserAgentMetadata metadata;
metadata.brand = version_info::GetProductName();
metadata.version = version_info::GetVersionNumber();
metadata.full_version = version_info::GetVersionNumber();
metadata.platform = version_info::GetOSType();
// TODO(mkwst): Poke at BuildUserAgentFromProduct to split out these pieces.
......
......@@ -48,6 +48,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
service_manager::mojom::ServiceRequest* service_request) override;
bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
const GURL& effective_url) override;
bool DoesSiteRequireDedicatedProcess(content::BrowserContext* browser_context,
const GURL& effective_site_url) override;
bool IsHandledURL(const GURL& url) override;
void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
......@@ -147,6 +149,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::RenderFrameHost* frame,
int render_process_id,
bool is_navigation,
bool is_download,
const url::Origin& request_initiator,
network::mojom::URLLoaderFactoryRequest* factory_request,
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,
......
......@@ -420,21 +420,17 @@ bool CefContext::Initialize(const CefMainArgs& args,
// gets called by some call down the line of service_manager::MainRun.
content::SetUpFieldTrialsAndFeatureList();
if (!main_delegate_->CreateUIThread()) {
return false;
}
initialized_ = true;
// Can't use CEF_POST_TASK here yet, because the TaskRunner is not yet set.
main_delegate_->ui_thread()->task_runner()->PostTask(
FROM_HERE,
base::BindOnce(
if (!main_delegate_->CreateUIThread(base::BindOnce(
[](CefContext* context, base::WaitableEvent* event) {
service_manager::MainRun(*context->sm_main_params_);
event->Signal();
},
base::Unretained(this), base::Unretained(&uithread_startup_event)));
base::Unretained(this),
base::Unretained(&uithread_startup_event)))) {
return false;
}
initialized_ = true;
// We need to wait until service_manager::MainRun has finished.
uithread_startup_event.Wait();
......
......@@ -107,11 +107,14 @@ void DeleteCookiesCallbackImpl(CefRefPtr<CefDeleteCookiesCallback> callback,
// Always execute the callback asynchronously.
void SetCookieCallbackImpl(CefRefPtr<CefSetCookieCallback> callback,
bool success) {
net::CanonicalCookie::CookieInclusionStatus status) {
if (!callback.get())
return;
CEF_POST_TASK(CEF_IOT, base::Bind(&CefSetCookieCallback::OnComplete,
callback.get(), success));
CEF_POST_TASK(
CEF_IOT,
base::Bind(
&CefSetCookieCallback::OnComplete, callback.get(),
status == net::CanonicalCookie::CookieInclusionStatus::INCLUDE));
}
net::CookieStore* GetExistingCookieStoreHelper(
......@@ -560,7 +563,7 @@ void CefCookieManagerImpl::SetCookieInternal(
base::Time(), // Last access time.
cookie.secure ? true : false, cookie.httponly ? true : false,
net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT),
cookie.secure ? true : false, cookie.httponly ? true : false,
url.scheme(), cookie.httponly ? true : false,
base::Bind(SetCookieCallbackImpl, callback));
}
......
......@@ -249,7 +249,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
std::string method;
base::ListValue* params = NULL;
base::DictionaryValue* dict = NULL;
std::unique_ptr<base::Value> parsed_message = base::JSONReader::Read(message);
base::Optional<base::Value> parsed_message = base::JSONReader::Read(message);
if (!parsed_message || !parsed_message->GetAsDictionary(&dict) ||
!dict->GetString("method", &method)) {
return;
......
......@@ -14,7 +14,7 @@
namespace extensions {
class Extension;
};
}
// CefNavigationEntry implementation
class CefExtensionImpl : public CefExtension {
......
......@@ -21,8 +21,8 @@
#include "extensions/browser/extension_function_dispatcher.h"
#include "extensions/common/error_utils.h"
using content::WebContents;
using content::RenderViewHost;
using content::WebContents;
namespace extensions {
......@@ -92,7 +92,7 @@ class CefGetExtensionLoadFileCallbackImpl
static std::unique_ptr<std::string> LoadFileFromStream(
const std::string& file,
CefRefPtr<CefStreamReader> stream) {
base::AssertBlockingAllowedDeprecated();
CEF_REQUIRE_BLOCKING();
// Move to the end of the stream.
stream->Seek(0, SEEK_END);
......
......@@ -19,4 +19,8 @@ void CefPDFWebContentsHelperClient::OnPDFHasUnsupportedFeature(
void CefPDFWebContentsHelperClient::OnSaveURL(content::WebContents* contents) {}
void CefPDFWebContentsHelperClient::SetPluginCanSave(
content::WebContents* contents,
bool can_save) {}
} // namespace extensions
......@@ -21,6 +21,7 @@ class CefPDFWebContentsHelperClient : public pdf::PDFWebContentsHelperClient {
int content_restrictions) override;
void OnPDFHasUnsupportedFeature(content::WebContents* contents) override;
void OnSaveURL(content::WebContents* contents) override;
void SetPluginCanSave(content::WebContents* contents, bool can_save) override;
DISALLOW_COPY_AND_ASSIGN(CefPDFWebContentsHelperClient);
};
......
......@@ -29,7 +29,7 @@ const blink::MediaStreamDevice* FindDefaultDeviceWithId(
}
return &(*devices.begin());
};
}
} // namespace
......
......@@ -305,7 +305,6 @@ void CefMenuManager::CreateDefaultModel() {
model_->AddItem(MENU_ID_CUT, GetLabel(IDS_CONTENT_CONTEXT_CUT));
model_->AddItem(MENU_ID_COPY, GetLabel(IDS_CONTENT_CONTEXT_COPY));
model_->AddItem(MENU_ID_PASTE, GetLabel(IDS_CONTENT_CONTEXT_PASTE));
model_->AddItem(MENU_ID_DELETE, GetLabel(IDS_CONTENT_CONTEXT_DELETE));
model_->AddSeparator();
model_->AddItem(MENU_ID_SELECT_ALL,
......
......@@ -17,7 +17,7 @@
namespace content {
class RenderFrameHost;
class WebContents;
};
} // namespace content
class CefBrowserHostImpl;
class CefRunContextMenuCallback;
......
......@@ -64,22 +64,24 @@ void CefCookieStoreProxy::SetCookieWithOptionsAsync(
cookie_store->SetCookieWithOptionsAsync(url, cookie_line, options,
std::move(callback));
} else if (!callback.is_null()) {
std::move(callback).Run(false);
std::move(callback).Run(
net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_FAILURE_TO_STORE);
}
}
void CefCookieStoreProxy::SetCanonicalCookieAsync(
std::unique_ptr<net::CanonicalCookie> cookie,
bool secure_source,
std::string source_scheme,
bool modify_http_only,
SetCookiesCallback callback) {
net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store) {
cookie_store->SetCanonicalCookieAsync(std::move(cookie), secure_source,
cookie_store->SetCanonicalCookieAsync(std::move(cookie), source_scheme,
modify_http_only,
std::move(callback));
} else if (!callback.is_null()) {
std::move(callback).Run(false);
std::move(callback).Run(
net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_FAILURE_TO_STORE);
}
}
......
......@@ -23,7 +23,7 @@ class CefCookieStoreProxy : public net::CookieStore {
const net::CookieOptions& options,
SetCookiesCallback callback) override;
void SetCanonicalCookieAsync(std::unique_ptr<net::CanonicalCookie> cookie,
bool secure_source,
std::string source_scheme,
bool modify_http_only,
SetCookiesCallback callback) override;
void GetCookieListWithOptionsAsync(const GURL& url,
......
......@@ -19,4 +19,4 @@ bool IsInternalRequest(const net::URLRequest* request) {
return false;
}
}; // namespace net_util
} // namespace net_util
......@@ -16,6 +16,6 @@ namespace net_util {
// the CEF API.
bool IsInternalRequest(const net::URLRequest* request);
}; // namespace net_util
} // namespace net_util
#endif // CEF_LIBCEF_BROWSER_NET_NET_UTIL_H_
......@@ -9,6 +9,7 @@
#include <vector>
#include "include/cef_callback.h"
#include "include/cef_parser.h"
#include "libcef/browser/cookie_manager_impl.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/request_impl.h"
......@@ -565,7 +566,7 @@ void CefResourceRequestJob::SaveNextCookie() {
if (can_set_cookie) {
request_->context()->cookie_store()->SetCanonicalCookieAsync(
std::move(cookie), request_->url().SchemeIsCryptographic(),
std::move(cookie), request_->url().scheme(),
!options.exclude_httponly(),
base::Bind(&CefResourceRequestJob::OnCookieSaved,
weak_factory_.GetWeakPtr()));
......@@ -575,7 +576,8 @@ void CefResourceRequestJob::SaveNextCookie() {
CookieHandled();
}