Commit Graph

580 Commits

Author SHA1 Message Date
e88e98f061 tools: Add VSCode setup (fixes #3906)
Add tooling to set up a Visual Studio Code development environment
for CEF. See script output for usage.

Run: python3 tools/setup_vscode.py
2025-03-20 13:53:33 -04:00
8fa5244adb distrib: Include CREDITS.html with third-party licenses
This is the same content currently available via about:credits.
2025-03-19 13:57:51 -04:00
40fef43488 tools: Fix assert when all file contents are excluded (see #3836)
The full contents of a file may be excluded at certain API versions.
2025-03-07 11:59:43 -05:00
e44a93551f tools: Add non-zero exit code for single patch failure (fixes #3903) 2025-03-07 15:46:05 +00:00
18b65ced23 tools: Also check for CEF_NEXT in .cc files (see #3836) 2025-02-28 18:22:33 -05:00
9c7b6e77a5 tools: Use short copyright for capi_versions.h headers (see #3836)
These files are not distributed and therefore don't require the
full copyright header.
2025-02-28 18:22:33 -05:00
781d2b5996 tools: Fix get_all_versions for newly added class (see #3836) 2025-02-28 18:22:33 -05:00
fdd36e8461 Support API versioning in platform-specific headers (see #3836)
- Exclude platform-specific includes (anything in < >) from the
  clang preprocessor by using `!defined(GENERATING_CEF_API_HASH)`
  in CEF header files.
- Define "target platforms" by passing platform- and architecture-
  specific ifdefs to the clang preprocessor. Grep for `defined(OS_`
  to identify headers that require target platform processing, and
  then process for each target as the platform-specific API hash
  contribution.
- Delete the univeral hash which is no longer a useful concept.
2025-02-25 12:36:00 -05:00
bfd1110145 tools: win: Use system installed Git version
Chromium has stopped bundling Git with depot_tools on Windows.
See https://groups.google.com/a/chromium.org/g/chromium-dev/c/e4ftLlQ5GpE/m/ye0ezOLaAAAJ
2025-02-19 12:27:47 -05:00
0c25276083 tools: win: Fix grep usage with system Git (see #3836) 2025-02-19 12:05:35 -05:00
64bb2aadd5 tools: Add null check for struct ptrs in CToCpp wrapper (see #3836) 2025-02-19 11:11:51 -05:00
c7c6a109c9 Update to Chromium version 134.0.6998.0 (#1415337) 2025-02-19 11:11:51 -05:00
e902b1f226 mac: Add -isysroot flag to clang command (see #3836) 2025-02-14 19:57:05 +00:00
6a3233f945 Add debugging help link (see #3836) 2025-01-14 12:56:21 -05:00
70c6a041eb Fix issues parsing clang output (see #3836) 2025-01-14 12:56:21 -05:00
719f423e70 Stop shipping snapshot_blob.bin
Shipping both snapshot_blob.bin and v8_context_snapshot.bin is
unnecessary, and v8_context_snapshot.bin is available on all
supported platforms. Chrome stopped shipping snapshot_blob.bin
in https://crrev.com/b550792f0f (~M66).
2025-01-14 12:56:21 -05:00
ee5cec12d2 Move generated includes to the gen directory 2025-01-09 12:03:07 -05:00
dd81904a2f Add initial support for API versioning (see #3836)
- Generated files are now created when running cef_create_projects or
  the new version_manager.py tool. These files are still created in the
  cef/ source tree (same location as before) but Git ignores them due to
  the generated .gitignore file.
- API hashes are committed to Git as a new cef_api_versions.json file.
  This file is used for both code generation and CEF version calculation
  (replacing the previous usage of cef_api_hash.h for this purpose).
  It will be updated by the CEF admin before merging breaking API
  changes upstream.
- As an added benefit to the above, contributor PRs will no longer
  contain generated code that is susceptible to frequent merge conflicts.
- From a code generation perspective, the main difference is that we now
  use versioned structs (e.g. cef_browser_0_t instead of cef_browser_t)
  on the libcef (dll/framework) side. Most of the make_*.py tool changes
  are related to supporting this.
- From the client perspective, you can now define CEF_API_VERSION in the
  project configuration (or get CEF_EXPERIMENTAL by default). This
  define will change the API exposed in CEF’s include/ and include/capi
  header files. All client-side targets including libcef_dll_wrapper
  will need be recompiled when changing this define.
- Examples of the new API-related define usage are provided in
  cef_api_version_test.h, api_version_test_impl.cc and
  api_version_unittest.cc.

To test:
- Run `ceftests --gtest_filter=ApiVersionTest.*`
- Add `cef_api_version=13300` to GN_DEFINES. Re-run configure, build and
  ceftests steps.
- Repeat with 13301, 13302, 13303 (all supported test versions).
2025-01-08 17:19:43 -05:00
f8b673a3ea win: Disable use of Rust for JSON parsing with cef_sandbox 2024-11-19 13:24:23 -05:00
980cc4b9fe bazel: win: Explicitly link libcef.lib in cc_binary (see #3757)
Using cc_import + interface_library/shared_library to link libcef.lib causes
libcef.dll to be copied as a transitive dependency, leading to issues with
complex Bazel configs. Instead, we explicitly link libcef.lib in the binary
target (cc_binary + linkopts/additional_linker_inputs) and explicitly copy
libcef.dll to the target directory.
2024-11-05 11:47:54 -05:00
5d817b20a6 Update to Chromium version 131.0.6768.0 (#1366576)
mac: Switch to Xcode 16.0 16A242d with macOS SDK 15.0 24A336
2024-10-24 11:24:17 -04:00
330534a2e7 tools: translator: Add void* return value support (fixes #3591) 2024-10-04 09:22:22 -04:00
467a0d6a85 tools: automate: Fail early if directory can't be renamed (fixes #2502) 2024-10-04 09:22:22 -04:00
2b6f461337 cefbuilds: Add channel matching for file records 2024-10-02 13:25:39 -04:00
cd052ec7c3 Update to Chromium version 130.0.6723.0 (#1356013) 2024-09-27 14:15:44 +00:00
b98eac265a bazel: mac: Copy but don't link the CEF framework (see #3757)
Copy the CEF framework into the app bundle but do not link it. See
https://groups.google.com/g/cef-announce/c/Fith0A3kWtw/m/6ds_mJVMCQAJ
for background.

Use `**kwargs` to pass all other arguments to the actual
`macos_application` target declaration.
2024-08-09 13:18:06 -04:00
9e9ba2c543 bazel: Limit define scope to specific cc targets (see #3757)
- Add `declare_[cc|objc]_library` macros to configure common `copts`
  and `local_defines` (where supported) on `[cc|objc]_library`
  targets. This limits the scope of defines to the specific target
  without inheritance by dependent targets.
- `objc_library` does not currently support `local_defines` so we
  use `copts` instead of MacOS.
- Use `**kwargs` to pass all other arguments to the actual cc
  target declaration.
2024-08-06 14:43:45 -04:00
f6f4ba8317 bazel: Support <angled> includes of CEF headers (see #3757)
Fixes "file not found with <angled> include" errors.
2024-08-05 17:24:44 -04:00
295ea1f715 Enable V8 sandbox by default (fixes #3332)
When the V8 sandbox is enabled, ArrayBuffer backing stores must be
allocated inside the sandbox address space. This change introduces a new
CefV8Value::CreateArrayBufferWithCopy method that copies the memory
contents into the sandbox address space.

Enabling the V8 sandbox can have a performance impact, especially when
passing large ArrayBuffers from C++ code to the JS side. We have therefore
retained the old CefV8Value::CreateArrayBuffer method that references
external memory. However, this method can only be used if the V8 sandbox is
disabled at CEF/Chromium build time.

To disable the V8 sandbox add `v8_enable_sandbox=false` to
`GN_DEFINES` when building CEF/Chromium.
2024-08-05 16:00:58 +00:00
08ae3a44a6 bazel: Fix resource paths as external repo (see #3757)
- Headers that are included by .rc files need to be supplied to
  `declare_exe` via the `resources_deps` attribute (passed as the `deps
  attribute to `compile_rc`). The headers must be part of a cc_library
  target via either the `hdrs` or `srcs` attribute.
- File paths for CEF resources are prefixed with "external/<repo>"
  when CEF is loaded as an external repo. Update `copy_filegroups` to
  work with these paths.
2024-08-02 16:51:11 -04:00
5ddeef736a bazel: Add repo for package-local target labels (see #3757)
Unqualified target labels don't resolve correctly when the
disribution is loaded as an external repo. Mapping, if necessary,
can be performed using the `repo_mapping` parameter to
http_archive() or local_repository().
2024-07-31 17:53:30 -04:00
a6c00b2ff6 bazel: Add initial config for binary distribution (see #3757)
Add support for building the CEF binary distribution using Bazel
and the default platform toolchain. Tested to work for Windows
x64, MacOS ARM64 and x64 (cross-compile from ARM64), and
Linux x64. Windows x86 (cross-compile from x64) is known to
be broken, see https://github.com/bazelbuild/bazel/issues/22164.

Includes minor changes to tests directory structure to meet
Bazel build requirements.
2024-07-28 18:19:47 +00:00
4023fea237 cefbuilds: Add tools distribution (see #3734) 2024-07-16 12:43:12 -04:00
5607a4d347 distrib: Add new tools distribution for mksnapshot (see #3734) 2024-07-16 12:43:12 -04:00
02ea88f79f Call SetIsShutdown after CefInitialize (fixes #3738)
Delay shutdown checking until after CefInitialize has drained existing
task pools.
2024-07-15 16:44:38 -04:00
b7a172fefc tools: Build using autoninja
Applies automatic `-j (#cores)` configuration
2024-07-11 10:17:21 -04:00
68e1fcf3a4 tools: win: Remove dynamic_annotations.lib from cef_sandbox
This library was removed in https://crbug.com/40209570.
2024-07-10 12:35:47 -04:00
1f35258023 Include debug symbols for all distributed binaries (fixes #2235) 2024-07-08 12:18:01 -04:00
231701d98b Expose DumpWithoutCrashing (fixes #3588) 2024-07-02 18:08:16 +00:00
a461a89728 Delete Alloy bootstrap (fixes #3685) 2024-07-01 12:32:14 -04:00
b95b3e6fd5 tools: Fix "invalid escape sequence '\s'" warning 2024-07-01 15:12:35 +00:00
c44aa35bfc Update to Chromium version 127.0.6533.0 (#1313161) 2024-06-20 12:09:46 -04:00
701fc03f00 Update to Chromium version 126.0.6478.0 (#1300313) 2024-05-26 13:45:29 -04:00
32fc106ab0 Enable BackupRefPtr for compatible non-Official builds (see #3239)
Compatible configurations include:
- Non-component builds.
- Debug builds on Mac/Linux.
- Release builds on Windows (b/c Debug builds require component builds).
- ASAN builds (which are also Release builds).

See related logic in //build_overrides/partition_alloc.gni
2024-05-20 13:05:37 -04:00
002f4b5b4a tools: Don't write args.gn if unchanged (see #3681, see #3685)
Now that args.gn is an input to the make_config_header target we
don't want to invalidate the build unnecessarily by modifying the
file if the contents are unchanged.
2024-05-03 15:38:10 -04:00
17a1fd62ec tests: Remove extension tests (see #3685)
The Alloy extension API is deprecated and these tests have not been
supported for some time.
2024-05-03 15:23:35 -04:00
b92749a58a Add DISABLE_ALLOY_BOOTSTRAP to cef_config.h (see #3681, see #3685)
Include cef_config.h from base/cef_build.h and fix detection of
args.gn changes so that defines are available everywhere by default.

Fix include configuration for chrome_elf_set and sandbox targets.
2024-05-01 14:34:32 -04:00
49a34d9160 Apply new Chromium style for #include sorting
Add "cef/" prefix for CEF #includes in libcef/ directory.

Sort #includes by following
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
2024-05-01 14:34:32 -04:00
b537fc929b mac: Disable dangling pointer detector (see #3239)
This is enabled by default on Mac in M125 but we can't use it until
raw_ptr<> is supported by libcef. For background see
https://chromium.googlesource.com/chromium/src/+/main/docs/dangling_ptr.md
2024-04-26 10:31:40 -04:00
4fe529e2dc mac: Enable allocator shim to fix builds (see #3061)
This is a workaround for https://crbug.com/326898585
2024-04-25 18:43:04 -04:00