Skip to content

Commit

Permalink
Update to Chromium revision a106f0ab (#464641)
Browse files Browse the repository at this point in the history
- Remove CefWindowInfo.transparent_painting_enabled. Set
  CefBrowserSettings.background_color to an opaque or transparent
  value instead.
  • Loading branch information
magreenblatt committed Apr 24, 2017
1 parent 2f6475c commit 3f71138
Show file tree
Hide file tree
Showing 151 changed files with 2,758 additions and 2,297 deletions.
8 changes: 4 additions & 4 deletions BUILD.gn
Expand Up @@ -140,9 +140,6 @@ assert(!enable_print_preview)
# Enable support for Widevine CDM.
assert(enable_widevine)

# Disable support for plugin installation.
assert(!enable_plugin_installation)

if (is_clang) {
# Don't use the chrome style plugin.
assert(!clang_use_chrome_plugins)
Expand Down Expand Up @@ -595,6 +592,9 @@ static_library("libcef_static") {
# we include Blink headers.
"//third_party/WebKit/public/platform",
"//third_party/WebKit/public/web",

# Crashpad code uses paths relative to this directory.
"//third_party/crashpad/crashpad",
]

public_deps = [
Expand Down Expand Up @@ -753,8 +753,8 @@ static_library("libcef_static") {
]

deps += [
"//build/config/freetype",
"//build/linux:fontconfig",
"//build/linux:freetype2",
]
}

Expand Down
2 changes: 1 addition & 1 deletion CHROMIUM_BUILD_COMPATIBILITY.txt
Expand Up @@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding

{
'chromium_checkout': '939b32ee5ba05c396eef3fd992822fcca9a2e262',
'chromium_checkout': 'a106f0abbf69dad349d4aaf4bcc4f5d376dd2377',
}
10 changes: 4 additions & 6 deletions include/internal/cef_linux.h
Expand Up @@ -81,7 +81,6 @@ struct CefWindowInfoTraits {
target->height = src->height;
target->parent_window = src->parent_window;
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
target->transparent_painting_enabled = src->transparent_painting_enabled;
target->window = src->window;
}
};
Expand Down Expand Up @@ -114,15 +113,14 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
// monitor info and to act as the parent window for dialogs, context menus,
// etc. If |parent| is not provided then the main screen monitor will be used
// and some functionality that requires a parent window may not function
// correctly. If |transparent| is true a transparent background color will be
// used (RGBA=0x00000000). If |transparent| is false the background will be
// white and opaque. In order to create windowless browsers the
// correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
void SetAsWindowless(CefWindowHandle parent, bool transparent) {
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = true;
parent_window = parent;
transparent_painting_enabled = transparent;
}
};

Expand Down
10 changes: 4 additions & 6 deletions include/internal/cef_mac.h
Expand Up @@ -87,7 +87,6 @@ struct CefWindowInfoTraits {
target->hidden = src->hidden;
target->parent_view = src->parent_view;
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
target->transparent_painting_enabled = src->transparent_painting_enabled;
target->view = src->view;
}
};
Expand Down Expand Up @@ -121,15 +120,14 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
// monitor info and to act as the parent view for dialogs, context menus,
// etc. If |parent| is not provided then the main screen monitor will be used
// and some functionality that requires a parent view may not function
// correctly. If |transparent| is true a transparent background color will be
// used (RGBA=0x00000000). If |transparent| is false the background will be
// white and opaque. In order to create windowless browsers the
// correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
void SetAsWindowless(CefWindowHandle parent, bool transparent) {
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = true;
parent_view = parent;
transparent_painting_enabled = transparent;
}
};

