Compare commits

...

21 Commits
6099 ... 3729

Author SHA1 Message Date
Chris Dziemborowicz
b62bacfe38 Fix version calculation for older commits on a release branch (fixes issue #2659) 2019-05-15 17:40:08 +03:00
Marshall Greenblatt
86e55c2449 Update to Chromium version 74.0.3729.157 2019-05-15 15:17:16 +03:00
Marshall Greenblatt
c6e5dd88db Windows: Add arch-specific versions of d3dcompiler_47.dll (see issue #2656)
This fixes an issue where the 64-bit version of d3dcompiler_47.dll would be
included with 32-bit binary distributions.
2019-05-15 14:41:36 +03:00
Marshall Greenblatt
e20b240523 Windows: Remove d3dcompiler_43.dll
The d3dcompiler_43.dll file was only required on Windows XP, which is no longer
supported.
2019-05-07 15:28:36 -04:00
Marshall Greenblatt
9f75be141d Windows: Add d3dcompiler_47.dll version 10.0.17134.12
This change adds the d3dcompiler_47.dll version that was included with Windows
SDK 10.0.17134. The newer version of this file included with Windows SDK
10.0.17763 adds a dependency on the Universal C Runtime (api-ms-win-crt-*.dll)
which might not be installed on Windows 7 (requires KB2999226).
2019-05-07 15:28:30 -04:00
Marshall Greenblatt
50c3c5c5fa Update to Chromium version 74.0.3729.131 2019-05-06 12:25:34 -04:00
Marshall Greenblatt
98f22d3b7b Update to Chromium version 74.0.3729.108 2019-04-24 14:11:39 -04:00
Riku Palomäki
5fa3d519c9 Fix assert failure when hiding the OSR widget (fixes issue #2631) 2019-04-15 13:27:53 -04:00
Marshall Greenblatt
2e39487ad6 Linux: Load additional binaries from DIR_ASSETS (fixes issue #1936)
This adds *.pak, locales/*.pak , chrome-sandbox, libGLESv2.so, libEGL.so and
swiftshader/*.so to the list of binaries that will be loaded from the libcef.so
directory instead of the executable directory by default.
2019-03-20 14:18:39 -04:00
Riku Palomäki
b469c3bf69 Don't create cache directories in incognito mode (fixes issue #2289) 2019-03-18 17:47:43 -04:00
Riku Palomäki
2ff59af429 Linux: Add OSR use_external_begin_frame support (see issue #1006) 2019-03-18 17:47:35 -04:00
Riku Palomäki
eef2fcc940 Fix frozen OSR rendering after resize (fixes issue #2627) 2019-03-18 17:47:25 -04:00
Riku Palomäki
e1c74c2e47 Make sure to call OnLoadingStateChange when navigation state changes (fixes issue #2624) 2019-03-18 17:47:14 -04:00
Riku Palomäki
8c3bd38177 Fix OSR PDF viewer rendering on initial page load (fixes issue #2598) 2019-03-18 17:46:57 -04:00
Marshall Greenblatt
2aa4651426 Enable new version number format by default (see issue #2596)
To continue using the old format set the CEF_OLD_VERSION_FORMAT=1 environment
variable before building.
2019-03-18 16:58:31 -04:00
Chris Dziemborowicz
67aea923c9 Mac: Fix undefined C++ symbols in cef_sandbox.a (see issue #2629)
This change updates make_distrib.py to link in all of libc++ and libc++abi from the Chromium build when generating cef_sandbox.a. This increases the size of the release build of cef_sandbox.a from about 0.5 MB to about 2.0 MB, but it ensures that no C++ symbols are imported by the archive.

Linking cef_sandbox.a with an incompatible C++ library prior to this change could cause undefined behavior in the resulting binary.

To make sure that we do not regress this fix, this change also updates make_distrib.py to verify that no C++ symbols are imported by cef_sandbox.a after it is generated (in a way similar to the way we verify that cef_sandbox.a exports the correct symbols).
2019-03-16 13:15:10 -04:00
Marshall Greenblatt
660ad50470 Linux: cmake: Add xi dependency for cefclient (see issue #1059) 2019-03-15 13:42:34 -04:00
Marshall Greenblatt
c67d0fe8fa cefbuilds: Add support for new version number format (see issue #2596) 2019-03-15 13:20:57 -04:00
Marshall Greenblatt
e8fe60af56 Compute all version numbers using cef_version.py (see issue #2596)
The version format can now be controlled by setting the CEF_OLD_VERSION_FORMAT
environment variable. The old format is currently the default.
2019-03-15 13:20:51 -04:00
Marshall Greenblatt
819eb61e73 Add cef_api_hash.h generated by the translator tool (see issue #2596)
This splits out the API hashes from the cef_version.h file which is generated at
build time. Changes to the cef_api_hash.h file are committed to the repo and
represent potentially breaking API changes. This commit history will be used to
calculate the version number.
2019-03-15 13:20:46 -04:00
Marshall Greenblatt
62d140e525 Update to Chromium version 74.0.3729.6 2019-03-14 09:19:01 -04:00
62 changed files with 1115 additions and 500 deletions

View File

@@ -166,45 +166,14 @@ if (is_mac) {
#
if (is_mac) {
cef_commit_number = exec_script(
"//cef/tools/commit_number.py",
[ rebase_path("//cef", root_build_dir) ],
"trim string", [])
cef_version_file = "//cef/VERSION.in"
# The tweak_info_plist.py script requires a version number with 4 parts. CEF
# uses a version number with 3 parts so just set the last part to 0.
cef_plist_version = exec_script(
"//build/util/version.py",
[
"-f",
rebase_path(cef_version_file, root_build_dir),
"-f",
rebase_path(chrome_version_file, root_build_dir),
"-t",
"@CEF_MAJOR@.@BUILD@.${cef_commit_number}.0",
],
"trim string",
[ cef_version_file, chrome_version_file ])
"//cef/tools/cef_version.py", [ "plist" ], "trim string", [])
# Need to be creative to match dylib version formatting requirements.
cef_dylib_version = exec_script(
"//build/util/version.py",
[
"-f",
rebase_path(cef_version_file, root_build_dir),
"-f",
rebase_path(chrome_version_file, root_build_dir),
"-t",
"@CEF_MAJOR@${cef_commit_number}.@BUILD_HI@.@BUILD_LO@",
"-e",
"BUILD_HI=int(BUILD)/256",
"-e",
"BUILD_LO=int(BUILD)%256",
],
"trim string",
[ cef_version_file, chrome_version_file ])
"//cef/tools/cef_version.py", [ "dylib" ], "trim string", [])
}
# Read file lists from gypi files. The gypi_to_gn.py script does not support

View File

@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/74.0.3729.0'
'chromium_checkout': 'refs/tags/74.0.3729.157'
}

View File

@@ -34,6 +34,7 @@
'include/base/internal/cef_lock_impl.h',
'include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h',
'include/base/internal/cef_thread_checker_impl.h',
'include/cef_api_hash.h',
'include/cef_base.h',
'include/cef_version.h',
'include/internal/cef_export.h',

View File

@@ -459,7 +459,6 @@ if(OS_WINDOWS)
# List of CEF binary files.
set(CEF_BINARY_FILES
chrome_elf.dll
d3dcompiler_43.dll
d3dcompiler_47.dll
libcef.dll
libEGL.dll

76
include/cef_api_hash.h Normal file
View File

@@ -0,0 +1,76 @@
// Copyright (c) 2019 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=b5fa5783096eaa1af5e76645e2557e123af56848$
//
#ifndef CEF_INCLUDE_API_HASH_H_
#define CEF_INCLUDE_API_HASH_H_
#include "include/internal/cef_export.h"
// The API hash is created by analyzing CEF header files for C API type
// definitions. The hash value will change when header files are modified in a
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "8ae24aac4bd16d2e2d87e7d6561985064990670e"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "fe476e7a38a8270fe783981b4bc6fac4284ab9fe"
#elif defined(OS_MACOSX)
#define CEF_API_HASH_PLATFORM "ab1b4d8c4578b0bcdc97f28f13a10384057bdf95"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "73f24626e0179a3f5664d64ffe0fa2aab9edf7cf"
#endif
#ifdef __cplusplus
extern "C" {
#endif
///
// Returns CEF API hashes for the libcef library. The returned string is owned
// by the library and should not be freed. The |entry| parameter describes which
// hash value will be returned:
// 0 - CEF_API_HASH_PLATFORM
// 1 - CEF_API_HASH_UNIVERSAL
// 2 - CEF_COMMIT_HASH (from cef_version.h)
///
CEF_EXPORT const char* cef_api_hash(int entry);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_API_HASH_H_

View File

@@ -2306,8 +2306,10 @@ void CefBrowserHostImpl::LoadingStateChanged(content::WebContents* source,
// This method may be called multiple times in a row with |is_loading| true
// as a result of https://crrev.com/5e750ad0. Ignore the 2nd+ times.
if (is_loading_ == is_loading)
if (is_loading_ == is_loading && can_go_back_ == can_go_back &&
can_go_forward_ == can_go_forward) {
return;
}
is_loading_ = is_loading;
can_go_back_ = can_go_back;

View File

@@ -46,7 +46,7 @@ std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
window_info, background_color);
#elif defined(OS_LINUX)
return std::make_unique<CefBrowserPlatformDelegateNativeLinux>(
window_info, background_color);
window_info, background_color, use_external_begin_frame);
#endif
}

View File

@@ -41,11 +41,12 @@ long GetSystemUptime() {
CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
const CefWindowInfo& window_info,
SkColor background_color)
SkColor background_color,
bool use_external_begin_frame)
: CefBrowserPlatformDelegateNative(window_info,
background_color,
false,
false),
use_external_begin_frame),
host_window_created_(false),
window_widget_(nullptr),
window_x11_(nullptr) {}

View File

@@ -14,7 +14,8 @@ class CefBrowserPlatformDelegateNativeLinux
: public CefBrowserPlatformDelegateNative {
public:
CefBrowserPlatformDelegateNativeLinux(const CefWindowInfo& window_info,
SkColor background_color);
SkColor background_color,
bool use_external_begin_frame);
// CefBrowserPlatformDelegate methods:
void BrowserDestroyed(CefBrowserHostImpl* browser) override;

View File

@@ -344,6 +344,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
software_output_device_(NULL),
hold_resize_(false),
pending_resize_(false),
pending_resize_force_(false),
render_widget_host_(content::RenderWidgetHostImpl::From(widget)),
has_parent_(parent_host_view != NULL),
parent_host_view_(parent_host_view),
@@ -381,7 +382,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
delegated_frame_host_ = std::make_unique<content::DelegatedFrameHost>(
AllocateFrameSinkId(is_guest_view_hack),
delegated_frame_host_client_.get(),
true /* should_register_frame_sink_id */);
false /* should_register_frame_sink_id */);
root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
#endif
@@ -414,6 +415,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
compositor_->SetDelegate(this);
compositor_->SetRootLayer(root_layer_.get());
compositor_->AddChildFrameSink(GetFrameSinkId());
#endif
if (browser_impl_.get())
@@ -533,6 +535,8 @@ void CefRenderWidgetHostViewOSR::Hide() {
if (!is_showing_)
return;
is_showing_ = false;
if (browser_impl_.get())
browser_impl_->CancelContextMenu();
@@ -545,8 +549,6 @@ void CefRenderWidgetHostViewOSR::Hide() {
GetDelegatedFrameHost()->WasHidden();
GetDelegatedFrameHost()->DetachFromCompositor();
#endif
is_showing_ = false;
}
bool CefRenderWidgetHostViewOSR::IsShowing() {
@@ -1141,9 +1143,11 @@ CefRenderWidgetHostViewOSR::CreateSyntheticGestureTarget() {
viz::ScopedSurfaceIdAllocator
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) {
bool force =
local_surface_id_allocation_ != metadata.local_surface_id_allocation;
base::OnceCallback<void()> allocation_task =
base::BindOnce(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties,
weak_ptr_factory_.GetWeakPtr());
weak_ptr_factory_.GetWeakPtr(), force);
return viz::ScopedSurfaceIdAllocator(std::move(allocation_task));
}
#endif
@@ -1248,14 +1252,16 @@ bool CefRenderWidgetHostViewOSR::InstallTransparency() {
return false;
}
void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties() {
void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties(bool force) {
if (hold_resize_) {
if (!pending_resize_)
pending_resize_ = true;
if (force)
pending_resize_force_ = true;
return;
}
ResizeRootLayer(false);
ResizeRootLayer(force);
}
void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
@@ -1317,6 +1323,9 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
DCHECK(begin_frame_args.IsValid());
begin_frame_number_++;
if (render_widget_host_)
render_widget_host_->ProgressFlingIfNeeded(frame_time);
if (renderer_compositor_frame_sink_) {
GetCompositor()->context_factory_private()->IssueExternalBeginFrame(
GetCompositor(), begin_frame_args);
@@ -1636,11 +1645,13 @@ void CefRenderWidgetHostViewOSR::ReleaseResize() {
hold_resize_ = false;
if (pending_resize_) {
bool force = pending_resize_force_;
pending_resize_ = false;
pending_resize_force_ = false;
CEF_POST_TASK(
CEF_UIT,
base::Bind(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties,
weak_ptr_factory_.GetWeakPtr()));
weak_ptr_factory_.GetWeakPtr(), force));
}
}

View File

@@ -225,7 +225,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
bool InstallTransparency();
void SynchronizeVisualProperties();
void SynchronizeVisualProperties(bool force = false);
void OnScreenInfoChanged();
void Invalidate(CefBrowserHost::PaintElementType type);
void SendExternalBeginFrame();
@@ -395,6 +395,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
bool hold_resize_;
bool pending_resize_;
bool pending_resize_force_;
// The associated Model. While |this| is being Destroyed,
// |render_widget_host_| is NULL and the message loop is run one last time

View File

@@ -139,7 +139,7 @@ void OverrideChildProcessPath() {
base::FilePath GetResourcesFilePath() {
base::FilePath pak_dir;
base::PathService::Get(base::DIR_MODULE, &pak_dir);
base::PathService::Get(base::DIR_ASSETS, &pak_dir);
return pak_dir;
}
@@ -265,8 +265,9 @@ bool IsScaleFactorSupported(ui::ScaleFactor scale_factor) {
}
#if defined(OS_LINUX)
// Look for the *.dat and *.bin files next to libcef instead of the exe on
// Linux. This is already the default on Windows.
// Look for binary files (*.bin, *.dat, *.pak, chrome-sandbox, libGLESv2.so,
// libEGL.so, locales/*.pak, swiftshader/*.so) next to libcef instead of the exe
// on Linux. This is already the default on Windows.
void OverrideAssetPath() {
Dl_info dl_info;
if (dladdr(reinterpret_cast<const void*>(&OverrideAssetPath), &dl_info)) {

View File

@@ -9,11 +9,11 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=a87daf3d3e3bd604ac3c008561676181d42f3266$
// $hash=0e24c6b07a7377337132b09396d9e5f3e4eca517$
//
#include "libcef_dll/ctocpp/command_line_ctocpp.h"
#include "include/cef_version.h"
#include "include/cef_api_hash.h"
#include "libcef_dll/transfer_util.h"
// STATIC METHODS - Body may be edited by hand.

View File

@@ -95,8 +95,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION CEF_VERSION_MAJOR,CHROME_VERSION_BUILD,CEF_COMMIT_NUMBER,0
PRODUCTVERSION CEF_VERSION_MAJOR,CHROME_VERSION_BUILD,CEF_COMMIT_NUMBER,0
FILEVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
PRODUCTVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L

View File

@@ -4,6 +4,7 @@
//
#include <cstddef>
#include "include/cef_api_hash.h"
#include "include/cef_version.h"
CEF_EXPORT int cef_version_info(int entry) {
@@ -11,14 +12,18 @@ CEF_EXPORT int cef_version_info(int entry) {
case 0:
return CEF_VERSION_MAJOR;
case 1:
return CEF_COMMIT_NUMBER;
return CEF_VERSION_MINOR;
case 2:
return CHROME_VERSION_MAJOR;
return CEF_VERSION_PATCH;
case 3:
return CHROME_VERSION_MINOR;
return CEF_COMMIT_NUMBER;
case 4:
return CHROME_VERSION_BUILD;
return CHROME_VERSION_MAJOR;
case 5:
return CHROME_VERSION_MINOR;
case 6:
return CHROME_VERSION_BUILD;
case 7:
return CHROME_VERSION_PATCH;
default:
return 0;

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=ef8269462464beba6718a2e0d03e0f1cb41901bf$
// $hash=4a4744491587c5f5b1ce8726d8dd08ad04646b92$
//
#include <dlfcn.h>
@@ -58,6 +58,7 @@
#include "include/capi/views/cef_scroll_view_capi.h"
#include "include/capi/views/cef_textfield_capi.h"
#include "include/capi/views/cef_window_capi.h"
#include "include/cef_api_hash.h"
#include "include/cef_version.h"
#include "include/internal/cef_logging_internal.h"
#include "include/internal/cef_string_list.h"
@@ -333,8 +334,8 @@ typedef struct _cef_textfield_t* (*cef_textfield_create_ptr)(
struct _cef_textfield_delegate_t*);
typedef struct _cef_window_t* (*cef_window_create_top_level_ptr)(
struct _cef_window_delegate_t*);
typedef int (*cef_version_info_ptr)(int);
typedef const char* (*cef_api_hash_ptr)(int);
typedef int (*cef_version_info_ptr)(int);
typedef int (*cef_get_min_log_level_ptr)();
typedef int (*cef_get_vlog_level_ptr)(const char*, size_t);
typedef void (*cef_log_ptr)(const char*, int, int, const char*);
@@ -656,8 +657,8 @@ struct libcef_pointers {
cef_scroll_view_create_ptr cef_scroll_view_create;
cef_textfield_create_ptr cef_textfield_create;
cef_window_create_top_level_ptr cef_window_create_top_level;
cef_version_info_ptr cef_version_info;
cef_api_hash_ptr cef_api_hash;
cef_version_info_ptr cef_version_info;
cef_get_min_log_level_ptr cef_get_min_log_level;
cef_get_vlog_level_ptr cef_get_vlog_level;
cef_log_ptr cef_log;
@@ -864,8 +865,8 @@ int libcef_init_pointers(const char* path) {
INIT_ENTRY(cef_scroll_view_create);
INIT_ENTRY(cef_textfield_create);
INIT_ENTRY(cef_window_create_top_level);
INIT_ENTRY(cef_version_info);
INIT_ENTRY(cef_api_hash);
INIT_ENTRY(cef_version_info);
INIT_ENTRY(cef_get_min_log_level);
INIT_ENTRY(cef_get_vlog_level);
INIT_ENTRY(cef_log);
@@ -1098,8 +1099,8 @@ int cef_create_url(const struct _cef_urlparts_t* parts, cef_string_t* url) {
}
NO_SANITIZE("cfi-icall")
cef_string_userfree_t
cef_format_url_for_security_display(const cef_string_t* origin_url) {
cef_string_userfree_t cef_format_url_for_security_display(
const cef_string_t* origin_url) {
return g_libcef_pointers.cef_format_url_for_security_display(origin_url);
}
@@ -1590,54 +1591,46 @@ struct _cef_translator_test_t* cef_translator_test_create() {
}
NO_SANITIZE("cfi-icall")
struct
_cef_translator_test_ref_ptr_library_t* cef_translator_test_ref_ptr_library_create(
int value) {
struct _cef_translator_test_ref_ptr_library_t*
cef_translator_test_ref_ptr_library_create(int value) {
return g_libcef_pointers.cef_translator_test_ref_ptr_library_create(value);
}
NO_SANITIZE("cfi-icall")
struct
_cef_translator_test_ref_ptr_library_child_t* cef_translator_test_ref_ptr_library_child_create(
int value,
int other_value) {
struct _cef_translator_test_ref_ptr_library_child_t*
cef_translator_test_ref_ptr_library_child_create(int value, int other_value) {
return g_libcef_pointers.cef_translator_test_ref_ptr_library_child_create(
value, other_value);
}
NO_SANITIZE("cfi-icall")
struct
_cef_translator_test_ref_ptr_library_child_child_t* cef_translator_test_ref_ptr_library_child_child_create(
int value,
int other_value,
int other_other_value) {
struct _cef_translator_test_ref_ptr_library_child_child_t*
cef_translator_test_ref_ptr_library_child_child_create(int value,
int other_value,
int other_other_value) {
return g_libcef_pointers
.cef_translator_test_ref_ptr_library_child_child_create(
value, other_value, other_other_value);
}
NO_SANITIZE("cfi-icall")
struct
_cef_translator_test_scoped_library_t* cef_translator_test_scoped_library_create(
int value) {
struct _cef_translator_test_scoped_library_t*
cef_translator_test_scoped_library_create(int value) {
return g_libcef_pointers.cef_translator_test_scoped_library_create(value);
}
NO_SANITIZE("cfi-icall")
struct
_cef_translator_test_scoped_library_child_t* cef_translator_test_scoped_library_child_create(
int value,
int other_value) {
struct _cef_translator_test_scoped_library_child_t*
cef_translator_test_scoped_library_child_create(int value, int other_value) {
return g_libcef_pointers.cef_translator_test_scoped_library_child_create(
value, other_value);
}
NO_SANITIZE("cfi-icall")
struct
_cef_translator_test_scoped_library_child_child_t* cef_translator_test_scoped_library_child_child_create(
int value,
int other_value,
int other_other_value) {
struct _cef_translator_test_scoped_library_child_child_t*
cef_translator_test_scoped_library_child_child_create(int value,
int other_value,
int other_other_value) {
return g_libcef_pointers
.cef_translator_test_scoped_library_child_child_create(value, other_value,
other_other_value);
@@ -1727,14 +1720,14 @@ struct _cef_window_t* cef_window_create_top_level(
return g_libcef_pointers.cef_window_create_top_level(delegate);
}
NO_SANITIZE("cfi-icall") int cef_version_info(int entry) {
return g_libcef_pointers.cef_version_info(entry);
}
NO_SANITIZE("cfi-icall") const char* cef_api_hash(int entry) {
return g_libcef_pointers.cef_api_hash(entry);
}
NO_SANITIZE("cfi-icall") int cef_version_info(int entry) {
return g_libcef_pointers.cef_version_info(entry);
}
NO_SANITIZE("cfi-icall") int cef_get_min_log_level() {
return g_libcef_pointers.cef_get_min_log_level();
}

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=a53efd61643236ca14fddb5541f23ef2d9d1dc54$
// $hash=32eea715f2566d1b6a4e3d263e35400cf7c53869$
//
#include "include/capi/cef_app_capi.h"
@@ -26,6 +26,7 @@
#include "include/capi/cef_v8_capi.h"
#include "include/capi/cef_web_plugin_capi.h"
#include "include/capi/test/cef_test_helpers_capi.h"
#include "include/cef_api_hash.h"
#include "include/cef_app.h"
#include "include/cef_crash_util.h"
#include "include/cef_file_util.h"
@@ -38,7 +39,6 @@
#include "include/cef_task.h"
#include "include/cef_trace.h"
#include "include/cef_v8.h"
#include "include/cef_version.h"
#include "include/cef_web_plugin.h"
#include "include/test/cef_test_helpers.h"
#include "libcef_dll/cpptoc/app_cpptoc.h"

View File

@@ -261,7 +261,8 @@ patches = [
# (c) Removing static_cast<> of StoragePartition to StoragePartitionImpl.
# https://bitbucket.org/chromiumembedded/cef/issues/1973
#
# Don't create a "databases" directory when cache_path is empty.
# Don't create databases, blob_storage or VideoDecodeStats directories when
# cache_path is empty.
# https://bitbucket.org/chromiumembedded/cef/issues/2289
'name': 'storage_partition_1973',
},
@@ -418,9 +419,9 @@ patches = [
'name': 'message_pump_mac_2495',
},
{
# Windows: Fix jumbo build error in AccessibilityTreeFormatterWin
# https://bugs.chromium.org/p/chromium/issues/detail?id=939668
'name': 'accessibility_win_939668',
# Linux: Load binaries from DIR_ASSETS.
# https://bitbucket.org/chromiumembedded/cef/issues/1936
'name': 'linux_assets_path_1936',
},
{
# Windows: Revert base::Value change which breaks cef_sandbox build.

View File

@@ -1,31 +0,0 @@
diff --git content/browser/accessibility/accessibility_tree_formatter_win.cc content/browser/accessibility/accessibility_tree_formatter_win.cc
index 59f85adf85c3..a60cb7aa874c 100644
--- content/browser/accessibility/accessibility_tree_formatter_win.cc
+++ content/browser/accessibility/accessibility_tree_formatter_win.cc
@@ -35,7 +35,7 @@
#include "ui/base/win/atl_module.h"
#include "ui/gfx/win/hwnd_util.h"
-namespace {
+namespace internal {
struct HwndWithProcId {
HwndWithProcId(const base::ProcessId id) : pid(id), hwnd(nullptr) {}
@@ -60,7 +60,7 @@ HWND GetHwndForProcess(base::ProcessId pid) {
return hwnd_with_proc_id.hwnd;
}
-} // namespace
+} // namespace internal
namespace content {
@@ -354,7 +354,7 @@ std::unique_ptr<base::DictionaryValue>
AccessibilityTreeFormatterWin::BuildAccessibilityTreeForProcess(
base::ProcessId pid) {
// Get HWND for process id.
- HWND hwnd = GetHwndForProcess(pid);
+ HWND hwnd = ::internal::GetHwndForProcess(pid);
return BuildAccessibilityTreeForWindow(hwnd);
}

View File

@@ -1,5 +1,5 @@
diff --git content/browser/renderer_host/render_widget_host_view_child_frame.cc content/browser/renderer_host/render_widget_host_view_child_frame.cc
index 1e2a66d449be..639bb2096cf4 100644
index eef13b593cfa..f157f6e54279 100644
--- content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -650,6 +650,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame(

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index f8dfe8e20824..ec6fc42d11de 100644
index 0324e35f2466..a0c9411863d7 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -8,6 +8,7 @@ import("//build/config/features.gni")
@@ -18,7 +18,7 @@ index f8dfe8e20824..ec6fc42d11de 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2109,6 +2111,10 @@ jumbo_split_static_library("browser") {
@@ -2108,6 +2110,10 @@ jumbo_split_static_library("browser") {
]
}
@@ -29,7 +29,7 @@ index f8dfe8e20824..ec6fc42d11de 100644
if (is_android) {
sources += [
"after_startup_task_utils_android.cc",
@@ -3858,7 +3864,7 @@ jumbo_split_static_library("browser") {
@@ -3861,7 +3867,7 @@ jumbo_split_static_library("browser") {
]
}

View File

@@ -51,7 +51,7 @@ index 7168c719aa25..bae7162a539c 100644
override;
network::NetworkQualityTracker* network_quality_tracker() override;
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 911e49e41313..eecbca982a92 100644
index d4ff15d0fcd9..33d5ac2c2321 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -9,6 +9,7 @@ import("//build/config/features.gni")

View File

@@ -71,7 +71,7 @@ index e8e76ce5b954..1dd338dd0142 100644
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
content::BrowserContext* context);
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index d66a0216832f..25c5ea80cb07 100644
index af40358b9ef2..6d2eef05af5e 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -384,7 +384,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
index 25de1508db60..5fcfffa96b89 100644
index 010f9511741c..a777f2d7a106 100644
--- chrome/browser/download/download_target_determiner.cc
+++ chrome/browser/download/download_target_determiner.cc
@@ -597,8 +597,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
@@ -602,8 +602,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
content::PluginService* plugin_service =
content::PluginService::GetInstance();
bool plugin_found = plugin_service->GetPluginInfo(
@@ -66,7 +66,7 @@ index be77d0e074e9..949873b9bb22 100644
}
diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
index 1e912186c32c..38d03aafc8b0 100644
index de22d5e48b35..830133d6e49c 100644
--- content/browser/frame_host/navigation_handle_impl.cc
+++ content/browser/frame_host/navigation_handle_impl.cc
@@ -308,12 +308,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
@@ -83,10 +83,10 @@ index 1e912186c32c..38d03aafc8b0 100644
"WillFailRequest state should come before WillProcessResponse");
return navigation_request_->render_frame_host();
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
index 21f84cc3f922..020017584cd9 100644
index 95fc376f184a..f68d998abcdd 100644
--- content/browser/frame_host/render_frame_host_impl.cc
+++ content/browser/frame_host/render_frame_host_impl.cc
@@ -4777,9 +4777,9 @@ void RenderFrameHostImpl::CommitNavigation(
@@ -4800,9 +4800,9 @@ void RenderFrameHostImpl::CommitNavigation(
// factories. TODO(kinuko): Consider setting this up only when prefetch
// is used. Currently we have this here to make sure we have non-racy
// situation (https://crbug.com/849929).
@@ -255,10 +255,10 @@ index 3009401dac6b..b4c5a9e2db50 100644
};
diff --git content/common/frame_messages.h content/common/frame_messages.h
index f1b940d02a3e..7ba4495c34b0 100644
index b6800bd3dab4..e726924758c4 100644
--- content/common/frame_messages.h
+++ content/common/frame_messages.h
@@ -1319,9 +1319,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
@@ -1328,9 +1328,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
// type. If there is no matching plugin, |found| is false.
// |actual_mime_type| is the actual mime type supported by the
// found plugin.
@@ -334,10 +334,10 @@ index c9ce48e3c3ec..0a3448b194a3 100644
virtual void FocusedNodeChanged(const blink::WebNode& node) {}
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index b82743edbc63..cae550657487 100644
index ae7ecadddf71..d4c7118da850 100644
--- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc
@@ -3922,7 +3922,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
@@ -3940,7 +3940,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
std::string mime_type;
bool found = false;
Send(new FrameHostMsg_GetPluginInfo(
@@ -347,7 +347,7 @@ index b82743edbc63..cae550657487 100644
params.mime_type.Utf8(), &found, &info, &mime_type));
if (!found)
return nullptr;
@@ -4340,6 +4341,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
@@ -4358,6 +4359,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
void RenderFrameImpl::FrameFocused() {
Send(new FrameHostMsg_FrameFocused(routing_id_));
@@ -357,7 +357,7 @@ index b82743edbc63..cae550657487 100644
void RenderFrameImpl::WillCommitProvisionalLoad() {
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index 9d029d4ee65b..d5aff5825371 100644
index 44d963793f14..0e345c8a61c3 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -806,6 +806,8 @@ void RenderThreadImpl::Init() {

View File

@@ -57,7 +57,7 @@ index cc7c7b4ffab5..24cab4f980a5 100644
// If |new_instance| is a new SiteInstance for a subframe that requires a
// dedicated process, set its process reuse policy so that such subframes are
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index 7fc0a70f4e79..96a887d5e8e5 100644
index 009991aa57e8..a31088768f60 100644
--- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h
@@ -460,6 +460,13 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -74,7 +74,7 @@ index 7fc0a70f4e79..96a887d5e8e5 100644
// Returns true if the passed in URL should be assigned as the site of the
// current SiteInstance, if it does not yet have a site.
virtual bool ShouldAssignSiteForURL(const GURL& url);
@@ -1491,6 +1498,10 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1495,6 +1502,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string.
virtual std::string GetProduct() const;
@@ -86,7 +86,7 @@ index 7fc0a70f4e79..96a887d5e8e5 100644
virtual std::string GetUserAgent() const;
diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc
index 0714c63350c8..c1acbd8bd531 100644
index 8cc9503fc131..b74c385b40a2 100644
--- extensions/browser/extension_host.cc
+++ extensions/browser/extension_host.cc
@@ -67,11 +67,12 @@ ExtensionHost::ExtensionHost(const Extension* extension,

View File

@@ -984,7 +984,7 @@ index 6955858281e7..045dee3185bf 100644
"buffer_manager.cc",
"buffer_manager.h",
diff --git gpu/command_buffer/service/gles2_cmd_decoder.cc gpu/command_buffer/service/gles2_cmd_decoder.cc
index d7197fe6455c..bfb072283725 100644
index 87220701d86b..0bcb74f19b7a 100644
--- gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -38,6 +38,7 @@
@@ -1079,7 +1079,7 @@ index d7197fe6455c..bfb072283725 100644
for (auto it = saved_back_textures_.begin(); it != saved_back_textures_.end();
++it) {
diff --git gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
index 805d9ae94712..6723682670e4 100644
index 2b5b7f41a055..ae3b016fb2e4 100644
--- gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
+++ gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -11,6 +11,7 @@
@@ -1090,7 +1090,7 @@ index 805d9ae94712..6723682670e4 100644
#include "gpu/command_buffer/service/command_buffer_service.h"
#include "gpu/command_buffer/service/decoder_client.h"
#include "gpu/command_buffer/service/feature_info.h"
@@ -2501,6 +2502,67 @@ error::Error GLES2DecoderPassthroughImpl::CheckSwapBuffersResult(
@@ -2513,6 +2514,67 @@ error::Error GLES2DecoderPassthroughImpl::CheckSwapBuffersResult(
return error::kNoError;
}

View File

@@ -1,5 +1,5 @@
diff --git ui/base/ime/input_method_win_base.cc ui/base/ime/input_method_win_base.cc
index 6b7c3bef62ae..e731d5037a4e 100644
index bd7edb13c4d1..8917f77e557e 100644
--- ui/base/ime/input_method_win_base.cc
+++ ui/base/ime/input_method_win_base.cc
@@ -267,8 +267,9 @@ bool InputMethodWinBase::IsWindowFocused(const TextInputClient* client) const {

View File

@@ -0,0 +1,35 @@
diff --git sandbox/linux/suid/client/setuid_sandbox_host.cc sandbox/linux/suid/client/setuid_sandbox_host.cc
index 7a103bf7f13c..cd3167ebed09 100644
--- sandbox/linux/suid/client/setuid_sandbox_host.cc
+++ sandbox/linux/suid/client/setuid_sandbox_host.cc
@@ -120,7 +120,7 @@ bool SetuidSandboxHost::IsDisabledViaEnvironment() {
base::FilePath SetuidSandboxHost::GetSandboxBinaryPath() {
base::FilePath sandbox_binary;
base::FilePath exe_dir;
- if (base::PathService::Get(base::DIR_EXE, &exe_dir)) {
+ if (base::PathService::Get(base::DIR_ASSETS, &exe_dir)) {
base::FilePath sandbox_candidate = exe_dir.AppendASCII("chrome-sandbox");
if (base::PathExists(sandbox_candidate))
sandbox_binary = sandbox_candidate;
diff --git ui/gl/init/gl_initializer_x11.cc ui/gl/init/gl_initializer_x11.cc
index e3c481b97d89..5fde4a0bb388 100644
--- ui/gl/init/gl_initializer_x11.cc
+++ ui/gl/init/gl_initializer_x11.cc
@@ -88,7 +88,7 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) {
if (implementation == kGLImplementationSwiftShaderGL) {
#if BUILDFLAG(ENABLE_SWIFTSHADER)
base::FilePath module_path;
- if (!base::PathService::Get(base::DIR_MODULE, &module_path))
+ if (!base::PathService::Get(base::DIR_ASSETS, &module_path))
return false;
module_path = module_path.Append("swiftshader/");
@@ -100,7 +100,7 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) {
} else if (cmd->GetSwitchValueASCII(switches::kUseGL) ==
kGLImplementationANGLEName) {
base::FilePath module_path;
- if (!base::PathService::Get(base::DIR_MODULE, &module_path))
+ if (!base::PathService::Get(base::DIR_ASSETS, &module_path))
return false;
glesv2_path = module_path.Append(kGLESv2ANGLELibraryName);

View File

@@ -99,7 +99,7 @@ index fd7f3e60a599..9678ad4828cf 100644
"../browser/ui/libgtkui/select_file_dialog_interactive_uitest.cc",
]
diff --git remoting/host/BUILD.gn remoting/host/BUILD.gn
index 647f01cfae49..fdbc8f8d49aa 100644
index 7aeefa7b1b89..13fc19218a4c 100644
--- remoting/host/BUILD.gn
+++ remoting/host/BUILD.gn
@@ -351,7 +351,7 @@ static_library("common") {
@@ -111,7 +111,7 @@ index 647f01cfae49..fdbc8f8d49aa 100644
deps += [ "//build/config/linux/gtk" ]
}
} else {
@@ -733,7 +733,7 @@ if (enable_me2me_host) {
@@ -734,7 +734,7 @@ if (enable_me2me_host) {
deps += [ "//components/policy:generated" ]
}

View File

@@ -38,7 +38,7 @@ index a19d29165970..aaf918cd4b71 100644
render_frame_host->GetLastCommittedOrigin(),
render_frame_host->GetFrameTreeNodeId(), std::move(wc_getter),
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
index 5610c0df1c7d..7440b58504ec 100644
index 5610c0df1c7d..6e039a0dc018 100644
--- content/browser/blob_storage/chrome_blob_storage_context.cc
+++ content/browser/blob_storage/chrome_blob_storage_context.cc
@@ -88,6 +88,11 @@ class BlobHandleImpl : public BlobHandle {
@@ -53,6 +53,16 @@ index 5610c0df1c7d..7440b58504ec 100644
// static
ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
BrowserContext* context) {
@@ -117,7 +122,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
// If we're not incognito mode, schedule all of our file tasks to enable
// disk on the storage context.
- if (!context->IsOffTheRecord() && io_thread_valid) {
+ if (!context->GetPath().empty() && !context->IsOffTheRecord() &&
+ io_thread_valid) {
file_task_runner = base::CreateTaskRunnerWithTraits(
{base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
diff --git content/browser/blob_storage/chrome_blob_storage_context.h content/browser/blob_storage/chrome_blob_storage_context.h
index afd21be63a9a..8ac63336f6e7 100644
--- content/browser/blob_storage/chrome_blob_storage_context.h
@@ -83,10 +93,18 @@ index 6952610f8c88..fd8babeb99fd 100644
partition->GetBluetoothAllowedDevicesMap();
return allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin());
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
index b2b3920da3b0..8ab540f00d3d 100644
index b2b3920da3b0..134f8b20d9b7 100644
--- content/browser/browser_context.cc
+++ content/browser/browser_context.cc
@@ -211,11 +211,18 @@ StoragePartition* GetStoragePartitionFromConfig(
@@ -56,6 +56,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/service_manager_connection.h"
#include "content/public/common/service_names.mojom.h"
+#include "media/capabilities/in_memory_video_decode_stats_db_impl.h"
#include "media/capabilities/video_decode_stats_db_impl.h"
#include "media/mojo/services/video_decode_perf_history.h"
#include "net/cookies/cookie_store.h"
@@ -211,11 +212,18 @@ StoragePartition* GetStoragePartitionFromConfig(
StoragePartitionImplMap* partition_map =
GetStoragePartitionMap(browser_context);
@@ -108,7 +126,7 @@ index b2b3920da3b0..8ab540f00d3d 100644
}
void SaveSessionStateOnIOThread(
@@ -741,6 +748,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
@@ -741,6 +749,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
BrowserContext::BrowserContext()
: unique_id_(base::UnguessableToken::Create().ToString()) {}
@@ -120,6 +138,24 @@ index b2b3920da3b0..8ab540f00d3d 100644
BrowserContext::~BrowserContext() {
CHECK(GetUserData(kServiceInstanceGroup))
<< "Attempting to destroy a BrowserContext that never called "
@@ -790,9 +803,14 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() {
// occurs later upon first VideoDecodePerfHistory API request that requires DB
// access. DB operations will not block the UI thread.
if (!decode_history) {
- std::unique_ptr<media::VideoDecodeStatsDBImpl> stats_db =
- media::VideoDecodeStatsDBImpl::Create(
- GetPath().Append(FILE_PATH_LITERAL("VideoDecodeStats")));
+ std::unique_ptr<media::VideoDecodeStatsDB> stats_db;
+ if (GetPath().empty()) {
+ stats_db =
+ std::make_unique<media::InMemoryVideoDecodeStatsDBImpl>(nullptr);
+ } else {
+ stats_db = media::VideoDecodeStatsDBImpl::Create(
+ GetPath().Append(FILE_PATH_LITERAL("VideoDecodeStats")));
+ }
auto new_decode_history = std::make_unique<media::VideoDecodePerfHistory>(
std::move(stats_db), BrowserFeatureProvider::GetFactoryCB());
decode_history = new_decode_history.get();
diff --git content/browser/devtools/protocol/background_service_handler.cc content/browser/devtools/protocol/background_service_handler.cc
index af047913e230..849eeddcfcc5 100644
--- content/browser/devtools/protocol/background_service_handler.cc
@@ -135,10 +171,10 @@ index af047913e230..849eeddcfcc5 100644
DCHECK(devtools_context_);
}
diff --git content/browser/devtools/protocol/network_handler.cc content/browser/devtools/protocol/network_handler.cc
index 4fa2f08b626c..84c3be6138c0 100644
index cfef1021a1ee..8721df15412b 100644
--- content/browser/devtools/protocol/network_handler.cc
+++ content/browser/devtools/protocol/network_handler.cc
@@ -816,8 +816,8 @@ class BackgroundSyncRestorer {
@@ -818,8 +818,8 @@ class BackgroundSyncRestorer {
scoped_refptr<ServiceWorkerDevToolsAgentHost> service_worker_host =
static_cast<ServiceWorkerDevToolsAgentHost*>(host.get());
scoped_refptr<BackgroundSyncContextImpl> sync_context =
@@ -196,7 +232,7 @@ index ec9ab86d0ca6..0fe5219f1e84 100644
base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_;
diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc
index 5ed0f15fe47b..5452066f9e73 100644
index dd4924bd5f0c..e7f52e6f51d6 100644
--- content/browser/download/download_manager_impl.cc
+++ content/browser/download/download_manager_impl.cc
@@ -102,9 +102,9 @@ void DeleteDownloadedFileOnUIThread(const base::FilePath& file_path) {
@@ -240,7 +276,7 @@ index 5ed0f15fe47b..5452066f9e73 100644
std::move(proxy_factory_ptr_info), std::move(proxy_factory_request));
}
@@ -1252,7 +1251,7 @@ void DownloadManagerImpl::InterceptNavigationOnChecksComplete(
@@ -1258,7 +1257,7 @@ void DownloadManagerImpl::InterceptNavigationOnChecksComplete(
tab_referrer_url = entry->GetReferrer().url;
}
}
@@ -249,7 +285,7 @@ index 5ed0f15fe47b..5452066f9e73 100644
GetStoragePartition(browser_context_, render_process_id, render_frame_id);
in_progress_manager_->InterceptDownloadFromNavigation(
std::move(resource_request), render_process_id, render_frame_id, site_url,
@@ -1303,10 +1302,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
@@ -1309,10 +1308,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
base::MakeRefCounted<WebUIDownloadURLLoaderFactoryGetter>(
rfh, params->url());
} else if (rfh && params->url().SchemeIsFileSystem()) {
@@ -262,7 +298,7 @@ index 5ed0f15fe47b..5452066f9e73 100644
std::string storage_domain;
auto* site_instance = rfh->GetSiteInstance();
if (site_instance) {
@@ -1350,10 +1347,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
@@ -1356,10 +1353,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
std::move(wrapper_factory));
}
} else {
@@ -366,7 +402,7 @@ index 9d3bee713440..38cc82d730a5 100644
partition->GetPaymentAppContext();
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
index 221dc8424f85..840a5533db90 100644
index fda6b51d9bc7..213da23441a9 100644
--- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -700,11 +700,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data,
@@ -441,7 +477,7 @@ index 221dc8424f85..840a5533db90 100644
AddObserver(indexed_db_factory_.get());
AddObserver(service_worker_dispatcher_host_.get());
@@ -1868,6 +1870,15 @@ void RenderProcessHostImpl::ResetChannelProxy() {
@@ -1861,6 +1863,15 @@ void RenderProcessHostImpl::ResetChannelProxy() {
void RenderProcessHostImpl::CreateMessageFilters() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -457,7 +493,7 @@ index 221dc8424f85..840a5533db90 100644
MediaInternals* media_internals = MediaInternals::GetInstance();
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
// from guests.
@@ -1907,10 +1918,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1900,10 +1911,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
media_request_context));
resource_message_filter_ = new ResourceMessageFilter(
@@ -470,7 +506,7 @@ index 221dc8424f85..840a5533db90 100644
storage_partition_impl_->GetPrefetchURLLoaderService(),
browser_context->GetSharedCorsOriginAccessList(),
std::move(get_contexts_callback),
@@ -1919,8 +1930,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1912,8 +1923,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(resource_message_filter_.get());
}
@@ -480,7 +516,7 @@ index 221dc8424f85..840a5533db90 100644
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(GetID());
AddFilter(peer_connection_tracker_host_.get());
@@ -1937,10 +1947,6 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1930,10 +1940,6 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(new TraceMessageFilter(GetID()));
AddFilter(new ResolveProxyMsgHelper(GetID()));
@@ -491,7 +527,7 @@ index 221dc8424f85..840a5533db90 100644
}
void RenderProcessHostImpl::BindCacheStorage(
@@ -1952,7 +1958,8 @@ void RenderProcessHostImpl::BindCacheStorage(
@@ -1945,7 +1951,8 @@ void RenderProcessHostImpl::BindCacheStorage(
cache_storage_dispatcher_host_ =
base::MakeRefCounted<CacheStorageDispatcherHost>();
cache_storage_dispatcher_host_->Init(
@@ -501,7 +537,7 @@ index 221dc8424f85..840a5533db90 100644
}
// Send the binding to IO thread, because Cache Storage handles Mojo IPC on IO
// thread entirely.
@@ -2068,7 +2075,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -2061,7 +2068,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
base::BindRepeating(
&BackgroundSyncContextImpl::CreateService,
base::Unretained(
@@ -511,7 +547,7 @@ index 221dc8424f85..840a5533db90 100644
AddUIThreadInterface(
registry.get(),
base::BindRepeating(&RenderProcessHostImpl::CreateStoragePartitionService,
@@ -2164,7 +2172,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -2157,7 +2165,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
registry->AddInterface(base::BindRepeating(
&CodeCacheHostImpl::Create, GetID(),
@@ -521,7 +557,7 @@ index 221dc8424f85..840a5533db90 100644
base::RetainedRef(
storage_partition_impl_->GetGeneratedCodeCacheContext())));
@@ -2176,7 +2185,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -2169,7 +2178,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
registry->AddInterface(base::BindRepeating(
&ChromeAppCacheService::CreateBackend,
@@ -531,7 +567,7 @@ index 221dc8424f85..840a5533db90 100644
GetID()));
AddUIThreadInterface(
@@ -2222,6 +2232,9 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -2215,6 +2225,9 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
plugin_registry_.reset(
new PluginRegistryImpl(GetBrowserContext()->GetResourceContext()));
}
@@ -542,7 +578,7 @@ index 221dc8424f85..840a5533db90 100644
&PluginRegistryImpl::Bind, base::Unretained(plugin_registry_.get())));
#endif
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
index a746e1dae051..59e4316ab2ae 100644
index ca57359fee34..44d4a5f56a46 100644
--- content/browser/renderer_host/render_process_host_impl.h
+++ content/browser/renderer_host/render_process_host_impl.h
@@ -101,7 +101,6 @@ class ServiceWorkerDispatcherHost;
@@ -562,7 +598,7 @@ index a746e1dae051..59e4316ab2ae 100644
SiteInstance* site_instance,
bool is_for_guests_only);
@@ -518,7 +517,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -523,7 +522,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Use CreateRenderProcessHost() instead of calling this constructor
// directly.
RenderProcessHostImpl(BrowserContext* browser_context,
@@ -571,7 +607,7 @@ index a746e1dae051..59e4316ab2ae 100644
bool is_for_guests_only);
// Initializes a new IPC::ChannelProxy in |channel_|, which will be connected
@@ -787,10 +786,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -792,10 +791,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
// The globally-unique identifier for this RPH.
const int id_;
@@ -585,7 +621,7 @@ index a746e1dae051..59e4316ab2ae 100644
// Keeps track of the BindingIds returned by storage_partition_impl_->Bind()
// calls so we can Unbind() them on cleanup.
diff --git content/browser/renderer_interface_binders.cc content/browser/renderer_interface_binders.cc
index 8e4df0b15aeb..02bcdca69af9 100644
index b317a37b4fa1..a0d9e850c5ec 100644
--- content/browser/renderer_interface_binders.cc
+++ content/browser/renderer_interface_binders.cc
@@ -140,7 +140,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
@@ -777,7 +813,7 @@ index 63fe0125ca1c..698378600723 100644
RenderFrameHost* render_frame_host_;
diff --git content/browser/worker_host/dedicated_worker_host.cc content/browser/worker_host/dedicated_worker_host.cc
index d55172625502..22abdeec0c94 100644
index 1897061418d5..3bfd0efff201 100644
--- content/browser/worker_host/dedicated_worker_host.cc
+++ content/browser/worker_host/dedicated_worker_host.cc
@@ -76,8 +76,7 @@ class DedicatedWorkerHost : public service_manager::mojom::InterfaceProvider {

View File

@@ -154,7 +154,7 @@ index 46f81be3d27a..249edf8cc5f8 100644
ImageView* image() const { return image_; }
Label* label() const;
diff --git ui/views/controls/label.cc ui/views/controls/label.cc
index ef1ed1092eb4..e913d9d50741 100644
index 0889f38dcfcb..90339b135ac0 100644
--- ui/views/controls/label.cc
+++ ui/views/controls/label.cc
@@ -43,6 +43,22 @@ bool IsOpaque(SkColor color) {
@@ -180,7 +180,7 @@ index ef1ed1092eb4..e913d9d50741 100644
const char Label::kViewClassName[] = "Label";
Label::Label() : Label(base::string16()) {
@@ -202,6 +218,14 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
@@ -205,6 +221,14 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
ResetLayout();
}
@@ -195,7 +195,7 @@ index ef1ed1092eb4..e913d9d50741 100644
void Label::SetTooltipText(const base::string16& tooltip_text) {
DCHECK(handles_tooltips_);
tooltip_text_ = tooltip_text;
@@ -430,7 +454,19 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText() const {
@@ -433,7 +457,19 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText() const {
render_text->SetFontList(font_list());
render_text->set_shadows(shadows());
render_text->SetCursorEnabled(false);
@@ -217,10 +217,10 @@ index ef1ed1092eb4..e913d9d50741 100644
render_text->SetMaxLines(multi_line() ? max_lines() : 0);
render_text->SetWordWrapBehavior(full_text_->word_wrap_behavior());
diff --git ui/views/controls/label.h ui/views/controls/label.h
index 771034ccebbe..79e3026f6870 100644
index ae3a1d6636f6..ee6fc25eca90 100644
--- ui/views/controls/label.h
+++ ui/views/controls/label.h
@@ -154,6 +154,10 @@ class VIEWS_EXPORT Label : public View,
@@ -159,6 +159,10 @@ class VIEWS_EXPORT Label : public View,
void SetElideBehavior(gfx::ElideBehavior elide_behavior);
gfx::ElideBehavior elide_behavior() const { return elide_behavior_; }
@@ -231,7 +231,7 @@ index 771034ccebbe..79e3026f6870 100644
// Sets the tooltip text. Default behavior for a label (single-line) is to
// show the full text if it is wider than its bounds. Calling this overrides
// the default behavior and lets you set a custom tooltip. To revert to
@@ -378,6 +382,7 @@ class VIEWS_EXPORT Label : public View,
@@ -385,6 +389,7 @@ class VIEWS_EXPORT Label : public View,
bool collapse_when_hidden_;
int fixed_width_;
int max_width_;
@@ -240,10 +240,10 @@ index 771034ccebbe..79e3026f6870 100644
std::unique_ptr<SelectionController> selection_controller_;
diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc
index 8a302b528875..8125b5af96c5 100644
index c66b33a62519..ab81a1c632fd 100644
--- ui/views/controls/menu/menu_controller.cc
+++ ui/views/controls/menu/menu_controller.cc
@@ -2618,8 +2618,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem(
@@ -2623,8 +2623,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem(
void MenuController::OpenSubmenuChangeSelectionIfCan() {
MenuItemView* item = pending_state_.item;
@@ -258,7 +258,7 @@ index 8a302b528875..8125b5af96c5 100644
MenuItemView* to_select = NULL;
if (item->GetSubmenu()->GetMenuItemCount() > 0)
to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN);
@@ -2638,8 +2643,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
@@ -2643,8 +2648,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
void MenuController::CloseSubmenu() {
MenuItemView* item = state_.item;
DCHECK(item);
@@ -310,10 +310,10 @@ index 921aef245bf3..4b7474c01c0e 100644
virtual int GetMaxWidthForMenu(MenuItemView* menu);
diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc
index e609b8521842..73971df2a441 100644
index 99cbf309d57c..695c5bb92172 100644
--- ui/views/controls/menu/menu_item_view.cc
+++ ui/views/controls/menu/menu_item_view.cc
@@ -1063,6 +1063,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas,
@@ -1057,6 +1057,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas,
spilling_rect.set_y(spilling_rect.y() - corner_radius_);
spilling_rect.set_height(spilling_rect.height() + corner_radius_);
canvas->DrawRoundRect(spilling_rect, corner_radius_, flags);
@@ -329,7 +329,7 @@ index e609b8521842..73971df2a441 100644
} else if (render_selection) {
gfx::Rect item_bounds = GetLocalBounds();
if (type_ == ACTIONABLE_SUBMENU) {
@@ -1129,6 +1138,13 @@ void MenuItemView::PaintMinorIconAndText(
@@ -1123,6 +1132,13 @@ void MenuItemView::PaintMinorIconAndText(
}
SkColor MenuItemView::GetTextColor(bool minor, bool render_selection) const {

View File

@@ -1,8 +1,8 @@
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
index 9ad76884fa8c..d04f8c633384 100644
index c7ea2789c7d8..51d455abbdd9 100644
--- content/browser/web_contents/web_contents_impl.cc
+++ content/browser/web_contents/web_contents_impl.cc
@@ -2068,21 +2068,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -2069,21 +2069,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
std::string unique_name;
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
@@ -45,7 +45,7 @@ index 9ad76884fa8c..d04f8c633384 100644
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
@@ -2781,6 +2790,15 @@ void WebContentsImpl::CreateNewWindow(
@@ -2782,6 +2791,15 @@ void WebContentsImpl::CreateNewWindow(
create_params.renderer_initiated_creation =
main_frame_route_id != MSG_ROUTING_NONE;
@@ -61,7 +61,7 @@ index 9ad76884fa8c..d04f8c633384 100644
std::unique_ptr<WebContents> new_contents;
if (!is_guest) {
create_params.context = view_->GetNativeView();
@@ -2813,7 +2831,7 @@ void WebContentsImpl::CreateNewWindow(
@@ -2814,7 +2832,7 @@ void WebContentsImpl::CreateNewWindow(
// TODO(brettw): It seems bogus that we have to call this function on the
// newly created object and give it one of its own member variables.
new_view->CreateViewForWidget(
@@ -70,7 +70,7 @@ index 9ad76884fa8c..d04f8c633384 100644
}
// Save the created window associated with the route so we can show it
// later.
@@ -6377,7 +6395,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() {
@@ -6378,7 +6396,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() {
void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager(
RenderViewHost* render_view_host) {
RenderWidgetHostViewBase* rwh_view =

View File

@@ -44,7 +44,7 @@ index eff68a91b185..e2487f1aa0dc 100644
.Top()
.GetSecurityContext()
diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc
index c6cc53beb1d4..469869b0ff60 100644
index a7b483e821fe..211b53d0eadb 100644
--- third_party/blink/renderer/core/frame/local_frame.cc
+++ third_party/blink/renderer/core/frame/local_frame.cc
@@ -1359,7 +1359,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {

View File

@@ -1,5 +1,5 @@
diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd
index ef5304602534..f2921f6f9da7 100644
index af89799dffcd..66ab701a61cd 100644
--- chrome/app/generated_resources.grd
+++ chrome/app/generated_resources.grd
@@ -4589,7 +4589,7 @@ Keep your key file in a safe place. You will need it to create new versions of y

View File

@@ -122,7 +122,7 @@ if(OS_LINUX)
)
# Find required libraries and update compiler/linker variables.
FIND_LINUX_LIBRARIES("gmodule-2.0 gtk+-2.0 gthread-2.0 gtk+-unix-print-2.0 gtkglext-1.0")
FIND_LINUX_LIBRARIES("gmodule-2.0 gtk+-2.0 gthread-2.0 gtk+-unix-print-2.0 gtkglext-1.0 xi")
# Executable target.
add_executable(${CEF_TARGET} ${CEFCLIENT_SRCS})

View File

@@ -144,8 +144,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION CEF_VERSION_MAJOR,CHROME_VERSION_BUILD,CEF_COMMIT_NUMBER,0
PRODUCTVERSION CEF_VERSION_MAJOR,CHROME_VERSION_BUILD,CEF_COMMIT_NUMBER,0
FILEVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
PRODUCTVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L

View File

@@ -51,8 +51,8 @@ IDI_SMALL ICON "small.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION CEF_VERSION_MAJOR,CHROME_VERSION_BUILD,CEF_COMMIT_NUMBER,0
PRODUCTVERSION CEF_VERSION_MAJOR,CHROME_VERSION_BUILD,CEF_COMMIT_NUMBER,0
FILEVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
PRODUCTVERSION CEF_VERSION_MAJOR,CEF_VERSION_MINOR,CEF_VERSION_PATCH,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L

View File

@@ -2,16 +2,19 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/cef_api_hash.h"
#include "include/cef_version.h"
#include "tests/gtest/include/gtest/gtest.h"
TEST(VersionTest, VersionInfo) {
EXPECT_EQ(CEF_VERSION_MAJOR, cef_version_info(0));
EXPECT_EQ(CEF_COMMIT_NUMBER, cef_version_info(1));
EXPECT_EQ(CHROME_VERSION_MAJOR, cef_version_info(2));
EXPECT_EQ(CHROME_VERSION_MINOR, cef_version_info(3));
EXPECT_EQ(CHROME_VERSION_BUILD, cef_version_info(4));
EXPECT_EQ(CHROME_VERSION_PATCH, cef_version_info(5));
EXPECT_EQ(CEF_VERSION_MINOR, cef_version_info(1));
EXPECT_EQ(CEF_VERSION_PATCH, cef_version_info(2));
EXPECT_EQ(CEF_COMMIT_NUMBER, cef_version_info(3));
EXPECT_EQ(CHROME_VERSION_MAJOR, cef_version_info(4));
EXPECT_EQ(CHROME_VERSION_MINOR, cef_version_info(5));
EXPECT_EQ(CHROME_VERSION_BUILD, cef_version_info(6));
EXPECT_EQ(CHROME_VERSION_PATCH, cef_version_info(7));
}
TEST(VersionTest, ApiHash) {

View File

@@ -44,6 +44,7 @@ class cef_api_hash:
self.included_files = []
self.excluded_files = [
"cef_api_hash.h",
"cef_version.h",
"internal/cef_tuple.h",
"internal/cef_types_wrappers.h",

View File

@@ -246,7 +246,7 @@ def format_translation_includes(header, body):
result += '#include <algorithm>\n'
if body.find('cef_api_hash(') > 0:
result += '#include "include/cef_version.h"\n'
result += '#include "include/cef_api_hash.h"\n'
# identify what CppToC classes are being used
p = re.compile('([A-Za-z0-9_]{1,})CppToC')
@@ -452,12 +452,47 @@ def get_next_function_impl(existing, name):
return result
def get_copyright():
result = \
def get_copyright(full=False):
if full:
result = \
"""// Copyright (c) $YEAR$ Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
else:
result = \
"""// Copyright (c) $YEAR$ The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
"""
result += \
"""//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by

273
tools/cef_version.py Normal file
View File

@@ -0,0 +1,273 @@
# Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
from file_util import *
import git_util as git
import os
class VersionFormatter:
""" Formats CEF version information. """
def __init__(self, chromium_src_path=None):
if chromium_src_path is None:
# Relative to the current directory.
script_path = os.path.abspath(os.path.dirname(__file__))
chromium_src_path = os.path.abspath(
os.path.join(script_path, os.pardir, os.pardir))
self.src_path = chromium_src_path
assert os.path.isdir(self.src_path), self.src_path
self.cef_path = os.path.join(self.src_path, 'cef')
assert os.path.isdir(self.cef_path), self.cef_path
# Whether to use the old version format by default.
self._old_format_default = \
bool(int(os.environ.get('CEF_OLD_VERSION_FORMAT', '0')))
self.reset()
def reset(self):
""" Reset internal state. """
self._chrome_version = {}
self._cef_version = {}
self._cef_commit = {}
self._branch_version = {}
self._old_version_string = None
self._old_version_parts = {}
self._version_string = None
self._version_parts = {}
def get_chrome_version_components(self):
""" Returns Chrome version components. """
if not bool(self._chrome_version):
file_path = os.path.join(self.src_path, 'chrome', 'VERSION')
assert os.path.isfile(file_path), file_path
read_version_file(file_path, self._chrome_version)
return self._chrome_version
def get_cef_version_components(self):
""" Returns CEF version components. """
if not bool(self._cef_version):
file_path = os.path.join(self.cef_path, 'VERSION.in')
assert os.path.isfile(file_path), file_path
read_version_file(file_path, self._cef_version)
return self._cef_version
def get_cef_commit_components(self):
""" Returns CEF commit components. """
if not bool(self._cef_commit):
hash = git.get_hash(self.cef_path)
number = git.get_commit_number(self.cef_path)
self._cef_commit = {'HASH': hash, 'NUMBER': number}
return self._cef_commit
def get_cef_branch_version_components(self):
""" Computes the CEF branch version. """
if not bool(self._branch_version):
minor = 0
bugfix = 0
# Retrieve the list of commits that have been applied on the current
# branch since branching from origin/master.
hashes = git.get_branch_hashes(self.cef_path)
for hash in hashes:
# Determine if the API hash file was modified by the commit.
found = False
files = git.get_changed_files(self.cef_path, hash)
for file in files:
if file.find('cef_api_hash.h') >= 0:
found = True
break
if found:
minor += 1
bugfix = 0
else:
bugfix += 1
self._branch_version = {'MINOR': minor, 'PATCH': bugfix}
return self._branch_version
def get_chromium_version_string(self):
""" Returns the Chromium version number string. """
chrome_version = self.get_chrome_version_components()
return '%s.%s.%s.%s' % (chrome_version['MAJOR'], chrome_version['MINOR'],
chrome_version['BUILD'], chrome_version['PATCH'])
@staticmethod
def _format_commit_hash(hash):
return 'g%s' % hash[:7]
# Computes old version numbers in the format "X.YYYY.A.gHHHHHHH".
#
# Where:
# - "X" is the CEF major version (currently 3).
# - "YYYY" is the Chromium branch.
# - "A" is an incremental number representing the number of commits in the
# current branch. This is roughly equivalent to the SVN revision number but
# on a per-branch basis and assists people in quickly determining the order
# of builds in the same branch (for bug reports, etc).
# - "gHHHHHHH" is the 7-character abbreviation for the Git commit hash. This
# facilitates lookup of the relevant commit history in Git.
#
# Example: "3.3729.1921.g62d140e"
def _compute_old_version(self):
if not self._old_version_string is None:
return
chrome_version = self.get_chrome_version_components()
cef_version = self.get_cef_version_components()
cef_commit = self.get_cef_commit_components()
cef_commit_hash = self._format_commit_hash(cef_commit['HASH'])
self._old_version_parts = {
'MAJOR': int(cef_version['CEF_MAJOR']),
'MINOR': int(chrome_version['BUILD']),
'PATCH': int(cef_commit['NUMBER'])
}
self._old_version_string = \
'%s.%s.%s.%s' % (cef_version['CEF_MAJOR'], chrome_version['BUILD'],
cef_commit['NUMBER'], cef_commit_hash)
def _get_old_version_string(self):
self._compute_old_version()
return self._old_version_string
def _get_old_version_parts(self):
self._compute_old_version()
return self._old_version_parts
# Computes version numbers in the format:
# - "X.Y.Z+gHHHHHHH+chromium-A.B.C.D" for release branch builds.
# - "X.0.0-master.N+gHHHHHHH+chromium-A.B.C.D" for master branch builds.
#
# Where:
# - "X" is the Chromium major version (e.g. 74).
# - "Y" is an incremental number that starts at 0 when a release branch is
# created and changes only when the CEF C/C++ API changes (similar to how
# the CEF_API_HASH_UNIVERSAL value behaves in cef_version.h) (release branch
# only).
# - "Z" is an incremental number that starts at 0 when a release branch is
# created and changes on each commit, with reset to 0 when "Y" changes
# (release branch only).
# - "N" is an incremental number representing the number of commits (master
# branch only).
# - "gHHHHHHH" is the 7-character abbreviation for the Git commit hash. This
# facilitates lookup of the relevant commit history in Git.
# - "A.B.C.D" is the Chromium version (e.g. 74.0.3729.6).
#
# Examples:
# - "74.0.1+g62d140e+chromium-74.0.3729.6" for a release build.
# - "74.0.0-master.1920+g725ed88+chromium-74.0.3729.0" for a master build.
def _compute_version(self):
if not self._version_string is None:
return
chrome_version = self.get_chrome_version_components()
chrome_major = chrome_version['MAJOR']
chrome_version_part = 'chromium-' + self.get_chromium_version_string()
cef_commit = self.get_cef_commit_components()
cef_commit_hash = self._format_commit_hash(cef_commit['HASH'])
# Determine whether the current commit is on a release branch. For example,
# if using Chrome build 3683, are we on CEF branch "3683" or "origin/3683"?
release_branch = chrome_version['BUILD']
on_release_branch = (
git.is_ancestor(self.cef_path, 'HEAD', release_branch) or
git.is_ancestor(self.cef_path, 'HEAD', 'origin/' + release_branch))
if not on_release_branch:
# Not on a commit that is part of an official named release branch. See
# if we can get the name of the branch we are on (may be just "HEAD").
cef_branch_name = git.get_branch_name(self.cef_path).split('/')[-1]
self._version_parts = {'MAJOR': int(chrome_major), 'MINOR': 0, 'PATCH': 0}
self._version_string = '%s.0.0-%s.%s+%s+%s' % \
(chrome_major, cef_branch_name, cef_commit['NUMBER'],
cef_commit_hash, chrome_version_part)
else:
cef_branch = self.get_cef_branch_version_components()
self._version_parts = {
'MAJOR': int(chrome_major),
'MINOR': cef_branch['MINOR'],
'PATCH': cef_branch['PATCH']
}
self._version_string = '%s.%d.%d+%s+%s' % \
(chrome_major, cef_branch['MINOR'], cef_branch['PATCH'],
cef_commit_hash, chrome_version_part)
def _get_version_string(self):
self._compute_version()
return self._version_string
def _get_version_parts(self):
self._compute_version()
return self._version_parts
def get_version_string(self, oldFormat=None):
""" Returns the CEF version number string based on current checkout state.
"""
if oldFormat is None:
oldFormat = self._old_format_default
if oldFormat:
return self._get_old_version_string()
return self._get_version_string()
def get_version_parts(self, oldFormat=None):
""" Returns the CEF version number parts based on current checkout state.
"""
if oldFormat is None:
oldFormat = self._old_format_default
if oldFormat:
return self._get_old_version_parts()
return self._get_version_parts()
def get_plist_version_string(self, oldFormat=None):
""" Returns the CEF version number string for plist files based on current
checkout state. """
parts = self.get_version_parts(oldFormat=oldFormat)
return "%d.%d.%d.0" % (parts['MAJOR'], parts['MINOR'], parts['PATCH'])
def get_dylib_version_string(self, oldFormat=None):
""" Returns the CEF version number string for dylib files based on current
checkout state. """
parts = self.get_version_parts(oldFormat=oldFormat)
# Dylib format supports a max value of 255 for the 2nd and 3rd components.
return "%d%d.%d.%d" % (parts['MAJOR'], parts['MINOR'], parts['PATCH'] / 255,
parts['PATCH'] % 255)
# Test the module.
if __name__ == "__main__":
import sys
# Optionally specify a format.
formats = ['current', 'old', 'plist', 'dylib']
if len(sys.argv) >= 2:
formats = [sys.argv[1]]
# Optionally specify the path to chromium/src.
chromium_src_path = None
if len(sys.argv) >= 3:
chromium_src_path = sys.argv[2]
formatter = VersionFormatter(chromium_src_path)
for format in formats:
if len(formats) > 1:
print format
if format == 'old':
print formatter.get_version_string(True)
elif format == 'dylib':
print formatter.get_dylib_version_string()
elif format == 'plist':
print formatter.get_plist_version_string()
else:
print formatter.get_version_string(False)

View File

@@ -154,7 +154,13 @@ class cef_html_builder:
@staticmethod
def _get_cef_source_url(cef_version):
branch = cef_version.split('.')[1]
if cef_version.find('+chromium') > 0:
# New-style CEF version numbers include the Chromium version number.
# Example: 74.0.1+g62d140e+chromium-74.0.3729.6
chromium_version = cef_version[cef_version.rfind('-') + 1:]
branch = chromium_version.split('.')[2]
else:
branch = cef_version.split('.')[1]
return 'https://bitbucket.org/chromiumembedded/cef/get/%s.tar.bz2' % branch
@staticmethod

View File

@@ -67,6 +67,18 @@ class cef_json_encoder(json.JSONEncoder):
return o
_chromium_version_regex = '[1-9]{1}[0-9]{1,2}\.0\.[1-9]{1}[0-9]{2,4}\.(0|[1-9]{1}[0-9]{0,2})'
_cef_hash_regex = 'g[0-9a-f]{7}'
_cef_number_regex = '[0-9]{1,5}\.[0-9]{1,5}\.[0-9]{1,5}'
# Example: 3.2704.1414.g185cd6c
_cef_old_version_regex = _cef_number_regex + '\.' + _cef_hash_regex
# Example: 74.0.1+g62d140e+chromium-74.0.3729.6
_cef_version_release_regex = _cef_number_regex + '\+' + _cef_hash_regex + '\+chromium\-' + _chromium_version_regex
# Example: 74.0.0-master.1920+g725ed88+chromium-74.0.3729.0
_cef_version_dev_regex = _cef_number_regex + '\-\w+\.[0-9]{1,7}\+' + _cef_hash_regex + '\+chromium\-' + _chromium_version_regex
class cef_json_builder:
""" Class used to build the cefbuilds JSON file. """
@@ -91,8 +103,11 @@ class cef_json_builder:
@staticmethod
def is_valid_version(version):
""" Returns true if the specified CEF version is fully qualified and valid. """
return bool(
re.compile('^3.[0-9]{4,5}.[0-9]{4,5}.g[0-9a-f]{7}$').match(version))
if version is None:
return False
return bool(re.compile('^' + _cef_old_version_regex + '$').match(version)) \
or bool(re.compile('^' + _cef_version_release_regex + '$').match(version)) \
or bool(re.compile('^' + _cef_version_dev_regex + '$').match(version))
@staticmethod
def is_valid_chromium_version(version):
@@ -100,7 +115,7 @@ class cef_json_builder:
if version is None:
return False
return version == 'master' or \
re.compile('^[1-9]{1}[0-9]{1}\.0\.[0-9]{4,5}.[0-9]{1,3}$').match(version)
bool(re.compile('^' + _chromium_version_regex + '$').match(version))
@staticmethod
def get_file_name(version, platform, type):
@@ -143,6 +158,36 @@ class cef_json_builder:
""" Returns the number of queries sent while building. """
return self._queryct
def _query_chromium_version(self, cef_version):
""" Try to remotely query the Chromium version for old-style CEF version
numbers. """
chromium_version = 'master'
git_hash = cef_version[-7:]
query_url = 'https://bitbucket.org/chromiumembedded/cef/raw/%s/CHROMIUM_BUILD_COMPATIBILITY.txt' % git_hash
self._queryct = self._queryct + 1
if not self._silent:
print 'Reading %s' % query_url
try:
# Read the remote URL contents.
handle = urllib.urlopen(query_url)
compat_value = handle.read().strip()
handle.close()
# Parse the contents.
config = eval(compat_value, {'__builtins__': None}, None)
if not 'chromium_checkout' in config:
raise Exception('Unexpected contents')
val = config['chromium_checkout']
if val.find('refs/tags/') == 0:
chromium_version = val[10:]
except Exception, e:
print 'Failed to read Chromium version information'
raise
return chromium_version
def set_chromium_version(self, cef_version, chromium_version=None):
""" Set the matching Chromium version. If the specified Chromium version is
invalid then it will be queried remotely. """
@@ -154,31 +199,12 @@ class cef_json_builder:
# Keep the Chromium version that we already know about.
return self._versions[cef_version]
# Try to identify the Chromium version.
chromium_version = 'master'
git_hash = cef_version[-7:]
query_url = 'https://bitbucket.org/chromiumembedded/cef/raw/%s/CHROMIUM_BUILD_COMPATIBILITY.txt' % git_hash
self._queryct = self._queryct + 1
if not self._silent:
print 'Reading %s' % query_url
try:
# Read the remote URL contents.
handle = urllib.urlopen(query_url)
compat_value = handle.read().strip()
handle.close()
# Parse the contents.
config = eval(compat_value, {'__builtins__': None}, None)
if not 'chromium_checkout' in config:
raise Exception('Unexpected contents')
val = config['chromium_checkout']
if val.find('refs/tags/') == 0:
chromium_version = val[10:]
except Exception, e:
print 'Failed to read Chromium version information'
raise
if cef_version.find('+chromium') > 0:
# New-style CEF version numbers include the Chromium version number.
# Example: 74.0.1+g62d140e+chromium-74.0.3729.6
chromium_version = cef_version[cef_version.rfind('-') + 1:]
else:
chromium_version = self._query_chromium_version(cef_version)
if not self.is_valid_chromium_version(chromium_version):
raise Exception('Invalid Chromium version: %s' % chromium_version)
@@ -188,7 +214,7 @@ class cef_json_builder:
def get_chromium_version(self, cef_version):
""" Return the matching Chromium version. If not currently known it will
be queried remotely. """
be parsed from the CEF version or queried remotely. """
if cef_version in self._versions:
return self._versions[cef_version]
# Identify the Chromium version.

View File

@@ -9,6 +9,59 @@ import unittest
class TestCefJSONBuilder(unittest.TestCase):
# Test CEF version number matching.
def test_valid_version(self):
# Old-style version numbers.
self.assertTrue(cef_json_builder.is_valid_version('3.2704.1414.g185cd6c'))
# New-style version numbers.
self.assertTrue(
cef_json_builder.is_valid_version(
'74.0.1+g62d140e+chromium-74.0.3729.6'))
self.assertTrue(
cef_json_builder.is_valid_version(
'74.0.0-master.1920+g725ed88+chromium-74.0.3729.0'))
self.assertTrue(
cef_json_builder.is_valid_version(
'74.0.0-my_branch.1920+g725ed88+chromium-74.0.3729.0'))
# Must be a completely qualified version number.
self.assertFalse(cef_json_builder.is_valid_version(None))
self.assertFalse(cef_json_builder.is_valid_version('foobar'))
self.assertFalse(cef_json_builder.is_valid_version('3.2704.1414'))
self.assertFalse(cef_json_builder.is_valid_version('74.0.1+g62d140e'))
self.assertFalse(
cef_json_builder.is_valid_version('74.0.0-master.1920+g725ed88'))
self.assertFalse(
cef_json_builder.is_valid_version('74.0.0+chromium-74.0.3729.0'))
# Test Chromium version number matching.
def test_valid_chromium_version(self):
self.assertTrue(cef_json_builder.is_valid_chromium_version('74.0.3729.0'))
self.assertTrue(cef_json_builder.is_valid_chromium_version('74.0.3729.6'))
self.assertTrue(
cef_json_builder.is_valid_chromium_version('100.0.59200.602'))
# self.assertFalse(cef_json_builder.is_valid_version(None))
self.assertFalse(cef_json_builder.is_valid_chromium_version('foobar'))
# Must be 4 numbers.
self.assertFalse(cef_json_builder.is_valid_chromium_version('74.0.3729'))
self.assertFalse(cef_json_builder.is_valid_chromium_version('74.0.3729.A'))
# 1st number is max 3 digits with no leading 0's.
self.assertFalse(
cef_json_builder.is_valid_chromium_version('7400.0.3729.6'))
self.assertFalse(cef_json_builder.is_valid_chromium_version('04.0.3729.6'))
# 2nd number is always 0.
self.assertFalse(cef_json_builder.is_valid_chromium_version('74.1.3729.6'))
# 3rd number is max 5 digits with no leading 0's.
self.assertFalse(cef_json_builder.is_valid_chromium_version('74.0.0372.6'))
self.assertFalse(
cef_json_builder.is_valid_chromium_version('74.0.372900.6'))
# 4rd number is max 3 digits with no leading 0's.
self.assertFalse(
cef_json_builder.is_valid_chromium_version('74.0.3729.6000'))
self.assertFalse(cef_json_builder.is_valid_chromium_version('74.0.3729.06'))
pass
# Write builder contents to string and then read in.
def _verify_write_read(self, builder):
output = str(builder)
@@ -105,60 +158,65 @@ class TestCefJSONBuilder(unittest.TestCase):
# Test get_files() behavior with a single file.
def test_get_files_single(self):
builder = cef_json_builder()
# yapf: disable
versions = (
('3.2704.1414.g185cd6c', '3.2704'),
('74.0.1+g62d140e+chromium-74.0.3729.6', '74.0'),
)
# yapf: enable
# Specify all values just in case the defaults change.
expected = self._add_test_file(
builder,
platform='linux32',
version='3.2704.1414.g185cd6c',
type='standard')
for version, partial_version in versions:
builder = cef_json_builder()
# No filter.
files = builder.get_files()
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
# Specify all values just in case the defaults change.
expected = self._add_test_file(
builder, platform='linux32', version=version, type='standard')
# Platform filter.
files = builder.get_files(platform='linux32')
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
files = builder.get_files(platform='linux64')
self.assertEqual(len(files), 0)
# No filter.
files = builder.get_files()
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
# Version filter exact.
files = builder.get_files(version='3.2704.1414.g185cd6c')
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
# Platform filter.
files = builder.get_files(platform='linux32')
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
files = builder.get_files(platform='linux64')
self.assertEqual(len(files), 0)
# Version filter partial.
files = builder.get_files(version='3.2704')
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
files = builder.get_files(version='3.2623')
self.assertEqual(len(files), 0)
# Version filter exact.
files = builder.get_files(version=version)
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
# Type filter.
files = builder.get_files(type='standard')
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
files = builder.get_files(type='client')
self.assertEqual(len(files), 0)
# Version filter partial.
files = builder.get_files(version=partial_version)
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
files = builder.get_files(version='3.2623')
self.assertEqual(len(files), 0)
# All filters.
files = builder.get_files(
platform='linux32', version='3.2704', type='standard')
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
files = builder.get_files(
platform='linux32', version='3.2704', type='minimal')
self.assertEqual(len(files), 0)
files = builder.get_files(
platform='linux32', version='3.2623', type='standard')
self.assertEqual(len(files), 0)
files = builder.get_files(
platform='linux64', version='3.2704', type='standard')
self.assertEqual(len(files), 0)
# Type filter.
files = builder.get_files(type='standard')
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
files = builder.get_files(type='client')
self.assertEqual(len(files), 0)
# All filters.
files = builder.get_files(
platform='linux32', version=partial_version, type='standard')
self.assertEqual(len(files), 1)
self.assertEqual(expected, files[0])
files = builder.get_files(
platform='linux32', version=partial_version, type='minimal')
self.assertEqual(len(files), 0)
files = builder.get_files(
platform='linux32', version='3.2623', type='standard')
self.assertEqual(len(files), 0)
files = builder.get_files(
platform='linux64', version=partial_version, type='standard')
self.assertEqual(len(files), 0)
# Test add/get of multiple files.
def test_add_multiple_files(self):
@@ -167,7 +225,13 @@ class TestCefJSONBuilder(unittest.TestCase):
expected = []
platforms = cef_json_builder.get_platforms()
versions = ['3.2704.1414.g185cd6c', '3.2704.1400.gde36543']
versions = [
# Old-style version numbers.
'3.2704.1414.g185cd6c',
'3.2704.1400.gde36543',
# New-style version numbers.
'74.0.1+g62d140e+chromium-74.0.3729.6'
]
types = cef_json_builder.get_distrib_types()
for platform in platforms:
for version in versions:
@@ -183,8 +247,9 @@ class TestCefJSONBuilder(unittest.TestCase):
self.assertEqual(len(files), len(platforms) * len(versions) * len(types))
# Version filter.
files = builder.get_files(version=version)
self.assertEqual(len(files), len(platforms) * len(types))
for version in versions:
files = builder.get_files(version=version)
self.assertEqual(len(files), len(platforms) * len(types))
# Type filter.
files = builder.get_files(type='client')
@@ -203,115 +268,119 @@ class TestCefJSONBuilder(unittest.TestCase):
platform=platform, type=type, version=version)
self.assertEqual(len(files), 1)
self.assertEqual(expected[idx], files[0])
idx = idx + 1
idx += 1
# Test add/get/replace of multiple files.
def test_replace_all_files(self):
builder = cef_json_builder()
version = '3.2704.1414.g185cd6c'
versions = ['3.2704.1414.g185cd6c', '74.0.1+g62d140e+chromium-74.0.3729.6']
platforms = ['linux32', 'linux64']
types = ['standard', 'minimal']
# Initial file versions.
for platform in platforms:
for type in types:
self._add_test_file(
builder, platform=platform, type=type, version=version)
for version in versions:
builder = cef_json_builder()
# No filter.
files = builder.get_files()
self.assertEqual(len(files), len(platforms) * len(types))
# Initial file versions.
for platform in platforms:
for type in types:
self._add_test_file(
builder, platform=platform, type=type, version=version)
expected = []
# No filter.
files = builder.get_files()
self.assertEqual(len(files), len(platforms) * len(types))
# Replace all file versions (due to new sha1).
for platform in platforms:
for type in types:
expected.append(
self._add_test_file(
builder,
platform=platform,
type=type,
version=version,
attrib_idx=1))
expected = []
# No filter.
files = builder.get_files()
self.assertEqual(len(files), len(platforms) * len(types))
# Replace all file versions (due to new sha1).
for platform in platforms:
for type in types:
expected.append(
self._add_test_file(
builder,
platform=platform,
type=type,
version=version,
attrib_idx=1))
# All filters.
idx = 0
for platform in platforms:
for type in types:
files = builder.get_files(platform=platform, type=type, version=version)
self.assertEqual(len(files), 1)
self.assertEqual(expected[idx], files[0])
idx = idx + 1
# No filter.
files = builder.get_files()
self.assertEqual(len(files), len(platforms) * len(types))
# All filters.
idx = 0
for platform in platforms:
for type in types:
files = builder.get_files(
platform=platform, type=type, version=version)
self.assertEqual(len(files), 1)
self.assertEqual(expected[idx], files[0])
idx += 1
# Test add/get/no replace of multiple files.
def test_replace_no_files(self):
builder = cef_json_builder()
version = '3.2704.1414.g185cd6c'
versions = ['3.2704.1414.g185cd6c', '74.0.1+g62d140e+chromium-74.0.3729.6']
platforms = ['linux32', 'linux64']
types = ['standard', 'minimal']
# Initial file versions.
for platform in platforms:
for type in types:
self._add_test_file(
builder, platform=platform, type=type, version=version)
for version in versions:
builder = cef_json_builder()
# No filter.
files = builder.get_files()
self.assertEqual(len(files), len(platforms) * len(types))
# Initial file versions.
for platform in platforms:
for type in types:
self._add_test_file(
builder, platform=platform, type=type, version=version)
expected = []
# No filter.
files = builder.get_files()
self.assertEqual(len(files), len(platforms) * len(types))
# Replace no file versions (due to same sha1).
for platform in platforms:
for type in types:
expected.append(
self._add_test_file(
builder,
platform=platform,
type=type,
version=version,
shouldfail=True))
expected = []
# No filter.
files = builder.get_files()
self.assertEqual(len(files), len(platforms) * len(types))
# Replace no file versions (due to same sha1).
for platform in platforms:
for type in types:
expected.append(
self._add_test_file(
builder,
platform=platform,
type=type,
version=version,
shouldfail=True))
# All filters.
idx = 0
for platform in platforms:
for type in types:
files = builder.get_files(platform=platform, type=type, version=version)
self.assertEqual(len(files), 1)
self.assertEqual(expected[idx], files[0])
idx = idx + 1
# No filter.
files = builder.get_files()
self.assertEqual(len(files), len(platforms) * len(types))
# All filters.
idx = 0
for platform in platforms:
for type in types:
files = builder.get_files(
platform=platform, type=type, version=version)
self.assertEqual(len(files), 1)
self.assertEqual(expected[idx], files[0])
idx += 1
# Test Chromium version.
def test_chromium_version(self):
builder = cef_json_builder()
self.assertTrue(builder.is_valid_chromium_version('master'))
self.assertTrue(builder.is_valid_chromium_version('49.0.2704.0'))
self.assertTrue(builder.is_valid_chromium_version('49.0.2704.50'))
self.assertTrue(builder.is_valid_chromium_version('49.0.2704.100'))
self.assertFalse(builder.is_valid_chromium_version(None))
self.assertFalse(builder.is_valid_chromium_version('09.0.2704.50'))
self.assertFalse(builder.is_valid_chromium_version('00.0.0000.00'))
self.assertFalse(builder.is_valid_chromium_version('foobar'))
# The Git hashes must exist but the rest of the CEF version can be fake.
versions = (('3.2704.1414.g185cd6c',
'51.0.2704.47'), ('3.2623.9999.gb90a3be', '49.0.2623.110'),
('3.2623.9999.g2a6491b',
'49.0.2623.87'), ('3.9999.9999.gab2636b', 'master'),)
# For old-style CEF version numbers the Git hashes must exist but the rest
# of the CEF version can be fake.
# yapf: disable
versions = (
# Old-style version numbers.
('3.2704.1414.g185cd6c', '51.0.2704.47'),
('3.2623.9999.gb90a3be', '49.0.2623.110'),
('3.2623.9999.g2a6491b', '49.0.2623.87'),
('3.9999.9999.gab2636b', 'master'),
# New-style version numbers.
('74.0.1+g62d140e+chromium-74.0.3729.6', '74.0.3729.6'),
('74.0.0-master.1920+g725ed88+chromium-74.0.3729.0', '74.0.3729.0'),
('74.0.0-my_branch.1920+g725ed88+chromium-74.0.3729.0', '74.0.3729.0'),
)
# yapf: enable
# Test with no query.
for (cef, chromium) in versions:
@@ -329,11 +398,12 @@ class TestCefJSONBuilder(unittest.TestCase):
# Test with query.
for (cef, chromium) in versions:
self.assertFalse(builder.has_chromium_version(cef))
# No version known, so query sent.
# No version known, so query sent for old-style version numbers.
self.assertEqual(chromium, builder.get_chromium_version(cef))
self.assertTrue(builder.has_chromium_version(cef))
self.assertEqual(len(versions), builder.get_query_count())
# Only old-style version numbers.
self.assertEqual(4, builder.get_query_count())
# Program entry point.

View File

@@ -1,21 +0,0 @@
# Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
import git_util as git
import os
import sys
# cannot be loaded as a module
if __name__ != "__main__":
sys.stderr.write('This file cannot be loaded as a module!')
sys.exit()
if len(sys.argv) < 2:
raise Exception('Path expected on command-line')
path = sys.argv[1]
if git.is_checkout(path):
sys.stdout.write(git.get_commit_number(path))
else:
raise Exception('Not a valid checkout: ' + path)

View File

@@ -5,8 +5,8 @@ cmake Contains CMake configuration files shared by all targets.
Debug Contains libcef.so and other components required to run the debug
version of CEF-based applications. By default these files should be
placed in the same directory as the executable and will be copied
there as part of the build process.
placed in the same directory as libcef.so and will be copied there
as part of the build process.
include Contains all required CEF header files.
@@ -15,8 +15,8 @@ libcef_dll Contains the source code for the libcef_dll_wrapper static library
Release Contains libcef.so and other components required to run the release
version of CEF-based applications. By default these files should be
placed in the same directory as the executable and will be copied
there as part of the build process.
placed in the same directory as libcef.so and will be copied there
as part of the build process.
Resources Contains resources required by libcef.so. By default these files
should be placed in the same directory as libcef.so and will be

View File

@@ -60,7 +60,6 @@ run but any related functionality may become broken or disabled.
Tools. Without this file Chrome Developer Tools will not function.
* Angle and Direct3D support.
* d3dcompiler_43.dll (required for Windows XP)
* d3dcompiler_47.dll (required for Windows Vista and newer)
* libEGL.dll
* libGLESv2.dll

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -10,6 +10,7 @@ def exec_cmd(cmd, path, input_string=None):
""" Execute the specified command and return the result. """
out = ''
err = ''
ret = -1
parts = cmd.split()
try:
if input_string is None:
@@ -20,6 +21,7 @@ def exec_cmd(cmd, path, input_string=None):
stderr=PIPE,
shell=(sys.platform == 'win32'))
out, err = process.communicate()
ret = process.returncode
else:
process = Popen(
parts,
@@ -29,8 +31,9 @@ def exec_cmd(cmd, path, input_string=None):
stderr=PIPE,
shell=(sys.platform == 'win32'))
out, err = process.communicate(input=input_string)
ret = process.returncode
except IOError, (errno, strerror):
raise
except:
raise
return {'out': out, 'err': err}
return {'out': out, 'err': err, 'ret': ret}

View File

@@ -28,8 +28,7 @@ else:
print "\nGenerating CEF version header file..."
cmd = [
'python', 'tools/make_version_header.py', '--header',
'include/cef_version.h', '--cef_version', 'VERSION.in', '--chrome_version',
'../chrome/VERSION', '--cpp_header_dir', 'include'
'include/cef_version.h'
]
RunAction(cef_dir, cmd)

View File

@@ -18,6 +18,13 @@ def is_checkout(path):
return os.path.isdir(os.path.join(path, '.git'))
def is_ancestor(path='.', commit1='HEAD', commit2='master'):
""" Returns whether |commit1| is an ancestor of |commit2|. """
cmd = "%s merge-base --is-ancestor %s %s" % (git_exe, commit1, commit2)
result = exec_cmd(cmd, path)
return result['ret'] == 0
def get_hash(path='.', branch='HEAD'):
""" Returns the git hash for the specified branch/tag/hash. """
cmd = "%s rev-parse %s" % (git_exe, branch)
@@ -27,6 +34,27 @@ def get_hash(path='.', branch='HEAD'):
return 'Unknown'
def get_branch_name(path='.', branch='HEAD'):
""" Returns the branch name for the specified branch/tag/hash. """
# Returns the branch name if not in detached HEAD state, else an empty string
# or "HEAD".
cmd = "%s rev-parse --abbrev-ref %s" % (git_exe, branch)
result = exec_cmd(cmd, path)
if result['out'] != '':
name = result['out'].strip()
if len(name) > 0 and name != 'HEAD':
return name
# Returns a value like "(HEAD, origin/3729, 3729)".
# Ubuntu 14.04 uses Git version 1.9.1 which does not support %D (which
# provides the same output but without the parentheses).
cmd = "%s log -n 1 --pretty=%%d %s" % (git_exe, branch)
result = exec_cmd(cmd, path)
if result['out'] != '':
return result['out'].strip()[1:-1].split(', ')[-1]
return 'Unknown'
def get_url(path='.'):
""" Returns the origin url for the specified path. """
cmd = "%s config --get remote.origin.url" % git_exe
@@ -63,6 +91,21 @@ def get_changed_files(path, hash):
return []
def get_branch_hashes(path='.', branch='HEAD', ref='origin/master'):
""" Returns an ordered list of hashes for commits that have been applied since
branching from ref. """
cmd = "%s cherry %s %s" % (git_exe, ref, branch)
result = exec_cmd(cmd, path)
if result['out'] != '':
hashes = result['out']
if sys.platform == 'win32':
# Convert to Unix line endings.
hashes = hashes.replace('\r\n', '\n')
# Remove the "+ " or "- " prefix.
return [line[2:] for line in hashes.strip().split('\n')]
return []
def write_indented_output(output):
""" Apply a fixed amount of intent to lines before printing. """
if output == '':

View File

@@ -0,0 +1,77 @@
# Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
from cef_api_hash import cef_api_hash
from cef_parser import *
from file_util import *
def make_api_hash_header(cpp_header_dir):
# calculate api hashes
api_hash_calculator = cef_api_hash(cpp_header_dir, verbose=False)
api_hash = api_hash_calculator.calculate()
result = get_copyright(full=True) + \
"""#ifndef CEF_INCLUDE_API_HASH_H_
#define CEF_INCLUDE_API_HASH_H_
#include "include/internal/cef_export.h"
// The API hash is created by analyzing CEF header files for C API type
// definitions. The hash value will change when header files are modified in a
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "$UNIVERSAL$"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "$WINDOWS$"
#elif defined(OS_MACOSX)
#define CEF_API_HASH_PLATFORM "$MACOSX$"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "$LINUX$"
#endif
#ifdef __cplusplus
extern "C" {
#endif
///
// Returns CEF API hashes for the libcef library. The returned string is owned
// by the library and should not be freed. The |entry| parameter describes which
// hash value will be returned:
// 0 - CEF_API_HASH_PLATFORM
// 1 - CEF_API_HASH_UNIVERSAL
// 2 - CEF_COMMIT_HASH (from cef_version.h)
///
CEF_EXPORT const char* cef_api_hash(int entry);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_API_HASH_H_
"""
# Substitute hash values for placeholders.
for platform, value in api_hash.iteritems():
result = result.replace('$%s$' % platform.upper(), value)
return result
def write_api_hash_header(header, cpp_header_dir):
newcontents = make_api_hash_header(cpp_header_dir)
return (header, newcontents)
# Test the module.
if __name__ == "__main__":
import sys
# Verify that the correct number of command-line arguments are provided.
if len(sys.argv) < 2:
sys.stderr.write('Usage: ' + sys.argv[0] + ' <cppheaderdir>')
sys.exit()
# Dump the result to stdout.
sys.stdout.write(make_api_hash_header(sys.argv[1]))

View File

@@ -2,6 +2,7 @@
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
from cef_version import VersionFormatter
from date_util import *
from exec_util import exec_cmd
from file_util import *
@@ -306,7 +307,7 @@ def get_exported_symbols(file):
""" Returns the global symbols exported by |file|. """
symbols = []
# Each symbol line has a value is like:
# Each symbol line has a value like:
# 0000000000000000 T _cef_sandbox_initialize
cmdline = 'nm -g -U %s' % file
result = exec_cmd(cmdline, os.path.join(cef_dir, 'tools'))
@@ -321,6 +322,25 @@ def get_exported_symbols(file):
return symbols
def get_undefined_symbols(file):
""" Returns the undefined symbols imported by |file|. """
symbols = []
# Each symbol line has a value like:
# cef_sandbox.a:cef_sandbox.o: _memcpy
cmdline = 'nm -u -A %s' % file
result = exec_cmd(cmdline, os.path.join(cef_dir, 'tools'))
if len(result['err']) > 0:
raise Exception('ERROR: nm failed: %s' % result['err'])
for line in result['out'].split('\n'):
if line.find(': ') < 0:
continue
symbol = line[line.rfind(': ') + 2:]
symbols.append(symbol)
return symbols
def combine_libs(platform, build_dir, libs, dest_lib):
""" Combine multiple static libraries into a single static library. """
intermediate_obj = None
@@ -374,6 +394,17 @@ def combine_libs(platform, build_dir, libs, dest_lib):
print 'Got', result_symbols
raise Exception('Failure verifying exported symbols')
# Verify that no C++ symbols are imported by the archive file. If the
# archive imports C++ symbols and the client app links an incompatible C++
# library, the result will be undefined behavior.
print 'Verifying imported (undefined) symbols...'
undefined_symbols = get_undefined_symbols(dest_lib)
cpp_symbols = list(
filter(lambda symbol: symbol.startswith('__Z'), undefined_symbols))
if cpp_symbols:
print 'Found C++ symbols:', cpp_symbols
raise Exception('Failure verifying imported (undefined) symbols')
def run(command_line, working_dir):
""" Run a command. """
@@ -536,24 +567,27 @@ chromium_rev = git.get_hash(src_dir)
date = get_date()
# Read and parse the version file (key=value pairs, one per line)
args = {}
read_version_file(os.path.join(cef_dir, 'VERSION.in'), args)
read_version_file(os.path.join(cef_dir, '../chrome/VERSION'), args)
cef_ver = '%s.%s.%s.g%s' % (args['CEF_MAJOR'], args['BUILD'], cef_commit_number,
cef_rev[:7])
chromium_ver = args['MAJOR'] + '.' + args['MINOR'] + '.' + args['BUILD'] + '.' + args['PATCH']
# format version strings
formatter = VersionFormatter()
cef_ver = formatter.get_version_string()
chromium_ver = formatter.get_chromium_version_string()
# list of output directories to be archived
archive_dirs = []
if options.x64build:
platform_arch = '64'
if options.armbuild:
platform_arch = 'arm64'
binary_arch = 'arm64'
else:
platform_arch = '64'
binary_arch = 'x64'
elif options.armbuild:
platform_arch = 'arm'
binary_arch = 'arm'
else:
platform_arch = '32'
binary_arch = 'x86'
# output directory
output_dir_base = 'cef_binary_' + cef_ver
@@ -755,7 +789,6 @@ if platform == 'windows':
# yapf: disable
binaries = [
{'path': 'chrome_elf.dll'},
{'path': 'd3dcompiler_47.dll'},
{'path': libcef_dll},
{'path': 'libEGL.dll'},
{'path': 'libGLESv2.dll'},
@@ -821,7 +854,8 @@ if platform == 'windows':
dst_dir = os.path.join(output_dir, 'Debug')
copy_files_list(build_dir, dst_dir, binaries)
copy_files(
os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
os.path.join(script_dir, 'distrib/win/%s/*.dll' % binary_arch),
dst_dir, options.quiet)
if not options.nosymbols:
# create the symbol output directory
@@ -843,7 +877,8 @@ if platform == 'windows':
dst_dir = os.path.join(output_dir, 'Release')
copy_files_list(build_dir, dst_dir, binaries)
copy_files(
os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
os.path.join(script_dir, 'distrib/win/%s/*.dll' % binary_arch),
dst_dir, options.quiet)
if not options.nosymbols:
# create the symbol output directory
@@ -916,6 +951,8 @@ elif platform == 'macosx':
'obj/sandbox/mac/libseatbelt.a',
'obj/sandbox/mac/libseatbelt_proto.a',
'obj/third_party/protobuf/libprotobuf_lite.a',
'obj/buildtools/third_party/libc++/libc++/*.o',
'obj/buildtools/third_party/libc++abi/libc++abi/*.o',
]
# Generate the cef_sandbox.a merged library. A separate *_sandbox build

View File

@@ -8,6 +8,7 @@ import os
# Other headers that export C API functions.
OTHER_HEADERS = [
'cef_api_hash.h',
'cef_version.h',
'internal/cef_logging_internal.h',
'internal/cef_string_list.h',
@@ -205,7 +206,7 @@ if __name__ == "__main__":
# Create the header object. Should match the logic in translator.py.
header = obj_header()
header.set_root_directory(cpp_header_dir)
excluded_files = ['cef_application_mac.h', 'cef_version.h']
excluded_files = ['cef_api_hash.h', 'cef_application_mac.h', 'cef_version.h']
header.add_directory(cpp_header_dir, excluded_files)
header.add_directory(os.path.join(cpp_header_dir, 'test'))
header.add_directory(os.path.join(cpp_header_dir, 'views'))

View File

@@ -1,2 +1,2 @@
@echo off
python.bat tools\make_version_header.py --header include\cef_version.h --cef_version VERSION.in --chrome_version ../chrome/VERSION --cpp_header_dir include
python.bat tools\make_version_header.py --header include\cef_version.h

View File

@@ -2,11 +2,12 @@
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
from cef_version import VersionFormatter
from date_util import *
from file_util import *
from optparse import OptionParser
from cef_api_hash import cef_api_hash
import git_util as git
import os
import sys
# cannot be loaded as a module
@@ -25,21 +26,6 @@ parser.add_option(
dest='header',
metavar='FILE',
help='output version header file [required]')
parser.add_option(
'--cef_version',
dest='cef_version',
metavar='FILE',
help='input CEF version config file [required]')
parser.add_option(
'--chrome_version',
dest='chrome_version',
metavar='FILE',
help='input Chrome version config file [required]')
parser.add_option(
'--cpp_header_dir',
dest='cpp_header_dir',
metavar='DIR',
help='input directory for C++ header files [required]')
parser.add_option(
'-q',
'--quiet',
@@ -50,24 +36,17 @@ parser.add_option(
(options, args) = parser.parse_args()
# the header option is required
if options.header is None or options.cef_version is None or options.chrome_version is None or options.cpp_header_dir is None:
if options.header is None:
parser.print_help(sys.stdout)
sys.exit()
def write_version_header(header, chrome_version, cef_version, cpp_header_dir):
def write_version_header(header):
""" Creates the header file for the current revision and Chrome version information
if the information has changed or if the file doesn't already exist. """
if not path_exists(chrome_version):
raise Exception('Chrome version file ' + chrome_version +
' does not exist.')
if not path_exists(cef_version):
raise Exception('CEF version file ' + cef_version + ' does not exist.')
args = {}
read_version_file(chrome_version, args)
read_version_file(cef_version, args)
if not git.is_checkout('.'):
raise Exception('Not a valid checkout')
if path_exists(header):
oldcontents = read_file(header)
@@ -75,18 +54,16 @@ def write_version_header(header, chrome_version, cef_version, cpp_header_dir):
oldcontents = ''
year = get_year()
formatter = VersionFormatter()
commit_hash = formatter.get_cef_commit_components()['HASH']
commit_number = formatter.get_cef_commit_components()['NUMBER']
version = formatter.get_version_string()
version_parts = formatter.get_version_parts()
chrome = formatter.get_chrome_version_components()
if not git.is_checkout('.'):
raise Exception('Not a valid checkout')
commit_number = git.get_commit_number()
commit_hash = git.get_hash()
version = '%s.%s.%s.g%s' % (args['CEF_MAJOR'], args['BUILD'], commit_number,
commit_hash[:7])
# calculate api hashes
api_hash_calculator = cef_api_hash(cpp_header_dir, verbose=False)
api_hashes = api_hash_calculator.calculate()
version_defines = '#define CEF_VERSION "%s"\n' % version
for key in ('MAJOR', 'MINOR', 'PATCH'):
version_defines += '#define CEF_VERSION_%s %d\n' % (key, version_parts[key])
newcontents = '// Copyright (c) '+year+' Marshall A. Greenblatt. All rights reserved.\n'+\
'//\n'+\
@@ -123,15 +100,14 @@ def write_version_header(header, chrome_version, cef_version, cpp_header_dir):
'//\n\n'+\
'#ifndef CEF_INCLUDE_CEF_VERSION_H_\n'+\
'#define CEF_INCLUDE_CEF_VERSION_H_\n\n'+\
'#define CEF_VERSION "' + version + '"\n'+\
'#define CEF_VERSION_MAJOR ' + args['CEF_MAJOR'] + '\n'+\
version_defines+\
'#define CEF_COMMIT_NUMBER ' + commit_number + '\n'+\
'#define CEF_COMMIT_HASH "' + commit_hash + '"\n'+\
'#define COPYRIGHT_YEAR ' + year + '\n\n'+\
'#define CHROME_VERSION_MAJOR ' + args['MAJOR'] + '\n'+\
'#define CHROME_VERSION_MINOR ' + args['MINOR'] + '\n'+\
'#define CHROME_VERSION_BUILD ' + args['BUILD'] + '\n'+\
'#define CHROME_VERSION_PATCH ' + args['PATCH'] + '\n\n'+\
'#define CHROME_VERSION_MAJOR ' + chrome['MAJOR'] + '\n'+\
'#define CHROME_VERSION_MINOR ' + chrome['MINOR'] + '\n'+\
'#define CHROME_VERSION_BUILD ' + chrome['BUILD'] + '\n'+\
'#define CHROME_VERSION_PATCH ' + chrome['PATCH'] + '\n\n'+\
'#define DO_MAKE_STRING(p) #p\n'+\
'#define MAKE_STRING(p) DO_MAKE_STRING(p)\n\n'+\
'#ifndef APSTUDIO_HIDDEN_SYMBOLS\n\n'\
@@ -139,39 +115,18 @@ def write_version_header(header, chrome_version, cef_version, cpp_header_dir):
'#ifdef __cplusplus\n'+\
'extern "C" {\n'+\
'#endif\n\n'+\
'// The API hash is created by analyzing CEF header files for C API type\n'+\
'// definitions. The hash value will change when header files are modified\n'+\
'// in a way that may cause binary incompatibility with other builds. The\n'+\
'// universal hash value will change if any platform is affected whereas the\n'+\
'// platform hash values will change only if that particular platform is\n'+\
'// affected.\n'+\
'#define CEF_API_HASH_UNIVERSAL "' + api_hashes['universal'] + '"\n'+\
'#if defined(OS_WIN)\n'+\
'#define CEF_API_HASH_PLATFORM "' + api_hashes['windows'] + '"\n'+\
'#elif defined(OS_MACOSX)\n'+\
'#define CEF_API_HASH_PLATFORM "' + api_hashes['macosx'] + '"\n'+\
'#elif defined(OS_LINUX)\n'+\
'#define CEF_API_HASH_PLATFORM "' + api_hashes['linux'] + '"\n'+\
'#endif\n\n'+\
'// Returns CEF version information for the libcef library. The |entry|\n'+\
'// parameter describes which version component will be returned:\n'+\
'// 0 - CEF_VERSION_MAJOR\n'+\
'// 1 - CEF_COMMIT_NUMBER\n'+\
'// 2 - CHROME_VERSION_MAJOR\n'+\
'// 3 - CHROME_VERSION_MINOR\n'+\
'// 4 - CHROME_VERSION_BUILD\n'+\
'// 5 - CHROME_VERSION_PATCH\n'+\
'// 1 - CEF_VERSION_MINOR\n'+\
'// 2 - CEF_VERSION_PATCH\n'+\
'// 3 - CEF_COMMIT_NUMBER\n'+\
'// 4 - CHROME_VERSION_MAJOR\n'+\
'// 5 - CHROME_VERSION_MINOR\n'+\
'// 6 - CHROME_VERSION_BUILD\n'+\
'// 7 - CHROME_VERSION_PATCH\n'+\
'///\n'+\
'CEF_EXPORT int cef_version_info(int entry);\n\n'+\
'///\n'+\
'// Returns CEF API hashes for the libcef library. The returned string is owned\n'+\
'// by the library and should not be freed. The |entry| parameter describes which\n'+\
'// hash value will be returned:\n'+\
'// 0 - CEF_API_HASH_PLATFORM\n'+\
'// 1 - CEF_API_HASH_UNIVERSAL\n'+\
'// 2 - CEF_COMMIT_HASH\n'+\
'///\n'+\
'CEF_EXPORT const char* cef_api_hash(int entry);\n\n'+\
'#ifdef __cplusplus\n'+\
'}\n'+\
'#endif\n\n'+\
@@ -184,8 +139,7 @@ def write_version_header(header, chrome_version, cef_version, cpp_header_dir):
return False
written = write_version_header(options.header, options.chrome_version,
options.cef_version, options.cpp_header_dir)
written = write_version_header(options.header)
if not options.quiet:
if written:
sys.stdout.write('File ' + options.header + ' updated.\n')

View File

@@ -1,2 +1,2 @@
#!/bin/sh
python tools/make_version_header.py --header include/cef_version.h --cef_version VERSION.in --chrome_version ../chrome/VERSION --cpp_header_dir include
python tools/make_version_header.py --header include/cef_version.h

View File

@@ -87,7 +87,7 @@ if __name__ == "__main__":
# Create the header object. Should match the logic in translator.py.
header = obj_header()
header.set_root_directory(cpp_header_dir)
excluded_files = ['cef_application_mac.h', 'cef_version.h']
excluded_files = ['cef_api_hash.h', 'cef_application_mac.h', 'cef_version.h']
header.add_directory(cpp_header_dir, excluded_files)
header.add_directory(os.path.join(cpp_header_dir, 'views'))

View File

@@ -42,7 +42,7 @@ if __name__ == "__main__":
# create the header object
header = obj_header()
excluded_files = ['cef_application_mac.h', 'cef_version.h']
excluded_files = ['cef_api_hash.h', 'cef_application_mac.h', 'cef_version.h']
header.add_directory(sys.argv[1], excluded_files)
# dump the result to stdout

View File

@@ -7,6 +7,7 @@ from cef_parser import *
from clang_util import clang_format
from file_util import *
import hashlib
from make_api_hash_header import *
from make_capi_header import *
from make_cpptoc_header import *
from make_cpptoc_impl import *
@@ -72,6 +73,7 @@ cpp_header_dir = os.path.join(root_dir, 'include')
cpp_header_test_dir = os.path.join(cpp_header_dir, 'test')
cpp_header_views_dir = os.path.join(cpp_header_dir, 'views')
capi_header_dir = os.path.join(cpp_header_dir, 'capi')
api_hash_header = os.path.join(cpp_header_dir, 'cef_api_hash.h')
libcef_dll_dir = os.path.join(root_dir, 'libcef_dll')
cpptoc_global_impl = os.path.join(libcef_dll_dir, 'libcef_dll.cc')
ctocpp_global_impl = os.path.join(libcef_dll_dir, 'wrapper',
@@ -96,7 +98,7 @@ header = obj_header()
# add include files to be processed
header.set_root_directory(cpp_header_dir)
excluded_files = ['cef_application_mac.h', 'cef_version.h']
excluded_files = ['cef_api_hash.h', 'cef_application_mac.h', 'cef_version.h']
header.add_directory(cpp_header_dir, excluded_files)
header.add_directory(cpp_header_test_dir)
header.add_directory(cpp_header_views_dir)
@@ -236,5 +238,11 @@ if not options.quiet:
sys.stdout.write('Generating ' + libcef_dll_dylib_impl + ' file...\n')
update_file(*write_libcef_dll_dylib_impl(header, libcef_dll_dylib_impl))
# Output the API hash header file. This must be done last because it reads files
# that were potentially written by proceeding operations.
if not options.quiet:
sys.stdout.write('Generating API hash header...\n')
update_file(*write_api_hash_header(api_hash_header, cpp_header_dir))
if not options.quiet:
sys.stdout.write('Done - Wrote ' + str(writect) + ' files.\n')