Commit f229796a authored by Marshall Greenblatt's avatar Marshall Greenblatt

Update to Chromium revision ff259bab (#488528)

parent 6da2bbf2
......@@ -277,6 +277,7 @@ source_set("webkit_set") {
deps = [
"//skia",
"//third_party/icu",
"//third_party/boringssl",
"//v8",
]
}
......@@ -704,6 +705,7 @@ static_library("libcef_static") {
"//components/keyed_service/content:content",
"//components/keyed_service/core:core",
"//components/navigation_interception",
"//components/network_session_configurator/common",
"//components/pdf/browser",
"//components/pdf/renderer",
"//components/plugins/renderer",
......@@ -723,7 +725,7 @@ static_library("libcef_static") {
"//components/visitedlink/browser",
"//components/visitedlink/common",
"//components/visitedlink/renderer",
"//components/viz/display_compositor",
"//components/viz/service",
"//components/web_cache/renderer",
"//content/public/app:both",
"//content/public/browser",
......@@ -842,7 +844,7 @@ static_library("libcef_static") {
deps += [
"//build/config/freetype",
"//build/linux:fontconfig",
"//third_party/fontconfig",
]
}
......@@ -957,6 +959,7 @@ static_library("libcef_static") {
"//ui/events",
"//ui/strings",
"//ui/wm",
"//ui/wm/public",
]
if (toolkit_views) {
......
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'd483fb7716e28b377c70c26c1bf1e3695aa1d8c9',
'chromium_checkout': 'ff259bab28b35d242e10186cd63af7ed404fae0d',
}
......@@ -39,14 +39,49 @@
#define CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
#pragma once
#if defined(BASE_ATOMIC_REF_COUNT_H_)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts.
#elif defined(USING_CHROMIUM_INCLUDES)
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/atomic_ref_count.h"
// Used when declaring a base::AtomicRefCount value. This is an object type with
// Chromium headers.
#define ATOMIC_DECLARATION (0)
// Maintaining compatibility with AtompicRefCount* functions that were removed
// from Chromium in http://crrev.com/ee96d561.
namespace base {
// Increment a reference count by 1.
inline void AtomicRefCountInc(volatile AtomicRefCount* ptr) {
const_cast<AtomicRefCount*>(ptr)->Increment();
}
// Decrement a reference count by 1 and return whether the result is non-zero.
// Insert barriers to ensure that state written before the reference count
// became zero will be visible to a thread that has just made the count zero.
inline bool AtomicRefCountDec(volatile AtomicRefCount* ptr) {
return const_cast<AtomicRefCount*>(ptr)->Decrement();
}
// Return whether the reference count is one. If the reference count is used
// in the conventional way, a refrerence count of 1 implies that the current
// thread owns the reference and no other thread shares it. This call performs
// the test for a reference count of one, and performs the memory barrier
// needed for the owning thread to act on the object, knowing that it has
// exclusive access to the object.
inline bool AtomicRefCountIsOne(volatile AtomicRefCount* ptr) {
return const_cast<AtomicRefCount*>(ptr)->IsOne();
}
// Return whether the reference count is zero. With conventional object
// referencing counting, the object will be destroyed, so the reference count
// should never be zero. Hence this is generally used for a debug check.
inline bool AtomicRefCountIsZero(volatile AtomicRefCount* ptr) {
return const_cast<AtomicRefCount*>(ptr)->IsZero();
}
} // namespace base
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
......@@ -58,6 +93,10 @@
#define ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
#define ANNOTATE_HAPPENS_AFTER(obj) /* empty */
// Used when declaring a base::AtomicRefCount value. This is an integer/ptr type
// with CEF headers.
#define ATOMIC_DECLARATION = 0
namespace base {
typedef subtle::Atomic32 AtomicRefCount;
......
......@@ -1916,12 +1916,7 @@ typedef struct _cef_popup_features_t {
int menuBarVisible;
int statusBarVisible;
int toolBarVisible;
int locationBarVisible;
int scrollbarsVisible;
int resizable;
int fullscreen;
int dialog;
} cef_popup_features_t;
///
......@@ -2463,42 +2458,61 @@ typedef enum {
// Policy for how the Referrer HTTP header value will be sent during navigation.
// If the `--no-referrers` command-line flag is specified then the policy value
// will be ignored and the Referrer value will never be sent.
// Must be kept synchronized with net::URLRequest::ReferrerPolicy from Chromium.
///
typedef enum {
///
// Always send the complete Referrer value.
// Clear the referrer header if the header value is HTTPS but the request
// destination is HTTP. This is the default behavior.
///
REFERRER_POLICY_ALWAYS,
REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
REFERRER_POLICY_DEFAULT =
REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
///
// Use the default policy. This is REFERRER_POLICY_ORIGIN_WHEN_CROSS_ORIGIN
// when the `--reduced-referrer-granularity` command-line flag is specified
// and REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE otherwise.
//
// A slight variant on CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
// If the request destination is HTTP, an HTTPS referrer will be cleared. If
// the request's destination is cross-origin with the referrer (but does not
// downgrade), the referrer's granularity will be stripped down to an origin
// rather than a full URL. Same-origin requests will send the full referrer.
///
REFERRER_POLICY_DEFAULT,
REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN,
///
// When navigating from HTTPS to HTTP do not send the Referrer value.
// Otherwise, send the complete Referrer value.
// Strip the referrer down to an origin when the origin of the referrer is
// different from the destination's origin.
///
REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE,
REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN,
///
// Never send the Referrer value.
// Never change the referrer.
///
REFERRER_POLICY_NEVER,
REFERRER_POLICY_NEVER_CLEAR_REFERRER,
///
// Only send the origin component of the Referrer value.
// Strip the referrer down to the origin regardless of the redirect location.
///
REFERRER_POLICY_ORIGIN,
///
// When navigating cross-origin only send the origin component of the Referrer
// value. Otherwise, send the complete Referrer value.
// Clear the referrer when the request's referrer is cross-origin with the
// request's destination.
///
REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN,
///
// Strip the referrer down to the origin, but clear it entirely if the
// referrer value is HTTPS and the destination is HTTP.
///
REFERRER_POLICY_ORIGIN_WHEN_CROSS_ORIGIN,
REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
///
// Always clear the referrer regardless of the request destination.
///
REFERRER_POLICY_NO_REFERRER,
// Always the last value in this enumeration.
REFERRER_POLICY_LAST_VALUE,
} cef_referrer_policy_t;
///
......
......@@ -488,9 +488,7 @@ struct CefPopupFeaturesTraits {
s->menuBarVisible = true;
s->statusBarVisible = true;
s->toolBarVisible = true;
s->locationBarVisible = true;
s->scrollbarsVisible = true;
s->resizable = true;
}
static inline void clear(struct_type* s) {}
......@@ -509,11 +507,7 @@ struct CefPopupFeaturesTraits {
target->menuBarVisible = src->menuBarVisible;
target->statusBarVisible = src->statusBarVisible;
target->toolBarVisible = src->toolBarVisible;
target->locationBarVisible = src->locationBarVisible;
target->scrollbarsVisible = src->scrollbarsVisible;
target->resizable = src->resizable;
target->fullscreen = src->fullscreen;
target->dialog = src->dialog;
}
};
......
......@@ -427,6 +427,11 @@ CefBrowserContextImpl::GetBackgroundSyncController() {
return nullptr;
}
content::BrowsingDataRemoverDelegate*
CefBrowserContextImpl::GetBrowsingDataRemoverDelegate() {
return nullptr;
}
net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) {
......@@ -453,7 +458,6 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
url_request_getter_ = new CefURLRequestContextGetterImpl(
settings_, GetPrefs(),
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
protocol_handlers, std::move(proxy_config_service),
std::move(request_interceptors));
resource_context()->set_url_request_context_getter(url_request_getter_.get());
......
......@@ -69,6 +69,8 @@ class CefBrowserContextImpl : public CefBrowserContext,
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
content::PermissionManager* GetPermissionManager() override;
content::BackgroundSyncController* GetBackgroundSyncController() override;
content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate()
override;
net::URLRequestContextGetter* CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) override;
......
......@@ -161,6 +161,11 @@ CefBrowserContextProxy::GetBackgroundSyncController() {
return parent_->GetBackgroundSyncController();
}
content::BrowsingDataRemoverDelegate*
CefBrowserContextProxy::GetBrowsingDataRemoverDelegate() {
return parent_->GetBrowsingDataRemoverDelegate();
}
net::URLRequestContextGetter* CefBrowserContextProxy::CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) {
......
......@@ -44,6 +44,8 @@ class CefBrowserContextProxy : public CefBrowserContext {
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
content::PermissionManager* GetPermissionManager() override;
content::BackgroundSyncController* GetBackgroundSyncController() override;
content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate()
override;
net::URLRequestContextGetter* CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) override;
......
......@@ -65,6 +65,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/resource_request_info.h"
#include "content/public/common/favicon_url.h"
#include "net/base/net_errors.h"
#include "third_party/WebKit/public/web/WebFindOptions.h"
#include "ui/events/base_event_utils.h"
......@@ -700,7 +701,7 @@ void CefBrowserHostImpl::StartDownload(const CefString& url) {
std::unique_ptr<content::DownloadUrlParameters> params(
content::DownloadUrlParameters::CreateForWebContentsMainFrame(
web_contents(), gurl));
web_contents(), gurl, NO_TRAFFIC_ANNOTATION_YET));
manager->DownloadUrl(std::move(params));
}
......@@ -1526,7 +1527,9 @@ void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) {
request.method = params.method;
request.referrer = params.referrer.url;
request.referrer_policy = params.referrer.policy;
request.referrer_policy =
CefRequestImpl::BlinkReferrerPolicyToNetReferrerPolicy(
params.referrer.policy);
request.frame_id = params.frame_id;
request.first_party_for_cookies = params.first_party_for_cookies;
request.headers = params.headers;
......@@ -2305,8 +2308,7 @@ void CefBrowserHostImpl::WebContentsCreated(
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents,
const base::Optional<content::WebContents::CreateParams>& create_params) {
content::WebContents* new_contents) {
CefBrowserSettings settings;
CefRefPtr<CefClient> client;
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate;
......@@ -2673,7 +2675,7 @@ void CefBrowserHostImpl::DidUpdateFaviconURL(
std::vector<CefString> icon_urls;
std::vector<content::FaviconURL>::const_iterator it = candidates.begin();
for (; it != candidates.end(); ++it) {
if (it->icon_type == content::FaviconURL::FAVICON)
if (it->icon_type == content::FaviconURL::IconType::kFavicon)
icon_urls.push_back(it->icon_url.spec());
}
if (!icon_urls.empty())
......@@ -2736,7 +2738,8 @@ void CefBrowserHostImpl::AccessibilityLocationChangesReceived(
}
}
void CefBrowserHostImpl::OnWebContentsFocused() {
void CefBrowserHostImpl::OnWebContentsFocused(
content::RenderWidgetHost* render_widget_host) {
if (client_.get()) {
CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler();
if (handler.get())
......
......@@ -35,7 +35,7 @@
namespace content {
struct DragEventSourceInfo;
class RenderWidgetHostImpl;
}
} // namespace content
namespace net {
class URLRequest;
......@@ -412,15 +412,12 @@ class CefBrowserHostImpl : public CefBrowserHost,
int opener_render_frame_id,
content::WebContentsView** view,
content::RenderViewHostDelegateView** delegate_view) override;
void WebContentsCreated(
content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents,
const base::Optional<content::WebContents::CreateParams>& create_params)
override;
void WebContentsCreated(content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) override;
void DidNavigateMainFramePostCommit(
content::WebContents* web_contents) override;
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
......@@ -484,7 +481,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
const std::vector<content::AXLocationChangeNotificationDetails>& locData)
override;
void OnWebContentsFocused() override;
void OnWebContentsFocused(
content::RenderWidgetHost* render_widget_host) override;
// Override to provide a thread safe implementation.
bool Send(IPC::Message* message) override;
......
......@@ -37,12 +37,7 @@ void TranslatePopupFeatures(const blink::mojom::WindowFeatures& webKitFeatures,
features.menuBarVisible = webKitFeatures.menu_bar_visible;
features.statusBarVisible = webKitFeatures.status_bar_visible;
features.toolBarVisible = webKitFeatures.tool_bar_visible;
features.locationBarVisible = webKitFeatures.location_bar_visible;
features.scrollbarsVisible = webKitFeatures.scrollbars_visible;
features.resizable = webKitFeatures.resizable;
features.fullscreen = webKitFeatures.fullscreen;
features.dialog = webKitFeatures.dialog;
}
CefBrowserInfoManager* g_info_manager = nullptr;
......@@ -112,11 +107,11 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo(
PendingNewBrowserInfoList::iterator it =
pending_new_browser_info_list_.begin();
for (; it != pending_new_browser_info_list_.end(); ++it) {
PendingNewBrowserInfo* info = *it;
PendingNewBrowserInfo* info = it->get();
if (info->render_process_id == render_process_id &&
info->render_view_routing_id == render_view_routing_id &&
info->render_frame_routing_id == render_frame_routing_id) {
SendNewBrowserInfoResponse(render_process_id, browser_info.get(), false,
SendNewBrowserInfoResponse(render_process_id, browser_info, false,
info->reply_msg);
pending_new_browser_info_list_.erase(it);
......@@ -304,8 +299,8 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(int render_process_id,
if (browser_info.get()) {
// Send the response immediately.
SendNewBrowserInfoResponse(render_process_id, browser_info.get(),
is_guest_view, reply_msg);
SendNewBrowserInfoResponse(render_process_id, browser_info, is_guest_view,
reply_msg);
return;
}
......@@ -315,7 +310,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(int render_process_id,
PendingNewBrowserInfoList::const_iterator it =
pending_new_browser_info_list_.begin();
for (; it != pending_new_browser_info_list_.end(); ++it) {
PendingNewBrowserInfo* info = *it;
PendingNewBrowserInfo* info = it->get();
if (info->render_process_id == render_process_id &&
info->render_view_routing_id == render_view_routing_id &&
info->render_frame_routing_id == render_frame_routing_id) {
......@@ -416,7 +411,7 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
PendingNewBrowserInfoList::iterator it =
pending_new_browser_info_list_.begin();
while (it != pending_new_browser_info_list_.end()) {
PendingNewBrowserInfo* info = *it;
PendingNewBrowserInfo* info = it->get();
if (info->render_process_id == render_process_id)
it = pending_new_browser_info_list_.erase(it);
else
......@@ -428,7 +423,7 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
{
PendingPopupList::iterator it = pending_popup_list_.begin();
while (it != pending_popup_list_.end()) {
PendingPopup* popup = *it;
PendingPopup* popup = it->get();
if (popup->opener_process_id == render_process_id) {
it = pending_popup_list_.erase(it);
} else {
......@@ -455,11 +450,13 @@ CefBrowserInfoManager::PopPendingPopup(PendingPopup::Step step,
PendingPopupList::iterator it = pending_popup_list_.begin();
for (; it != pending_popup_list_.end(); ++it) {
PendingPopup* popup = *it;
PendingPopup* popup = it->get();
if (popup->step == step && popup->opener_process_id == opener_process_id &&
popup->opener_frame_id == opener_frame_id &&
popup->target_url == target_url) {
pending_popup_list_.weak_erase(it);
// Transfer ownership of the pointer.
it->release();
pending_popup_list_.erase(it);
return base::WrapUnique(popup);
}
}
......@@ -525,7 +522,7 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfo(
// static
void CefBrowserInfoManager::SendNewBrowserInfoResponse(
int render_process_id,
CefBrowserInfo* browser_info,
scoped_refptr<CefBrowserInfo> browser_info,
bool is_guest_view,
IPC::Message* reply_msg) {
if (!CEF_CURRENTLY_ON_UIT()) {
......
......@@ -9,10 +9,11 @@
#include "include/cef_client.h"