Expand Down
25 changes: 16 additions & 9 deletions include/internal/cef_types.h
Expand Up @@ -401,10 +401,14 @@ typedef struct _cef_settings_t {
int enable_net_security_expiration;

///
// Opaque background color used for accelerated content. By default the
// background color will be white. Only the RGB compontents of the specified
// value will be used. The alpha component must greater than 0 to enable use
// of the background color but will be otherwise ignored.
// Background color used for the browser before a document is loaded and when
// no document color is specified. The alpha component must be either fully
// opaque (0xFF) or fully transparent (0x00). If the alpha component is fully
// opaque then the RGB components will be used as the background color. If the
// alpha component is fully transparent for a windowed browser then the
// default value of opaque white be used. If the alpha component is fully
// transparent for a windowless (off-screen) browser then transparent painting
// will be enabled.
///
cef_color_t background_color;

Expand Down Expand Up @@ -652,11 +656,14 @@ typedef struct _cef_browser_settings_t {
cef_state_t webgl;

///
// Opaque background color used for the browser before a document is loaded
// and when no document color is specified. By default the background color
// will be the same as CefSettings.background_color. Only the RGB compontents
// of the specified value will be used. The alpha component must greater than
// 0 to enable use of the background color but will be otherwise ignored.
// Background color used for the browser before a document is loaded and when
// no document color is specified. The alpha component must be either fully
// opaque (0xFF) or fully transparent (0x00). If the alpha component is fully
// opaque then the RGB components will be used as the background color. If the
// alpha component is fully transparent for a windowed browser then the
// CefSettings.background_color value will be used. If the alpha component is
// fully transparent for a windowless (off-screen) browser then transparent
// painting will be enabled.
///
cef_color_t background_color;

Expand Down
10 changes: 2 additions & 8 deletions include/internal/cef_types_linux.h
Expand Up @@ -92,17 +92,11 @@ typedef struct _cef_window_info_t {
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
int windowless_rendering_enabled;

///
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
///
int transparent_painting_enabled;

///
// Pointer for the new browser window. Only used with windowed rendering.
///
Expand Down
10 changes: 2 additions & 8 deletions include/internal/cef_types_mac.h
Expand Up @@ -102,17 +102,11 @@ typedef struct _cef_window_info_t {
// monitor will be used and some functionality that requires a parent view
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
int windowless_rendering_enabled;

///
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
///
int transparent_painting_enabled;

///
// NSView pointer for the new browser view. Only used with windowed rendering.
///
Expand Down
10 changes: 2 additions & 8 deletions include/internal/cef_types_win.h
Expand Up @@ -82,17 +82,11 @@ typedef struct _cef_window_info_t {
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
int windowless_rendering_enabled;

///
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
///
int transparent_painting_enabled;

///
// Handle for the new browser window. Only used with windowed rendering.
///
Expand Down
10 changes: 4 additions & 6 deletions include/internal/cef_win.h
Expand Up @@ -88,7 +88,6 @@ struct CefWindowInfoTraits {
target->height = src->height;
target->parent_window = src->parent_window;
target->menu = src->menu;
target->transparent_painting_enabled = src->transparent_painting_enabled;
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
target->window = src->window;
}
Expand Down Expand Up @@ -140,15 +139,14 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
// monitor info and to act as the parent window for dialogs, context menus,
// etc. If |parent| is not provided then the main screen monitor will be used
// and some functionality that requires a parent window may not function
// correctly. If |transparent| is true a transparent background color will be
// used (RGBA=0x00000000). If |transparent| is false the background will be
// white and opaque. In order to create windowless browsers the
// correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
void SetAsWindowless(CefWindowHandle parent, bool transparent) {
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = TRUE;
parent_window = parent;
transparent_painting_enabled = transparent;
}
};

Expand Down
21 changes: 13 additions & 8 deletions libcef/browser/browser_context.cc
Expand Up @@ -28,6 +28,15 @@ CefBrowserContext::~CefBrowserContext() {
void CefBrowserContext::Initialize() {
content::BrowserContext::Initialize(this, GetPath());

resource_context_.reset(
new CefResourceContext(IsOffTheRecord(), GetHandler()));

// This must be called before creating any services to avoid hitting
// DependencyManager::AssertContextWasntDestroyed when creating/destroying
// multiple browser contexts (due to pointer address reuse).
BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices(
this);

const bool extensions_enabled = extensions::ExtensionsEnabled();
if (extensions_enabled) {
// Create the custom ExtensionSystem first because other KeyedServices
Expand All @@ -41,22 +50,18 @@ void CefBrowserContext::Initialize() {
} else {
extension_system_->InitForRegularProfile(true);
}
resource_context_->set_extensions_info_map(extension_system_->info_map());
}
}

resource_context_.reset(new CefResourceContext(
IsOffTheRecord(),
extensions_enabled ? extension_system_->info_map() : NULL,
GetHandler()));

BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices(
this);

void CefBrowserContext::PostInitialize() {
// Spell checking support and possibly other subsystems retrieve the
// PrefService associated with a BrowserContext via UserPrefs::Get().
PrefService* pref_service = GetPrefs();
DCHECK(pref_service);
user_prefs::UserPrefs::Set(this, pref_service);

const bool extensions_enabled = extensions::ExtensionsEnabled();
if (extensions_enabled && !is_proxy_)
extension_system_->Init();
}
Expand Down
3 changes: 3 additions & 0 deletions libcef/browser/browser_context.h
Expand Up @@ -187,6 +187,9 @@ class CefBrowserContext : public ChromeProfileStub {
protected:
~CefBrowserContext() override;

// Must be called after all services have been initialized.
void PostInitialize();

// Must be called before the child object destructor has completed.
void Shutdown();

Expand Down
26 changes: 21 additions & 5 deletions libcef/browser/browser_context_impl.cc
Expand Up @@ -85,6 +85,8 @@ class ImplManager {
CefBrowserContextImpl* GetImplForContext(
const content::BrowserContext* context) {
CEF_REQUIRE_UIT();
if (!context)
return NULL;

const CefBrowserContext* cef_context =
static_cast<const CefBrowserContext*>(context);
Expand Down Expand Up @@ -141,7 +143,14 @@ class ImplManager {
DISALLOW_COPY_AND_ASSIGN(ImplManager);
};

base::LazyInstance<ImplManager> g_manager = LAZY_INSTANCE_INITIALIZER;
#if DCHECK_IS_ON()
// Because of DCHECK()s in the object destructor.
base::LazyInstance<ImplManager>::DestructorAtExit g_manager =
LAZY_INSTANCE_INITIALIZER;
#else
base::LazyInstance<ImplManager>::Leaky g_manager =
LAZY_INSTANCE_INITIALIZER;
#endif

} // namespace

Expand Down Expand Up @@ -259,9 +268,16 @@ void CefBrowserContextImpl::Initialize() {
CefString(&CefContext::Get()->settings().accept_language_list);
}

// Initialize preferences.
// Initialize a temporary PrefService object that may be referenced during
// BrowserContextServices initialization.
pref_service_ = browser_prefs::CreatePrefService(
this, cache_path_, !!settings_.persist_user_preferences);
this, base::FilePath(), false, true);

CefBrowserContext::Initialize();

// Initialize the real PrefService object.
pref_service_ = browser_prefs::CreatePrefService(
this, cache_path_, !!settings_.persist_user_preferences, false);

// Initialize visited links management.
base::FilePath visited_link_path;
Expand All @@ -275,13 +291,13 @@ void CefBrowserContextImpl::Initialize() {
visitedlink_listener_->CreateListenerForContext(this);
visitedlink_master_->Init();

CefBrowserContext::Initialize();

// Initialize proxy configuration tracker.
pref_proxy_config_tracker_.reset(
ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
GetPrefs()));

CefBrowserContext::PostInitialize();

// Create the CefURLRequestContextGetterImpl via an indirect call to
// CreateRequestContext. Triggers a call to CefURLRequestContextGetterImpl::
// GetURLRequestContext() on the IO thread which creates the
Expand Down
7 changes: 7 additions & 0 deletions libcef/browser/browser_context_proxy.cc
Expand Up @@ -82,6 +82,8 @@ void CefBrowserContextProxy::Initialize() {
// This object's CefResourceContext needs to proxy some UserData requests to
// the parent object's CefResourceContext.
resource_context()->set_parent(parent_->resource_context());

CefBrowserContext::PostInitialize();
}

base::SupportsUserData::Data*
Expand Down Expand Up @@ -182,6 +184,11 @@ net::URLRequestContextGetter*
return nullptr;
}

void CefBrowserContextProxy::RegisterInProcessServices(
StaticServiceMap* services) {
parent_->RegisterInProcessServices(services);
}

PrefService* CefBrowserContextProxy::GetPrefs() {
return parent_->GetPrefs();
}
Expand Down
1 change: 1 addition & 0 deletions libcef/browser/browser_context_proxy.h
Expand Up @@ -54,6 +54,7 @@ class CefBrowserContextProxy : public CefBrowserContext {
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors)
override;
void RegisterInProcessServices(StaticServiceMap* services) override;

// Profile methods.
PrefService* GetPrefs() override;
Expand Down

1 comment on commit 3f71138

@EndoSakura
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why SK_AlphaOPAQUE will always be returned for windowed browsers. SK_ColorTRANSPARENT may be returned for windowless browsers to enable transparency?

Please sign in to comment.