Compare commits

..

60 Commits
4389 ... 2883

Author SHA1 Message Date
Marshall Greenblatt
f984155b3f Windows: Fix command line parsing for crash handler (issue #1995) 2017-01-30 16:18:58 -05:00
Marshall Greenblatt
80bd6062d7 Fix command line parsing for crash handler (issue #1995) 2017-01-27 14:22:17 -05:00
Marshall Greenblatt
88ff29a56a Standardize product/version/platform crash keys (issue #1995) 2017-01-25 14:18:49 -05:00
Marshall Greenblatt
beccb2dd1b Fix potential OSR crash on renderer process recreation (issue #2082) 2017-01-25 12:48:33 -05:00
Marshall Greenblatt
6b8ef03a2b Fix error in patch file generation (issue #2015) 2017-01-24 18:16:56 -05:00
Marshall Greenblatt
c8ee0ae2ca Add is_main_frame argument to CefRequestContextHandler::OnBeforePluginLoad (issue #2015) 2017-01-24 17:54:51 -05:00
Marshall Greenblatt
d6fc4a4c16 Add CefContextMenuParams::GetTitleText method (issue #2030) 2017-01-17 13:22:08 -05:00
Marshall Greenblatt
8b2618a72a Fix CefRequestHandler::OnCertificateError callback trigger (issue #2019) 2017-01-17 13:11:22 -05:00
Marshall Greenblatt
4fdfc02858 cefclient: Fix typo in TempWindow comments 2017-01-17 13:11:22 -05:00
Marshall Greenblatt
d685d27313 Windows: Fix white flash during browser creation (issue #1984) 2017-01-13 16:35:26 -05:00
Marshall Greenblatt
fd774d81ad Windows: Fix AppName and ExternalHandler usage in crash_reporter.cfg (issue #1995) 2017-01-13 15:23:19 -05:00
Marshall Greenblatt
6e0baff75c Improve crashpad integration (issue #1995)
- Crash reporting is enabled and configured using a "crash_reporter.cfg"
  file. See comments in include/cef_crash_util.h and tools/crash_server.py
  for usage.

Add product name and version to crash_reporter.cfg (issue #1995)
2017-01-12 14:43:34 -05:00
Marshall Greenblatt
f264ab9620 Update to Chromium version 55.0.2883.87 2017-01-10 22:06:33 -05:00
Marshall Greenblatt
c993bcadc3 Update copyright year on generated files 2017-01-10 19:25:18 -05:00
Marshall Greenblatt
edbfb207b8 Windows: Fix behavior of frameless windows with Views.
- Don't set InitParams::TRANSLUCENT_WINDOW. Setting this resulted in
  the WS_EX_COMPOSITED style being added and the WS_THICKFRAME style
  being removed, which disabled Aero Snap.
- Remove the non-client border to get a completely frameless window.
  Having a border is problematic because the top is drawn by Windows
  while the rest is drawn black. Having Windows draw part of the
  border is required to enable the window drop shadow (see
  HWNDMessageHandler::SetDwmFrameExtension).
- Delete the remove_caption patches which are no longer required.
2016-12-14 16:57:43 +01:00
Marshall Greenblatt
d7f087e766 Windows: Fix missing InsertAllocatorDispatch symbol in cef_sandbox.lib (issue #2044) 2016-11-30 19:51:05 -05:00
Marshall Greenblatt
7f76148993 Windows: Fix x64 build conversion from 'size_t' to 'int' error (issue #2054) 2016-11-30 15:25:08 -05:00
Marshall Greenblatt
7843d6cdff Update to Chromium version 55.0.2883.59 2016-11-30 00:00:09 -05:00
Marshall Greenblatt
a8ecb191da Add option to enable/disable net security expiration (issue #1994)
- Net security (CT, HSTS) expiration based on build age is now
  disabled by default.
- Add new enable_net_security_expiration option to CefSettings and
  CefRequestContextSettings.
2016-11-18 16:18:03 -05:00
Marshall Greenblatt
6064e023ff Windows: Fix x64 build conversion from 'size_t' to 'int' error (issue #2043) 2016-11-18 14:30:26 -05:00
Marshall Greenblatt
a841c0a319 Mac: Fix resource copy when building the binary distrib with Ninja (issue #1632) 2016-11-18 13:46:41 -05:00
Marshall Greenblatt
fbe14a56a8 Rename unittests to ceftests (issue #1632) 2016-11-18 13:46:41 -05:00
Marshall Greenblatt
a76670a3ed Add unittests target to the binary distribution (issue #1632)
- Move all tests from the top-level directory to tests/.
- Move files shared by cefclient and unittests to tests/shared/.
- Add a fused (single header/source file) version of gtest in
  tests/gtest/ with associated CMake configuration.
- Test-only headers are now exposed in include/test/. Unit test
  targets must define UNIT_TEST in order to access them.
- Replace usage of USING_CEF_SHARED with WRAPPING_CEF_SHARED for
  clarity (only the libcef_dll_wrapper target should define it).
- Remove the RENAME_DIRECTORY CMake macro which is no longer used.
- Remove C++11 usage from unittests sources for compatibility with
  the binary distribution configuration.
- Windows: Fix build errors due to chrome_elf.dll and imm32.lib
  missing from the CMake configuration.
2016-11-18 13:46:40 -05:00
Marshall Greenblatt
fe419c09ec Remove Chromium target dependencies for unit tests (issue #1632) 2016-11-18 13:46:40 -05:00
Marshall Greenblatt
0187add5ae Remove Chromium includes in unit tests (issue #1632) 2016-11-18 13:46:39 -05:00
Marshall Greenblatt
9610905541 Remove usage of ui::KeyboardCode in unit tests (issue #1632) 2016-11-18 13:46:39 -05:00
Marshall Greenblatt
ac9d105c5d Add CefWaitableEvent interface for unit tests (issue #1632) 2016-11-18 13:46:39 -05:00
Marshall Greenblatt
9c76128317 Add CefScopedTempDir and file utility functions for unit tests (issue #1632) 2016-11-18 13:46:39 -05:00
Marshall Greenblatt
b462c19db1 Remove usage of gfx in unit tests (issue #1632) 2016-11-18 13:46:39 -05:00
Marshall Greenblatt
53b3f1c274 Remove usage of base::StringPrintf in unit tests (issue #1632) 2016-11-18 13:46:39 -05:00
Marshall Greenblatt
cc0e7d207c Remove usage of base::WrapUnique in unit tests (issue #1632) 2016-11-18 13:46:39 -05:00
Marshall Greenblatt
648b7b243f Add CefThread interface (issue #1632) 2016-11-18 13:46:39 -05:00
Marshall Greenblatt
b099f8cb79 Update to Chromium version 55.0.2883.44 2016-11-10 16:13:41 -05:00
Marshall Greenblatt
aeeb51361b Fix memory leak with IME on macOS (see http://crbug.com/654695) 2016-11-10 16:13:14 -05:00
Marshall Greenblatt
7a2765f89c Add initial WebUI support (issue #2037)
- Visit chrome://webui-hosts for the list of supported hosts.
2016-11-08 20:39:23 -05:00
Marshall Greenblatt
3beb937bcb Fix cef_time_t.year documentation (issue #1913) 2016-11-04 17:06:34 -04:00
Marshall Greenblatt
d59682018c Change index parameter type from int to size_t (issue #1491) 2016-11-04 15:28:37 -04:00
Marshall Greenblatt
5cea4e312b Add test for history navigation of pages containing dynamically created iframes (issue #2022) 2016-11-04 13:54:29 -04:00
Marshall Greenblatt
f7014becfa Standardize IME callbacks for off-screen rendering (issue #1675) 2016-11-03 21:12:41 -04:00
Marshall Greenblatt
e30a588a4c Fix DCHECK while running PDF unit tests (issue #2032) 2016-11-03 12:48:02 -04:00
Marshall Greenblatt
6e2177b6fa Disable channel ID support (issue #1912) 2016-11-02 15:15:30 -04:00
Marshall Greenblatt
666341d24e Update to Chromium version 55.0.2883.28 2016-11-01 12:45:33 -04:00
Marshall Greenblatt
afbd288efa Remove mention of automatic type conversion in cef_v8.h (issue #1089) 2016-10-28 20:54:07 -04:00
Marshall Greenblatt
814fe1e069 Mac: Always set enable_dsyms=true (issue #2027) 2016-10-28 20:31:52 -04:00
Marshall Greenblatt
ebddf7c5f3 Remove unhelpful context debug checks (issue #1954) 2016-10-28 16:05:13 -04:00
Marshall Greenblatt
713ddcc96d Fix URL comparison errors in CefRequest (issue #1967) 2016-10-28 14:17:30 -04:00
Marshall Greenblatt
ed84471e8a Fix CefMenuModelDelegate methods missing from the CAPI (issue #2006) 2016-10-28 13:18:56 -04:00
Marshall Greenblatt
99e95ca434 Fix crash when persisting user preferences (issue #2017) 2016-10-28 12:39:57 -04:00
Marshall Greenblatt
a6c42a74b1 Fix translator error with X509CertificateList (issue #1824) 2016-10-27 15:45:53 -04:00
Marshall Greenblatt
67eba55c79 Minor fixes for output consistency 2016-10-27 14:47:47 -04:00
Marshall Greenblatt
97fe56d30c Add callback for custom certificate selection (issue #1824) 2016-10-27 14:47:47 -04:00
Marshall Greenblatt
f3598b5ab0 Add V8 interceptor support (issue #1159) 2016-10-27 14:47:47 -04:00
Marshall Greenblatt
dd8daeb8c9 Fix shutdown assertion with authentication whitelist preferences (issue #1150) 2016-10-27 14:47:47 -04:00
Marshall Greenblatt
8fc370c9be Add authentication whitelist preferences (issue #1150) 2016-10-27 14:47:47 -04:00
Marshall Greenblatt
499813b294 Allow CefV8Context::Eval to bypass CSP (issue #2024) 2016-10-27 14:47:47 -04:00
Marshall Greenblatt
3a77b243a3 Windows: Fix crash when AVX instructions are not supported (issue #1999) 2016-10-27 14:47:47 -04:00
Marshall Greenblatt
0ad5d2918b Add patch tool enhancements (issue #2016) 2016-10-27 14:47:46 -04:00
Marshall Greenblatt
37753febf5 Fix PDF rendering with OSR (issue #1689) 2016-10-27 14:47:46 -04:00
Marshall Greenblatt
5cd77e8491 Fix missing browser.enable_spellchecking pref registration (issue #1996) 2016-10-27 14:47:46 -04:00
Marshall Greenblatt
287664d85f Update to Chromium version 55.0.2883.21 2016-10-25 20:19:54 -04:00
2045 changed files with 95586 additions and 178504 deletions

10
.gitignore vendored
View File

@@ -35,7 +35,6 @@
.metadata
.project
.pydevproject
.vscode
# Settings directory for eclipse
/.settings
.checkstyle
@@ -43,14 +42,11 @@ cscope.*
Session.vim
tags
Thumbs.db
# IDE's
.vs/
.kdev4/
*.kdev4
# CEF generated directories
/binary_distrib
/docs
# CEF generated files
/include/cef_config.h
/include/cef_pack_resources.h
/include/cef_pack_strings.h
/include/cef_version.h
.ccls-cache/
/patch/patch_state.h

View File

@@ -1,9 +0,0 @@
# Copyright (c) 2017 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
# Configuration settings for tools/fix_style.py
{
# Directories containing these path components will be ignored.
'ignore_directories': ['yapf'],
}

View File

@@ -1,2 +0,0 @@
[style]
based_on_style = chromium

View File

@@ -1,8 +1,6 @@
# This file is an addendum to the Chromium AUTHORS file. It lists authors
# through March 16, 2015 when Git was introduced for source code management.
# A list of additional authors added after that date can be found by executing
# this command on a local Git checkout:
# git log --all --format="%aN <%aE>" | sort -u
# This file is an addendum to the Chromium AUTHORS file.
# Names should be added to this file like so:
# Name or Organization <email address>
Marshall Greenblatt <magreenblatt@gmail.com>
Jamie Kirkpatrick <jkp@spotify.com>

1239
BUILD.gn

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/89.0.4389.114',
'depot_tools_checkout': '1f976d6f30'
'chromium_checkout': 'refs/tags/55.0.2883.87',
}

View File

@@ -1,66 +0,0 @@
# The Chromium Embedded Framework (CEF) project is built on top of the Chromium
# project source tree. When updating Chromium to a new version certain files and
# patterns should be observed for changes. If changes are detected then the CEF
# source code or patch files will likely need to be updated.
#
# Add `--log-chromium-changes` to the automate-git.py command-line to output
# the following files in the <download-dir>:
#
# * chromium_update_changes.diff
# Files in the chromium/src directory that have changed. See the 'files'
# section below.
#
# * chromium_update_patterns.txt
# Files in the chromium/src directory that contain invalid/unexpected
# patterns. See the 'patterns' section below. Failure of this step is
# considered a fatal error during update.
#
# * chromium_update_patches.txt
# Output from attempting to update existing Chromium patch files using the
# patch_updater.py tool. Failure of this step is considered a fatal error
# during update.
#
# For complete update instructions see:
# https://bitbucket.org/chromiumembedded/cef/wiki/ChromiumUpdate.md
{
# Files in the chromium/src directory that should be evaluated for changes.
# Similar changes may need to be applied to the CEF source code.
'files': [
'chrome/browser/browser_process.h',
'chrome/browser/extensions/api/tabs/tabs_api.*',
'chrome/browser/extensions/chrome_component_extension_resource_manager.*',
'chrome/browser/extensions/chrome_extension_web_contents_observer.*',
'chrome/browser/extensions/component_loader.*',
'chrome/browser/extensions/extension_service.*',
'chrome/browser/printing/print_view_manager*',
'chrome/browser/printing/printing_message_filter*',
'chrome/browser/profiles/profile.h',
'chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.*',
'chrome/common/extensions/api/*_features.json',
'chrome/renderer/chrome_content_renderer_client.*',
'chrome/renderer/extensions/chrome_extensions_renderer_client.*',
'content/browser/renderer_host/render_widget_host_view_base.*',
'content/public/browser/content_browser_client.*',
'content/public/browser/render_widget_host_view.h',
'content/public/browser/storage_partition.h',
'content/public/browser/web_contents_delegate.h',
'content/public/common/content_features.cc',
'content/shell/BUILD.gn',
'content/shell/app/*',
'content/shell/browser/shell_*',
'content/shell/browser/renderer_host/shell_*',
'content/shell/common/shell_*',
'content/shell/gpu/shell_*',
'content/shell/renderer/shell_*',
'content/shell/utility/shell_*',
'extensions/shell/*',
'net/base/features.cc',
'net/cookies/cookie_store.h',
'services/network/public/cpp/features.cc',
'ui/base/ui_base_features.cc',
],
# Patterns that should not be found in the chromium/src directory after
# applying patch files.
'patterns': [],
}

View File

@@ -12,8 +12,8 @@
# distribution include:
#
# Linux: Ninja, Unix Makefiles
# MacOS: Ninja, Xcode 8+ (x86_64) or Xcode 12.2+ (ARM64)
# Windows: Ninja, Visual Studio 2015+
# Mac OS X: Ninja, Xcode 5+
# Windows: Ninja, Visual Studio 2010+
#
# Ninja is a cross-platform open-source tool for running fast builds using
# pre-installed platform toolchains (GNU, clang, Xcode or MSVC). It can be
@@ -40,22 +40,21 @@
#
# - Linux requirements:
# Currently supported distributions include Debian Wheezy, Ubuntu Precise, and
# related. Ubuntu 18.04 64-bit is recommended. Newer versions will likely also
# related. Ubuntu 14.04 64-bit is recommended. Newer versions will likely also
# work but may not have been tested.
# Required packages include:
# build-essential
# libgtk2.0-dev (required by the cefclient target only)
# libgtkglext1-dev (required by the cefclient target only)
#
# - MacOS requirements:
# Xcode 8 or newer building on MacOS 10.11 (El Capitan) or newer for x86_64.
# Xcode 12.2 or newer building on MacOS 10.15.4 (Catalina) or newer for ARM64.
# Only 64-bit builds are supported. The Xcode command-line tools must also be
# installed.
# - Mac OS X requirements:
# Xcode 5 or newer building on Mac OS X 10.9 (Mavericks) or newer. Xcode 7.2
# and OS X 10.11 are recommended. The Xcode command-line tools must also be
# installed. Only 64-bit builds are supported on OS X.
#
# - Windows requirements:
# Visual Studio 2015 Update 2 or newer building on Windows 7 or newer. Visual
# Studio 2019 and Windows 10 64-bit are recommended.
# Visual Studio 2010 or newer building on Windows 7 or newer. Visual Studio
# 2015 Update 2 and Windows 10 64-bit are recommended.
#
# BUILD EXAMPLES
#
@@ -76,7 +75,7 @@
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a MacOS build using a 64-bit CEF binary distribution:
# To perform a Mac OS X build using a 64-bit CEF binary distribution:
# Using the Xcode IDE:
# > cmake -G "Xcode" -DPROJECT_ARCH="x86_64" ..
# Open build\cef.xcodeproj in Xcode and select Product > Build.
@@ -85,47 +84,27 @@
# > cmake -G "Ninja" -DPROJECT_ARCH="x86_64" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a MacOS build using an ARM64 CEF binary distribution:
# Using the Xcode IDE:
# > cmake -G "Xcode" -DPROJECT_ARCH="arm64" ..
# Open build\cef.xcodeproj in Xcode and select Product > Build.
#
# Using Ninja:
# > cmake -G "Ninja" -DPROJECT_ARCH="arm64" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a Windows build using a 32-bit CEF binary distribution:
# Using the Visual Studio 2019 IDE:
# > cmake -G "Visual Studio 16" -A Win32 ..
# Using the Visual Studio 2015 IDE:
# > cmake -G "Visual Studio 14" ..
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
#
# Using Ninja with Visual Studio 2019 command-line tools:
# Using Ninja with Visual Studio 2015 command-line tools:
# (this path may be different depending on your Visual Studio installation)
# > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars32.bat"
# > "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a Windows build using a 64-bit CEF binary distribution:
# Using the Visual Studio 2019 IDE:
# > cmake -G "Visual Studio 16" -A x64 ..
# Using the Visual Studio 2015 IDE:
# > cmake -G "Visual Studio 14 Win64" ..
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
#
# Using Ninja with Visual Studio 2019 command-line tools:
# Using Ninja with Visual Studio 2015 command-line tools:
# (this path may be different depending on your Visual Studio installation)
# > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat"
# > "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefclient cefsimple
#
# To perform a Windows build using an ARM64 CEF binary distribution:
# Using the Visual Studio 2019 IDE:
# > cmake -G "Visual Studio 16" -A arm64 ..
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
#
# Using Ninja with Visual Studio 2019 command-line tools:
# (this path may be different depending on your Visual Studio installation)
# > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
# > ninja cefsimple
#
# Global setup.
@@ -220,15 +199,10 @@ add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
# Include application targets.
# Comes from the <target>/CMakeLists.txt file in the current directory.
# TODO: Change these lines to match your project target when you copy this file.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
add_subdirectory(tests/cefsimple)
add_subdirectory(tests/gtest)
add_subdirectory(tests/ceftests)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/cefclient")
add_subdirectory(tests/cefclient)
endif()
add_subdirectory(tests/cefclient)
add_subdirectory(tests/cefsimple)
add_subdirectory(tests/gtest)
add_subdirectory(tests/ceftests)
# Display configuration settings.
PRINT_CEF_CONFIG()

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2008-2020 Marshall A. Greenblatt. Portions Copyright (c)
// Copyright (c) 2008-2014 Marshall A. Greenblatt. Portions Copyright (c)
// 2006-2009 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without

View File

@@ -7,11 +7,10 @@ The Chromium Embedded Framework (CEF) is a simple framework for embedding Chromi
* General Usage - https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage
* Master Build Quick-Start - https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart
* Branches and Building - https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
* Announcements - https://groups.google.com/forum/#!forum/cef-announce
* Support Forum - http://www.magpcss.org/ceforum/
* CEF1 C++ API Docs - http://magpcss.org/ceforum/apidocs/
* CEF3 C++ API Docs - http://magpcss.org/ceforum/apidocs3/
* Downloads - https://cef-builds.spotifycdn.com/index.html
* Downloads - http://opensource.spotify.com/cefbuilds/index.html
* Donations - http://www.magpcss.org/ceforum/donate.php
# Introduction
@@ -33,7 +32,7 @@ Users new to CEF development should start by reading the [Tutorial](https://bitb
# Binary Distributions
Binary distributions, which include all files necessary to build a CEF-based application, are available on the [Downloads](https://cef-builds.spotifycdn.com/index.html) page. Binary distributions are stand-alone and do not require the download of CEF or Chromium source code. Symbol files for debugging binary distributions of libcef can also be downloaded from the above links.
Binary distributions, which include all files necessary to build a CEF-based application, are available on the [Downloads](http://opensource.spotify.com/cefbuilds/index.html) page. Binary distributions are stand-alone and do not require the download of CEF or Chromium source code. Symbol files for debugging binary distributions of libcef can also be downloaded from the above links.
# Source Distributions
@@ -43,14 +42,12 @@ The CEF project is an extension of the Chromium project. CEF maintains developme
The base CEF framework includes support for the C and C++ programming languages. Thanks to the hard work of external maintainers CEF can integrate with a number of other programming languages and frameworks. These external projects are not maintained by CEF so please contact the respective project maintainer if you have any questions or issues.
* .Net (CEF3) - https://github.com/cefsharp/CefSharp
* .Net - https://github.com/chillitom/CefSharp
* .Net (CEF1) - https://bitbucket.org/fddima/cefglue
* .Net/Mono (CEF3) - https://bitbucket.org/xilium/xilium.cefglue
* .Net (CEF3) - https://bitbucket.org/chromiumfx/chromiumfx
* Delphi (CEF1) - http://code.google.com/p/delphichromiumembedded/
* Delphi (CEF3) - https://github.com/hgourvest/dcef3
* Delphi (CEF3) - https://github.com/salvadordf/CEF4Delphi
* Go - https://github.com/richardwilkes/cef
* Delphi (CEF3) - http://code.google.com/p/dcef3/
* Go - https://github.com/CzarekTomczak/cef2go
* Java - https://bitbucket.org/chromiumembedded/java-cef
* Java - http://code.google.com/p/javacef/
@@ -84,4 +81,4 @@ If you would like to contribute source code changes to CEF please follow the bel
* Be submitted against the current [CEF master branch](https://bitbucket.org/chromiumembedded/cef/src/?at=master) unless explicitly fixing a bug in a CEF release branch.
* Follow the style of existing CEF source files. In general CEF uses the [Chromium coding style](http://www.chromium.org/developers/coding-style).
* Include new or modified unit tests as appropriate to the functionality.
* Not include unnecessary or unrelated changes.
* Not include unnecessary or unrelated changes.

View File

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights
# Copyright (c) 2017 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.
#
@@ -8,15 +8,11 @@
# by hand. See the translator.README.txt file in the tools directory for
# more information.
#
# $hash=f1877c7a493342351e284cb6c14e6f223461facb$
#
{
'variables': {
'autogen_cpp_includes': [
'include/cef_accessibility_handler.h',
'include/cef_app.h',
'include/cef_audio_handler.h',
'include/cef_auth_callback.h',
'include/cef_browser.h',
'include/cef_browser_process_handler.h',
@@ -26,7 +22,6 @@
'include/cef_context_menu_handler.h',
'include/cef_cookie.h',
'include/cef_crash_util.h',
'include/cef_devtools_message_observer.h',
'include/cef_dialog_handler.h',
'include/cef_display_handler.h',
'include/cef_dom.h',
@@ -34,18 +29,17 @@
'include/cef_download_item.h',
'include/cef_drag_data.h',
'include/cef_drag_handler.h',
'include/cef_extension.h',
'include/cef_extension_handler.h',
'include/cef_file_util.h',
'include/cef_find_handler.h',
'include/cef_focus_handler.h',
'include/cef_frame.h',
'include/cef_geolocation.h',
'include/cef_geolocation_handler.h',
'include/cef_image.h',
'include/cef_jsdialog_handler.h',
'include/cef_keyboard_handler.h',
'include/cef_life_span_handler.h',
'include/cef_load_handler.h',
'include/cef_media_router.h',
'include/cef_menu_model.h',
'include/cef_menu_model_delegate.h',
'include/cef_navigation_entry.h',
@@ -56,22 +50,18 @@
'include/cef_print_settings.h',
'include/cef_process_message.h',
'include/cef_process_util.h',
'include/cef_registration.h',
'include/cef_render_handler.h',
'include/cef_render_process_handler.h',
'include/cef_request.h',
'include/cef_request_callback.h',
'include/cef_request_context.h',
'include/cef_request_context_handler.h',
'include/cef_request_handler.h',
'include/cef_resource_bundle.h',
'include/cef_resource_bundle_handler.h',
'include/cef_resource_handler.h',
'include/cef_resource_request_handler.h',
'include/cef_response.h',
'include/cef_response_filter.h',
'include/cef_scheme.h',
'include/cef_server.h',
'include/cef_ssl_info.h',
'include/cef_ssl_status.h',
'include/cef_stream.h',
@@ -87,7 +77,6 @@
'include/cef_x509_certificate.h',
'include/cef_xml_reader.h',
'include/cef_zip_reader.h',
'include/test/cef_test_helpers.h',
'include/test/cef_translator_test.h',
'include/views/cef_box_layout.h',
'include/views/cef_browser_view.h',
@@ -111,9 +100,7 @@
'include/views/cef_window_delegate.h',
],
'autogen_capi_includes': [
'include/capi/cef_accessibility_handler_capi.h',
'include/capi/cef_app_capi.h',
'include/capi/cef_audio_handler_capi.h',
'include/capi/cef_auth_callback_capi.h',
'include/capi/cef_browser_capi.h',
'include/capi/cef_browser_process_handler_capi.h',
@@ -123,7 +110,6 @@
'include/capi/cef_context_menu_handler_capi.h',
'include/capi/cef_cookie_capi.h',
'include/capi/cef_crash_util_capi.h',
'include/capi/cef_devtools_message_observer_capi.h',
'include/capi/cef_dialog_handler_capi.h',
'include/capi/cef_display_handler_capi.h',
'include/capi/cef_dom_capi.h',
@@ -131,18 +117,17 @@
'include/capi/cef_download_item_capi.h',
'include/capi/cef_drag_data_capi.h',
'include/capi/cef_drag_handler_capi.h',
'include/capi/cef_extension_capi.h',
'include/capi/cef_extension_handler_capi.h',
'include/capi/cef_file_util_capi.h',
'include/capi/cef_find_handler_capi.h',
'include/capi/cef_focus_handler_capi.h',
'include/capi/cef_frame_capi.h',
'include/capi/cef_geolocation_capi.h',
'include/capi/cef_geolocation_handler_capi.h',
'include/capi/cef_image_capi.h',
'include/capi/cef_jsdialog_handler_capi.h',
'include/capi/cef_keyboard_handler_capi.h',
'include/capi/cef_life_span_handler_capi.h',
'include/capi/cef_load_handler_capi.h',
'include/capi/cef_media_router_capi.h',
'include/capi/cef_menu_model_capi.h',
'include/capi/cef_menu_model_delegate_capi.h',
'include/capi/cef_navigation_entry_capi.h',
@@ -153,22 +138,18 @@
'include/capi/cef_print_settings_capi.h',
'include/capi/cef_process_message_capi.h',
'include/capi/cef_process_util_capi.h',
'include/capi/cef_registration_capi.h',
'include/capi/cef_render_handler_capi.h',
'include/capi/cef_render_process_handler_capi.h',
'include/capi/cef_request_capi.h',
'include/capi/cef_request_callback_capi.h',
'include/capi/cef_request_context_capi.h',
'include/capi/cef_request_context_handler_capi.h',
'include/capi/cef_request_handler_capi.h',
'include/capi/cef_resource_bundle_capi.h',
'include/capi/cef_resource_bundle_handler_capi.h',
'include/capi/cef_resource_handler_capi.h',
'include/capi/cef_resource_request_handler_capi.h',
'include/capi/cef_response_capi.h',
'include/capi/cef_response_filter_capi.h',
'include/capi/cef_scheme_capi.h',
'include/capi/cef_server_capi.h',
'include/capi/cef_ssl_info_capi.h',
'include/capi/cef_ssl_status_capi.h',
'include/capi/cef_stream_capi.h',
@@ -184,7 +165,6 @@
'include/capi/cef_x509_certificate_capi.h',
'include/capi/cef_xml_reader_capi.h',
'include/capi/cef_zip_reader_capi.h',
'include/capi/test/cef_test_helpers_capi.h',
'include/capi/test/cef_translator_test_capi.h',
'include/capi/views/cef_box_layout_capi.h',
'include/capi/views/cef_browser_view_capi.h',
@@ -208,12 +188,8 @@
'include/capi/views/cef_window_delegate_capi.h',
],
'autogen_library_side': [
'libcef_dll/ctocpp/accessibility_handler_ctocpp.cc',
'libcef_dll/ctocpp/accessibility_handler_ctocpp.h',
'libcef_dll/ctocpp/app_ctocpp.cc',
'libcef_dll/ctocpp/app_ctocpp.h',
'libcef_dll/ctocpp/audio_handler_ctocpp.cc',
'libcef_dll/ctocpp/audio_handler_ctocpp.h',
'libcef_dll/cpptoc/auth_callback_cpptoc.cc',
'libcef_dll/cpptoc/auth_callback_cpptoc.h',
'libcef_dll/cpptoc/before_download_callback_cpptoc.cc',
@@ -248,8 +224,6 @@
'libcef_dll/ctocpp/context_menu_handler_ctocpp.h',
'libcef_dll/cpptoc/context_menu_params_cpptoc.cc',
'libcef_dll/cpptoc/context_menu_params_cpptoc.h',
'libcef_dll/ctocpp/cookie_access_filter_ctocpp.cc',
'libcef_dll/ctocpp/cookie_access_filter_ctocpp.h',
'libcef_dll/cpptoc/cookie_manager_cpptoc.cc',
'libcef_dll/cpptoc/cookie_manager_cpptoc.h',
'libcef_dll/ctocpp/cookie_visitor_ctocpp.cc',
@@ -262,8 +236,6 @@
'libcef_dll/ctocpp/domvisitor_ctocpp.h',
'libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc',
'libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h',
'libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.cc',
'libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.h',
'libcef_dll/ctocpp/dialog_handler_ctocpp.cc',
'libcef_dll/ctocpp/dialog_handler_ctocpp.h',
'libcef_dll/cpptoc/dictionary_value_cpptoc.cc',
@@ -286,10 +258,6 @@
'libcef_dll/ctocpp/drag_handler_ctocpp.h',
'libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc',
'libcef_dll/ctocpp/end_tracing_callback_ctocpp.h',
'libcef_dll/cpptoc/extension_cpptoc.cc',
'libcef_dll/cpptoc/extension_cpptoc.h',
'libcef_dll/ctocpp/extension_handler_ctocpp.cc',
'libcef_dll/ctocpp/extension_handler_ctocpp.h',
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc',
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.h',
'libcef_dll/cpptoc/views/fill_layout_cpptoc.cc',
@@ -300,8 +268,12 @@
'libcef_dll/ctocpp/focus_handler_ctocpp.h',
'libcef_dll/cpptoc/frame_cpptoc.cc',
'libcef_dll/cpptoc/frame_cpptoc.h',
'libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.cc',
'libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h',
'libcef_dll/cpptoc/geolocation_callback_cpptoc.cc',
'libcef_dll/cpptoc/geolocation_callback_cpptoc.h',
'libcef_dll/ctocpp/geolocation_handler_ctocpp.cc',
'libcef_dll/ctocpp/geolocation_handler_ctocpp.h',
'libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc',
'libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h',
'libcef_dll/cpptoc/image_cpptoc.cc',
'libcef_dll/cpptoc/image_cpptoc.h',
'libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc',
@@ -320,26 +292,10 @@
'libcef_dll/cpptoc/list_value_cpptoc.h',
'libcef_dll/ctocpp/load_handler_ctocpp.cc',
'libcef_dll/ctocpp/load_handler_ctocpp.h',
'libcef_dll/ctocpp/media_observer_ctocpp.cc',
'libcef_dll/ctocpp/media_observer_ctocpp.h',
'libcef_dll/cpptoc/media_route_cpptoc.cc',
'libcef_dll/cpptoc/media_route_cpptoc.h',
'libcef_dll/ctocpp/media_route_create_callback_ctocpp.cc',
'libcef_dll/ctocpp/media_route_create_callback_ctocpp.h',
'libcef_dll/cpptoc/media_router_cpptoc.cc',
'libcef_dll/cpptoc/media_router_cpptoc.h',
'libcef_dll/cpptoc/media_sink_cpptoc.cc',
'libcef_dll/cpptoc/media_sink_cpptoc.h',
'libcef_dll/ctocpp/media_sink_device_info_callback_ctocpp.cc',
'libcef_dll/ctocpp/media_sink_device_info_callback_ctocpp.h',
'libcef_dll/cpptoc/media_source_cpptoc.cc',
'libcef_dll/cpptoc/media_source_cpptoc.h',
'libcef_dll/cpptoc/views/menu_button_cpptoc.cc',
'libcef_dll/cpptoc/views/menu_button_cpptoc.h',
'libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc',
'libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h',
'libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.cc',
'libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.h',
'libcef_dll/cpptoc/menu_model_cpptoc.cc',
'libcef_dll/cpptoc/menu_model_cpptoc.h',
'libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc',
@@ -372,8 +328,6 @@
'libcef_dll/ctocpp/read_handler_ctocpp.h',
'libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc',
'libcef_dll/ctocpp/register_cdm_callback_ctocpp.h',
'libcef_dll/cpptoc/registration_cpptoc.cc',
'libcef_dll/cpptoc/registration_cpptoc.h',
'libcef_dll/ctocpp/render_handler_ctocpp.cc',
'libcef_dll/ctocpp/render_handler_ctocpp.h',
'libcef_dll/ctocpp/render_process_handler_ctocpp.cc',
@@ -396,12 +350,6 @@
'libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h',
'libcef_dll/ctocpp/resource_handler_ctocpp.cc',
'libcef_dll/ctocpp/resource_handler_ctocpp.h',
'libcef_dll/cpptoc/resource_read_callback_cpptoc.cc',
'libcef_dll/cpptoc/resource_read_callback_cpptoc.h',
'libcef_dll/ctocpp/resource_request_handler_ctocpp.cc',
'libcef_dll/ctocpp/resource_request_handler_ctocpp.h',
'libcef_dll/cpptoc/resource_skip_callback_cpptoc.cc',
'libcef_dll/cpptoc/resource_skip_callback_cpptoc.h',
'libcef_dll/cpptoc/response_cpptoc.cc',
'libcef_dll/cpptoc/response_cpptoc.h',
'libcef_dll/ctocpp/response_filter_ctocpp.cc',
@@ -422,10 +370,6 @@
'libcef_dll/cpptoc/views/scroll_view_cpptoc.h',
'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc',
'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h',
'libcef_dll/cpptoc/server_cpptoc.cc',
'libcef_dll/cpptoc/server_cpptoc.h',
'libcef_dll/ctocpp/server_handler_ctocpp.cc',
'libcef_dll/ctocpp/server_handler_ctocpp.h',
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc',
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.h',
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
@@ -446,34 +390,22 @@
'libcef_dll/cpptoc/thread_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_cpptoc.h',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h',
'libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h',
'libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h',
'libcef_dll/ctocpp/test/translator_test_handler_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h',
'libcef_dll/cpptoc/test/translator_test_object_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_object_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h',
'libcef_dll/cpptoc/urlrequest_cpptoc.cc',
'libcef_dll/cpptoc/urlrequest_cpptoc.h',
'libcef_dll/ctocpp/urlrequest_client_ctocpp.cc',
'libcef_dll/ctocpp/urlrequest_client_ctocpp.h',
'libcef_dll/ctocpp/v8accessor_ctocpp.cc',
'libcef_dll/ctocpp/v8accessor_ctocpp.h',
'libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc',
'libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h',
'libcef_dll/cpptoc/v8context_cpptoc.cc',
'libcef_dll/cpptoc/v8context_cpptoc.h',
'libcef_dll/cpptoc/v8exception_cpptoc.cc',
@@ -518,12 +450,8 @@
'libcef_dll/cpptoc/zip_reader_cpptoc.h',
],
'autogen_client_side': [
'libcef_dll/cpptoc/accessibility_handler_cpptoc.cc',
'libcef_dll/cpptoc/accessibility_handler_cpptoc.h',
'libcef_dll/cpptoc/app_cpptoc.cc',
'libcef_dll/cpptoc/app_cpptoc.h',
'libcef_dll/cpptoc/audio_handler_cpptoc.cc',
'libcef_dll/cpptoc/audio_handler_cpptoc.h',
'libcef_dll/ctocpp/auth_callback_ctocpp.cc',
'libcef_dll/ctocpp/auth_callback_ctocpp.h',
'libcef_dll/ctocpp/before_download_callback_ctocpp.cc',
@@ -558,8 +486,6 @@
'libcef_dll/cpptoc/context_menu_handler_cpptoc.h',
'libcef_dll/ctocpp/context_menu_params_ctocpp.cc',
'libcef_dll/ctocpp/context_menu_params_ctocpp.h',
'libcef_dll/cpptoc/cookie_access_filter_cpptoc.cc',
'libcef_dll/cpptoc/cookie_access_filter_cpptoc.h',
'libcef_dll/ctocpp/cookie_manager_ctocpp.cc',
'libcef_dll/ctocpp/cookie_manager_ctocpp.h',
'libcef_dll/cpptoc/cookie_visitor_cpptoc.cc',
@@ -572,8 +498,6 @@
'libcef_dll/cpptoc/domvisitor_cpptoc.h',
'libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc',
'libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h',
'libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.cc',
'libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.h',
'libcef_dll/cpptoc/dialog_handler_cpptoc.cc',
'libcef_dll/cpptoc/dialog_handler_cpptoc.h',
'libcef_dll/ctocpp/dictionary_value_ctocpp.cc',
@@ -596,10 +520,6 @@
'libcef_dll/cpptoc/drag_handler_cpptoc.h',
'libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc',
'libcef_dll/cpptoc/end_tracing_callback_cpptoc.h',
'libcef_dll/ctocpp/extension_ctocpp.cc',
'libcef_dll/ctocpp/extension_ctocpp.h',
'libcef_dll/cpptoc/extension_handler_cpptoc.cc',
'libcef_dll/cpptoc/extension_handler_cpptoc.h',
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc',
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.h',
'libcef_dll/ctocpp/views/fill_layout_ctocpp.cc',
@@ -610,8 +530,12 @@
'libcef_dll/cpptoc/focus_handler_cpptoc.h',
'libcef_dll/ctocpp/frame_ctocpp.cc',
'libcef_dll/ctocpp/frame_ctocpp.h',
'libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.cc',
'libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h',
'libcef_dll/ctocpp/geolocation_callback_ctocpp.cc',
'libcef_dll/ctocpp/geolocation_callback_ctocpp.h',
'libcef_dll/cpptoc/geolocation_handler_cpptoc.cc',
'libcef_dll/cpptoc/geolocation_handler_cpptoc.h',
'libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc',
'libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h',
'libcef_dll/ctocpp/image_ctocpp.cc',
'libcef_dll/ctocpp/image_ctocpp.h',
'libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc',
@@ -630,26 +554,10 @@
'libcef_dll/ctocpp/list_value_ctocpp.h',
'libcef_dll/cpptoc/load_handler_cpptoc.cc',
'libcef_dll/cpptoc/load_handler_cpptoc.h',
'libcef_dll/cpptoc/media_observer_cpptoc.cc',
'libcef_dll/cpptoc/media_observer_cpptoc.h',
'libcef_dll/ctocpp/media_route_ctocpp.cc',
'libcef_dll/ctocpp/media_route_ctocpp.h',
'libcef_dll/cpptoc/media_route_create_callback_cpptoc.cc',
'libcef_dll/cpptoc/media_route_create_callback_cpptoc.h',
'libcef_dll/ctocpp/media_router_ctocpp.cc',
'libcef_dll/ctocpp/media_router_ctocpp.h',
'libcef_dll/ctocpp/media_sink_ctocpp.cc',
'libcef_dll/ctocpp/media_sink_ctocpp.h',
'libcef_dll/cpptoc/media_sink_device_info_callback_cpptoc.cc',
'libcef_dll/cpptoc/media_sink_device_info_callback_cpptoc.h',
'libcef_dll/ctocpp/media_source_ctocpp.cc',
'libcef_dll/ctocpp/media_source_ctocpp.h',
'libcef_dll/ctocpp/views/menu_button_ctocpp.cc',
'libcef_dll/ctocpp/views/menu_button_ctocpp.h',
'libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc',
'libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h',
'libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.cc',
'libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.h',
'libcef_dll/ctocpp/menu_model_ctocpp.cc',
'libcef_dll/ctocpp/menu_model_ctocpp.h',
'libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc',
@@ -682,8 +590,6 @@
'libcef_dll/cpptoc/read_handler_cpptoc.h',
'libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc',
'libcef_dll/cpptoc/register_cdm_callback_cpptoc.h',
'libcef_dll/ctocpp/registration_ctocpp.cc',
'libcef_dll/ctocpp/registration_ctocpp.h',
'libcef_dll/cpptoc/render_handler_cpptoc.cc',
'libcef_dll/cpptoc/render_handler_cpptoc.h',
'libcef_dll/cpptoc/render_process_handler_cpptoc.cc',
@@ -706,12 +612,6 @@
'libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h',
'libcef_dll/cpptoc/resource_handler_cpptoc.cc',
'libcef_dll/cpptoc/resource_handler_cpptoc.h',
'libcef_dll/ctocpp/resource_read_callback_ctocpp.cc',
'libcef_dll/ctocpp/resource_read_callback_ctocpp.h',
'libcef_dll/cpptoc/resource_request_handler_cpptoc.cc',
'libcef_dll/cpptoc/resource_request_handler_cpptoc.h',
'libcef_dll/ctocpp/resource_skip_callback_ctocpp.cc',
'libcef_dll/ctocpp/resource_skip_callback_ctocpp.h',
'libcef_dll/ctocpp/response_ctocpp.cc',
'libcef_dll/ctocpp/response_ctocpp.h',
'libcef_dll/cpptoc/response_filter_cpptoc.cc',
@@ -732,10 +632,6 @@
'libcef_dll/ctocpp/views/scroll_view_ctocpp.h',
'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc',
'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h',
'libcef_dll/ctocpp/server_ctocpp.cc',
'libcef_dll/ctocpp/server_ctocpp.h',
'libcef_dll/cpptoc/server_handler_cpptoc.cc',
'libcef_dll/cpptoc/server_handler_cpptoc.h',
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc',
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.h',
'libcef_dll/ctocpp/stream_reader_ctocpp.cc',
@@ -756,34 +652,22 @@
'libcef_dll/ctocpp/thread_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_ctocpp.h',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h',
'libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h',
'libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h',
'libcef_dll/cpptoc/test/translator_test_handler_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h',
'libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.cc',
'libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h',
'libcef_dll/ctocpp/test/translator_test_object_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_object_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h',
'libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.cc',
'libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h',
'libcef_dll/ctocpp/urlrequest_ctocpp.cc',
'libcef_dll/ctocpp/urlrequest_ctocpp.h',
'libcef_dll/cpptoc/urlrequest_client_cpptoc.cc',
'libcef_dll/cpptoc/urlrequest_client_cpptoc.h',
'libcef_dll/cpptoc/v8accessor_cpptoc.cc',
'libcef_dll/cpptoc/v8accessor_cpptoc.h',
'libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc',
'libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h',
'libcef_dll/ctocpp/v8context_ctocpp.cc',
'libcef_dll/ctocpp/v8context_ctocpp.h',
'libcef_dll/ctocpp/v8exception_ctocpp.cc',

View File

@@ -13,6 +13,7 @@
'include/base/cef_build.h',
'include/base/cef_callback.h',
'include/base/cef_callback_forward.h',
'include/base/cef_callback_helpers.h',
'include/base/cef_callback_list.h',
'include/base/cef_cancelable_callback.h',
'include/base/cef_lock.h',
@@ -25,6 +26,7 @@
'include/base/cef_string16.h',
'include/base/cef_template_util.h',
'include/base/cef_thread_checker.h',
'include/base/cef_thread_collision_warner.h',
'include/base/cef_trace_event.h',
'include/base/cef_tuple.h',
'include/base/cef_weak_ptr.h',
@@ -33,26 +35,22 @@
'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_config.h',
'include/cef_version.h',
'include/internal/cef_export.h',
'include/internal/cef_ptr.h',
'include/internal/cef_string_wrappers.h',
'include/internal/cef_types_wrappers.h',
],
'includes_common_capi': [
'include/internal/cef_logging_internal.h',
'include/internal/cef_ptr.h',
'include/internal/cef_string.h',
'include/internal/cef_string_list.h',
'include/internal/cef_string_map.h',
'include/internal/cef_string_multimap.h',
'include/internal/cef_string_types.h',
'include/internal/cef_string_wrappers.h',
'include/internal/cef_thread_internal.h',
'include/internal/cef_time.h',
'include/internal/cef_trace_event_internal.h',
'include/internal/cef_types.h',
'include/internal/cef_types_wrappers.h',
],
'includes_capi': [
'include/capi/cef_base_capi.h',
@@ -68,54 +66,35 @@
'include/wrapper/cef_xml_object.h',
'include/wrapper/cef_zip_archive.h',
],
'includes_wrapper_mac': [
'include/wrapper/cef_library_loader.h',
],
'includes_win': [
'include/base/internal/cef_atomicops_arm64_msvc.h',
'include/base/internal/cef_atomicops_x86_msvc.h',
'include/base/internal/cef_bind_internal_win.h',
'include/cef_sandbox_win.h',
'include/internal/cef_win.h',
],
'includes_win_capi': [
'include/internal/cef_types_win.h',
'include/internal/cef_win.h',
],
'includes_mac': [
'include/base/internal/cef_atomicops_atomicword_compat.h',
'include/base/internal/cef_atomicops_mac.h',
'include/cef_application_mac.h',
'include/cef_sandbox_mac.h',
'include/internal/cef_mac.h',
],
'includes_mac_capi': [
'include/internal/cef_types_mac.h',
],
'includes_linux': [
'include/base/internal/cef_atomicops_atomicword_compat.h',
'include/base/internal/cef_atomicops_arm_gcc.h',
'include/base/internal/cef_atomicops_arm64_gcc.h',
'include/base/internal/cef_atomicops_x86_gcc.h',
'include/internal/cef_linux.h',
],
'includes_linux_capi': [
'include/internal/cef_types_linux.h',
],
'libcef_sources_common': [
'libcef_dll/cpptoc/cpptoc_ref_counted.h',
'libcef_dll/cpptoc/cpptoc_scoped.h',
'libcef_dll/ctocpp/base_ref_counted_ctocpp.cc',
'libcef_dll/ctocpp/base_ref_counted_ctocpp.h',
'libcef_dll/ctocpp/base_scoped_ctocpp.cc',
'libcef_dll/ctocpp/base_scoped_ctocpp.h',
'libcef_dll/ctocpp/ctocpp_ref_counted.h',
'libcef_dll/ctocpp/ctocpp_scoped.h',
'libcef_dll/cpptoc/cpptoc.h',
'libcef_dll/ctocpp/base_ctocpp.cc',
'libcef_dll/ctocpp/base_ctocpp.h',
'libcef_dll/ctocpp/ctocpp.h',
'libcef_dll/libcef_dll.cc',
'libcef_dll/libcef_dll2.cc',
'libcef_dll/ptr_util.h',
'libcef_dll/resource.h',
'libcef_dll/shutdown_checker.cc',
'libcef_dll/shutdown_checker.h',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',
@@ -123,6 +102,7 @@
'libcef_dll_wrapper_sources_base': [
'libcef_dll/base/cef_atomicops_x86_gcc.cc',
'libcef_dll/base/cef_bind_helpers.cc',
'libcef_dll/base/cef_callback_helpers.cc',
'libcef_dll/base/cef_callback_internal.cc',
'libcef_dll/base/cef_lock.cc',
'libcef_dll/base/cef_lock_impl.cc',
@@ -130,20 +110,14 @@
'libcef_dll/base/cef_ref_counted.cc',
'libcef_dll/base/cef_string16.cc',
'libcef_dll/base/cef_thread_checker_impl.cc',
'libcef_dll/base/cef_thread_collision_warner.cc',
'libcef_dll/base/cef_weak_ptr.cc',
],
'libcef_dll_wrapper_sources_common': [
'libcef_dll/cpptoc/base_ref_counted_cpptoc.cc',
'libcef_dll/cpptoc/base_ref_counted_cpptoc.h',
'libcef_dll/cpptoc/base_scoped_cpptoc.cc',
'libcef_dll/cpptoc/base_scoped_cpptoc.h',
'libcef_dll/cpptoc/cpptoc_ref_counted.h',
'libcef_dll/cpptoc/cpptoc_scoped.h',
'libcef_dll/ctocpp/ctocpp_ref_counted.h',
'libcef_dll/ctocpp/ctocpp_scoped.h',
'libcef_dll/ptr_util.h',
'libcef_dll/shutdown_checker.cc',
'libcef_dll/shutdown_checker.h',
'libcef_dll/cpptoc/base_cpptoc.cc',
'libcef_dll/cpptoc/base_cpptoc.h',
'libcef_dll/cpptoc/cpptoc.h',
'libcef_dll/ctocpp/ctocpp.h',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',
@@ -159,17 +133,9 @@
'libcef_dll/wrapper/libcef_dll_wrapper.cc',
'libcef_dll/wrapper/libcef_dll_wrapper2.cc',
],
'libcef_dll_wrapper_sources_mac': [
'libcef_dll/wrapper/cef_library_loader_mac.mm',
'libcef_dll/wrapper/libcef_dll_dylib.cc',
],
'shared_sources_browser': [
'tests/shared/browser/client_app_browser.cc',
'tests/shared/browser/client_app_browser.h',
'tests/shared/browser/extension_util.cc',
'tests/shared/browser/extension_util.h',
'tests/shared/browser/file_util.cc',
'tests/shared/browser/file_util.h',
'tests/shared/browser/geometry_util.cc',
'tests/shared/browser/geometry_util.h',
'tests/shared/browser/main_message_loop.cc',
@@ -179,6 +145,8 @@
'tests/shared/browser/main_message_loop_std.cc',
'tests/shared/browser/main_message_loop_std.h',
'tests/shared/browser/resource_util.h',
'tests/shared/browser/resource_util.cc',
'tests/shared/browser/resource_util.h',
],
'shared_sources_common': [
'tests/shared/common/client_app.cc',
@@ -238,18 +206,13 @@
'tests/cefclient/browser/dialog_test.h',
'tests/cefclient/browser/drm_test.cc',
'tests/cefclient/browser/drm_test.h',
'tests/cefclient/browser/image_cache.cc',
'tests/cefclient/browser/image_cache.h',
'tests/cefclient/browser/main_context.cc',
'tests/cefclient/browser/main_context.h',
'tests/cefclient/browser/main_context_impl.cc',
'tests/cefclient/browser/main_context_impl.h',
'tests/cefclient/browser/media_router_test.cc',
'tests/cefclient/browser/media_router_test.h',
'tests/cefclient/browser/osr_dragdrop_events.h',
'tests/cefclient/browser/osr_renderer.h',
'tests/cefclient/browser/osr_renderer.cc',
'tests/cefclient/browser/osr_renderer_settings.h',
'tests/cefclient/browser/preferences_test.cc',
'tests/cefclient/browser/preferences_test.h',
'tests/cefclient/browser/resource.h',
@@ -262,8 +225,6 @@
'tests/cefclient/browser/root_window_manager.h',
'tests/cefclient/browser/scheme_test.cc',
'tests/cefclient/browser/scheme_test.h',
'tests/cefclient/browser/server_test.cc',
'tests/cefclient/browser/server_test.h',
'tests/cefclient/browser/temp_window.h',
'tests/cefclient/browser/test_runner.cc',
'tests/cefclient/browser/test_runner.h',
@@ -295,7 +256,6 @@
'tests/cefclient/resources/drm.html',
'tests/cefclient/resources/localstorage.html',
'tests/cefclient/resources/logo.png',
'tests/cefclient/resources/media_router.html',
'tests/cefclient/resources/menu_icon.1x.png',
'tests/cefclient/resources/menu_icon.2x.png',
'tests/cefclient/resources/other_tests.html',
@@ -303,20 +263,11 @@
'tests/cefclient/resources/performance2.html',
'tests/cefclient/resources/preferences.html',
'tests/cefclient/resources/response_filter.html',
'tests/cefclient/resources/server.html',
'tests/cefclient/resources/transparency.html',
'tests/cefclient/resources/urlrequest.html',
'tests/cefclient/resources/websocket.html',
'tests/cefclient/resources/window.html',
'tests/cefclient/resources/xmlhttprequest.html',
],
'cefclient_sources_resources_extensions_set_page_color': [
'tests/cefclient/resources/extensions/set_page_color/icon.png',
'tests/cefclient/resources/extensions/set_page_color/manifest.json',
'tests/cefclient/resources/extensions/set_page_color/popup.html',
'tests/cefclient/resources/extensions/set_page_color/popup.js',
'tests/cefclient/resources/extensions/set_page_color/README.md',
],
'cefclient_sources_win': [
'tests/cefclient/browser/browser_window_osr_win.cc',
'tests/cefclient/browser/browser_window_osr_win.h',
@@ -325,23 +276,10 @@
'tests/cefclient/browser/main_context_impl_win.cc',
'tests/cefclient/browser/main_message_loop_multithreaded_win.cc',
'tests/cefclient/browser/main_message_loop_multithreaded_win.h',
'tests/cefclient/browser/osr_accessibility_helper.cc',
'tests/cefclient/browser/osr_accessibility_helper.h',
'tests/cefclient/browser/osr_accessibility_node.cc',
'tests/cefclient/browser/osr_accessibility_node.h',
'tests/cefclient/browser/osr_accessibility_node_win.cc',
'tests/cefclient/browser/osr_dragdrop_win.cc',
'tests/cefclient/browser/osr_dragdrop_win.h',
'tests/cefclient/browser/osr_ime_handler_win.cc',
'tests/cefclient/browser/osr_ime_handler_win.h',
'tests/cefclient/browser/osr_d3d11_win.cc',
'tests/cefclient/browser/osr_d3d11_win.h',
'tests/cefclient/browser/osr_render_handler_win.cc',
'tests/cefclient/browser/osr_render_handler_win.h',
'tests/cefclient/browser/osr_render_handler_win_d3d11.cc',
'tests/cefclient/browser/osr_render_handler_win_d3d11.h',
'tests/cefclient/browser/osr_render_handler_win_gl.cc',
'tests/cefclient/browser/osr_render_handler_win_gl.h',
'tests/cefclient/browser/osr_window_win.cc',
'tests/cefclient/browser/osr_window_win.h',
'tests/cefclient/browser/resource_util_win_idmap.cc',
@@ -351,10 +289,6 @@
'tests/cefclient/browser/root_window_win.h',
'tests/cefclient/browser/temp_window_win.cc',
'tests/cefclient/browser/temp_window_win.h',
'tests/cefclient/browser/views_menu_bar.cc',
'tests/cefclient/browser/views_menu_bar.h',
'tests/cefclient/browser/views_style.cc',
'tests/cefclient/browser/views_style.h',
'tests/cefclient/browser/views_window.cc',
'tests/cefclient/browser/views_window.h',
'tests/cefclient/browser/window_test_runner_views.cc',
@@ -362,11 +296,9 @@
'tests/cefclient/browser/window_test_runner_win.cc',
'tests/cefclient/browser/window_test_runner_win.h',
'tests/cefclient/cefclient_win.cc',
'tests/cefclient/resources/win/cefclient.rc',
],
'cefclient_sources_resources_win': [
'tests/cefclient/resources/win/cefclient.exe.manifest',
'tests/cefclient/resources/win/cefclient.ico',
'tests/cefclient/resources/win/cefclient.rc',
'tests/cefclient/resources/win/small.ico',
],
'cefclient_sources_mac': [
@@ -375,11 +307,6 @@
'tests/cefclient/browser/browser_window_std_mac.h',
'tests/cefclient/browser/browser_window_std_mac.mm',
'tests/cefclient/browser/main_context_impl_posix.cc',
'tests/cefclient/browser/osr_accessibility_helper.cc',
'tests/cefclient/browser/osr_accessibility_helper.h',
'tests/cefclient/browser/osr_accessibility_node.cc',
'tests/cefclient/browser/osr_accessibility_node.h',
'tests/cefclient/browser/osr_accessibility_node_mac.mm',
'tests/cefclient/browser/root_window_mac.h',
'tests/cefclient/browser/root_window_mac.mm',
'tests/cefclient/browser/temp_window_mac.h',
@@ -404,8 +331,6 @@
'tests/cefclient/browser/dialog_handler_gtk.cc',
'tests/cefclient/browser/dialog_handler_gtk.h',
'tests/cefclient/browser/main_context_impl_posix.cc',
'tests/cefclient/browser/main_message_loop_multithreaded_gtk.cc',
'tests/cefclient/browser/main_message_loop_multithreaded_gtk.h',
'tests/cefclient/browser/print_handler_gtk.cc',
'tests/cefclient/browser/print_handler_gtk.h',
'tests/cefclient/browser/resource_util_linux.cc',
@@ -415,12 +340,6 @@
'tests/cefclient/browser/root_window_views.h',
'tests/cefclient/browser/temp_window_x11.cc',
'tests/cefclient/browser/temp_window_x11.h',
'tests/cefclient/browser/util_gtk.cc',
'tests/cefclient/browser/util_gtk.h',
'tests/cefclient/browser/views_menu_bar.cc',
'tests/cefclient/browser/views_menu_bar.h',
'tests/cefclient/browser/views_style.cc',
'tests/cefclient/browser/views_style.h',
'tests/cefclient/browser/views_window.cc',
'tests/cefclient/browser/views_window.h',
'tests/cefclient/browser/window_test_runner_gtk.cc',
@@ -436,13 +355,11 @@
'tests/cefsimple/simple_handler.h',
],
'cefsimple_sources_win': [
'tests/cefsimple/cefsimple.exe.manifest',
'tests/cefsimple/cefsimple.rc',
'tests/cefsimple/cefsimple_win.cc',
'tests/cefsimple/simple_handler_win.cc',
'tests/cefsimple/resource.h',
],
'cefsimple_sources_resources_win': [
'tests/cefsimple/cefsimple.exe.manifest',
'tests/cefsimple/res/cefsimple.ico',
'tests/cefsimple/res/small.ico',
],
@@ -464,26 +381,19 @@
'tests/cefsimple/simple_handler_linux.cc',
],
'ceftests_sources_common': [
'tests/ceftests/audio_output_unittest.cc',
'tests/ceftests/browser_info_map_unittest.cc',
'tests/ceftests/command_line_unittest.cc',
'tests/ceftests/cookie_unittest.cc',
'tests/ceftests/cors_unittest.cc',
'tests/ceftests/devtools_message_unittest.cc',
'tests/ceftests/dialog_unittest.cc',
'tests/ceftests/display_unittest.cc',
'tests/ceftests/dom_unittest.cc',
'tests/ceftests/download_unittest.cc',
'tests/ceftests/draggable_regions_unittest.cc',
'tests/ceftests/extensions/background_unittest.cc',
'tests/ceftests/extensions/chrome_alarms_unittest.cc',
'tests/ceftests/extensions/chrome_storage_unittest.cc',
'tests/ceftests/extensions/chrome_tabs_unittest.cc',
'tests/ceftests/extensions/extension_test_handler.cc',
'tests/ceftests/extensions/extension_test_handler.h',
'tests/ceftests/extensions/view_unittest.cc',
'tests/ceftests/file_util.cc',
'tests/ceftests/file_util.h',
'tests/ceftests/file_util_unittest.cc',
'tests/ceftests/frame_unittest.cc',
'tests/ceftests/geolocation_unittest.cc',
'tests/ceftests/image_unittest.cc',
'tests/ceftests/image_util.cc',
'tests/ceftests/image_util.h',
@@ -492,8 +402,6 @@
'tests/ceftests/message_router_unittest.cc',
'tests/ceftests/navigation_unittest.cc',
'tests/ceftests/os_rendering_unittest.cc',
'tests/ceftests/osr_accessibility_unittest.cc',
'tests/ceftests/osr_display_unittest.cc',
'tests/ceftests/parser_unittest.cc',
'tests/ceftests/plugin_unittest.cc',
'tests/ceftests/preference_unittest.cc',
@@ -502,16 +410,13 @@
'tests/ceftests/request_context_unittest.cc',
'tests/ceftests/request_handler_unittest.cc',
'tests/ceftests/request_unittest.cc',
'tests/ceftests/response_unittest.cc',
'tests/ceftests/resource.h',
'tests/ceftests/resource_manager_unittest.cc',
'tests/ceftests/resource_request_handler_unittest.cc',
'tests/ceftests/routing_test_handler.cc',
'tests/ceftests/routing_test_handler.h',
'tests/ceftests/run_all_unittests.cc',
'tests/ceftests/scheme_handler_unittest.cc',
'tests/ceftests/scoped_temp_dir_unittest.cc',
'tests/ceftests/server_unittest.cc',
'tests/ceftests/stream_unittest.cc',
'tests/ceftests/stream_resource_handler_unittest.cc',
'tests/ceftests/string_unittest.cc',
@@ -519,11 +424,6 @@
'tests/ceftests/task_unittest.cc',
'tests/ceftests/test_handler.cc',
'tests/ceftests/test_handler.h',
'tests/ceftests/test_request.cc',
'tests/ceftests/test_request.h',
'tests/ceftests/test_server.cc',
'tests/ceftests/test_server.h',
'tests/ceftests/test_server_unittest.cc',
'tests/ceftests/test_suite.cc',
'tests/ceftests/test_suite.h',
'tests/ceftests/test_util.cc',
@@ -532,7 +432,6 @@
'tests/ceftests/thread_helper.h',
'tests/ceftests/thread_unittest.cc',
'tests/ceftests/tracing_unittest.cc',
'tests/ceftests/track_callback.h',
'tests/ceftests/translator_unittest.cc',
'tests/ceftests/urlrequest_unittest.cc',
'tests/ceftests/v8_unittest.cc',
@@ -554,11 +453,9 @@
],
'ceftests_sources_win': [
'tests/ceftests/resource_util_win_idmap.cc',
'tests/ceftests/resources/win/ceftests.rc',
],
'ceftests_sources_resources_win': [
'tests/ceftests/resources/win/ceftests.exe.manifest',
'tests/ceftests/resources/win/ceftests.ico',
'tests/ceftests/resources/win/ceftests.rc',
'tests/ceftests/resources/win/small.ico',
],
'ceftests_sources_mac': [
@@ -567,15 +464,15 @@
'tests/ceftests/run_all_unittests_mac.mm',
],
'ceftests_sources_mac_helper': [
'tests/shared/browser/file_util.cc',
'tests/shared/browser/file_util.h',
'tests/shared/browser/resource_util.cc',
'tests/shared/browser/resource_util.h',
'tests/shared/browser/resource_util_mac.mm',
'tests/shared/browser/resource_util_posix.cc',
'tests/ceftests/audio_output_unittest.cc',
'tests/ceftests/client_app_delegates.cc',
'tests/ceftests/cookie_unittest.cc',
'tests/ceftests/dom_unittest.cc',
'tests/ceftests/file_util.cc',
'tests/ceftests/file_util.h',
'tests/ceftests/frame_unittest.cc',
'tests/ceftests/message_router_unittest.cc',
'tests/ceftests/navigation_unittest.cc',
@@ -584,23 +481,16 @@
'tests/ceftests/process_message_unittest.cc',
'tests/ceftests/request_handler_unittest.cc',
'tests/ceftests/request_unittest.cc',
'tests/ceftests/response_unittest.cc',
'tests/ceftests/resource_request_handler_unittest.cc',
'tests/ceftests/routing_test_handler.cc',
'tests/ceftests/routing_test_handler.h',
'tests/ceftests/scheme_handler_unittest.cc',
'tests/ceftests/urlrequest_unittest.cc',
'tests/ceftests/test_handler.cc',
'tests/ceftests/test_handler.h',
'tests/ceftests/test_request.cc',
'tests/ceftests/test_request.h',
'tests/ceftests/test_server.cc',
'tests/ceftests/test_server.h',
'tests/ceftests/test_suite.cc',
'tests/ceftests/test_suite.h',
'tests/ceftests/test_util.cc',
'tests/ceftests/test_util.h',
'tests/ceftests/track_callback.h',
'tests/ceftests/thread_helper.cc',
'tests/ceftests/thread_helper.h',
'tests/ceftests/thread_unittest.cc',

View File

@@ -34,13 +34,10 @@ template("_repack_one_locale") {
"${root_gen_dir}/chrome/generated_resources_${locale}.pak",
"${root_gen_dir}/chrome/locale_settings_${locale}.pak",
"${root_gen_dir}/chrome/platform_locale_settings_${locale}.pak",
"${root_gen_dir}/components/omnibox/resources/omnibox_resources_${locale}.pak",
"${root_gen_dir}/components/strings/components_chromium_strings_${locale}.pak",
"${root_gen_dir}/components/strings/components_locale_settings_${locale}.pak",
"${root_gen_dir}/components/strings/components_strings_${locale}.pak",
"${root_gen_dir}/content/app/strings/content_strings_${locale}.pak",
"${root_gen_dir}/extensions/strings/extensions_strings_${locale}.pak",
"${root_gen_dir}/services/strings/services_strings_${locale}.pak",
"${root_gen_dir}/third_party/blink/public/strings/blink_strings_${locale}.pak",
"${root_gen_dir}/ui/strings/app_locale_settings_${locale}.pak",
"${root_gen_dir}/ui/strings/ui_strings_${locale}.pak",
]
@@ -54,13 +51,10 @@ template("_repack_one_locale") {
"//chrome/app:generated_resources",
"//chrome/app/resources:locale_settings",
"//chrome/app/resources:platform_locale_settings",
"//components/omnibox/resources:omnibox_resources",
"//components/strings:components_chromium_strings",
"//components/strings:components_locale_settings",
"//components/strings:components_strings",
"//content/app/strings",
"//extensions/strings",
"//services/strings",
"//third_party/blink/public/strings",
"//ui/strings:app_locale_settings",
"//ui/strings:ui_strings",
]

View File

@@ -19,23 +19,22 @@ macro(PRINT_CEF_CONFIG)
message(STATUS "Platform: ${CMAKE_SYSTEM_NAME}")
message(STATUS "Project architecture: ${PROJECT_ARCH}")
if(GEN_NINJA OR GEN_MAKEFILES)
if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
endif()
message(STATUS "Binary distribution root: ${_CEF_ROOT}")
if(OS_MAC)
if(OS_MACOSX)
message(STATUS "Base SDK: ${CMAKE_OSX_SYSROOT}")
message(STATUS "Target SDK: ${CEF_TARGET_SDK}")
endif()
if(OS_WINDOWS)
message(STATUS "CEF Windows sandbox: ${USE_SANDBOX}")
message(STATUS "Visual Studio ATL support: ${USE_ATL}")
endif()
message(STATUS "CEF sandbox: ${USE_SANDBOX}")
set(_libraries ${CEF_STANDARD_LIBS})
if(OS_WINDOWS AND USE_SANDBOX)
list(APPEND _libraries ${CEF_SANDBOX_STANDARD_LIBS})
@@ -75,14 +74,15 @@ macro(APPEND_PLATFORM_SOURCES name_of_list)
if(OS_WINDOWS AND ${name_of_list}_WINDOWS)
list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS})
endif()
if(OS_MAC AND ${name_of_list}_MAC)
list(APPEND ${name_of_list} ${${name_of_list}_MAC})
if(OS_MACOSX AND ${name_of_list}_MACOSX)
list(APPEND ${name_of_list} ${${name_of_list}_MACOSX})
endif()
endmacro()
# Determine the target output directory based on platform and generator.
macro(SET_CEF_TARGET_OUT_DIR)
if(GEN_NINJA OR GEN_MAKEFILES)
if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR
${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
# By default Ninja and Make builds don't create a subdirectory named after
# the configuration.
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
@@ -102,19 +102,7 @@ macro(COPY_FILES target file_list source_dir target_dir)
set(source_file ${source_dir}/${FILENAME})
get_filename_component(target_name ${FILENAME} NAME)
set(target_file ${target_dir}/${target_name})
string(FIND ${source_file} "$<CONFIGURATION>" _pos)
if(NOT ${_pos} EQUAL -1)
# Must test with an actual configuration directory.
string(REPLACE "$<CONFIGURATION>" "Release" existing_source_file ${source_file})
if(NOT EXISTS ${existing_source_file})
string(REPLACE "$<CONFIGURATION>" "Debug" existing_source_file ${source_file})
endif()
else()
set(existing_source_file ${source_file})
endif()
if(IS_DIRECTORY ${existing_source_file})
if(IS_DIRECTORY ${source_file})
add_custom_command(
TARGET ${target}
POST_BUILD
@@ -184,10 +172,26 @@ endif(OS_LINUX)
# Mac OS X macros.
#
if(OS_MAC)
if(OS_MACOSX)
# Fix the framework rpath in the helper executable.
macro(FIX_MACOSX_HELPER_FRAMEWORK_RPATH target)
# The helper is in $app_name.app/Contents/Frameworks/$app_name Helper.app/Contents/MacOS/
# so set rpath up to Contents/ so that the loader can find Frameworks/.
set_target_properties(${target} PROPERTIES INSTALL_RPATH "@executable_path/../../../..")
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
endmacro()
# Fix the framework rpath in the main executable.
macro(FIX_MACOSX_MAIN_FRAMEWORK_RPATH target)
# The main app is at $app_name.app/Contents/MacOS/$app_name
# so set rpath up to Contents/ so that the loader can find Frameworks/.
set_target_properties(${target} PROPERTIES INSTALL_RPATH "@executable_path/..")
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
endmacro()
# Manually process and copy over resource files.
macro(COPY_MAC_RESOURCES resource_list prefix_list target source_dir app_path)
macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path)
foreach(FILENAME ${resource_list})
# Remove one or more prefixes from the source paths.
set(TARGET_FILENAME "${FILENAME}")
@@ -229,7 +233,7 @@ macro(COPY_MAC_RESOURCES resource_list prefix_list target source_dir app_path)
endforeach()
endmacro()
endif(OS_MAC)
endif(OS_MACOSX)
#
@@ -272,17 +276,17 @@ endmacro()
# SET_EXECUTABLE_TARGET_PROPERTIES() instead of calling this macro directly.
macro(SET_COMMON_TARGET_PROPERTIES target)
# Compile flags.
target_compile_options(${target} PRIVATE ${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS})
target_compile_options(${target} PRIVATE $<$<CONFIG:Debug>:${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}>)
target_compile_options(${target} PRIVATE $<$<CONFIG:Release>:${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}>)
target_compile_options(${target} PUBLIC ${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS})
target_compile_options(${target} PUBLIC $<$<CONFIG:Debug>:${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}>)
target_compile_options(${target} PUBLIC $<$<CONFIG:Release>:${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}>)
# Compile definitions.
target_compile_definitions(${target} PRIVATE ${CEF_COMPILER_DEFINES})
target_compile_definitions(${target} PRIVATE $<$<CONFIG:Debug>:${CEF_COMPILER_DEFINES_DEBUG}>)
target_compile_definitions(${target} PRIVATE $<$<CONFIG:Release>:${CEF_COMPILER_DEFINES_RELEASE}>)
target_compile_definitions(${target} PUBLIC ${CEF_COMPILER_DEFINES})
target_compile_definitions(${target} PUBLIC $<$<CONFIG:Debug>:${CEF_COMPILER_DEFINES_DEBUG}>)
target_compile_definitions(${target} PUBLIC $<$<CONFIG:Release>:${CEF_COMPILER_DEFINES_RELEASE}>)
# Include directories.
target_include_directories(${target} PRIVATE ${CEF_INCLUDE_PATH})
target_include_directories(${target} PUBLIC ${CEF_INCLUDE_PATH})
# Linker flags.
if(CEF_LINKER_FLAGS)
@@ -298,7 +302,7 @@ macro(SET_COMMON_TARGET_PROPERTIES target)
set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
endif()
if(OS_MAC)
if(OS_MACOSX)
# Set Xcode target properties.
set_target_properties(${target} PROPERTIES
XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO

View File

@@ -14,8 +14,7 @@ endif()
# Determine the platform.
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(OS_MAC 1)
set(OS_MACOSX 1) # For backwards compatibility.
set(OS_MACOSX 1)
set(OS_POSIX 1)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(OS_LINUX 1)
@@ -26,28 +25,21 @@ endif()
# Determine the project architecture.
if(NOT DEFINED PROJECT_ARCH)
if(OS_WINDOWS AND "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64")
set(PROJECT_ARCH "arm64")
elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
if(CMAKE_SIZEOF_VOID_P MATCHES 8)
set(PROJECT_ARCH "x86_64")
else()
set(PROJECT_ARCH "x86")
endif()
if(OS_MAC)
if(OS_MACOSX)
# PROJECT_ARCH should be specified on Mac OS X.
message(WARNING "No PROJECT_ARCH value specified, using ${PROJECT_ARCH}")
endif()
endif()
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
set(GEN_NINJA 1)
elseif(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(GEN_MAKEFILES 1)
endif()
# Determine the build type.
if(NOT CMAKE_BUILD_TYPE AND (GEN_NINJA OR GEN_MAKEFILES))
if(NOT CMAKE_BUILD_TYPE AND
(${CMAKE_GENERATOR} STREQUAL "Ninja" OR ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles"))
# CMAKE_BUILD_TYPE should be specified when using Ninja or Unix Makefiles.
set(CMAKE_BUILD_TYPE Release)
message(WARNING "No CMAKE_BUILD_TYPE value selected, using ${CMAKE_BUILD_TYPE}")
@@ -69,10 +61,6 @@ list(APPEND CEF_COMPILER_DEFINES
)
# Configure use of the sandbox.
option(USE_SANDBOX "Enable or disable use of the sandbox." ON)
#
# Linux configuration.
#
@@ -93,8 +81,6 @@ if(OS_LINUX)
-Werror # Treat warnings as errors
-Wno-missing-field-initializers # Don't warn about missing field initializers
-Wno-unused-parameter # Don't warn about unused parameters
-Wno-error=comment # Don't warn about code in comments
-Wno-comment # Don't warn about code in comments
)
list(APPEND CEF_C_COMPILER_FLAGS
-std=c99 # Use the C99 language standard
@@ -144,13 +130,6 @@ if(OS_LINUX)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-Wno-undefined-var-template COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
if(COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
list(APPEND CEF_CXX_COMPILER_FLAGS
-Wno-undefined-var-template # Don't warn about potentially uninstantiated static members
)
endif()
CHECK_C_COMPILER_FLAG(-Wno-unused-local-typedefs COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS)
if(COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS)
list(APPEND CEF_C_COMPILER_FLAGS
@@ -172,12 +151,6 @@ if(OS_LINUX)
)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
list(APPEND CEF_CXX_COMPILER_FLAGS
-Wno-attributes # The cfi-icall attribute is not supported by the GNU C++ compiler
)
endif()
if(PROJECT_ARCH STREQUAL "x86_64")
# 64-bit architecture.
list(APPEND CEF_COMPILER_FLAGS
@@ -219,11 +192,8 @@ if(OS_LINUX)
set(CEF_BINARY_FILES
chrome-sandbox
libcef.so
libEGL.so
libGLESv2.so
natives_blob.bin
snapshot_blob.bin
v8_context_snapshot.bin
swiftshader
)
# List of CEF resource files.
@@ -236,12 +206,6 @@ if(OS_LINUX)
icudtl.dat
locales
)
if(USE_SANDBOX)
list(APPEND CEF_COMPILER_DEFINES
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
)
endif()
endif()
@@ -249,9 +213,9 @@ endif()
# Mac OS X configuration.
#
if(OS_MAC)
if(OS_MACOSX)
# Platform-specific compiler/linker flags.
# See also Xcode target properties in cef_macros.cmake.
# See also Xcode target properties in macros.cmake.
set(CEF_LIBTYPE SHARED)
list(APPEND CEF_COMPILER_FLAGS
-fno-strict-aliasing # Avoid assumptions regarding non-aliasing of objects of different types
@@ -295,15 +259,6 @@ if(OS_MAC)
-Wl,-dead_strip # Strip dead code
)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-Wno-undefined-var-template COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
if(COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
list(APPEND CEF_CXX_COMPILER_FLAGS
-Wno-undefined-var-template # Don't warn about potentially uninstantiated static members
)
endif()
# Standard libraries.
set(CEF_STANDARD_LIBS
-lpthread
@@ -313,7 +268,7 @@ if(OS_MAC)
# Find the newest available base SDK.
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
foreach(OS_VERSION 10.15 10.14 10.13 10.12 10.11)
foreach(OS_VERSION 10.10 10.9 10.8 10.7)
set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
set(CMAKE_OSX_SYSROOT ${SDK})
@@ -321,7 +276,7 @@ if(OS_MAC)
endforeach()
# Target SDK.
set(CEF_TARGET_SDK "10.11")
set(CEF_TARGET_SDK "10.7")
list(APPEND CEF_COMPILER_FLAGS
-mmacosx-version-min=${CEF_TARGET_SDK}
)
@@ -330,38 +285,18 @@ if(OS_MAC)
# Target architecture.
if(PROJECT_ARCH STREQUAL "x86_64")
set(CMAKE_OSX_ARCHITECTURES "x86_64")
elseif(PROJECT_ARCH STREQUAL "arm64")
set(CMAKE_OSX_ARCHITECTURES "arm64")
else()
set(CMAKE_OSX_ARCHITECTURES "i386")
endif()
# Prevent Xcode 11 from doing automatic codesigning.
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
# CEF directory paths.
set(CEF_BINARY_DIR "${_CEF_ROOT}/$<CONFIGURATION>")
set(CEF_BINARY_DIR_DEBUG "${_CEF_ROOT}/Debug")
set(CEF_BINARY_DIR_RELEASE "${_CEF_ROOT}/Release")
if(USE_SANDBOX)
list(APPEND CEF_COMPILER_DEFINES
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
)
# CEF sandbox library paths.
set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a")
set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a")
endif()
# CEF Helper app suffixes.
# Format is "<name suffix>:<target suffix>:<plist suffix>".
set(CEF_HELPER_APP_SUFFIXES
"::"
" (GPU):_gpu:.gpu"
" (Plugin):_plugin:.plugin"
" (Renderer):_renderer:.renderer"
)
# CEF library paths.
set(CEF_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/Chromium Embedded Framework.framework/Chromium Embedded Framework")
set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/Chromium Embedded Framework.framework/Chromium Embedded Framework")
endif()
@@ -370,33 +305,27 @@ endif()
#
if(OS_WINDOWS)
if (GEN_NINJA)
# When using the Ninja generator clear the CMake defaults to avoid excessive
# console warnings (see issue #2120).
set(CMAKE_CXX_FLAGS "")
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_RELEASE "")
# Configure use of the sandbox.
option(USE_SANDBOX "Enable or disable use of the sandbox." ON)
if(USE_SANDBOX AND NOT MSVC_VERSION EQUAL 1900)
# The cef_sandbox.lib static library is currently built with VS2015. It will
# not link successfully with other VS versions.
set(USE_SANDBOX OFF)
endif()
if(USE_SANDBOX)
# Check if the current MSVC version is compatible with the cef_sandbox.lib
# static library. We require VS2015 or newer.
if(MSVC_VERSION LESS 1900)
message(WARNING "CEF sandbox is not compatible with the current MSVC version (${MSVC_VERSION})")
set(USE_SANDBOX OFF)
endif()
# Configure use of official build compiler settings.
# When using an official build the "Debug" build is actually a Release build
# with DCHECKs enabled. In order to link the sandbox the Debug build must
# be configured with some Release-related compiler settings.
option(USE_OFFICIAL_BUILD_SANDBOX "Enable or disable use of an official build sandbox." ON)
if(NOT USE_SANDBOX)
# Don't need official build settings when the sandbox is off.
set(USE_OFFICIAL_BUILD_SANDBOX OFF)
endif()
# Consumers who run into LNK4099 warnings can pass /Z7 instead (see issue #385).
set(CEF_DEBUG_INFO_FLAG "/Zi" CACHE STRING "Optional flag specifying specific /Z flag to use")
# Consumers using different runtime types may want to pass different flags
set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Optional flag specifying which runtime to use")
if (CEF_RUNTIME_LIBRARY_FLAG)
list(APPEND CEF_COMPILER_FLAGS_DEBUG ${CEF_RUNTIME_LIBRARY_FLAG}d)
list(APPEND CEF_COMPILER_FLAGS_RELEASE ${CEF_RUNTIME_LIBRARY_FLAG})
endif()
# Platform-specific compiler/linker flags.
set(CEF_LIBTYPE STATIC)
list(APPEND CEF_COMPILER_FLAGS
@@ -415,11 +344,24 @@ if(OS_WINDOWS)
/wd4996 # Ignore "function or variable may be unsafe" warning
${CEF_DEBUG_INFO_FLAG}
)
list(APPEND CEF_COMPILER_FLAGS_DEBUG
/RTC1 # Disable optimizations
/Od # Enable basic run-time checks
)
if(USE_OFFICIAL_BUILD_SANDBOX)
# CMake adds /RTC1, /D"_DEBUG" and a few other values by default for Debug
# builds. We can't link the sandbox with those values so clear the CMake
# defaults here.
set(CMAKE_CXX_FLAGS_DEBUG "")
list(APPEND CEF_COMPILER_FLAGS_DEBUG
/MT # Multithreaded release runtime
)
else()
list(APPEND CEF_COMPILER_FLAGS_DEBUG
/MTd # Multithreaded debug runtime
/RTC1 # Disable optimizations
/Od # Enable basic run-time checks
)
endif()
list(APPEND CEF_COMPILER_FLAGS_RELEASE
/MT # Multithreaded release runtime
/O2 # Optimize for maximum speed
/Ob2 # Inline any suitable function
/GF # Enable string pooling
@@ -434,11 +376,17 @@ if(OS_WINDOWS)
list(APPEND CEF_COMPILER_DEFINES
WIN32 _WIN32 _WINDOWS # Windows platform
UNICODE _UNICODE # Unicode build
WINVER=0x0601 _WIN32_WINNT=0x601 # Targeting Windows 7
WINVER=0x0602 _WIN32_WINNT=0x602 # Targeting Windows 8
NOMINMAX # Use the standard's templated min/max
WIN32_LEAN_AND_MEAN # Exclude less common API declarations
_HAS_EXCEPTIONS=0 # Disable exceptions
)
if(USE_OFFICIAL_BUILD_SANDBOX)
list(APPEND CEF_COMPILER_DEFINES_DEBUG
NDEBUG _NDEBUG # Not a debug build
DCHECK_ALWAYS_ON=1 # DCHECKs are enabled
)
endif()
list(APPEND CEF_COMPILER_DEFINES_RELEASE
NDEBUG _NDEBUG # Not a debug build
)
@@ -464,20 +412,15 @@ 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
libGLESv2.dll
natives_blob.bin
snapshot_blob.bin
v8_context_snapshot.bin
swiftshader
)
if(NOT PROJECT_ARCH STREQUAL "arm64")
list(APPEND CEF_BINARY_FILES
d3dcompiler_47.dll
)
endif()
# List of CEF resource files.
set(CEF_RESOURCE_FILES
cef.pak
@@ -497,17 +440,9 @@ if(OS_WINDOWS)
# Libraries required by cef_sandbox.lib.
set(CEF_SANDBOX_STANDARD_LIBS
Advapi32.lib
dbghelp.lib
Delayimp.lib
OleAut32.lib
PowrProf.lib
Propsys.lib
psapi.lib
SetupAPI.lib
Shell32.lib
version.lib
wbemuuid.lib
winmm.lib
)
@@ -519,26 +454,10 @@ if(OS_WINDOWS)
# Configure use of ATL.
option(USE_ATL "Enable or disable use of ATL." ON)
if(USE_ATL)
# Locate the atlmfc directory if it exists. It may be at any depth inside
# the VC directory. The cl.exe path returned by CMAKE_CXX_COMPILER may also
# be at different depths depending on the toolchain version
# (e.g. "VC/bin/cl.exe", "VC/bin/amd64_x86/cl.exe",
# "VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe", etc).
set(HAS_ATLMFC 0)
get_filename_component(VC_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
while(NOT ${VC_DIR_NAME} STREQUAL "VC")
get_filename_component(VC_DIR ${VC_DIR} DIRECTORY)
if(IS_DIRECTORY "${VC_DIR}/atlmfc")
set(HAS_ATLMFC 1)
break()
endif()
get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
endwhile()
# Determine if the Visual Studio install supports ATL.
if(NOT HAS_ATLMFC)
message(WARNING "ATL is not supported by your VC installation.")
get_filename_component(VC_BIN_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
get_filename_component(VC_DIR ${VC_BIN_DIR} DIRECTORY)
if(NOT IS_DIRECTORY "${VC_DIR}/atlmfc")
set(USE_ATL OFF)
endif()
endif()

View File

@@ -39,49 +39,14 @@
#define CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
#if defined(BASE_ATOMIC_REF_COUNT_H_)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts.
#elif defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/atomic_ref_count.h"
// Used when declaring a base::AtomicRefCount value. This is an object type with
// Chromium headers.
#define ATOMIC_DECLARATION (0)
// Maintaining compatibility with AtompicRefCount* functions that were removed
// from Chromium in http://crrev.com/ee96d561.
namespace base {
// Increment a reference count by 1.
inline void AtomicRefCountInc(volatile AtomicRefCount* ptr) {
const_cast<AtomicRefCount*>(ptr)->Increment();
}
// Decrement a reference count by 1 and return whether the result is non-zero.
// Insert barriers to ensure that state written before the reference count
// became zero will be visible to a thread that has just made the count zero.
inline bool AtomicRefCountDec(volatile AtomicRefCount* ptr) {
return const_cast<AtomicRefCount*>(ptr)->Decrement();
}
// Return whether the reference count is one. If the reference count is used
// in the conventional way, a refrerence count of 1 implies that the current
// thread owns the reference and no other thread shares it. This call performs
// the test for a reference count of one, and performs the memory barrier
// needed for the owning thread to act on the object, knowing that it has
// exclusive access to the object.
inline bool AtomicRefCountIsOne(volatile AtomicRefCount* ptr) {
return const_cast<AtomicRefCount*>(ptr)->IsOne();
}
// Return whether the reference count is zero. With conventional object
// referencing counting, the object will be destroyed, so the reference count
// should never be zero. Hence this is generally used for a debug check.
inline bool AtomicRefCountIsZero(volatile AtomicRefCount* ptr) {
return const_cast<AtomicRefCount*>(ptr)->IsZero();
}
} // namespace base
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
@@ -91,18 +56,14 @@ inline bool AtomicRefCountIsZero(volatile AtomicRefCount* ptr) {
// Annotations are not currently supported.
#define ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
#define ANNOTATE_HAPPENS_AFTER(obj) /* empty */
// Used when declaring a base::AtomicRefCount value. This is an integer/ptr type
// with CEF headers.
#define ATOMIC_DECLARATION = 0
#define ANNOTATE_HAPPENS_AFTER(obj) /* empty */
namespace base {
typedef subtle::Atomic32 AtomicRefCount;
// Increment a reference count by "increment", which must exceed 0.
inline void AtomicRefCountIncN(volatile AtomicRefCount* ptr,
inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr,
AtomicRefCount increment) {
subtle::NoBarrier_AtomicIncrement(ptr, increment);
}
@@ -111,7 +72,7 @@ inline void AtomicRefCountIncN(volatile AtomicRefCount* ptr,
// and return whether the result is non-zero.
// Insert barriers to ensure that state written before the reference count
// became zero will be visible to a thread that has just made the count zero.
inline bool AtomicRefCountDecN(volatile AtomicRefCount* ptr,
inline bool AtomicRefCountDecN(volatile AtomicRefCount *ptr,
AtomicRefCount decrement) {
ANNOTATE_HAPPENS_BEFORE(ptr);
bool res = (subtle::Barrier_AtomicIncrement(ptr, -decrement) != 0);
@@ -122,14 +83,14 @@ inline bool AtomicRefCountDecN(volatile AtomicRefCount* ptr,
}
// Increment a reference count by 1.
inline void AtomicRefCountInc(volatile AtomicRefCount* ptr) {
inline void AtomicRefCountInc(volatile AtomicRefCount *ptr) {
base::AtomicRefCountIncN(ptr, 1);
}
// Decrement a reference count by 1 and return whether the result is non-zero.
// Insert barriers to ensure that state written before the reference count
// became zero will be visible to a thread that has just made the count zero.
inline bool AtomicRefCountDec(volatile AtomicRefCount* ptr) {
inline bool AtomicRefCountDec(volatile AtomicRefCount *ptr) {
return base::AtomicRefCountDecN(ptr, 1);
}
@@ -139,7 +100,7 @@ inline bool AtomicRefCountDec(volatile AtomicRefCount* ptr) {
// the test for a reference count of one, and performs the memory barrier
// needed for the owning thread to act on the object, knowing that it has
// exclusive access to the object.
inline bool AtomicRefCountIsOne(volatile AtomicRefCount* ptr) {
inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) {
bool res = (subtle::Acquire_Load(ptr) == 1);
if (res) {
ANNOTATE_HAPPENS_AFTER(ptr);
@@ -150,7 +111,7 @@ inline bool AtomicRefCountIsOne(volatile AtomicRefCount* ptr) {
// Return whether the reference count is zero. With conventional object
// referencing counting, the object will be destroyed, so the reference count
// should never be zero. Hence this is generally used for a debug check.
inline bool AtomicRefCountIsZero(volatile AtomicRefCount* ptr) {
inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
bool res = (subtle::Acquire_Load(ptr) == 0);
if (res) {
ANNOTATE_HAPPENS_AFTER(ptr);

View File

@@ -122,7 +122,8 @@ Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value);
// *ptr with the increment applied. This routine implies no memory barriers.
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment);
// These following lower-level operations are typically useful only to people
// implementing higher-level synchronization operations like spinlocks,
@@ -178,14 +179,10 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
// Include our platform specific implementation.
#if defined(OS_WIN) && defined(COMPILER_MSVC) && defined(ARCH_CPU_X86_FAMILY)
#include "include/base/internal/cef_atomicops_x86_msvc.h"
#elif defined(OS_WIN) && (defined(__ARM_ARCH_ISA_A64) || defined(_M_ARM64))
#include "include/base/internal/cef_atomicops_arm64_msvc.h"
#elif defined(OS_MAC)
#elif defined(OS_MACOSX)
#include "include/base/internal/cef_atomicops_mac.h"
#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
#include "include/base/internal/cef_atomicops_x86_gcc.h"
#elif defined(COMPILER_GCC) && defined(__ARM_ARCH_ISA_A64)
#include "include/base/internal/cef_atomicops_arm64_gcc.h"
#elif defined(COMPILER_GCC) && defined(__ARM_ARCH)
#include "include/base/internal/cef_atomicops_arm_gcc.h"
#else
@@ -194,7 +191,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
// On some platforms we need additional declarations to make
// AtomicWord compatible with our other Atomic* types.
#if defined(OS_MAC) || defined(OS_OPENBSD)
#if defined(OS_MACOSX) || defined(OS_OPENBSD)
#include "include/base/internal/cef_atomicops_atomicword_compat.h"
#endif

View File

@@ -32,8 +32,8 @@
#define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
#pragma once
#include <limits.h> // For UINT_MAX
#include <stddef.h> // For size_t
#include <limits.h> // For UINT_MAX
#include <stddef.h> // For size_t
#include "include/base/cef_build.h"
@@ -42,45 +42,35 @@
//
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
// <inttypes.h> format macros even in the LP64 model.
#if defined(__LP64__) && !defined(OS_MAC) && !defined(OS_OPENBSD)
typedef long int64;
typedef unsigned long uint64;
#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
typedef long int64; // NOLINT(runtime/int)
typedef unsigned long uint64; // NOLINT(runtime/int)
#else
typedef long long int64;
typedef unsigned long long uint64;
typedef long long int64; // NOLINT(runtime/int)
typedef unsigned long long uint64; // NOLINT(runtime/int)
#endif
// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _INT32
#define _INT32
typedef int int32;
typedef int int32;
#endif
// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _UINT32
#define _UINT32
typedef unsigned int uint32;
#endif
#ifndef _INT16
#define _INT16
typedef short int16;
#endif
#ifndef _UINT16
#define _UINT16
typedef unsigned short uint16;
typedef unsigned int uint32;
#endif
// UTF-16 character type.
// This should be kept synchronized with base/strings/string16.h
#ifndef char16
#if defined(WCHAR_T_IS_UTF16)
typedef wchar_t char16;
typedef wchar_t char16;
#elif defined(WCHAR_T_IS_UTF32)
typedef unsigned short char16;
typedef unsigned short char16;
#endif
#endif

View File

@@ -89,32 +89,34 @@
namespace base {
template <typename Functor>
base::Callback<typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void()>::UnboundRunType>
base::Callback<
typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void()>
::UnboundRunType>
Bind(Functor functor) {
// Typedefs for how to store and run the functor.
typedef
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
typedef cef_internal::BindState<RunnableType, RunType, void()> BindState;
return Callback<typename BindState::UnboundRunType>(
new BindState(cef_internal::MakeRunnable(functor)));
}
template <typename Functor, typename P1>
base::Callback<typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>::
UnboundRunType>
base::Callback<
typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>
::UnboundRunType>
Bind(Functor functor, const P1& p1) {
// Typedefs for how to store and run the functor.
typedef
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
// Use RunnableType::RunType instead of RunType above because our
@@ -129,39 +131,39 @@ Bind(Functor functor, const P1& p1) {
// invoked function will receive a reference to the stored copy of the
// argument and not the original.
COMPILE_ASSERT(
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value),
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ),
do_not_bind_functions_with_nonconst_ref);
// For methods, we need to be careful for parameter 1. We do not require
// a scoped_refptr because BindState<> itself takes care of AddRef() for
// methods. We also disallow binding of an array as the method's target
// object.
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(
cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
!is_array<P1>::value,
first_bound_argument_to_method_cannot_be_array);
typedef cef_internal::BindState<
RunnableType, RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>
BindState;
typedef cef_internal::BindState<RunnableType, RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)> BindState;
return Callback<typename BindState::UnboundRunType>(
new BindState(cef_internal::MakeRunnable(functor), p1));
}
template <typename Functor, typename P1, typename P2>
base::Callback<typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType)>::
UnboundRunType>
base::Callback<
typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType)>
::UnboundRunType>
Bind(Functor functor, const P1& p1, const P2& p2) {
// Typedefs for how to store and run the functor.
typedef
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
// Use RunnableType::RunType instead of RunType above because our
@@ -177,43 +179,43 @@ Bind(Functor functor, const P1& p1, const P2& p2) {
// argument and not the original.
COMPILE_ASSERT(
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value),
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ),
do_not_bind_functions_with_nonconst_ref);
// For methods, we need to be careful for parameter 1. We do not require
// a scoped_refptr because BindState<> itself takes care of AddRef() for
// methods. We also disallow binding of an array as the method's target
// object.
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(
cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
!is_array<P1>::value,
first_bound_argument_to_method_cannot_be_array);
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
p2_is_refcounted_type_and_needs_scoped_refptr);
typedef cef_internal::BindState<
RunnableType, RunType,
typedef cef_internal::BindState<RunnableType, RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType)>
BindState;
typename cef_internal::CallbackParamTraits<P2>::StorageType)> BindState;
return Callback<typename BindState::UnboundRunType>(
new BindState(cef_internal::MakeRunnable(functor), p1, p2));
}
template <typename Functor, typename P1, typename P2, typename P3>
base::Callback<typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType)>::
UnboundRunType>
base::Callback<
typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType)>
::UnboundRunType>
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
// Typedefs for how to store and run the functor.
typedef
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
// Use RunnableType::RunType instead of RunType above because our
@@ -229,17 +231,18 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
// argument and not the original.
COMPILE_ASSERT(
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value),
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ),
do_not_bind_functions_with_nonconst_ref);
// For methods, we need to be careful for parameter 1. We do not require
// a scoped_refptr because BindState<> itself takes care of AddRef() for
// methods. We also disallow binding of an array as the method's target
// object.
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(
cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
!is_array<P1>::value,
first_bound_argument_to_method_cannot_be_array);
@@ -247,30 +250,29 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
p2_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
p3_is_refcounted_type_and_needs_scoped_refptr);
typedef cef_internal::BindState<
RunnableType, RunType,
typedef cef_internal::BindState<RunnableType, RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType)>
BindState;
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType)> BindState;
return Callback<typename BindState::UnboundRunType>(
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3));
}
template <typename Functor, typename P1, typename P2, typename P3, typename P4>
base::Callback<typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType)>::
UnboundRunType>
base::Callback<
typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType)>
::UnboundRunType>
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
// Typedefs for how to store and run the functor.
typedef
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
// Use RunnableType::RunType instead of RunType above because our
@@ -286,18 +288,19 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
// argument and not the original.
COMPILE_ASSERT(
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value),
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ),
do_not_bind_functions_with_nonconst_ref);
// For methods, we need to be careful for parameter 1. We do not require
// a scoped_refptr because BindState<> itself takes care of AddRef() for
// methods. We also disallow binding of an array as the method's target
// object.
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(
cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
!is_array<P1>::value,
first_bound_argument_to_method_cannot_be_array);
@@ -307,42 +310,33 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
p3_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
p4_is_refcounted_type_and_needs_scoped_refptr);
typedef cef_internal::BindState<
RunnableType, RunType,
typedef cef_internal::BindState<RunnableType, RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType)>
BindState;
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType)> BindState;
return Callback<typename BindState::UnboundRunType>(
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4));
}
template <typename Functor,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
base::Callback<typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType)>::
UnboundRunType>
Bind(Functor functor,
const P1& p1,
const P2& p2,
const P3& p3,
const P4& p4,
const P5& p5) {
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
typename P5>
base::Callback<
typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType)>
::UnboundRunType>
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
const P5& p5) {
// Typedefs for how to store and run the functor.
typedef
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
// Use RunnableType::RunType instead of RunType above because our
@@ -358,19 +352,20 @@ Bind(Functor functor,
// argument and not the original.
COMPILE_ASSERT(
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value),
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ),
do_not_bind_functions_with_nonconst_ref);
// For methods, we need to be careful for parameter 1. We do not require
// a scoped_refptr because BindState<> itself takes care of AddRef() for
// methods. We also disallow binding of an array as the method's target
// object.
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(
cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
!is_array<P1>::value,
first_bound_argument_to_method_cannot_be_array);
@@ -382,46 +377,35 @@ Bind(Functor functor,
p4_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
p5_is_refcounted_type_and_needs_scoped_refptr);
typedef cef_internal::BindState<
RunnableType, RunType,
typedef cef_internal::BindState<RunnableType, RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType)>
BindState;
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType)> BindState;
return Callback<typename BindState::UnboundRunType>(
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5));
}
template <typename Functor,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
base::Callback<typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType,
typename cef_internal::CallbackParamTraits<P6>::StorageType)>::
UnboundRunType>
Bind(Functor functor,
const P1& p1,
const P2& p2,
const P3& p3,
const P4& p4,
const P5& p5,
const P6& p6) {
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6>
base::Callback<
typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType,
typename cef_internal::CallbackParamTraits<P6>::StorageType)>
::UnboundRunType>
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
const P5& p5, const P6& p6) {
// Typedefs for how to store and run the functor.
typedef
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
// Use RunnableType::RunType instead of RunType above because our
@@ -437,20 +421,21 @@ Bind(Functor functor,
// argument and not the original.
COMPILE_ASSERT(
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A6Type>::value),
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A6Type>::value ),
do_not_bind_functions_with_nonconst_ref);
// For methods, we need to be careful for parameter 1. We do not require
// a scoped_refptr because BindState<> itself takes care of AddRef() for
// methods. We also disallow binding of an array as the method's target
// object.
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(
cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
!is_array<P1>::value,
first_bound_argument_to_method_cannot_be_array);
@@ -464,50 +449,37 @@ Bind(Functor functor,
p5_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
p6_is_refcounted_type_and_needs_scoped_refptr);
typedef cef_internal::BindState<
RunnableType, RunType,
typedef cef_internal::BindState<RunnableType, RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType,
typename cef_internal::CallbackParamTraits<P6>::StorageType)>
BindState;
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType,
typename cef_internal::CallbackParamTraits<P6>::StorageType)> BindState;
return Callback<typename BindState::UnboundRunType>(new BindState(
cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6));
return Callback<typename BindState::UnboundRunType>(
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6));
}
template <typename Functor,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
base::Callback<typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType,
typename cef_internal::CallbackParamTraits<P6>::StorageType,
typename cef_internal::CallbackParamTraits<P7>::StorageType)>::
UnboundRunType>
Bind(Functor functor,
const P1& p1,
const P2& p2,
const P3& p3,
const P4& p4,
const P5& p5,
const P6& p6,
const P7& p7) {
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6, typename P7>
base::Callback<
typename cef_internal::BindState<
typename cef_internal::FunctorTraits<Functor>::RunnableType,
typename cef_internal::FunctorTraits<Functor>::RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType,
typename cef_internal::CallbackParamTraits<P6>::StorageType,
typename cef_internal::CallbackParamTraits<P7>::StorageType)>
::UnboundRunType>
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
const P5& p5, const P6& p6, const P7& p7) {
// Typedefs for how to store and run the functor.
typedef
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
// Use RunnableType::RunType instead of RunType above because our
@@ -523,21 +495,22 @@ Bind(Functor functor,
// argument and not the original.
COMPILE_ASSERT(
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A6Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A7Type>::value),
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A6Type>::value ||
is_non_const_reference<typename BoundFunctorTraits::A7Type>::value ),
do_not_bind_functions_with_nonconst_ref);
// For methods, we need to be careful for parameter 1. We do not require
// a scoped_refptr because BindState<> itself takes care of AddRef() for
// methods. We also disallow binding of an array as the method's target
// object.
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(
cef_internal::HasIsMethodTag<RunnableType>::value ||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
p1_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
!is_array<P1>::value,
first_bound_argument_to_method_cannot_be_array);
@@ -553,19 +526,19 @@ Bind(Functor functor,
p6_is_refcounted_type_and_needs_scoped_refptr);
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P7>::value,
p7_is_refcounted_type_and_needs_scoped_refptr);
typedef cef_internal::BindState<
RunnableType, RunType,
typedef cef_internal::BindState<RunnableType, RunType,
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType,
typename cef_internal::CallbackParamTraits<P6>::StorageType,
typename cef_internal::CallbackParamTraits<P7>::StorageType)>
BindState;
typename cef_internal::CallbackParamTraits<P2>::StorageType,
typename cef_internal::CallbackParamTraits<P3>::StorageType,
typename cef_internal::CallbackParamTraits<P4>::StorageType,
typename cef_internal::CallbackParamTraits<P5>::StorageType,
typename cef_internal::CallbackParamTraits<P6>::StorageType,
typename cef_internal::CallbackParamTraits<P7>::StorageType)> BindState;
return Callback<typename BindState::UnboundRunType>(new BindState(
cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7));
return Callback<typename BindState::UnboundRunType>(
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6,
p7));
}
} // namespace base

View File

@@ -274,20 +274,20 @@ class SupportsAddRefAndRelease {
// instantiate Base is made. We disable the warning for this definition.
#if defined(OS_WIN)
#pragma warning(push)
#pragma warning(disable : 4624)
#pragma warning(disable:4624)
#endif
struct Base : public T, public BaseMixin {};
struct Base : public T, public BaseMixin {
};
#if defined(OS_WIN)
#pragma warning(pop)
#endif
template <void (BaseMixin::*)(void)>
struct Helper {};
template <void(BaseMixin::*)(void)> struct Helper {};
template <typename C>
static No& Check(Helper<&C::AddRef>*);
template <typename>
template <typename >
static Yes& Check(...);
public:
@@ -297,18 +297,22 @@ class SupportsAddRefAndRelease {
// Helpers to assert that arguments of a recounted type are bound with a
// scoped_refptr.
template <bool IsClasstype, typename T>
struct UnsafeBindtoRefCountedArgHelper : false_type {};
struct UnsafeBindtoRefCountedArgHelper : false_type {
};
template <typename T>
struct UnsafeBindtoRefCountedArgHelper<true, T>
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {};
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {
};
template <typename T>
struct UnsafeBindtoRefCountedArg : false_type {};
struct UnsafeBindtoRefCountedArg : false_type {
};
template <typename T>
struct UnsafeBindtoRefCountedArg<T*>
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {};
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {
};
template <typename T>
class HasIsMethodTag {
@@ -330,7 +334,6 @@ class UnretainedWrapper {
public:
explicit UnretainedWrapper(T* o) : ptr_(o) {}
T* get() const { return ptr_; }
private:
T* ptr_;
};
@@ -340,7 +343,6 @@ class ConstRefWrapper {
public:
explicit ConstRefWrapper(const T& o) : ptr_(&o) {}
const T& get() const { return *ptr_; }
private:
const T* ptr_;
};
@@ -353,7 +355,7 @@ struct IgnoreResultHelper {
};
template <typename T>
struct IgnoreResultHelper<Callback<T>> {
struct IgnoreResultHelper<Callback<T> > {
explicit IgnoreResultHelper(const Callback<T>& functor) : functor_(functor) {}
const Callback<T>& functor_;
@@ -407,7 +409,8 @@ class PassedWrapper {
public:
explicit PassedWrapper(T scoper) : is_valid_(true), scoper_(scoper.Pass()) {}
PassedWrapper(const PassedWrapper& other)
: is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) {}
: is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) {
}
T Pass() const {
CHECK(is_valid_);
is_valid_ = false;
@@ -427,7 +430,7 @@ struct UnwrapTraits {
};
template <typename T>
struct UnwrapTraits<UnretainedWrapper<T>> {
struct UnwrapTraits<UnretainedWrapper<T> > {
typedef T* ForwardType;
static ForwardType Unwrap(UnretainedWrapper<T> unretained) {
return unretained.get();
@@ -435,7 +438,7 @@ struct UnwrapTraits<UnretainedWrapper<T>> {
};
template <typename T>
struct UnwrapTraits<ConstRefWrapper<T>> {
struct UnwrapTraits<ConstRefWrapper<T> > {
typedef const T& ForwardType;
static ForwardType Unwrap(ConstRefWrapper<T> const_ref) {
return const_ref.get();
@@ -443,27 +446,31 @@ struct UnwrapTraits<ConstRefWrapper<T>> {
};
template <typename T>
struct UnwrapTraits<scoped_refptr<T>> {
struct UnwrapTraits<scoped_refptr<T> > {
typedef T* ForwardType;
static ForwardType Unwrap(const scoped_refptr<T>& o) { return o.get(); }
};
template <typename T>
struct UnwrapTraits<WeakPtr<T>> {
struct UnwrapTraits<WeakPtr<T> > {
typedef const WeakPtr<T>& ForwardType;
static ForwardType Unwrap(const WeakPtr<T>& o) { return o; }
};
template <typename T>
struct UnwrapTraits<OwnedWrapper<T>> {
struct UnwrapTraits<OwnedWrapper<T> > {
typedef T* ForwardType;
static ForwardType Unwrap(const OwnedWrapper<T>& o) { return o.get(); }
static ForwardType Unwrap(const OwnedWrapper<T>& o) {
return o.get();
}
};
template <typename T>
struct UnwrapTraits<PassedWrapper<T>> {
struct UnwrapTraits<PassedWrapper<T> > {
typedef T ForwardType;
static T Unwrap(PassedWrapper<T>& o) { return o.Pass(); }
static T Unwrap(PassedWrapper<T>& o) {
return o.Pass();
}
};
// Utility for handling different refcounting semantics in the Bind()
@@ -498,7 +505,7 @@ struct MaybeRefcount<true, T*> {
// No need to additionally AddRef() and Release() since we are storing a
// scoped_refptr<> inside the storage object already.
template <typename T>
struct MaybeRefcount<true, scoped_refptr<T>> {
struct MaybeRefcount<true, scoped_refptr<T> > {
static void AddRef(const scoped_refptr<T>& o) {}
static void Release(const scoped_refptr<T>& o) {}
};
@@ -519,10 +526,10 @@ template <bool IsMethod, typename P1>
struct IsWeakMethod : public false_type {};
template <typename T>
struct IsWeakMethod<true, WeakPtr<T>> : public true_type {};
struct IsWeakMethod<true, WeakPtr<T> > : public true_type {};
template <typename T>
struct IsWeakMethod<true, ConstRefWrapper<WeakPtr<T>>> : public true_type {};
struct IsWeakMethod<true, ConstRefWrapper<WeakPtr<T> > > : public true_type {};
} // namespace cef_internal
@@ -560,14 +567,14 @@ static inline cef_internal::IgnoreResultHelper<T> IgnoreResult(T data) {
}
template <typename T>
static inline cef_internal::IgnoreResultHelper<Callback<T>> IgnoreResult(
const Callback<T>& data) {
return cef_internal::IgnoreResultHelper<Callback<T>>(data);
static inline cef_internal::IgnoreResultHelper<Callback<T> >
IgnoreResult(const Callback<T>& data) {
return cef_internal::IgnoreResultHelper<Callback<T> >(data);
}
void DoNothing();
template <typename T>
template<typename T>
void DeletePointer(T* obj) {
delete obj;
}

View File

@@ -27,6 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
#pragma once
@@ -44,14 +45,6 @@
#define OS_WIN 1
#endif
#elif defined(__APPLE__)
// New platform defines after https://crbug.com/1105907.
#ifndef OS_MAC
#define OS_MAC 1
#endif
#ifndef OS_APPLE
#define OS_APPLE 1
#endif
// Old platform defines retained for backwards compatibility.
#ifndef OS_MACOSX
#define OS_MACOSX 1
#endif
@@ -65,7 +58,7 @@
// For access to standard POSIXish features, use OS_POSIX instead of a
// more specific macro.
#if defined(OS_MAC) || defined(OS_LINUX)
#if defined(OS_MACOSX) || defined(OS_LINUX)
#ifndef OS_POSIX
#define OS_POSIX 1
#endif
@@ -103,7 +96,7 @@
#define ARCH_CPU_ARMEL 1
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__aarch64__) || defined(_M_ARM64)
#elif defined(__aarch64__)
#define ARCH_CPU_ARM_FAMILY 1
#define ARCH_CPU_ARM64 1
#define ARCH_CPU_64_BITS 1
@@ -123,10 +116,12 @@
// Type detection for wchar_t.
#if defined(OS_WIN)
#define WCHAR_T_IS_UTF16
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
defined(__WCHAR_MAX__) && \
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
#define WCHAR_T_IS_UTF32
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
defined(__WCHAR_MAX__) && \
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
// compile in this mode (in particular, Chrome doesn't). This is intended for
@@ -170,16 +165,6 @@
#define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0
#endif
// Sanitizers annotations.
#if defined(__has_attribute)
#if __has_attribute(no_sanitize)
#define NO_SANITIZE(what) __attribute__((no_sanitize(what)))
#endif
#endif
#if !defined(NO_SANITIZE)
#define NO_SANITIZE(what)
#endif
#endif // !USING_CHROMIUM_INCLUDES
// Annotate a virtual method indicating it must be overriding a virtual method
@@ -196,7 +181,7 @@
// Visual Studio 2010 and later support override.
#define OVERRIDE override
#elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700
// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
#define OVERRIDE override
#else
@@ -204,12 +189,4 @@
#endif
#endif // OVERRIDE
// Check for C++11 template alias support which was added in VS2013 and GCC4.7.
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
#if __cplusplus > 199711L || (defined(_MSC_VER) && _MSC_VER >= 1800) || \
(defined(__GNUC__) && \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ >= 40700))
#define HAS_CPP11_TEMPLATE_ALIAS_SUPPORT
#endif
#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_

View File

@@ -45,9 +45,9 @@
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/internal/cef_callback_internal.h"
#include "include/base/cef_callback_forward.h"
#include "include/base/cef_template_util.h"
#include "include/base/internal/cef_callback_internal.h"
// NOTE: Header files that do not require the full definition of Callback or
// Closure should #include "base/cef_callback_forward.h" instead of this file.
@@ -407,20 +407,21 @@ class Callback<R(void)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)();
Callback() : CallbackBase(NULL) {}
Callback() : CallbackBase(NULL) { }
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
@@ -436,7 +437,9 @@ class Callback<R(void)> : public cef_internal::CallbackBase {
}
private:
typedef R (*PolymorphicInvoke)(cef_internal::BindStateBase*);
typedef R(*PolymorphicInvoke)(
cef_internal::BindStateBase*);
};
template <typename R, typename A1>
@@ -444,20 +447,21 @@ class Callback<R(A1)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1);
Callback() : CallbackBase(NULL) {}
Callback() : CallbackBase(NULL) { }
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
@@ -473,9 +477,10 @@ class Callback<R(A1)> : public cef_internal::CallbackBase {
}
private:
typedef R (*PolymorphicInvoke)(
typedef R(*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType);
};
template <typename R, typename A1, typename A2>
@@ -483,20 +488,21 @@ class Callback<R(A1, A2)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2);
Callback() : CallbackBase(NULL) {}
Callback() : CallbackBase(NULL) { }
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
@@ -514,10 +520,11 @@ class Callback<R(A1, A2)> : public cef_internal::CallbackBase {
}
private:
typedef R (*PolymorphicInvoke)(
typedef R(*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType);
};
template <typename R, typename A1, typename A2, typename A3>
@@ -525,20 +532,21 @@ class Callback<R(A1, A2, A3)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2, A3);
Callback() : CallbackBase(NULL) {}
Callback() : CallbackBase(NULL) { }
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
@@ -558,11 +566,12 @@ class Callback<R(A1, A2, A3)> : public cef_internal::CallbackBase {
}
private:
typedef R (*PolymorphicInvoke)(
typedef R(*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType);
};
template <typename R, typename A1, typename A2, typename A3, typename A4>
@@ -570,20 +579,21 @@ class Callback<R(A1, A2, A3, A4)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2, A3, A4);
Callback() : CallbackBase(NULL) {}
Callback() : CallbackBase(NULL) { }
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
@@ -605,38 +615,36 @@ class Callback<R(A1, A2, A3, A4)> : public cef_internal::CallbackBase {
}
private:
typedef R (*PolymorphicInvoke)(
typedef R(*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType);
};
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5>
class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2, A3, A4, A5);
Callback() : CallbackBase(NULL) {}
Callback() : CallbackBase(NULL) { }
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
@@ -652,47 +660,45 @@ class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
PolymorphicInvoke f =
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
return f(
bind_state_.get(), cef_internal::CallbackForward(a1),
cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3),
cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5));
return f(bind_state_.get(), cef_internal::CallbackForward(a1),
cef_internal::CallbackForward(a2),
cef_internal::CallbackForward(a3),
cef_internal::CallbackForward(a4),
cef_internal::CallbackForward(a5));
}
private:
typedef R (*PolymorphicInvoke)(
typedef R(*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
typename cef_internal::CallbackParamTraits<A5>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
typename cef_internal::CallbackParamTraits<A5>::ForwardType);
};
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6>
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6>
class Callback<R(A1, A2, A3, A4, A5, A6)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
Callback() : CallbackBase(NULL) {}
Callback() : CallbackBase(NULL) { }
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
@@ -709,51 +715,47 @@ class Callback<R(A1, A2, A3, A4, A5, A6)> : public cef_internal::CallbackBase {
PolymorphicInvoke f =
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
return f(
bind_state_.get(), cef_internal::CallbackForward(a1),
cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3),
cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5),
cef_internal::CallbackForward(a6));
return f(bind_state_.get(), cef_internal::CallbackForward(a1),
cef_internal::CallbackForward(a2),
cef_internal::CallbackForward(a3),
cef_internal::CallbackForward(a4),
cef_internal::CallbackForward(a5),
cef_internal::CallbackForward(a6));
}
private:
typedef R (*PolymorphicInvoke)(
typedef R(*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
typename cef_internal::CallbackParamTraits<A6>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
typename cef_internal::CallbackParamTraits<A6>::ForwardType);
};
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6,
typename A7>
class Callback<R(A1, A2, A3, A4, A5, A6, A7)>
: public cef_internal::CallbackBase {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7>
class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
Callback() : CallbackBase(NULL) {}
Callback() : CallbackBase(NULL) { }
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
@@ -771,25 +773,29 @@ class Callback<R(A1, A2, A3, A4, A5, A6, A7)>
PolymorphicInvoke f =
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
return f(
bind_state_.get(), cef_internal::CallbackForward(a1),
cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3),
cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5),
cef_internal::CallbackForward(a6), cef_internal::CallbackForward(a7));
return f(bind_state_.get(), cef_internal::CallbackForward(a1),
cef_internal::CallbackForward(a2),
cef_internal::CallbackForward(a3),
cef_internal::CallbackForward(a4),
cef_internal::CallbackForward(a5),
cef_internal::CallbackForward(a6),
cef_internal::CallbackForward(a7));
}
private:
typedef R (*PolymorphicInvoke)(
typedef R(*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
typename cef_internal::CallbackParamTraits<A6>::ForwardType,
typename cef_internal::CallbackParamTraits<A7>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
typename cef_internal::CallbackParamTraits<A6>::ForwardType,
typename cef_internal::CallbackParamTraits<A7>::ForwardType);
};
// Syntactic sugar to make Callbacks<void(void)> easier to declare since it
// will be used in a lot of APIs with delayed execution.
typedef Callback<void(void)> Closure;

View File

@@ -0,0 +1,93 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. 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 defines helpful methods for dealing with Callbacks. Because Callbacks
// are implemented using templates, with a class per callback signature, adding
// methods to Callback<> itself is unattractive (lots of extra code gets
// generated). Instead, consider adding methods here.
//
// ResetAndReturn(&cb) is like cb.Reset() but allows executing a callback (via a
// copy) after the original callback is Reset(). This can be handy if Run()
// reads/writes the variable holding the Callback.
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_
#define CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_
#pragma once
#if defined(BASE_CALLBACK_HELPERS_H_)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts.
#elif defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/callback_helpers.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/cef_basictypes.h"
#include "include/base/cef_build.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_macros.h"
namespace base {
template <typename Sig>
base::Callback<Sig> ResetAndReturn(base::Callback<Sig>* cb) {
base::Callback<Sig> ret(*cb);
cb->Reset();
return ret;
}
// ScopedClosureRunner is akin to scoped_ptr for Closures. It ensures that the
// Closure is executed and deleted no matter how the current scope exits.
class ScopedClosureRunner {
public:
ScopedClosureRunner();
explicit ScopedClosureRunner(const Closure& closure);
~ScopedClosureRunner();
void Reset();
void Reset(const Closure& closure);
Closure Release() WARN_UNUSED_RESULT;
private:
Closure closure_;
DISALLOW_COPY_AND_ASSIGN(ScopedClosureRunner);
};
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_

View File

@@ -48,12 +48,12 @@
#include <list>
#include "include/base/cef_basictypes.h"
#include "include/base/cef_build.h"
#include "include/base/cef_callback.h"
#include "include/base/internal/cef_callback_internal.h"
#include "include/base/cef_build.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_scoped_ptr.h"
#include "include/base/internal/cef_callback_internal.h"
// OVERVIEW:
//
@@ -120,7 +120,9 @@ class CallbackListBase {
public:
Subscription(CallbackListBase<CallbackType>* list,
typename std::list<CallbackType>::iterator iter)
: list_(list), iter_(iter) {}
: list_(list),
iter_(iter) {
}
~Subscription() {
if (list_->active_iterator_count_) {
@@ -165,12 +167,14 @@ class CallbackListBase {
class Iterator {
public:
explicit Iterator(CallbackListBase<CallbackType>* list)
: list_(list), list_iter_(list_->callbacks_.begin()) {
: list_(list),
list_iter_(list_->callbacks_.begin()) {
++list_->active_iterator_count_;
}
Iterator(const Iterator& iter)
: list_(iter.list_), list_iter_(iter.list_iter_) {
: list_(iter.list_),
list_iter_(iter.list_iter_) {
++list_->active_iterator_count_;
}
@@ -206,7 +210,9 @@ class CallbackListBase {
// Returns an instance of a CallbackListBase::Iterator which can be used
// to run callbacks.
Iterator GetIterator() { return Iterator(this); }
Iterator GetIterator() {
return Iterator(this);
}
// Compact the list: remove any entries which were NULLed out during
// iteration.
@@ -236,12 +242,11 @@ class CallbackListBase {
} // namespace cef_internal
template <typename Sig>
class CallbackList;
template <typename Sig> class CallbackList;
template <>
class CallbackList<void(void)>
: public cef_internal::CallbackListBase<Callback<void(void)>> {
: public cef_internal::CallbackListBase<Callback<void(void)> > {
public:
typedef Callback<void(void)> CallbackType;
@@ -262,7 +267,7 @@ class CallbackList<void(void)>
template <typename A1>
class CallbackList<void(A1)>
: public cef_internal::CallbackListBase<Callback<void(A1)>> {
: public cef_internal::CallbackListBase<Callback<void(A1)> > {
public:
typedef Callback<void(A1)> CallbackType;
@@ -283,7 +288,7 @@ class CallbackList<void(A1)>
template <typename A1, typename A2>
class CallbackList<void(A1, A2)>
: public cef_internal::CallbackListBase<Callback<void(A1, A2)>> {
: public cef_internal::CallbackListBase<Callback<void(A1, A2)> > {
public:
typedef Callback<void(A1, A2)> CallbackType;
@@ -305,7 +310,7 @@ class CallbackList<void(A1, A2)>
template <typename A1, typename A2, typename A3>
class CallbackList<void(A1, A2, A3)>
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3)>> {
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3)> > {
public:
typedef Callback<void(A1, A2, A3)> CallbackType;
@@ -328,7 +333,7 @@ class CallbackList<void(A1, A2, A3)>
template <typename A1, typename A2, typename A3, typename A4>
class CallbackList<void(A1, A2, A3, A4)>
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4)>> {
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4)> > {
public:
typedef Callback<void(A1, A2, A3, A4)> CallbackType;
@@ -352,8 +357,7 @@ class CallbackList<void(A1, A2, A3, A4)>
template <typename A1, typename A2, typename A3, typename A4, typename A5>
class CallbackList<void(A1, A2, A3, A4, A5)>
: public cef_internal::CallbackListBase<
Callback<void(A1, A2, A3, A4, A5)>> {
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5)> > {
public:
typedef Callback<void(A1, A2, A3, A4, A5)> CallbackType;
@@ -376,15 +380,11 @@ class CallbackList<void(A1, A2, A3, A4, A5)>
DISALLOW_COPY_AND_ASSIGN(CallbackList);
};
template <typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6>
template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6>
class CallbackList<void(A1, A2, A3, A4, A5, A6)>
: public cef_internal::CallbackListBase<
Callback<void(A1, A2, A3, A4, A5, A6)>> {
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5,
A6)> > {
public:
typedef Callback<void(A1, A2, A3, A4, A5, A6)> CallbackType;
@@ -408,16 +408,11 @@ class CallbackList<void(A1, A2, A3, A4, A5, A6)>
DISALLOW_COPY_AND_ASSIGN(CallbackList);
};
template <typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6,
typename A7>
template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6, typename A7>
class CallbackList<void(A1, A2, A3, A4, A5, A6, A7)>
: public cef_internal::CallbackListBase<
Callback<void(A1, A2, A3, A4, A5, A6, A7)>> {
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5, A6,
A7)> > {
public:
typedef Callback<void(A1, A2, A3, A4, A5, A6, A7)> CallbackType;

View File

@@ -83,8 +83,8 @@
// updated to match.
#include "include/base/cef_bind.h"
#include "include/base/cef_build.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_build.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_weak_ptr.h"
@@ -102,7 +102,8 @@ class CancelableCallback<void(void)> {
// |callback| must not be null.
explicit CancelableCallback(const base::Callback<void(void)>& callback)
: weak_factory_(this), callback_(callback) {
: weak_factory_(this),
callback_(callback) {
DCHECK(!callback.is_null());
InitializeForwarder();
}
@@ -117,7 +118,9 @@ class CancelableCallback<void(void)> {
}
// Returns true if the wrapped callback has been cancelled.
bool IsCancelled() const { return callback_.is_null(); }
bool IsCancelled() const {
return callback_.is_null();
}
// Sets |callback| as the closure that may be cancelled. |callback| may not
// be null. Outstanding and any previously wrapped callbacks are cancelled.
@@ -134,10 +137,14 @@ class CancelableCallback<void(void)> {
}
// Returns a callback that can be disabled by calling Cancel().
const base::Callback<void(void)>& callback() const { return forwarder_; }
const base::Callback<void(void)>& callback() const {
return forwarder_;
}
private:
void Forward() { callback_.Run(); }
void Forward() {
callback_.Run();
}
// Helper method to bind |forwarder_| using a weak pointer from
// |weak_factory_|.
@@ -147,7 +154,7 @@ class CancelableCallback<void(void)> {
}
// Used to ensure Forward() is not run when this object is destroyed.
base::WeakPtrFactory<CancelableCallback<void(void)>> weak_factory_;
base::WeakPtrFactory<CancelableCallback<void(void)> > weak_factory_;
// The wrapper closure.
base::Callback<void(void)> forwarder_;
@@ -165,7 +172,8 @@ class CancelableCallback<void(A1)> {
// |callback| must not be null.
explicit CancelableCallback(const base::Callback<void(A1)>& callback)
: weak_factory_(this), callback_(callback) {
: weak_factory_(this),
callback_(callback) {
DCHECK(!callback.is_null());
InitializeForwarder();
}
@@ -180,7 +188,9 @@ class CancelableCallback<void(A1)> {
}
// Returns true if the wrapped callback has been cancelled.
bool IsCancelled() const { return callback_.is_null(); }
bool IsCancelled() const {
return callback_.is_null();
}
// Sets |callback| as the closure that may be cancelled. |callback| may not
// be null. Outstanding and any previously wrapped callbacks are cancelled.
@@ -197,10 +207,14 @@ class CancelableCallback<void(A1)> {
}
// Returns a callback that can be disabled by calling Cancel().
const base::Callback<void(A1)>& callback() const { return forwarder_; }
const base::Callback<void(A1)>& callback() const {
return forwarder_;
}
private:
void Forward(A1 a1) const { callback_.Run(a1); }
void Forward(A1 a1) const {
callback_.Run(a1);
}
// Helper method to bind |forwarder_| using a weak pointer from
// |weak_factory_|.
@@ -210,7 +224,7 @@ class CancelableCallback<void(A1)> {
}
// Used to ensure Forward() is not run when this object is destroyed.
base::WeakPtrFactory<CancelableCallback<void(A1)>> weak_factory_;
base::WeakPtrFactory<CancelableCallback<void(A1)> > weak_factory_;
// The wrapper closure.
base::Callback<void(A1)> forwarder_;
@@ -228,7 +242,8 @@ class CancelableCallback<void(A1, A2)> {
// |callback| must not be null.
explicit CancelableCallback(const base::Callback<void(A1, A2)>& callback)
: weak_factory_(this), callback_(callback) {
: weak_factory_(this),
callback_(callback) {
DCHECK(!callback.is_null());
InitializeForwarder();
}
@@ -243,7 +258,9 @@ class CancelableCallback<void(A1, A2)> {
}
// Returns true if the wrapped callback has been cancelled.
bool IsCancelled() const { return callback_.is_null(); }
bool IsCancelled() const {
return callback_.is_null();
}
// Sets |callback| as the closure that may be cancelled. |callback| may not
// be null. Outstanding and any previously wrapped callbacks are cancelled.
@@ -260,10 +277,14 @@ class CancelableCallback<void(A1, A2)> {
}
// Returns a callback that can be disabled by calling Cancel().
const base::Callback<void(A1, A2)>& callback() const { return forwarder_; }
const base::Callback<void(A1, A2)>& callback() const {
return forwarder_;
}
private:
void Forward(A1 a1, A2 a2) const { callback_.Run(a1, a2); }
void Forward(A1 a1, A2 a2) const {
callback_.Run(a1, a2);
}
// Helper method to bind |forwarder_| using a weak pointer from
// |weak_factory_|.
@@ -273,7 +294,7 @@ class CancelableCallback<void(A1, A2)> {
}
// Used to ensure Forward() is not run when this object is destroyed.
base::WeakPtrFactory<CancelableCallback<void(A1, A2)>> weak_factory_;
base::WeakPtrFactory<CancelableCallback<void(A1, A2)> > weak_factory_;
// The wrapper closure.
base::Callback<void(A1, A2)> forwarder_;

View File

@@ -125,7 +125,9 @@ class AutoLock {
public:
struct AlreadyAcquired {};
explicit AutoLock(Lock& lock) : lock_(lock) { lock_.Acquire(); }
explicit AutoLock(Lock& lock) : lock_(lock) {
lock_.Acquire();
}
AutoLock(Lock& lock, const AlreadyAcquired&) : lock_(lock) {
lock_.AssertAcquired();
@@ -151,7 +153,9 @@ class AutoUnlock {
lock_.Release();
}
~AutoUnlock() { lock_.Acquire(); }
~AutoUnlock() {
lock_.Acquire();
}
private:
Lock& lock_;

View File

@@ -136,11 +136,7 @@
#define CEF_INCLUDE_BASE_CEF_LOGGING_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/logging.h"
#include "base/notreached.h"
#elif defined(DCHECK)
#if defined(DCHECK)
// Do nothing if the macros provided by this header already exist.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
@@ -148,20 +144,23 @@
// Always define the DCHECK_IS_ON macro which is used from other CEF headers.
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
#define DCHECK_IS_ON() false
#define DCHECK_IS_ON() 0
#else
#define DCHECK_IS_ON() true
#define DCHECK_IS_ON() 1
#endif
#else // !defined(DCHECK)
#elif defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/logging.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <cassert>
#include <string>
#include <cstring>
#include <sstream>
#include <string>
#include "include/base/cef_build.h"
#include "include/base/cef_macros.h"
@@ -202,27 +201,32 @@ const LogSeverity LOG_DFATAL = LOG_FATAL;
// A few definitions of macros that don't generate much code. These are used
// by LOG() and LOG_IF, etc. Since these are used all over our code, it's
// better to have compact code for these operations.
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_INFO, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_WARNING, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_ERROR, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_FATAL, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_DFATAL, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_INFO , \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_WARNING , \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_ERROR , \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_FATAL , \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_DFATAL , \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(LogMessage)
#define COMPACT_GOOGLE_LOG_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
#define COMPACT_GOOGLE_LOG_ERROR COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage)
#define COMPACT_GOOGLE_LOG_FATAL COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage)
#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage)
#define COMPACT_GOOGLE_LOG_INFO \
COMPACT_GOOGLE_LOG_EX_INFO(LogMessage)
#define COMPACT_GOOGLE_LOG_WARNING \
COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
#define COMPACT_GOOGLE_LOG_ERROR \
COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage)
#define COMPACT_GOOGLE_LOG_FATAL \
COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage)
#define COMPACT_GOOGLE_LOG_DFATAL \
COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage)
#if defined(OS_WIN)
// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets
@@ -232,7 +236,7 @@ const LogSeverity LOG_DFATAL = LOG_FATAL;
// the Windows SDK does for consistency.
#define ERROR 0
#define COMPACT_GOOGLE_LOG_EX_0(ClassName, ...) \
COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ##__VA_ARGS__)
COMPACT_GOOGLE_LOG_EX_ERROR(ClassName , ##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR
// Needed for LOG_IS_ON(ERROR).
const LogSeverity LOG_0 = LOG_ERROR;
@@ -242,7 +246,7 @@ const LogSeverity LOG_0 = LOG_ERROR;
// LOG_IS_ON(DFATAL) always holds in debug mode. In particular, CHECK()s will
// always fire if they fail.
#define LOG_IS_ON(severity) \
((::cef::logging::LOG_##severity) >= ::cef::logging::GetMinLogLevel())
((::cef::logging::LOG_ ## severity) >= ::cef::logging::GetMinLogLevel())
// We can't do any caching tricks with VLOG_IS_ON() like the
// google-glog version since it requires GCC extensions. This means
@@ -253,8 +257,8 @@ const LogSeverity LOG_0 = LOG_ERROR;
// Helper macro which avoids evaluating the arguments to a stream if
// the condition doesn't hold.
#define LAZY_STREAM(stream, condition) \
!(condition) ? (void)0 : ::cef::logging::LogMessageVoidify() & (stream)
#define LAZY_STREAM(stream, condition) \
!(condition) ? (void) 0 : ::cef::logging::LogMessageVoidify() & (stream)
// We use the preprocessor's merging operator, "##", so that, e.g.,
// LOG(INFO) becomes the token COMPACT_GOOGLE_LOG_INFO. There's some funny
@@ -264,7 +268,7 @@ const LogSeverity LOG_0 = LOG_ERROR;
// impossible to stream something like a string directly to an unnamed
// ostream. We employ a neat hack by calling the stream() member
// function of LogMessage which seems to avoid the problem.
#define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_##severity.stream()
#define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_ ## severity.stream()
#define LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
#define LOG_IF(severity, condition) \
@@ -282,18 +286,16 @@ const LogSeverity LOG_0 = LOG_ERROR;
#define VLOG_IF(verbose_level, condition) \
LAZY_STREAM(VLOG_STREAM(verbose_level), \
VLOG_IS_ON(verbose_level) && (condition))
VLOG_IS_ON(verbose_level) && (condition))
#if defined(OS_WIN)
#define VPLOG_STREAM(verbose_level) \
cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \
::cef::logging::GetLastSystemErrorCode()) \
.stream()
#if defined (OS_WIN)
#define VPLOG_STREAM(verbose_level) \
cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \
::cef::logging::GetLastSystemErrorCode()).stream()
#elif defined(OS_POSIX)
#define VPLOG_STREAM(verbose_level) \
cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \
::cef::logging::GetLastSystemErrorCode()) \
.stream()
#define VPLOG_STREAM(verbose_level) \
cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \
::cef::logging::GetLastSystemErrorCode()).stream()
#endif
#define VPLOG(verbose_level) \
@@ -301,35 +303,34 @@ const LogSeverity LOG_0 = LOG_ERROR;
#define VPLOG_IF(verbose_level, condition) \
LAZY_STREAM(VPLOG_STREAM(verbose_level), \
VLOG_IS_ON(verbose_level) && (condition))
VLOG_IS_ON(verbose_level) && (condition))
// TODO(akalin): Add more VLOG variants, e.g. VPLOG.
#define LOG_ASSERT(condition) \
#define LOG_ASSERT(condition) \
LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". "
#define SYSLOG_ASSERT(condition) \
SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". "
#if defined(OS_WIN)
#define PLOG_STREAM(severity) \
COMPACT_GOOGLE_LOG_EX_##severity(Win32ErrorLogMessage, \
::cef::logging::GetLastSystemErrorCode()) \
.stream()
#define PLOG_STREAM(severity) \
COMPACT_GOOGLE_LOG_EX_ ## severity(Win32ErrorLogMessage, \
::cef::logging::GetLastSystemErrorCode()).stream()
#elif defined(OS_POSIX)
#define PLOG_STREAM(severity) \
COMPACT_GOOGLE_LOG_EX_##severity(ErrnoLogMessage, \
::cef::logging::GetLastSystemErrorCode()) \
.stream()
#define PLOG_STREAM(severity) \
COMPACT_GOOGLE_LOG_EX_ ## severity(ErrnoLogMessage, \
::cef::logging::GetLastSystemErrorCode()).stream()
#endif
#define PLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
#define PLOG(severity) \
LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
#define PLOG_IF(severity, condition) \
LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition))
// The actual stream used isn't important.
#define EAT_STREAM_PARAMETERS \
true ? (void)0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL)
#define EAT_STREAM_PARAMETERS \
true ? (void) 0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL)
// CHECK dies with a fatal error if condition is not true. It is *not*
// controlled by NDEBUG, so the check will be executed regardless of
@@ -340,27 +341,28 @@ const LogSeverity LOG_0 = LOG_ERROR;
#define CHECK(condition) \
LAZY_STREAM(LOG_STREAM(FATAL), !(condition)) \
<< "Check failed: " #condition ". "
<< "Check failed: " #condition ". "
#define PCHECK(condition) \
#define PCHECK(condition) \
LAZY_STREAM(PLOG_STREAM(FATAL), !(condition)) \
<< "Check failed: " #condition ". "
<< "Check failed: " #condition ". "
// Helper macro for binary operators.
// Don't use this macro directly in your code, use CHECK_EQ et al below.
//
// TODO(akalin): Rewrite this so that constructs like if (...)
// CHECK_EQ(...) else { ... } work properly.
#define CHECK_OP(name, op, val1, val2) \
if (std::string* _result = cef::logging::Check##name##Impl( \
(val1), (val2), #val1 " " #op " " #val2)) \
cef::logging::LogMessage(__FILE__, __LINE__, _result).stream()
#define CHECK_OP(name, op, val1, val2) \
if (std::string* _result = \
cef::logging::Check##name##Impl((val1), (val2), \
#val1 " " #op " " #val2)) \
cef::logging::LogMessage(__FILE__, __LINE__, _result).stream()
// Build the error message string. This is separate from the "Impl"
// function template because it is not performance critical and so can
// be out of line, while the "Impl" code should be inline. Caller
// takes ownership of the returned string.
template <class t1, class t2>
template<class t1, class t2>
std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
std::ostringstream ss;
ss << names << " (" << v1 << " vs. " << v2 << ")";
@@ -372,60 +374,51 @@ std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
#if !defined(COMPILER_MSVC)
// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated
// in logging.cc.
extern template std::string* MakeCheckOpString<int, int>(const int&,
const int&,
const char* names);
extern template std::string* MakeCheckOpString<unsigned long, unsigned long>(
const unsigned long&,
const unsigned long&,
const char* names);
extern template std::string* MakeCheckOpString<unsigned long, unsigned int>(
const unsigned long&,
const unsigned int&,
const char* names);
extern template std::string* MakeCheckOpString<unsigned int, unsigned long>(
const unsigned int&,
const unsigned long&,
const char* names);
extern template std::string* MakeCheckOpString<std::string, std::string>(
const std::string&,
const std::string&,
const char* name);
extern template std::string* MakeCheckOpString<int, int>(
const int&, const int&, const char* names);
extern template
std::string* MakeCheckOpString<unsigned long, unsigned long>(
const unsigned long&, const unsigned long&, const char* names);
extern template
std::string* MakeCheckOpString<unsigned long, unsigned int>(
const unsigned long&, const unsigned int&, const char* names);
extern template
std::string* MakeCheckOpString<unsigned int, unsigned long>(
const unsigned int&, const unsigned long&, const char* names);
extern template
std::string* MakeCheckOpString<std::string, std::string>(
const std::string&, const std::string&, const char* name);
#endif
// Helper functions for CHECK_OP macro.
// The (int, int) specialization works around the issue that the compiler
// will not instantiate the template version of the function on values of
// unnamed enum type - see comment below.
#define DEFINE_CHECK_OP_IMPL(name, op) \
template <class t1, class t2> \
inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \
const char* names) { \
if (v1 op v2) \
return NULL; \
else \
return MakeCheckOpString(v1, v2, names); \
} \
#define DEFINE_CHECK_OP_IMPL(name, op) \
template <class t1, class t2> \
inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \
const char* names) { \
if (v1 op v2) return NULL; \
else return MakeCheckOpString(v1, v2, names); \
} \
inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \
if (v1 op v2) \
return NULL; \
else \
return MakeCheckOpString(v1, v2, names); \
if (v1 op v2) return NULL; \
else return MakeCheckOpString(v1, v2, names); \
}
DEFINE_CHECK_OP_IMPL(EQ, ==)
DEFINE_CHECK_OP_IMPL(NE, !=)
DEFINE_CHECK_OP_IMPL(LE, <=)
DEFINE_CHECK_OP_IMPL(LT, <)
DEFINE_CHECK_OP_IMPL(LT, < )
DEFINE_CHECK_OP_IMPL(GE, >=)
DEFINE_CHECK_OP_IMPL(GT, >)
DEFINE_CHECK_OP_IMPL(GT, > )
#undef DEFINE_CHECK_OP_IMPL
#define CHECK_EQ(val1, val2) CHECK_OP(EQ, ==, val1, val2)
#define CHECK_NE(val1, val2) CHECK_OP(NE, !=, val1, val2)
#define CHECK_LE(val1, val2) CHECK_OP(LE, <=, val1, val2)
#define CHECK_LT(val1, val2) CHECK_OP(LT, <, val1, val2)
#define CHECK_LT(val1, val2) CHECK_OP(LT, < , val1, val2)
#define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2)
#define CHECK_GT(val1, val2) CHECK_OP(GT, >, val1, val2)
#define CHECK_GT(val1, val2) CHECK_OP(GT, > , val1, val2)
#if defined(NDEBUG)
#define ENABLE_DLOG 0
@@ -478,9 +471,11 @@ enum { DEBUG_MODE = ENABLE_DLOG };
#undef ENABLE_DLOG
#define DLOG(severity) LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity))
#define DLOG(severity) \
LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity))
#define DPLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
#define DPLOG(severity) \
LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
#define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel))
@@ -491,7 +486,7 @@ enum { DEBUG_MODE = ENABLE_DLOG };
#if DCHECK_IS_ON()
#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \
COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ##__VA_ARGS__)
COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL
const LogSeverity LOG_DCHECK = LOG_FATAL;
@@ -499,7 +494,7 @@ const LogSeverity LOG_DCHECK = LOG_FATAL;
// These are just dummy values.
#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \
COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ##__VA_ARGS__)
COMPACT_GOOGLE_LOG_EX_INFO(ClassName , ##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_INFO
const LogSeverity LOG_DCHECK = LOG_INFO;
@@ -510,23 +505,22 @@ const LogSeverity LOG_DCHECK = LOG_INFO;
// variable warnings if the only use of a variable is in a DCHECK.
// This behavior is different from DLOG_IF et al.
#define DCHECK(condition) \
LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
#define DCHECK(condition) \
LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
<< "Check failed: " #condition ". "
#define DPCHECK(condition) \
LAZY_STREAM(PLOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
#define DPCHECK(condition) \
LAZY_STREAM(PLOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
<< "Check failed: " #condition ". "
// Helper macro for binary operators.
// Don't use this macro directly in your code, use DCHECK_EQ et al below.
#define DCHECK_OP(name, op, val1, val2) \
if (DCHECK_IS_ON()) \
if (std::string* _result = cef::logging::Check##name##Impl( \
(val1), (val2), #val1 " " #op " " #val2)) \
cef::logging::LogMessage(__FILE__, __LINE__, ::cef::logging::LOG_DCHECK, \
_result) \
.stream()
#define DCHECK_OP(name, op, val1, val2) \
if (DCHECK_IS_ON()) \
if (std::string* _result = cef::logging::Check##name##Impl( \
(val1), (val2), #val1 " " #op " " #val2)) \
cef::logging::LogMessage(__FILE__, __LINE__, \
::cef::logging::LOG_DCHECK, _result).stream()
// Equality/Inequality checks - compare two values, and log a
// LOG_DCHECK message including the two values when the result is not
@@ -550,11 +544,16 @@ const LogSeverity LOG_DCHECK = LOG_INFO;
#define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2)
#define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2)
#define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2)
#define DCHECK_LT(val1, val2) DCHECK_OP(LT, <, val1, val2)
#define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2)
#define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2)
#define DCHECK_GT(val1, val2) DCHECK_OP(GT, >, val1, val2)
#define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2)
#if defined(NDEBUG) && defined(OS_CHROMEOS)
#define NOTREACHED() LOG(ERROR) << "NOTREACHED() hit in " << \
__FUNCTION__ << ". "
#else
#define NOTREACHED() DCHECK(false)
#endif
// Redefine the standard assert to use our nice log files
#undef assert
@@ -578,9 +577,7 @@ class LogMessage {
LogMessage(const char* file, int line, std::string* result);
// Used for DCHECK_EQ(), etc. Takes ownership of the given string.
LogMessage(const char* file,
int line,
LogSeverity severity,
LogMessage(const char* file, int line, LogSeverity severity,
std::string* result);
~LogMessage();
@@ -620,7 +617,7 @@ class LogMessage {
// A non-macro interface to the log facility; (useful
// when the logging level is not a compile-time constant).
inline void LogAtLevel(int const log_level, std::string const& msg) {
inline void LogAtLevel(int const log_level, std::string const &msg) {
LogMessage(__FILE__, __LINE__, log_level).stream() << msg;
}
@@ -629,10 +626,10 @@ inline void LogAtLevel(int const log_level, std::string const& msg) {
// is not used" and "statement has no effect".
class LogMessageVoidify {
public:
LogMessageVoidify() {}
LogMessageVoidify() { }
// This has to be an operator with a precedence lower than << but
// higher than ?:
void operator&(std::ostream&) {}
void operator&(std::ostream&) { }
};
#if defined(OS_WIN)
@@ -742,13 +739,12 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
#elif NOTIMPLEMENTED_POLICY == 4
#define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG
#elif NOTIMPLEMENTED_POLICY == 5
#define NOTIMPLEMENTED() \
do { \
static bool logged_once = false; \
LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG; \
logged_once = true; \
} while (0); \
EAT_STREAM_PARAMETERS
#define NOTIMPLEMENTED() do {\
static bool logged_once = false;\
LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
logged_once = true;\
} while(0);\
EAT_STREAM_PARAMETERS
#endif
#endif // !USING_CHROMIUM_INCLUDES

View File

@@ -41,7 +41,7 @@
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <stddef.h> // For size_t.
#include <stddef.h> // For size_t.
#include "include/base/cef_build.h" // For COMPILER_MSVC
#if !defined(arraysize)
@@ -126,13 +126,14 @@ char (&ArraySizeHelper(const T (&array)[N]))[N];
namespace cef {
template <bool>
struct CompileAssert {};
struct CompileAssert {
};
} // namespace cef
#define COMPILE_ASSERT(expr, msg) \
typedef cef::CompileAssert<(bool(expr))> \
msg[bool(expr) ? 1 : -1] ALLOW_UNUSED_TYPE
#define COMPILE_ASSERT(expr, msg) \
typedef cef::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] \
ALLOW_UNUSED_TYPE
// Implementation details of COMPILE_ASSERT:
//
@@ -181,12 +182,13 @@ struct CompileAssert {};
#endif // !USING_CHROMIUM_INCLUDES
#if !defined(MSVC_PUSH_DISABLE_WARNING) && defined(COMPILER_MSVC)
#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST)
#if defined(COMPILER_MSVC)
// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled.
// The warning remains disabled until popped by MSVC_POP_WARNING.
#define MSVC_PUSH_DISABLE_WARNING(n) \
__pragma(warning(push)) __pragma(warning(disable : n))
#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \
__pragma(warning(disable:n))
// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level
// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all
@@ -196,10 +198,6 @@ struct CompileAssert {};
// Pop effects of innermost MSVC_PUSH_* macro.
#define MSVC_POP_WARNING() __pragma(warning(pop))
#endif // !defined(MSVC_PUSH_DISABLE_WARNING) && defined(COMPILER_MSVC)
#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST)
#if defined(COMPILER_MSVC)
// Allows |this| to be passed as an argument in constructor initializer lists.
// This uses push/pop instead of the seemingly simpler suppress feature to avoid
// having the warning be disabled for more than just |code|.
@@ -209,11 +207,13 @@ struct CompileAssert {};
//
// Compiler warning C4355: 'this': used in base member initializer list:
// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) \
MSVC_PUSH_DISABLE_WARNING(4355) \
code MSVC_POP_WARNING()
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \
code \
MSVC_POP_WARNING()
#else // !COMPILER_MSVC
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
#endif // !COMPILER_MSVC
#endif // !ALLOW_THIS_IN_INITIALIZER_LIST

View File

@@ -240,22 +240,20 @@
//
// The workaround is to explicitly declare your copy constructor.
//
#define MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \
private: \
struct rvalue_type { \
#define MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \
private: \
struct rvalue_type { \
explicit rvalue_type(type* object) : object(object) {} \
type* object; \
}; \
type(type&); \
void operator=(type&); \
\
public: \
operator rvalue_type() { return rvalue_type(this); } \
type Pass() { return type(rvalue_type(this)); } \
typedef void MoveOnlyTypeForCPP03; \
\
type* object; \
}; \
type(type&); \
void operator=(type&); \
public: \
operator rvalue_type() { return rvalue_type(this); } \
type Pass() { return type(rvalue_type(this)); } \
typedef void MoveOnlyTypeForCPP03; \
private:
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_MOVE_H_

View File

@@ -69,14 +69,21 @@ class PlatformThreadRef {
public:
typedef cef_platform_thread_handle_t RefType;
PlatformThreadRef() : id_(0) {}
PlatformThreadRef()
: id_(0) {
}
explicit PlatformThreadRef(RefType id) : id_(id) {}
explicit PlatformThreadRef(RefType id)
: id_(id) {
}
bool operator==(PlatformThreadRef other) const { return id_ == other.id_; }
bool is_null() const { return id_ == 0; }
bool operator==(PlatformThreadRef other) const {
return id_ == other.id_;
}
bool is_null() const {
return id_ == 0;
}
private:
RefType id_;
};

View File

@@ -51,7 +51,7 @@
#include "include/base/cef_atomic_ref_count.h"
#include "include/base/cef_build.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_thread_collision_warner.h"
namespace base {
@@ -60,40 +60,47 @@ namespace cef_subtle {
class RefCountedBase {
public:
bool HasOneRef() const { return ref_count_ == 1; }
bool HasAtLeastOneRef() const { return ref_count_ >= 1; }
protected:
RefCountedBase()
: ref_count_(0)
#if DCHECK_IS_ON()
,
in_dtor_(false)
#endif
{
#if DCHECK_IS_ON()
, in_dtor_(false)
#endif
{
}
~RefCountedBase() {
#if DCHECK_IS_ON()
#if DCHECK_IS_ON()
DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()";
#endif
#endif
}
void AddRef() const {
#if DCHECK_IS_ON()
// TODO(maruel): Add back once it doesn't assert 500 times/sec.
// Current thread books the critical section "AddRelease"
// without release it.
// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
#if DCHECK_IS_ON()
DCHECK(!in_dtor_);
#endif
#endif
++ref_count_;
}
// Returns true if the object should self-delete.
bool Release() const {
#if DCHECK_IS_ON()
// TODO(maruel): Add back once it doesn't assert 500 times/sec.
// Current thread books the critical section "AddRelease"
// without release it.
// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
#if DCHECK_IS_ON()
DCHECK(!in_dtor_);
#endif
#endif
if (--ref_count_ == 0) {
#if DCHECK_IS_ON()
#if DCHECK_IS_ON()
in_dtor_ = true;
#endif
#endif
return true;
}
return false;
@@ -105,13 +112,14 @@ class RefCountedBase {
mutable bool in_dtor_;
#endif
DFAKE_MUTEX(add_release_);
DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
};
class RefCountedThreadSafeBase {
public:
bool HasOneRef() const;
bool HasAtLeastOneRef() const;
protected:
RefCountedThreadSafeBase();
@@ -152,7 +160,9 @@ class RefCounted : public cef_subtle::RefCountedBase {
public:
RefCounted() {}
void AddRef() const { cef_subtle::RefCountedBase::AddRef(); }
void AddRef() const {
cef_subtle::RefCountedBase::AddRef();
}
void Release() const {
if (cef_subtle::RefCountedBase::Release()) {
@@ -168,19 +178,18 @@ class RefCounted : public cef_subtle::RefCountedBase {
};
// Forward declaration.
template <class T, typename Traits>
class RefCountedThreadSafe;
template <class T, typename Traits> class RefCountedThreadSafe;
// Default traits for RefCountedThreadSafe<T>. Deletes the object when its ref
// count reaches 0. Overload to delete it on a different thread etc.
template <typename T>
template<typename T>
struct DefaultRefCountedThreadSafeTraits {
static void Destruct(const T* x) {
// Delete through RefCountedThreadSafe to make child classes only need to be
// friend with RefCountedThreadSafe instead of this struct, which is an
// implementation detail.
RefCountedThreadSafe<T, DefaultRefCountedThreadSafeTraits>::DeleteInternal(
x);
RefCountedThreadSafe<T,
DefaultRefCountedThreadSafeTraits>::DeleteInternal(x);
}
};
@@ -196,12 +205,14 @@ struct DefaultRefCountedThreadSafeTraits {
// private:
// friend class base::RefCountedThreadSafe<MyFoo>;
// ~MyFoo();
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T>>
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T> >
class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
public:
RefCountedThreadSafe() {}
void AddRef() const { cef_subtle::RefCountedThreadSafeBase::AddRef(); }
void AddRef() const {
cef_subtle::RefCountedThreadSafeBase::AddRef();
}
void Release() const {
if (cef_subtle::RefCountedThreadSafeBase::Release()) {
@@ -223,9 +234,9 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
// A thread-safe wrapper for some piece of data so we can place other
// things in scoped_refptrs<>.
//
template <typename T>
template<typename T>
class RefCountedData
: public base::RefCountedThreadSafe<base::RefCountedData<T>> {
: public base::RefCountedThreadSafe< base::RefCountedData<T> > {
public:
RefCountedData() : data() {}
RefCountedData(const T& in_value) : data(in_value) {}
@@ -233,7 +244,7 @@ class RefCountedData
T data;
private:
friend class base::RefCountedThreadSafe<base::RefCountedData<T>>;
friend class base::RefCountedThreadSafe<base::RefCountedData<T> >;
~RefCountedData() {}
};
@@ -292,7 +303,8 @@ class scoped_refptr {
public:
typedef T element_type;
scoped_refptr() : ptr_(NULL) {}
scoped_refptr() : ptr_(NULL) {
}
scoped_refptr(T* p) : ptr_(p) {
if (ptr_)
@@ -352,7 +364,9 @@ class scoped_refptr {
*pp = p;
}
void swap(scoped_refptr<T>& r) { swap(&r.ptr_); }
void swap(scoped_refptr<T>& r) {
swap(&r.ptr_);
}
protected:
T* ptr_;

View File

@@ -154,8 +154,7 @@ class RefCountedThreadSafeBase;
template <class T>
struct DefaultDeleter {
DefaultDeleter() {}
template <typename U>
DefaultDeleter(const DefaultDeleter<U>& other) {
template <typename U> DefaultDeleter(const DefaultDeleter<U>& other) {
// IMPLEMENTATION NOTE: C++11 20.7.1.1.2p2 only provides this constructor
// if U* is implicitly convertible to T* and U is not an array type.
//
@@ -195,8 +194,7 @@ struct DefaultDeleter<T[]> {
// References:
// C++98 [expr.delete]p3
// http://cplusplus.github.com/LWG/lwg-defects.html#938
template <typename U>
void operator()(U* array) const;
template <typename U> void operator()(U* array) const;
};
template <class T, int n>
@@ -211,18 +209,18 @@ struct DefaultDeleter<T[n]> {
// scoped_ptr<int, base::FreeDeleter> foo_ptr(
// static_cast<int*>(malloc(sizeof(int))));
struct FreeDeleter {
inline void operator()(void* ptr) const { free(ptr); }
inline void operator()(void* ptr) const {
free(ptr);
}
};
namespace cef_internal {
template <typename T>
struct IsNotRefCounted {
template <typename T> struct IsNotRefCounted {
enum {
value =
!base::is_convertible<T*, base::subtle::RefCountedBase*>::value &&
!base::is_convertible<T*,
base::subtle::RefCountedThreadSafeBase*>::value
value = !base::is_convertible<T*, base::subtle::RefCountedBase*>::value &&
!base::is_convertible<T*, base::subtle::RefCountedThreadSafeBase*>::
value
};
};
@@ -231,7 +229,7 @@ struct IsNotRefCounted {
template <class T, class D>
class scoped_ptr_impl {
public:
explicit scoped_ptr_impl(T* p) : data_(p) {}
explicit scoped_ptr_impl(T* p) : data_(p) { }
// Initializer for deleters that have data parameters.
scoped_ptr_impl(T* p, const D& d) : data_(p, d) {}
@@ -311,8 +309,7 @@ class scoped_ptr_impl {
private:
// Needed to allow type-converting constructor.
template <typename U, typename V>
friend class scoped_ptr_impl;
template <typename U, typename V> friend class scoped_ptr_impl;
// Use the empty base class optimization to allow us to have a D
// member, while avoiding any space overhead for it when D is an
@@ -349,7 +346,7 @@ class scoped_ptr_impl {
// unique_ptr<> features. Known deficiencies include not supporting move-only
// deleteres, function pointers as deleters, and deleters with reference
// types.
template <class T, class D = base::DefaultDeleter<T>>
template <class T, class D = base::DefaultDeleter<T> >
class scoped_ptr {
MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue)
@@ -362,13 +359,13 @@ class scoped_ptr {
typedef D deleter_type;
// Constructor. Defaults to initializing with NULL.
scoped_ptr() : impl_(NULL) {}
scoped_ptr() : impl_(NULL) { }
// Constructor. Takes ownership of p.
explicit scoped_ptr(element_type* p) : impl_(p) {}
explicit scoped_ptr(element_type* p) : impl_(p) { }
// Constructor. Allows initialization of a stateful deleter.
scoped_ptr(element_type* p, const D& d) : impl_(p, d) {}
scoped_ptr(element_type* p, const D& d) : impl_(p, d) { }
// Constructor. Allows construction from a scoped_ptr rvalue for a
// convertible type and deleter.
@@ -386,7 +383,7 @@ class scoped_ptr {
}
// Constructor. Move constructor for C++03 move emulation of this type.
scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) {}
scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { }
// operator=. Allows assignment from a scoped_ptr rvalue for a convertible
// type and deleter.
@@ -415,7 +412,7 @@ class scoped_ptr {
assert(impl_.get() != NULL);
return *impl_.get();
}
element_type* operator->() const {
element_type* operator->() const {
assert(impl_.get() != NULL);
return impl_.get();
}
@@ -446,14 +443,18 @@ class scoped_ptr {
bool operator!=(const element_type* p) const { return impl_.get() != p; }
// Swap two scoped pointers.
void swap(scoped_ptr& p2) { impl_.swap(p2.impl_); }
void swap(scoped_ptr& p2) {
impl_.swap(p2.impl_);
}
// Release a pointer.
// The return value is the current pointer held by this object.
// If this object holds a NULL pointer, the return value is NULL.
// After this operation, this object will hold a NULL pointer,
// and will not own the object any more.
element_type* release() WARN_UNUSED_RESULT { return impl_.release(); }
element_type* release() WARN_UNUSED_RESULT {
return impl_.release();
}
// C++98 doesn't support functions templates with default parameters which
// makes it hard to write a PassAs() that understands converting the deleter
@@ -468,8 +469,7 @@ class scoped_ptr {
private:
// Needed to reach into |impl_| in the constructor.
template <typename U, typename V>
friend class scoped_ptr;
template <typename U, typename V> friend class scoped_ptr;
base::cef_internal::scoped_ptr_impl<element_type, deleter_type> impl_;
// Forbidden for API compatibility with std::unique_ptr.
@@ -479,10 +479,8 @@ class scoped_ptr {
// doesn't make sense, and if U == T, it still doesn't make sense
// because you should never have the same object owned by two different
// scoped_ptrs.
template <class U>
bool operator==(scoped_ptr<U> const& p2) const;
template <class U>
bool operator!=(scoped_ptr<U> const& p2) const;
template <class U> bool operator==(scoped_ptr<U> const& p2) const;
template <class U> bool operator!=(scoped_ptr<U> const& p2) const;
};
template <class T, class D>
@@ -495,7 +493,7 @@ class scoped_ptr<T[], D> {
typedef D deleter_type;
// Constructor. Defaults to initializing with NULL.
scoped_ptr() : impl_(NULL) {}
scoped_ptr() : impl_(NULL) { }
// Constructor. Stores the given array. Note that the argument's type
// must exactly match T*. In particular:
@@ -513,10 +511,10 @@ class scoped_ptr<T[], D> {
// to work around this may use implicit_cast<const T*>().
// However, because of the first bullet in this comment, users MUST
// NOT use implicit_cast<Base*>() to upcast the static type of the array.
explicit scoped_ptr(element_type* array) : impl_(array) {}
explicit scoped_ptr(element_type* array) : impl_(array) { }
// Constructor. Move constructor for C++03 move emulation of this type.
scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) {}
scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { }
// operator=. Move operator= for C++03 move emulation of this type.
scoped_ptr& operator=(RValue rhs) {
@@ -555,14 +553,18 @@ class scoped_ptr<T[], D> {
bool operator!=(element_type* array) const { return impl_.get() != array; }
// Swap two scoped pointers.
void swap(scoped_ptr& p2) { impl_.swap(p2.impl_); }
void swap(scoped_ptr& p2) {
impl_.swap(p2.impl_);
}
// Release a pointer.
// The return value is the current pointer held by this object.
// If this object holds a NULL pointer, the return value is NULL.
// After this operation, this object will hold a NULL pointer,
// and will not own the object any more.
element_type* release() WARN_UNUSED_RESULT { return impl_.release(); }
element_type* release() WARN_UNUSED_RESULT {
return impl_.release();
}
private:
// Force element_type to be a complete type.
@@ -576,24 +578,20 @@ class scoped_ptr<T[], D> {
// private and has no definition. This is disabled because it is not safe to
// call delete[] on an array whose static type does not match its dynamic
// type.
template <typename U>
explicit scoped_ptr(U* array);
template <typename U> explicit scoped_ptr(U* array);
explicit scoped_ptr(int disallow_construction_from_null);
// Disable reset() from any type other than element_type*, for the same
// reasons as the constructor above.
template <typename U>
void reset(U* array);
template <typename U> void reset(U* array);
void reset(int disallow_reset_from_null);
// Forbid comparison of scoped_ptr types. If U != T, it totally
// doesn't make sense, and if U == T, it still doesn't make sense
// because you should never have the same object owned by two different
// scoped_ptrs.
template <class U>
bool operator==(scoped_ptr<U> const& p2) const;
template <class U>
bool operator!=(scoped_ptr<U> const& p2) const;
template <class U> bool operator==(scoped_ptr<U> const& p2) const;
template <class U> bool operator!=(scoped_ptr<U> const& p2) const;
};
// Free functions

View File

@@ -86,7 +86,6 @@ typedef std::char_traits<wchar_t> string16_char_traits;
#include "include/base/cef_macros.h"
namespace cef {
namespace base {
typedef uint16_t char16;
@@ -113,19 +112,26 @@ struct string16_char_traits {
typedef mbstate_t state_type;
typedef std::fpos<state_type> pos_type;
static void assign(char_type& c1, const char_type& c2) { c1 = c2; }
static void assign(char_type& c1, const char_type& c2) {
c1 = c2;
}
static bool eq(const char_type& c1, const char_type& c2) { return c1 == c2; }
static bool lt(const char_type& c1, const char_type& c2) { return c1 < c2; }
static bool eq(const char_type& c1, const char_type& c2) {
return c1 == c2;
}
static bool lt(const char_type& c1, const char_type& c2) {
return c1 < c2;
}
static int compare(const char_type* s1, const char_type* s2, size_t n) {
return c16memcmp(s1, s2, n);
}
static size_t length(const char_type* s) { return c16len(s); }
static size_t length(const char_type* s) {
return c16len(s);
}
static const char_type* find(const char_type* s,
size_t n,
static const char_type* find(const char_type* s, size_t n,
const char_type& a) {
return c16memchr(s, a, n);
}
@@ -146,26 +152,24 @@ struct string16_char_traits {
return eq_int_type(c, eof()) ? 0 : c;
}
static char_type to_char_type(const int_type& c) { return char_type(c); }
static char_type to_char_type(const int_type& c) {
return char_type(c);
}
static int_type to_int_type(const char_type& c) { return int_type(c); }
static int_type to_int_type(const char_type& c) {
return int_type(c);
}
static bool eq_int_type(const int_type& c1, const int_type& c2) {
return c1 == c2;
}
static int_type eof() { return static_cast<int_type>(EOF); }
static int_type eof() {
return static_cast<int_type>(EOF);
}
};
typedef std::basic_string<char16, string16_char_traits> string16;
} // namespace base
} // namespace cef
namespace base {
typedef cef::base::char16 char16;
typedef cef::base::string16 string16;
typedef std::basic_string<char16, base::string16_char_traits> string16;
extern std::ostream& operator<<(std::ostream& out, const string16& str);
@@ -213,8 +217,8 @@ extern void PrintTo(const string16& str, std::ostream* out);
//
// TODO(mark): File this bug with Apple and update this note with a bug number.
extern template class std::basic_string<cef::base::char16,
cef::base::string16_char_traits>;
extern template
class std::basic_string<base::char16, base::string16_char_traits>;
#endif // WCHAR_T_IS_UTF32

View File

@@ -53,92 +53,70 @@ namespace base {
// template definitions from tr1
template <class T, T v>
template<class T, T v>
struct integral_constant {
static const T value = v;
typedef T value_type;
typedef integral_constant<T, v> type;
};
template <class T, T v>
const T integral_constant<T, v>::value;
template <class T, T v> const T integral_constant<T, v>::value;
typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
template <class T>
struct is_pointer : false_type {};
template <class T>
struct is_pointer<T*> : true_type {};
template <class T> struct is_pointer : false_type {};
template <class T> struct is_pointer<T*> : true_type {};
// Member function pointer detection up to four params. Add more as needed
// below. This is built-in to C++ 11, and we can remove this when we switch.
template <typename T>
template<typename T>
struct is_member_function_pointer : false_type {};
template <typename R, typename Z>
struct is_member_function_pointer<R (Z::*)()> : true_type {};
struct is_member_function_pointer<R(Z::*)()> : true_type {};
template <typename R, typename Z>
struct is_member_function_pointer<R (Z::*)() const> : true_type {};
struct is_member_function_pointer<R(Z::*)() const> : true_type {};
template <typename R, typename Z, typename A>
struct is_member_function_pointer<R (Z::*)(A)> : true_type {};
struct is_member_function_pointer<R(Z::*)(A)> : true_type {};
template <typename R, typename Z, typename A>
struct is_member_function_pointer<R (Z::*)(A) const> : true_type {};
struct is_member_function_pointer<R(Z::*)(A) const> : true_type {};
template <typename R, typename Z, typename A, typename B>
struct is_member_function_pointer<R (Z::*)(A, B)> : true_type {};
struct is_member_function_pointer<R(Z::*)(A, B)> : true_type {};
template <typename R, typename Z, typename A, typename B>
struct is_member_function_pointer<R (Z::*)(A, B) const> : true_type {};
struct is_member_function_pointer<R(Z::*)(A, B) const> : true_type {};
template <typename R, typename Z, typename A, typename B, typename C>
struct is_member_function_pointer<R (Z::*)(A, B, C)> : true_type {};
struct is_member_function_pointer<R(Z::*)(A, B, C)> : true_type {};
template <typename R, typename Z, typename A, typename B, typename C>
struct is_member_function_pointer<R (Z::*)(A, B, C) const> : true_type {};
struct is_member_function_pointer<R(Z::*)(A, B, C) const> : true_type {};
template <typename R,
typename Z,
typename A,
typename B,
typename C,
template <typename R, typename Z, typename A, typename B, typename C,
typename D>
struct is_member_function_pointer<R (Z::*)(A, B, C, D)> : true_type {};
template <typename R,
typename Z,
typename A,
typename B,
typename C,
struct is_member_function_pointer<R(Z::*)(A, B, C, D)> : true_type {};
template <typename R, typename Z, typename A, typename B, typename C,
typename D>
struct is_member_function_pointer<R (Z::*)(A, B, C, D) const> : true_type {};
struct is_member_function_pointer<R(Z::*)(A, B, C, D) const> : true_type {};
template <class T, class U>
struct is_same : public false_type {};
template <class T>
struct is_same<T, T> : true_type {};
template <class>
struct is_array : public false_type {};
template <class T, size_t n>
struct is_array<T[n]> : public true_type {};
template <class T>
struct is_array<T[]> : public true_type {};
template <class T, class U> struct is_same : public false_type {};
template <class T> struct is_same<T,T> : true_type {};
template <class T>
struct is_non_const_reference : false_type {};
template <class T>
struct is_non_const_reference<T&> : true_type {};
template <class T>
struct is_non_const_reference<const T&> : false_type {};
template<class> struct is_array : public false_type {};
template<class T, size_t n> struct is_array<T[n]> : public true_type {};
template<class T> struct is_array<T[]> : public true_type {};
template <class T>
struct is_const : false_type {};
template <class T>
struct is_const<const T> : true_type {};
template <class T> struct is_non_const_reference : false_type {};
template <class T> struct is_non_const_reference<T&> : true_type {};
template <class T> struct is_non_const_reference<const T&> : false_type {};
template <class T>
struct is_void : false_type {};
template <>
struct is_void<void> : true_type {};
template <class T> struct is_const : false_type {};
template <class T> struct is_const<const T> : true_type {};
template <class T> struct is_void : false_type {};
template <> struct is_void<void> : true_type {};
namespace cef_internal {
@@ -174,7 +152,7 @@ struct ConvertHelper {
// is_class type_trait implementation.
struct IsClassHelper {
template <typename C>
static YesType Test(void (C::*)(void));
static YesType Test(void(C::*)(void));
template <typename C>
static NoType Test(...);
@@ -190,22 +168,22 @@ template <typename From, typename To>
struct is_convertible
: integral_constant<bool,
sizeof(cef_internal::ConvertHelper::Test<To>(
cef_internal::ConvertHelper::Create<From>())) ==
sizeof(cef_internal::YesType)> {};
cef_internal::ConvertHelper::Create<From>())) ==
sizeof(cef_internal::YesType)> {
};
template <typename T>
struct is_class
: integral_constant<bool,
sizeof(cef_internal::IsClassHelper::Test<T>(0)) ==
sizeof(cef_internal::YesType)> {};
sizeof(cef_internal::YesType)> {
};
template <bool B, class T = void>
template<bool B, class T = void>
struct enable_if {};
template <class T>
struct enable_if<true, T> {
typedef T type;
};
template<class T>
struct enable_if<true, T> { typedef T type; };
} // namespace base

View File

@@ -58,6 +58,7 @@
#define ENABLE_THREAD_CHECKER 0
#endif
namespace base {
namespace cef_internal {
@@ -68,7 +69,9 @@ namespace cef_internal {
// right version for your build configuration.
class ThreadCheckerDoNothing {
public:
bool CalledOnValidThread() const { return true; }
bool CalledOnValidThread() const {
return true;
}
void DetachFromThread() {}
};
@@ -107,9 +110,11 @@ class ThreadCheckerDoNothing {
//
// In Release mode, CalledOnValidThread will always return true.
#if ENABLE_THREAD_CHECKER
class ThreadChecker : public cef_internal::ThreadCheckerImpl {};
class ThreadChecker : public cef_internal::ThreadCheckerImpl {
};
#else
class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {};
class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {
};
#endif // ENABLE_THREAD_CHECKER
#undef ENABLE_THREAD_CHECKER

View File

@@ -0,0 +1,288 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. 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.
#ifndef CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_
#define CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_
#pragma once
#if defined(BASE_THREADING_THREAD_COLLISION_WARNER_H_)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts.
#elif defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/threading/thread_collision_warner.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <memory>
#include "include/base/cef_atomicops.h"
#include "include/base/cef_basictypes.h"
#include "include/base/cef_build.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
// A helper class alongside macros to be used to verify assumptions about thread
// safety of a class.
//
// Example: Queue implementation non thread-safe but still usable if clients
// are synchronized somehow.
//
// In this case the macro DFAKE_SCOPED_LOCK has to be
// used, it checks that if a thread is inside the push/pop then
// noone else is still inside the pop/push
//
// class NonThreadSafeQueue {
// public:
// ...
// void push(int) { DFAKE_SCOPED_LOCK(push_pop_); ... }
// int pop() { DFAKE_SCOPED_LOCK(push_pop_); ... }
// ...
// private:
// DFAKE_MUTEX(push_pop_);
// };
//
//
// Example: Queue implementation non thread-safe but still usable if clients
// are synchronized somehow, it calls a method to "protect" from
// a "protected" method
//
// In this case the macro DFAKE_SCOPED_RECURSIVE_LOCK
// has to be used, it checks that if a thread is inside the push/pop
// then noone else is still inside the pop/push
//
// class NonThreadSafeQueue {
// public:
// void push(int) {
// DFAKE_SCOPED_LOCK(push_pop_);
// ...
// }
// int pop() {
// DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_);
// bar();
// ...
// }
// void bar() { DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_); ... }
// ...
// private:
// DFAKE_MUTEX(push_pop_);
// };
//
//
// Example: Queue implementation not usable even if clients are synchronized,
// so only one thread in the class life cycle can use the two members
// push/pop.
//
// In this case the macro DFAKE_SCOPED_LOCK_THREAD_LOCKED pins the
// specified
// critical section the first time a thread enters push or pop, from
// that time on only that thread is allowed to execute push or pop.
//
// class NonThreadSafeQueue {
// public:
// ...
// void push(int) { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... }
// int pop() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... }
// ...
// private:
// DFAKE_MUTEX(push_pop_);
// };
//
//
// Example: Class that has to be contructed/destroyed on same thread, it has
// a "shareable" method (with external synchronization) and a not
// shareable method (even with external synchronization).
//
// In this case 3 Critical sections have to be defined
//
// class ExoticClass {
// public:
// ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... }
// ~ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... }
//
// void Shareable() { DFAKE_SCOPED_LOCK(shareable_section_); ... }
// void NotShareable() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... }
// ...
// private:
// DFAKE_MUTEX(ctor_dtor_);
// DFAKE_MUTEX(shareable_section_);
// };
#if DCHECK_IS_ON()
// Defines a class member that acts like a mutex. It is used only as a
// verification tool.
#define DFAKE_MUTEX(obj) \
mutable base::ThreadCollisionWarner obj
// Asserts the call is never called simultaneously in two threads. Used at
// member function scope.
#define DFAKE_SCOPED_LOCK(obj) \
base::ThreadCollisionWarner::ScopedCheck s_check_##obj(&obj)
// Asserts the call is never called simultaneously in two threads. Used at
// member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks.
#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \
base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj)
// Asserts the code is always executed in the same thread.
#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \
base::ThreadCollisionWarner::Check check_##obj(&obj)
#else
#define DFAKE_MUTEX(obj) typedef void InternalFakeMutexType##obj
#define DFAKE_SCOPED_LOCK(obj) ((void)0)
#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) ((void)0)
#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) ((void)0)
#endif
namespace base {
// The class ThreadCollisionWarner uses an Asserter to notify the collision
// AsserterBase is the interfaces and DCheckAsserter is the default asserter
// used. During the unit tests is used another class that doesn't "DCHECK"
// in case of collision (check thread_collision_warner_unittests.cc)
struct AsserterBase {
virtual ~AsserterBase() {}
virtual void warn() = 0;
};
struct DCheckAsserter : public AsserterBase {
virtual ~DCheckAsserter() {}
virtual void warn() OVERRIDE;
};
class ThreadCollisionWarner {
public:
// The parameter asserter is there only for test purpose
explicit ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter())
: valid_thread_id_(0),
counter_(0),
asserter_(asserter) {}
~ThreadCollisionWarner() {
delete asserter_;
}
// This class is meant to be used through the macro
// DFAKE_SCOPED_LOCK_THREAD_LOCKED
// it doesn't leave the critical section, as opposed to ScopedCheck,
// because the critical section being pinned is allowed to be used only
// from one thread
class Check {
public:
explicit Check(ThreadCollisionWarner* warner)
: warner_(warner) {
warner_->EnterSelf();
}
~Check() {}
private:
ThreadCollisionWarner* warner_;
DISALLOW_COPY_AND_ASSIGN(Check);
};
// This class is meant to be used through the macro
// DFAKE_SCOPED_LOCK
class ScopedCheck {
public:
explicit ScopedCheck(ThreadCollisionWarner* warner)
: warner_(warner) {
warner_->Enter();
}
~ScopedCheck() {
warner_->Leave();
}
private:
ThreadCollisionWarner* warner_;
DISALLOW_COPY_AND_ASSIGN(ScopedCheck);
};
// This class is meant to be used through the macro
// DFAKE_SCOPED_RECURSIVE_LOCK
class ScopedRecursiveCheck {
public:
explicit ScopedRecursiveCheck(ThreadCollisionWarner* warner)
: warner_(warner) {
warner_->EnterSelf();
}
~ScopedRecursiveCheck() {
warner_->Leave();
}
private:
ThreadCollisionWarner* warner_;
DISALLOW_COPY_AND_ASSIGN(ScopedRecursiveCheck);
};
private:
// This method stores the current thread identifier and does a DCHECK
// if a another thread has already done it, it is safe if same thread
// calls this multiple time (recursion allowed).
void EnterSelf();
// Same as EnterSelf but recursion is not allowed.
void Enter();
// Removes the thread_id stored in order to allow other threads to
// call EnterSelf or Enter.
void Leave();
// This stores the thread id that is inside the critical section, if the
// value is 0 then no thread is inside.
volatile subtle::Atomic32 valid_thread_id_;
// Counter to trace how many time a critical section was "pinned"
// (when allowed) in order to unpin it when counter_ reaches 0.
volatile subtle::Atomic32 counter_;
// Here only for class unit tests purpose, during the test I need to not
// DCHECK but notify the collision with something else.
AsserterBase* asserter_;
DISALLOW_COPY_AND_ASSIGN(ThreadCollisionWarner);
};
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_

View File

@@ -160,29 +160,32 @@
// enabled, then this does nothing.
// - category and name strings must have application lifetime (statics or
// literals). They may not include " chars.
#define TRACE_EVENT0(category, name) \
#define TRACE_EVENT0(category, name) \
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false); \
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \
#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false); \
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, false); \
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val, false); \
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
// Implementation detail: trace event macros create temporary variable names.
// These macros give each temporary variable a unique name based on the line
// number to prevent name collisions.
#define CEF_INTERNAL_TRACE_EVENT_UID3(a, b) cef_trace_event_unique_##a##b
#define CEF_INTERNAL_TRACE_EVENT_UID2(a, b) CEF_INTERNAL_TRACE_EVENT_UID3(a, b)
#define CEF_INTERNAL_TRACE_EVENT_UID3(a,b) \
cef_trace_event_unique_##a##b
#define CEF_INTERNAL_TRACE_EVENT_UID2(a,b) \
CEF_INTERNAL_TRACE_EVENT_UID3(a,b)
#define CEF_INTERNAL_TRACE_EVENT_UID(name_prefix) \
CEF_INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__)
// Implementation detail: internal macro to end end event when the scope ends.
#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \
cef_trace_event::CefTraceEndOnScopeClose CEF_INTERNAL_TRACE_EVENT_UID( \
profileScope)(category, name)
#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \
cef_trace_event::CefTraceEndOnScopeClose \
CEF_INTERNAL_TRACE_EVENT_UID(profileScope)(category, name)
// Records a single event called "name" immediately, with 0, 1 or 2
// associated arguments. If the category is not enabled, then this
@@ -193,18 +196,18 @@
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, false)
#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, false)
#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, false)
#define TRACE_EVENT_COPY_INSTANT0(category, name) \
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, true)
#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, true)
arg2_val, true)
// Records a single BEGIN event called "name" immediately, with 0, 1 or 2
// associated arguments. If the category is not enabled, then this
@@ -215,18 +218,18 @@
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false)
#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, false)
#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, false)
#define TRACE_EVENT_COPY_BEGIN0(category, name) \
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, true)
#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, true)
arg2_val, true)
// Records a single END event for "name" immediately. If the category
// is not enabled, then this does nothing.
@@ -236,18 +239,18 @@
cef_trace_event_end(category, name, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, false)
#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, false)
#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, false)
#define TRACE_EVENT_COPY_END0(category, name) \
cef_trace_event_end(category, name, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, true)
#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, true)
#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, true)
// Records the value of a counter called "name" immediately. Value
// must be representable as a 32 bit integer.
@@ -263,14 +266,14 @@
// values as a stacked-bar chart.
// - category and name strings must have application lifetime (statics or
// literals). They may not include " chars.
#define TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, \
value2_val) \
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
value2_val, false)
#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \
value2_name, value2_val) \
#define TRACE_COUNTER2(category, name, value1_name, value1_val, \
value2_name, value2_val) \
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
value2_val, true)
value2_val, false)
#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \
value2_name, value2_val) \
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
value2_val, true)
// Records the value of a counter called "name" immediately. Value
// must be representable as a 32 bit integer.
@@ -295,13 +298,14 @@
// bits will be xored with a hash of the process ID so that the same pointer
// on two different processes will not collide.
#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \
value2_name, value2_val) \
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
value2_name, value2_val, false)
#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val, \
value2_name, value2_val) \
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
value2_name, value2_val, true)
value2_name, value2_val) \
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
value2_name, value2_val, false)
#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, \
value1_val, value2_name, value2_val) \
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
value2_name, value2_val, true)
// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
// associated arguments. If the category is not enabled, then this
@@ -321,22 +325,23 @@
// args.
#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
0, false)
0, false)
#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, false)
arg2_name, arg2_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, false)
#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
0, true)
#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, true)
#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, \
arg1_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
0, true)
#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, \
arg1_val, arg2_name, arg2_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, true)
// Records a single ASYNC_STEP_INTO event for |step| immediately. If the
// category is not enabled, then this does nothing. The |name| and |id| must
@@ -346,16 +351,16 @@
// ASYNC_STEP_PAST events.
#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false)
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
arg1_val, false)
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, \
arg1_name, arg1_val) \
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
arg1_val, false)
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO0(category, name, id, step) \
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, true)
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
arg1_val, true)
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, \
arg1_name, arg1_val) \
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
arg1_val, true)
// Records a single ASYNC_STEP_PAST event for |step| immediately. If the
// category is not enabled, then this does nothing. The |name| and |id| must
@@ -365,37 +370,38 @@
// ASYNC_STEP_INTO events.
#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false)
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
arg1_val, false)
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, \
arg1_name, arg1_val) \
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
arg1_val, false)
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST0(category, name, id, step) \
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, true)
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
arg1_val, true)
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, \
arg1_name, arg1_val) \
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
arg1_val, true)
// Records a single ASYNC_END event for "name" immediately. If the category
// is not enabled, then this does nothing.
#define TRACE_EVENT_ASYNC_END0(category, name, id) \
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
false)
false)
#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, false)
arg2_name, arg2_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, false)
#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, \
arg1_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
true)
#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, true)
true)
#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, \
arg1_val, arg2_name, arg2_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, true)
namespace cef_trace_event {
@@ -403,7 +409,8 @@ namespace cef_trace_event {
class CefTraceEndOnScopeClose {
public:
CefTraceEndOnScopeClose(const char* category, const char* name)
: category_(category), name_(name) {}
: category_(category), name_(name) {
}
~CefTraceEndOnScopeClose() {
cef_trace_event_end(category_, name_, NULL, 0, NULL, 0, false);
}

File diff suppressed because it is too large Load Diff

View File

@@ -117,10 +117,8 @@
namespace base {
template <typename T>
class SupportsWeakPtr;
template <typename T>
class WeakPtr;
template <typename T> class SupportsWeakPtr;
template <typename T> class WeakPtr;
namespace cef_internal {
// These classes are part of the WeakPtr implementation.
@@ -166,7 +164,9 @@ class WeakReferenceOwner {
WeakReference GetRef() const;
bool HasRefs() const { return flag_.get() && !flag_->HasOneRef(); }
bool HasRefs() const {
return flag_.get() && !flag_->HasOneRef();
}
void Invalidate();
@@ -198,10 +198,10 @@ class SupportsWeakPtrBase {
// conversion will only compile if there is exists a Base which inherits
// from SupportsWeakPtr<Base>. See base::AsWeakPtr() below for a helper
// function that makes calling this easier.
template <typename Derived>
template<typename Derived>
static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
typedef is_convertible<Derived, cef_internal::SupportsWeakPtrBase&>
convertible;
typedef
is_convertible<Derived, cef_internal::SupportsWeakPtrBase&> convertible;
COMPILE_ASSERT(convertible::value,
AsWeakPtr_argument_inherits_from_SupportsWeakPtr);
return AsWeakPtrImpl<Derived>(t, *t);
@@ -212,8 +212,8 @@ class SupportsWeakPtrBase {
// which is an instance of SupportsWeakPtr<Base>. We can then safely
// static_cast the Base* to a Derived*.
template <typename Derived, typename Base>
static WeakPtr<Derived> AsWeakPtrImpl(Derived* t,
const SupportsWeakPtr<Base>&) {
static WeakPtr<Derived> AsWeakPtrImpl(
Derived* t, const SupportsWeakPtr<Base>&) {
WeakPtr<Base> ptr = t->Base::AsWeakPtr();
return WeakPtr<Derived>(ptr.ref_, static_cast<Derived*>(ptr.ptr_));
}
@@ -221,8 +221,7 @@ class SupportsWeakPtrBase {
} // namespace cef_internal
template <typename T>
class WeakPtrFactory;
template <typename T> class WeakPtrFactory;
// The WeakPtr class holds a weak reference to |T*|.
//
@@ -240,21 +239,23 @@ class WeakPtrFactory;
template <typename T>
class WeakPtr : public cef_internal::WeakPtrBase {
public:
WeakPtr() : ptr_(NULL) {}
WeakPtr() : ptr_(NULL) {
}
// Allow conversion from U to T provided U "is a" T. Note that this
// is separate from the (implicit) copy constructor.
template <typename U>
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other), ptr_(other.ptr_) {}
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other), ptr_(other.ptr_) {
}
T* get() const { return ref_.is_valid() ? ptr_ : NULL; }
T& operator*() const {
CHECK(ref_.is_valid());
DCHECK(get() != NULL);
return *get();
}
T* operator->() const {
CHECK(ref_.is_valid());
DCHECK(get() != NULL);
return get();
}
@@ -279,19 +280,18 @@ class WeakPtr : public cef_internal::WeakPtrBase {
private:
// Explicitly declare comparison operators as required by the bool
// trick, but keep them private.
template <class U>
bool operator==(WeakPtr<U> const&) const;
template <class U>
bool operator!=(WeakPtr<U> const&) const;
template <class U> bool operator==(WeakPtr<U> const&) const;
template <class U> bool operator!=(WeakPtr<U> const&) const;
friend class cef_internal::SupportsWeakPtrBase;
template <typename U>
friend class WeakPtr;
template <typename U> friend class WeakPtr;
friend class SupportsWeakPtr<T>;
friend class WeakPtrFactory<T>;
WeakPtr(const cef_internal::WeakReference& ref, T* ptr)
: WeakPtrBase(ref), ptr_(ptr) {}
: WeakPtrBase(ref),
ptr_(ptr) {
}
// This pointer is only valid when ref_.is_valid() is true. Otherwise, its
// value is undefined (as opposed to NULL).
@@ -306,9 +306,12 @@ class WeakPtr : public cef_internal::WeakPtrBase {
template <class T>
class WeakPtrFactory {
public:
explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {}
explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {
}
~WeakPtrFactory() { ptr_ = NULL; }
~WeakPtrFactory() {
ptr_ = NULL;
}
WeakPtr<T> GetWeakPtr() {
DCHECK(ptr_);

View File

@@ -1,335 +0,0 @@
// Copyright (c) 2012 Google Inc. 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.
//
// Do not include this header file directly. Use base/cef_atomicops.h
// instead.
#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ARM64_GCC_H_
#define CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ARM64_GCC_H_
namespace base {
namespace subtle {
inline void MemoryBarrier() {
__asm__ __volatile__ ("dmb ish" ::: "memory"); // NOLINT
}
// NoBarrier versions of the operation include "memory" in the clobber list.
// This is not required for direct usage of the NoBarrier versions of the
// operations. However this is required for correctness when they are used as
// part of the Acquire or Release versions, to ensure that nothing from outside
// the call is reordered between the operation and the memory barrier. This does
// not change the code generated, so has no or minimal impact on the
// NoBarrier operations.
inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) {
Atomic32 prev;
int32_t temp;
__asm__ __volatile__ ( // NOLINT
"0: \n\t"
"ldxr %w[prev], %[ptr] \n\t" // Load the previous value.
"cmp %w[prev], %w[old_value] \n\t"
"bne 1f \n\t"
"stxr %w[temp], %w[new_value], %[ptr] \n\t" // Try to store the new value.
"cbnz %w[temp], 0b \n\t" // Retry if it did not work.
"1: \n\t"
: [prev]"=&r" (prev),
[temp]"=&r" (temp),
[ptr]"+Q" (*ptr)
: [old_value]"IJr" (old_value),
[new_value]"r" (new_value)
: "cc", "memory"
); // NOLINT
return prev;
}
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
Atomic32 new_value) {
Atomic32 result;
int32_t temp;
__asm__ __volatile__ ( // NOLINT
"0: \n\t"
"ldxr %w[result], %[ptr] \n\t" // Load the previous value.
"stxr %w[temp], %w[new_value], %[ptr] \n\t" // Try to store the new value.
"cbnz %w[temp], 0b \n\t" // Retry if it did not work.
: [result]"=&r" (result),
[temp]"=&r" (temp),
[ptr]"+Q" (*ptr)
: [new_value]"r" (new_value)
: "memory"
); // NOLINT
return result;
}
inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) {
Atomic32 result;
int32_t temp;
__asm__ __volatile__ ( // NOLINT
"0: \n\t"
"ldxr %w[result], %[ptr] \n\t" // Load the previous value.
"add %w[result], %w[result], %w[increment]\n\t"
"stxr %w[temp], %w[result], %[ptr] \n\t" // Try to store the result.
"cbnz %w[temp], 0b \n\t" // Retry on failure.
: [result]"=&r" (result),
[temp]"=&r" (temp),
[ptr]"+Q" (*ptr)
: [increment]"IJr" (increment)
: "memory"
); // NOLINT
return result;
}
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) {
Atomic32 result;
MemoryBarrier();
result = NoBarrier_AtomicIncrement(ptr, increment);
MemoryBarrier();
return result;
}
inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) {
Atomic32 prev;
prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
MemoryBarrier();
return prev;
}
inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) {
Atomic32 prev;
MemoryBarrier();
prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
return prev;
}
inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
*ptr = value;
}
inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
*ptr = value;
MemoryBarrier();
}
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
__asm__ __volatile__ ( // NOLINT
"stlr %w[value], %[ptr] \n\t"
: [ptr]"=Q" (*ptr)
: [value]"r" (value)
: "memory"
); // NOLINT
}
inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
return *ptr;
}
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
Atomic32 value;
__asm__ __volatile__ ( // NOLINT
"ldar %w[value], %[ptr] \n\t"
: [value]"=r" (value)
: [ptr]"Q" (*ptr)
: "memory"
); // NOLINT
return value;
}
inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
MemoryBarrier();
return *ptr;
}
// 64-bit versions of the operations.
// See the 32-bit versions for comments.
inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) {
Atomic64 prev;
int32_t temp;
__asm__ __volatile__ ( // NOLINT
"0: \n\t"
"ldxr %[prev], %[ptr] \n\t"
"cmp %[prev], %[old_value] \n\t"
"bne 1f \n\t"
"stxr %w[temp], %[new_value], %[ptr] \n\t"
"cbnz %w[temp], 0b \n\t"
"1: \n\t"
: [prev]"=&r" (prev),
[temp]"=&r" (temp),
[ptr]"+Q" (*ptr)
: [old_value]"IJr" (old_value),
[new_value]"r" (new_value)
: "cc", "memory"
); // NOLINT
return prev;
}
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
Atomic64 new_value) {
Atomic64 result;
int32_t temp;
__asm__ __volatile__ ( // NOLINT
"0: \n\t"
"ldxr %[result], %[ptr] \n\t"
"stxr %w[temp], %[new_value], %[ptr] \n\t"
"cbnz %w[temp], 0b \n\t"
: [result]"=&r" (result),
[temp]"=&r" (temp),
[ptr]"+Q" (*ptr)
: [new_value]"r" (new_value)
: "memory"
); // NOLINT
return result;
}
inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) {
Atomic64 result;
int32_t temp;
__asm__ __volatile__ ( // NOLINT
"0: \n\t"
"ldxr %[result], %[ptr] \n\t"
"add %[result], %[result], %[increment] \n\t"
"stxr %w[temp], %[result], %[ptr] \n\t"
"cbnz %w[temp], 0b \n\t"
: [result]"=&r" (result),
[temp]"=&r" (temp),
[ptr]"+Q" (*ptr)
: [increment]"IJr" (increment)
: "memory"
); // NOLINT
return result;
}
inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) {
Atomic64 result;
MemoryBarrier();
result = NoBarrier_AtomicIncrement(ptr, increment);
MemoryBarrier();
return result;
}
inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) {
Atomic64 prev;
prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
MemoryBarrier();
return prev;
}
inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) {
Atomic64 prev;
MemoryBarrier();
prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
return prev;
}
inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
*ptr = value;
}
inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
*ptr = value;
MemoryBarrier();
}
inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
__asm__ __volatile__ ( // NOLINT
"stlr %x[value], %[ptr] \n\t"
: [ptr]"=Q" (*ptr)
: [value]"r" (value)
: "memory"
); // NOLINT
}
inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
return *ptr;
}
inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
Atomic64 value;
__asm__ __volatile__ ( // NOLINT
"ldar %x[value], %[ptr] \n\t"
: [value]"=r" (value)
: [ptr]"Q" (*ptr)
: "memory"
); // NOLINT
return value;
}
inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
MemoryBarrier();
return *ptr;
}
} } // namespace base::subtle
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ARM64_GCC_H_

View File

@@ -1,197 +0,0 @@
// Copyright (c) 2008 Google Inc. 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.
// Do not include this header file directly. Use base/cef_atomicops.h
// instead.
#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ARM64_MSVC_H_
#define CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ARM64_MSVC_H_
#include <windows.h>
#include <intrin.h>
#include "include/base/cef_macros.h"
namespace base {
namespace subtle {
inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) {
LONG result = _InterlockedCompareExchange(
reinterpret_cast<volatile LONG*>(ptr), static_cast<LONG>(new_value),
static_cast<LONG>(old_value));
return static_cast<Atomic32>(result);
}
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
Atomic32 new_value) {
LONG result = _InterlockedExchange(reinterpret_cast<volatile LONG*>(ptr),
static_cast<LONG>(new_value));
return static_cast<Atomic32>(result);
}
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) {
return _InterlockedExchangeAdd(reinterpret_cast<volatile LONG*>(ptr),
static_cast<LONG>(increment)) +
increment;
}
inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) {
return Barrier_AtomicIncrement(ptr, increment);
}
#if !(defined(_MSC_VER) && _MSC_VER >= 1400)
#error "We require at least vs2005 for MemoryBarrier"
#endif
inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) {
return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
}
inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) {
return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
}
inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
*ptr = value;
}
inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
NoBarrier_AtomicExchange(ptr, value);
// acts as a barrier in this implementation
}
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
*ptr = value;
// See comments in Atomic64 version of Release_Store() below.
}
inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
return *ptr;
}
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
Atomic32 value = *ptr;
return value;
}
inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
MemoryBarrier();
return *ptr;
}
#if defined(_WIN64)
// 64-bit low-level operations on 64-bit platform.
COMPILE_ASSERT(sizeof(Atomic64) == sizeof(PVOID), atomic_word_is_atomic);
inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) {
PVOID result = InterlockedCompareExchangePointer(
reinterpret_cast<volatile PVOID*>(ptr),
reinterpret_cast<PVOID>(new_value), reinterpret_cast<PVOID>(old_value));
return reinterpret_cast<Atomic64>(result);
}
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
Atomic64 new_value) {
PVOID result =
InterlockedExchangePointer(reinterpret_cast<volatile PVOID*>(ptr),
reinterpret_cast<PVOID>(new_value));
return reinterpret_cast<Atomic64>(result);
}
inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) {
return InterlockedExchangeAdd64(reinterpret_cast<volatile LONGLONG*>(ptr),
static_cast<LONGLONG>(increment)) +
increment;
}
inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) {
return Barrier_AtomicIncrement(ptr, increment);
}
inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
*ptr = value;
}
inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
NoBarrier_AtomicExchange(ptr, value);
// acts as a barrier in this implementation
}
inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
*ptr = value;
}
inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
return *ptr;
}
inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
Atomic64 value = *ptr;
return value;
}
inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
MemoryBarrier();
return *ptr;
}
inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) {
return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
}
inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) {
return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
}
#endif // defined(_WIN64)
} // namespace base::subtle
} // namespace base
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ARM64_MSVC_H_

View File

@@ -85,9 +85,9 @@ inline void MemoryBarrier() {
// variant of the target architecture is being used. This tests against
// any known ARMv6 or ARMv7 variant, where it is possible to directly
// use ldrex/strex instructions to implement fast atomic operations.
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || \
defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__)
@@ -103,17 +103,16 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
// reloop = 0
// if (prev_value != old_value)
// reloop = STREX(ptr, new_value)
__asm__ __volatile__(
" ldrex %0, [%3]\n"
" mov %1, #0\n"
" cmp %0, %4\n"
__asm__ __volatile__(" ldrex %0, [%3]\n"
" mov %1, #0\n"
" cmp %0, %4\n"
#ifdef __thumb2__
" it eq\n"
" it eq\n"
#endif
" strexeq %1, %5, [%3]\n"
: "=&r"(prev_value), "=&r"(reloop), "+m"(*ptr)
: "r"(ptr), "r"(old_value), "r"(new_value)
: "cc", "memory");
" strexeq %1, %5, [%3]\n"
: "=&r"(prev_value), "=&r"(reloop), "+m"(*ptr)
: "r"(ptr), "r"(old_value), "r"(new_value)
: "cc", "memory");
} while (reloop != 0);
return prev_value;
}
@@ -144,13 +143,12 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
// value += increment
// reloop = STREX(ptr, value)
//
__asm__ __volatile__(
" ldrex %0, [%3]\n"
" add %0, %0, %4\n"
" strex %1, %0, [%3]\n"
: "=&r"(value), "=&r"(reloop), "+m"(*ptr)
: "r"(ptr), "r"(increment)
: "cc", "memory");
__asm__ __volatile__(" ldrex %0, [%3]\n"
" add %0, %0, %4\n"
" strex %1, %0, [%3]\n"
: "=&r"(value), "=&r"(reloop), "+m"(*ptr)
: "r"(ptr), "r"(increment)
: "cc", "memory");
} while (reloop);
return value;
}
@@ -173,19 +171,18 @@ inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
do {
// old_value = LDREX(ptr)
// reloop = STREX(ptr, new_value)
__asm__ __volatile__(
" ldrex %0, [%3]\n"
" strex %1, %4, [%3]\n"
: "=&r"(old_value), "=&r"(reloop), "+m"(*ptr)
: "r"(ptr), "r"(new_value)
: "cc", "memory");
__asm__ __volatile__(" ldrex %0, [%3]\n"
" strex %1, %4, [%3]\n"
: "=&r"(old_value), "=&r"(reloop), "+m"(*ptr)
: "r"(ptr), "r"(new_value)
: "cc", "memory");
} while (reloop != 0);
return old_value;
}
// This tests against any known ARMv5 variant.
#elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__)
defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__)
// The kernel also provides a helper function to perform an atomic
// compare-and-swap operation at the hard-wired address 0xffff0fc0.
@@ -284,7 +281,7 @@ inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
}
#else
#error "Your CPU's ARM architecture is not supported yet"
# error "Your CPU's ARM architecture is not supported yet"
#endif
// NOTE: Atomicity of the following load and store operations is only
@@ -304,9 +301,7 @@ inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
*ptr = value;
}
inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
return *ptr;
}
inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { return *ptr; }
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
Atomic32 value = *ptr;

View File

@@ -52,26 +52,26 @@ namespace subtle {
inline AtomicWord NoBarrier_CompareAndSwap(volatile AtomicWord* ptr,
AtomicWord old_value,
AtomicWord new_value) {
return NoBarrier_CompareAndSwap(reinterpret_cast<volatile Atomic32*>(ptr),
old_value, new_value);
return NoBarrier_CompareAndSwap(
reinterpret_cast<volatile Atomic32*>(ptr), old_value, new_value);
}
inline AtomicWord NoBarrier_AtomicExchange(volatile AtomicWord* ptr,
AtomicWord new_value) {
return NoBarrier_AtomicExchange(reinterpret_cast<volatile Atomic32*>(ptr),
new_value);
return NoBarrier_AtomicExchange(
reinterpret_cast<volatile Atomic32*>(ptr), new_value);
}
inline AtomicWord NoBarrier_AtomicIncrement(volatile AtomicWord* ptr,
AtomicWord increment) {
return NoBarrier_AtomicIncrement(reinterpret_cast<volatile Atomic32*>(ptr),
increment);
return NoBarrier_AtomicIncrement(
reinterpret_cast<volatile Atomic32*>(ptr), increment);
}
inline AtomicWord Barrier_AtomicIncrement(volatile AtomicWord* ptr,
AtomicWord increment) {
return Barrier_AtomicIncrement(reinterpret_cast<volatile Atomic32*>(ptr),
increment);
return Barrier_AtomicIncrement(
reinterpret_cast<volatile Atomic32*>(ptr), increment);
}
inline AtomicWord Acquire_CompareAndSwap(volatile AtomicWord* ptr,
@@ -88,22 +88,24 @@ inline AtomicWord Release_CompareAndSwap(volatile AtomicWord* ptr,
reinterpret_cast<volatile Atomic32*>(ptr), old_value, new_value);
}
inline void NoBarrier_Store(volatile AtomicWord* ptr, AtomicWord value) {
NoBarrier_Store(reinterpret_cast<volatile Atomic32*>(ptr), value);
inline void NoBarrier_Store(volatile AtomicWord *ptr, AtomicWord value) {
NoBarrier_Store(
reinterpret_cast<volatile Atomic32*>(ptr), value);
}
inline void Acquire_Store(volatile AtomicWord* ptr, AtomicWord value) {
return base::subtle::Acquire_Store(reinterpret_cast<volatile Atomic32*>(ptr),
value);
return base::subtle::Acquire_Store(
reinterpret_cast<volatile Atomic32*>(ptr), value);
}
inline void Release_Store(volatile AtomicWord* ptr, AtomicWord value) {
return base::subtle::Release_Store(reinterpret_cast<volatile Atomic32*>(ptr),
value);
return base::subtle::Release_Store(
reinterpret_cast<volatile Atomic32*>(ptr), value);
}
inline AtomicWord NoBarrier_Load(volatile const AtomicWord* ptr) {
return NoBarrier_Load(reinterpret_cast<volatile const Atomic32*>(ptr));
inline AtomicWord NoBarrier_Load(volatile const AtomicWord *ptr) {
return NoBarrier_Load(
reinterpret_cast<volatile const Atomic32*>(ptr));
}
inline AtomicWord Acquire_Load(volatile const AtomicWord* ptr) {
@@ -116,8 +118,8 @@ inline AtomicWord Release_Load(volatile const AtomicWord* ptr) {
reinterpret_cast<volatile const Atomic32*>(ptr));
}
} // namespace base::subtle
} // namespace base
} // namespace base::subtle
} // namespace base
#endif // !defined(ARCH_CPU_64_BITS)

View File

@@ -170,7 +170,7 @@ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 prev_value;
do {
if (OSAtomicCompareAndSwap64Barrier(
old_value, new_value, reinterpret_cast<volatile int64_t*>(ptr))) {
old_value, new_value, reinterpret_cast<volatile int64_t*>(ptr))) {
return old_value;
}
prev_value = *ptr;
@@ -217,7 +217,7 @@ inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
#endif // defined(__LP64__)
} // namespace base::subtle
} // namespace base
} // namespace base::subtle
} // namespace base
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_MAC_H_

View File

@@ -38,10 +38,11 @@
// Features of this x86. Values may not be correct before main() is run,
// but are set conservatively.
struct AtomicOps_x86CPUFeatureStruct {
bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
// after acquire compare-and-swap.
bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
// after acquire compare-and-swap.
};
extern struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures;
extern struct AtomicOps_x86CPUFeatureStruct
AtomicOps_Internalx86CPUFeatures;
#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
@@ -55,8 +56,8 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 new_value) {
Atomic32 prev;
__asm__ __volatile__("lock; cmpxchgl %1,%2"
: "=a"(prev)
: "q"(new_value), "m"(*ptr), "0"(old_value)
: "=a" (prev)
: "q" (new_value), "m" (*ptr), "0" (old_value)
: "memory");
return prev;
}
@@ -64,8 +65,8 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
Atomic32 new_value) {
__asm__ __volatile__("xchgl %1,%0" // The lock prefix is implicit for xchg.
: "=r"(new_value)
: "m"(*ptr), "0"(new_value)
: "=r" (new_value)
: "m" (*ptr), "0" (new_value)
: "memory");
return new_value; // Now it's the previous value.
}
@@ -74,9 +75,8 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) {
Atomic32 temp = increment;
__asm__ __volatile__("lock; xaddl %0,%1"
: "+r"(temp), "+m"(*ptr)
:
: "memory");
: "+r" (temp), "+m" (*ptr)
: : "memory");
// temp now holds the old value of *ptr
return temp + increment;
}
@@ -85,9 +85,8 @@ inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) {
Atomic32 temp = increment;
__asm__ __volatile__("lock; xaddl %0,%1"
: "+r"(temp), "+m"(*ptr)
:
: "memory");
: "+r" (temp), "+m" (*ptr)
: : "memory");
// temp now holds the old value of *ptr
if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
__asm__ __volatile__("lfence" : : : "memory");
@@ -126,7 +125,7 @@ inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
ATOMICOPS_COMPILER_BARRIER();
*ptr = value; // An x86 store acts as a release barrier.
*ptr = value; // An x86 store acts as a release barrier.
// See comments in Atomic64 version of Release_Store(), below.
}
@@ -135,7 +134,7 @@ inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
}
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
Atomic32 value = *ptr; // An x86 load acts as a acquire barrier.
Atomic32 value = *ptr; // An x86 load acts as a acquire barrier.
// See comments in Atomic64 version of Release_Store(), below.
ATOMICOPS_COMPILER_BARRIER();
return value;
@@ -155,8 +154,8 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 new_value) {
Atomic64 prev;
__asm__ __volatile__("lock; cmpxchgq %1,%2"
: "=a"(prev)
: "q"(new_value), "m"(*ptr), "0"(old_value)
: "=a" (prev)
: "q" (new_value), "m" (*ptr), "0" (old_value)
: "memory");
return prev;
}
@@ -164,8 +163,8 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
Atomic64 new_value) {
__asm__ __volatile__("xchgq %1,%0" // The lock prefix is implicit for xchg.
: "=r"(new_value)
: "m"(*ptr), "0"(new_value)
: "=r" (new_value)
: "m" (*ptr), "0" (new_value)
: "memory");
return new_value; // Now it's the previous value.
}
@@ -174,9 +173,8 @@ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) {
Atomic64 temp = increment;
__asm__ __volatile__("lock; xaddq %0,%1"
: "+r"(temp), "+m"(*ptr)
:
: "memory");
: "+r" (temp), "+m" (*ptr)
: : "memory");
// temp now contains the previous value of *ptr
return temp + increment;
}
@@ -185,9 +183,8 @@ inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) {
Atomic64 temp = increment;
__asm__ __volatile__("lock; xaddq %0,%1"
: "+r"(temp), "+m"(*ptr)
:
: "memory");
: "+r" (temp), "+m" (*ptr)
: : "memory");
// temp now contains the previous value of *ptr
if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
__asm__ __volatile__("lfence" : : : "memory");
@@ -207,9 +204,9 @@ inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
ATOMICOPS_COMPILER_BARRIER();
*ptr = value; // An x86 store acts as a release barrier
// for current AMD/Intel chips as of Jan 2008.
// See also Acquire_Load(), below.
*ptr = value; // An x86 store acts as a release barrier
// for current AMD/Intel chips as of Jan 2008.
// See also Acquire_Load(), below.
// When new chips come out, check:
// IA-32 Intel Architecture Software Developer's Manual, Volume 3:
@@ -230,9 +227,9 @@ inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
}
inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
Atomic64 value = *ptr; // An x86 load acts as a acquire barrier,
// for current AMD/Intel chips as of Jan 2008.
// See also Release_Store(), above.
Atomic64 value = *ptr; // An x86 load acts as a acquire barrier,
// for current AMD/Intel chips as of Jan 2008.
// See also Release_Store(), above.
ATOMICOPS_COMPILER_BARRIER();
return value;
}
@@ -260,8 +257,8 @@ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
#endif // defined(__x86_64__)
} // namespace base::subtle
} // namespace base
} // namespace base::subtle
} // namespace base
#undef ATOMICOPS_COMPILER_BARRIER

View File

@@ -55,23 +55,25 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) {
LONG result = _InterlockedCompareExchange(
reinterpret_cast<volatile LONG*>(ptr), static_cast<LONG>(new_value),
reinterpret_cast<volatile LONG*>(ptr),
static_cast<LONG>(new_value),
static_cast<LONG>(old_value));
return static_cast<Atomic32>(result);
}
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
Atomic32 new_value) {
LONG result = _InterlockedExchange(reinterpret_cast<volatile LONG*>(ptr),
static_cast<LONG>(new_value));
LONG result = _InterlockedExchange(
reinterpret_cast<volatile LONG*>(ptr),
static_cast<LONG>(new_value));
return static_cast<Atomic32>(result);
}
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) {
return _InterlockedExchangeAdd(reinterpret_cast<volatile LONG*>(ptr),
static_cast<LONG>(increment)) +
increment;
return _InterlockedExchangeAdd(
reinterpret_cast<volatile LONG*>(ptr),
static_cast<LONG>(increment)) + increment;
}
inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
@@ -110,11 +112,11 @@ inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
NoBarrier_AtomicExchange(ptr, value);
// acts as a barrier in this implementation
// acts as a barrier in this implementation
}
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
*ptr = value; // works w/o barrier for current Intel chips as of June 2005
*ptr = value; // works w/o barrier for current Intel chips as of June 2005
// See comments in Atomic64 version of Release_Store() below.
}
@@ -142,24 +144,24 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) {
PVOID result = InterlockedCompareExchangePointer(
reinterpret_cast<volatile PVOID*>(ptr),
reinterpret_cast<PVOID>(new_value), reinterpret_cast<PVOID>(old_value));
reinterpret_cast<volatile PVOID*>(ptr),
reinterpret_cast<PVOID>(new_value), reinterpret_cast<PVOID>(old_value));
return reinterpret_cast<Atomic64>(result);
}
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
Atomic64 new_value) {
PVOID result =
InterlockedExchangePointer(reinterpret_cast<volatile PVOID*>(ptr),
reinterpret_cast<PVOID>(new_value));
PVOID result = InterlockedExchangePointer(
reinterpret_cast<volatile PVOID*>(ptr),
reinterpret_cast<PVOID>(new_value));
return reinterpret_cast<Atomic64>(result);
}
inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) {
return InterlockedExchangeAdd64(reinterpret_cast<volatile LONGLONG*>(ptr),
static_cast<LONGLONG>(increment)) +
increment;
return InterlockedExchangeAdd64(
reinterpret_cast<volatile LONGLONG*>(ptr),
static_cast<LONGLONG>(increment)) + increment;
}
inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
@@ -173,11 +175,11 @@ inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
NoBarrier_AtomicExchange(ptr, value);
// acts as a barrier in this implementation
// acts as a barrier in this implementation
}
inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
*ptr = value; // works w/o barrier for current Intel chips as of June 2005
*ptr = value; // works w/o barrier for current Intel chips as of June 2005
// When new chips come out, check:
// IA-32 Intel Architecture Software Developer's Manual, Volume 3:
@@ -213,6 +215,7 @@ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
}
#endif // defined(_WIN64)
} // namespace base::subtle

File diff suppressed because it is too large Load Diff

View File

@@ -38,8 +38,7 @@
// In the x64 architecture in Windows, __fastcall, __stdcall, etc, are all
// the same as __cdecl which would turn the following specializations into
// multiple definitions.
#if defined(ARCH_CPU_X86_FAMILY)
#if defined(ARCH_CPU_32_BITS)
#if !defined(ARCH_CPU_X86_64)
namespace base {
namespace cef_internal {
@@ -49,350 +48,343 @@ class RunnableAdapter;
// __stdcall Function: Arity 0.
template <typename R>
class RunnableAdapter<R(__stdcall*)()> {
class RunnableAdapter<R(__stdcall *)()> {
public:
typedef R(RunType)();
typedef R (RunType)();
explicit RunnableAdapter(R(__stdcall* function)()) : function_(function) {}
explicit RunnableAdapter(R(__stdcall *function)())
: function_(function) {
}
R Run() { return function_(); }
R Run() {
return function_();
}
private:
R(__stdcall* function_)();
R (__stdcall *function_)();
};
// __fastcall Function: Arity 0.
template <typename R>
class RunnableAdapter<R(__fastcall*)()> {
class RunnableAdapter<R(__fastcall *)()> {
public:
typedef R(RunType)();
typedef R (RunType)();
explicit RunnableAdapter(R(__fastcall* function)()) : function_(function) {}
explicit RunnableAdapter(R(__fastcall *function)())
: function_(function) {
}
R Run() { return function_(); }
R Run() {
return function_();
}
private:
R(__fastcall* function_)();
R (__fastcall *function_)();
};
// __stdcall Function: Arity 1.
template <typename R, typename A1>
class RunnableAdapter<R(__stdcall*)(A1)> {
class RunnableAdapter<R(__stdcall *)(A1)> {
public:
typedef R(RunType)(A1);
typedef R (RunType)(A1);
explicit RunnableAdapter(R(__stdcall* function)(A1)) : function_(function) {}
explicit RunnableAdapter(R(__stdcall *function)(A1))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
return function_(a1);
}
private:
R(__stdcall* function_)(A1);
R (__stdcall *function_)(A1);
};
// __fastcall Function: Arity 1.
template <typename R, typename A1>
class RunnableAdapter<R(__fastcall*)(A1)> {
class RunnableAdapter<R(__fastcall *)(A1)> {
public:
typedef R(RunType)(A1);
typedef R (RunType)(A1);
explicit RunnableAdapter(R(__fastcall* function)(A1)) : function_(function) {}
explicit RunnableAdapter(R(__fastcall *function)(A1))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
return function_(a1);
}
private:
R(__fastcall* function_)(A1);
R (__fastcall *function_)(A1);
};
// __stdcall Function: Arity 2.
template <typename R, typename A1, typename A2>
class RunnableAdapter<R(__stdcall*)(A1, A2)> {
class RunnableAdapter<R(__stdcall *)(A1, A2)> {
public:
typedef R(RunType)(A1, A2);
typedef R (RunType)(A1, A2);
explicit RunnableAdapter(R(__stdcall* function)(A1, A2))
: function_(function) {}
explicit RunnableAdapter(R(__stdcall *function)(A1, A2))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2) {
typename CallbackParamTraits<A2>::ForwardType a2) {
return function_(a1, a2);
}
private:
R(__stdcall* function_)(A1, A2);
R (__stdcall *function_)(A1, A2);
};
// __fastcall Function: Arity 2.
template <typename R, typename A1, typename A2>
class RunnableAdapter<R(__fastcall*)(A1, A2)> {
class RunnableAdapter<R(__fastcall *)(A1, A2)> {
public:
typedef R(RunType)(A1, A2);
typedef R (RunType)(A1, A2);
explicit RunnableAdapter(R(__fastcall* function)(A1, A2))
: function_(function) {}
explicit RunnableAdapter(R(__fastcall *function)(A1, A2))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2) {
typename CallbackParamTraits<A2>::ForwardType a2) {
return function_(a1, a2);
}
private:
R(__fastcall* function_)(A1, A2);
R (__fastcall *function_)(A1, A2);
};
// __stdcall Function: Arity 3.
template <typename R, typename A1, typename A2, typename A3>
class RunnableAdapter<R(__stdcall*)(A1, A2, A3)> {
class RunnableAdapter<R(__stdcall *)(A1, A2, A3)> {
public:
typedef R(RunType)(A1, A2, A3);
typedef R (RunType)(A1, A2, A3);
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3))
: function_(function) {}
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3) {
return function_(a1, a2, a3);
}
private:
R(__stdcall* function_)(A1, A2, A3);
R (__stdcall *function_)(A1, A2, A3);
};
// __fastcall Function: Arity 3.
template <typename R, typename A1, typename A2, typename A3>
class RunnableAdapter<R(__fastcall*)(A1, A2, A3)> {
class RunnableAdapter<R(__fastcall *)(A1, A2, A3)> {
public:
typedef R(RunType)(A1, A2, A3);
typedef R (RunType)(A1, A2, A3);
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3))
: function_(function) {}
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3) {
return function_(a1, a2, a3);
}
private:
R(__fastcall* function_)(A1, A2, A3);
R (__fastcall *function_)(A1, A2, A3);
};
// __stdcall Function: Arity 4.
template <typename R, typename A1, typename A2, typename A3, typename A4>
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4)> {
class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4)> {
public:
typedef R(RunType)(A1, A2, A3, A4);
typedef R (RunType)(A1, A2, A3, A4);
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4))
: function_(function) {}
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4) {
return function_(a1, a2, a3, a4);
}
private:
R(__stdcall* function_)(A1, A2, A3, A4);
R (__stdcall *function_)(A1, A2, A3, A4);
};
// __fastcall Function: Arity 4.
template <typename R, typename A1, typename A2, typename A3, typename A4>
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4)> {
class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4)> {
public:
typedef R(RunType)(A1, A2, A3, A4);
typedef R (RunType)(A1, A2, A3, A4);
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4))
: function_(function) {}
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4) {
return function_(a1, a2, a3, a4);
}
private:
R(__fastcall* function_)(A1, A2, A3, A4);
R (__fastcall *function_)(A1, A2, A3, A4);
};
// __stdcall Function: Arity 5.
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4, A5)> {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5>
class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5)> {
public:
typedef R(RunType)(A1, A2, A3, A4, A5);
typedef R (RunType)(A1, A2, A3, A4, A5);
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5))
: function_(function) {}
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5) {
return function_(a1, a2, a3, a4, a5);
}
private:
R(__stdcall* function_)(A1, A2, A3, A4, A5);
R (__stdcall *function_)(A1, A2, A3, A4, A5);
};
// __fastcall Function: Arity 5.
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4, A5)> {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5>
class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5)> {
public:
typedef R(RunType)(A1, A2, A3, A4, A5);
typedef R (RunType)(A1, A2, A3, A4, A5);
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5))
: function_(function) {}
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5) {
return function_(a1, a2, a3, a4, a5);
}
private:
R(__fastcall* function_)(A1, A2, A3, A4, A5);
R (__fastcall *function_)(A1, A2, A3, A4, A5);
};
// __stdcall Function: Arity 6.
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6>
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4, A5, A6)> {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6>
class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6)> {
public:
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
typedef R (RunType)(A1, A2, A3, A4, A5, A6);
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5, A6))
: function_(function) {}
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5,
typename CallbackParamTraits<A6>::ForwardType a6) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5,
typename CallbackParamTraits<A6>::ForwardType a6) {
return function_(a1, a2, a3, a4, a5, a6);
}
private:
R(__stdcall* function_)(A1, A2, A3, A4, A5, A6);
R (__stdcall *function_)(A1, A2, A3, A4, A5, A6);
};
// __fastcall Function: Arity 6.
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6>
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4, A5, A6)> {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6>
class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6)> {
public:
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
typedef R (RunType)(A1, A2, A3, A4, A5, A6);
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5, A6))
: function_(function) {}
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5,
typename CallbackParamTraits<A6>::ForwardType a6) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5,
typename CallbackParamTraits<A6>::ForwardType a6) {
return function_(a1, a2, a3, a4, a5, a6);
}
private:
R(__fastcall* function_)(A1, A2, A3, A4, A5, A6);
R (__fastcall *function_)(A1, A2, A3, A4, A5, A6);
};
// __stdcall Function: Arity 7.
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6,
typename A7>
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4, A5, A6, A7)> {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7>
class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7)> {
public:
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5, A6, A7))
: function_(function) {}
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5,
typename CallbackParamTraits<A6>::ForwardType a6,
typename CallbackParamTraits<A7>::ForwardType a7) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5,
typename CallbackParamTraits<A6>::ForwardType a6,
typename CallbackParamTraits<A7>::ForwardType a7) {
return function_(a1, a2, a3, a4, a5, a6, a7);
}
private:
R(__stdcall* function_)(A1, A2, A3, A4, A5, A6, A7);
R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7);
};
// __fastcall Function: Arity 7.
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6,
typename A7>
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4, A5, A6, A7)> {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7>
class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7)> {
public:
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5, A6, A7))
: function_(function) {}
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7))
: function_(function) {
}
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5,
typename CallbackParamTraits<A6>::ForwardType a6,
typename CallbackParamTraits<A7>::ForwardType a7) {
typename CallbackParamTraits<A2>::ForwardType a2,
typename CallbackParamTraits<A3>::ForwardType a3,
typename CallbackParamTraits<A4>::ForwardType a4,
typename CallbackParamTraits<A5>::ForwardType a5,
typename CallbackParamTraits<A6>::ForwardType a6,
typename CallbackParamTraits<A7>::ForwardType a7) {
return function_(a1, a2, a3, a4, a5, a6, a7);
}
private:
R(__fastcall* function_)(A1, A2, A3, A4, A5, A6, A7);
R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7);
};
} // namespace cef_internal
} // namespace base
#endif // defined(ARCH_CPU_32_BITS)
#endif // defined(ARCH_CPU_X86_FAMILY)
#endif // !defined(ARCH_CPU_X86_64)
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_

View File

@@ -92,7 +92,7 @@ class CallbackBase {
// another type. It is not okay to use void*. We create a InvokeFuncStorage
// that that can store our function pointer, and then cast it back to
// the original type on usage.
typedef void (*InvokeFuncStorage)(void);
typedef void(*InvokeFuncStorage)(void);
// Returns true if this callback equals |other|. |other| may be null.
bool Equals(const CallbackBase& other) const;
@@ -115,16 +115,15 @@ class CallbackBase {
// A helper template to determine if given type is non-const move-only-type,
// i.e. if a value of the given type should be passed via .Pass() in a
// destructive way.
template <typename T>
struct IsMoveOnlyType {
template <typename T> struct IsMoveOnlyType {
template <typename U>
static YesType Test(const typename U::MoveOnlyTypeForCPP03*);
template <typename U>
static NoType Test(...);
static const bool value =
sizeof(Test<T>(0)) == sizeof(YesType) && !is_const<T>::value;
static const bool value = sizeof(Test<T>(0)) == sizeof(YesType) &&
!is_const<T>::value;
};
// This is a typetraits object that's used to take an argument type, and

View File

@@ -1,8 +0,0 @@
// 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.
//
// Include net error codes from the Chromium source location. When creating a
// CEF binary distribution this file will be replaced with the Chromium version.
#include "net/base/net_error_list.h"

View File

@@ -51,7 +51,9 @@ namespace cef_internal {
template <typename T>
struct NeedsScopedRefptrButGetsRawPtr {
#if defined(OS_WIN)
enum { value = base::false_type::value };
enum {
value = base::false_type::value
};
#else
enum {
// Human readable translation: you needed to be a scoped_refptr if you are a
@@ -75,103 +77,74 @@ struct ParamsUseScopedRefptrCorrectly<Tuple0> {
};
template <typename A>
struct ParamsUseScopedRefptrCorrectly<Tuple1<A>> {
struct ParamsUseScopedRefptrCorrectly<Tuple1<A> > {
enum { value = !NeedsScopedRefptrButGetsRawPtr<A>::value };
};
template <typename A, typename B>
struct ParamsUseScopedRefptrCorrectly<Tuple2<A, B>> {
enum {
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value)
};
struct ParamsUseScopedRefptrCorrectly<Tuple2<A, B> > {
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value) };
};
template <typename A, typename B, typename C>
struct ParamsUseScopedRefptrCorrectly<Tuple3<A, B, C>> {
enum {
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value)
};
struct ParamsUseScopedRefptrCorrectly<Tuple3<A, B, C> > {
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value) };
};
template <typename A, typename B, typename C, typename D>
struct ParamsUseScopedRefptrCorrectly<Tuple4<A, B, C, D>> {
enum {
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value)
};
struct ParamsUseScopedRefptrCorrectly<Tuple4<A, B, C, D> > {
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value) };
};
template <typename A, typename B, typename C, typename D, typename E>
struct ParamsUseScopedRefptrCorrectly<Tuple5<A, B, C, D, E>> {
enum {
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
NeedsScopedRefptrButGetsRawPtr<E>::value)
};
struct ParamsUseScopedRefptrCorrectly<Tuple5<A, B, C, D, E> > {
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
NeedsScopedRefptrButGetsRawPtr<E>::value) };
};
template <typename A,
typename B,
typename C,
typename D,
typename E,
template <typename A, typename B, typename C, typename D, typename E,
typename F>
struct ParamsUseScopedRefptrCorrectly<Tuple6<A, B, C, D, E, F>> {
enum {
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
NeedsScopedRefptrButGetsRawPtr<F>::value)
};
struct ParamsUseScopedRefptrCorrectly<Tuple6<A, B, C, D, E, F> > {
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
NeedsScopedRefptrButGetsRawPtr<F>::value) };
};
template <typename A,
typename B,
typename C,
typename D,
typename E,
typename F,
typename G>
struct ParamsUseScopedRefptrCorrectly<Tuple7<A, B, C, D, E, F, G>> {
enum {
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
NeedsScopedRefptrButGetsRawPtr<F>::value ||
NeedsScopedRefptrButGetsRawPtr<G>::value)
};
template <typename A, typename B, typename C, typename D, typename E,
typename F, typename G>
struct ParamsUseScopedRefptrCorrectly<Tuple7<A, B, C, D, E, F, G> > {
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
NeedsScopedRefptrButGetsRawPtr<F>::value ||
NeedsScopedRefptrButGetsRawPtr<G>::value) };
};
template <typename A,
typename B,
typename C,
typename D,
typename E,
typename F,
typename G,
typename H>
struct ParamsUseScopedRefptrCorrectly<Tuple8<A, B, C, D, E, F, G, H>> {
enum {
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
NeedsScopedRefptrButGetsRawPtr<F>::value ||
NeedsScopedRefptrButGetsRawPtr<G>::value ||
NeedsScopedRefptrButGetsRawPtr<H>::value)
};
template <typename A, typename B, typename C, typename D, typename E,
typename F, typename G, typename H>
struct ParamsUseScopedRefptrCorrectly<Tuple8<A, B, C, D, E, F, G, H> > {
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
NeedsScopedRefptrButGetsRawPtr<F>::value ||
NeedsScopedRefptrButGetsRawPtr<G>::value ||
NeedsScopedRefptrButGetsRawPtr<H>::value) };
};
} // namespace cef_internal

View File

@@ -1,81 +0,0 @@
// Copyright (c) 2021 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c487e5fd787b1be8224a8981839e0cfdd0ed74f3$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
// Implement this structure to receive accessibility notification when
// accessibility events have been registered. The functions of this structure
// will be called on the UI thread.
///
typedef struct _cef_accessibility_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Called after renderer process sends accessibility tree changes to the
// browser process.
///
void(CEF_CALLBACK* on_accessibility_tree_change)(
struct _cef_accessibility_handler_t* self,
struct _cef_value_t* value);
///
// Called after renderer process sends accessibility location changes to the
// browser process.
///
void(CEF_CALLBACK* on_accessibility_location_change)(
struct _cef_accessibility_handler_t* self,
struct _cef_value_t* value);
} cef_accessibility_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a4b63e6e7942e3a3961b4f7141a963980178ae6f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
@@ -61,7 +59,7 @@ typedef struct _cef_app_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Provides an opportunity to view and/or modify command-line arguments before
@@ -74,9 +72,8 @@ typedef struct _cef_app_t {
// modify command-line arguments for non-browser processes as this may result
// in undefined behavior including crashes.
///
void(CEF_CALLBACK* on_before_command_line_processing)(
struct _cef_app_t* self,
const cef_string_t* process_type,
void (CEF_CALLBACK *on_before_command_line_processing)(
struct _cef_app_t* self, const cef_string_t* process_type,
struct _cef_command_line_t* command_line);
///
@@ -85,8 +82,7 @@ typedef struct _cef_app_t {
// each process and the registered schemes should be the same across all
// processes.
///
void(CEF_CALLBACK* on_register_custom_schemes)(
struct _cef_app_t* self,
void (CEF_CALLBACK *on_register_custom_schemes)(struct _cef_app_t* self,
struct _cef_scheme_registrar_t* registrar);
///
@@ -95,24 +91,25 @@ typedef struct _cef_app_t {
// If no handler is returned resources will be loaded from pack files. This
// function is called by the browser and render processes on multiple threads.
///
struct _cef_resource_bundle_handler_t*(
CEF_CALLBACK* get_resource_bundle_handler)(struct _cef_app_t* self);
struct _cef_resource_bundle_handler_t* (
CEF_CALLBACK *get_resource_bundle_handler)(struct _cef_app_t* self);
///
// Return the handler for functionality specific to the browser process. This
// function is called on multiple threads in the browser process.
///
struct _cef_browser_process_handler_t*(
CEF_CALLBACK* get_browser_process_handler)(struct _cef_app_t* self);
struct _cef_browser_process_handler_t* (
CEF_CALLBACK *get_browser_process_handler)(struct _cef_app_t* self);
///
// Return the handler for functionality specific to the render process. This
// function is called on the render process main thread.
///
struct _cef_render_process_handler_t*(
CEF_CALLBACK* get_render_process_handler)(struct _cef_app_t* self);
struct _cef_render_process_handler_t* (
CEF_CALLBACK *get_render_process_handler)(struct _cef_app_t* self);
} cef_app_t;
///
// This function should be called from the application entry point function to
// execute a secondary process. It can be used to run secondary processes from
@@ -126,8 +123,7 @@ typedef struct _cef_app_t {
// cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
cef_app_t* application,
void* windows_sandbox_info);
cef_app_t* application, void* windows_sandbox_info);
///
// This function should be called on the main application thread to initialize
@@ -137,9 +133,8 @@ CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
// be NULL (see cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
const struct _cef_settings_t* settings,
cef_app_t* application,
void* windows_sandbox_info);
const struct _cef_settings_t* settings, cef_app_t* application,
void* windows_sandbox_info);
///
// This function should be called on the main application thread to shut down

View File

@@ -1,121 +0,0 @@
// Copyright (c) 2021 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7a483ed552ecca4f1aaa03800d366beca1ea2dee$
//
#ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
// Implement this structure to handle audio events.
///
typedef struct _cef_audio_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Called on the UI thread to allow configuration of audio stream parameters.
// Return true (1) to proceed with audio stream capture, or false (0) to
// cancel it. All members of |params| can optionally be configured here, but
// they are also pre-filled with some sensible defaults.
///
int(CEF_CALLBACK* get_audio_parameters)(struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser,
cef_audio_parameters_t* params);
///
// Called on a browser audio capture thread when the browser starts streaming
// audio. OnAudioSteamStopped will always be called after
// OnAudioStreamStarted; both functions may be called multiple times for the
// same browser. |params| contains the audio parameters like sample rate and
// channel layout. |channels| is the number of channels.
///
void(CEF_CALLBACK* on_audio_stream_started)(
struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser,
const cef_audio_parameters_t* params,
int channels);
///
// Called on the audio stream thread when a PCM packet is received for the
// stream. |data| is an array representing the raw PCM data as a floating
// point type, i.e. 4-byte value(s). |frames| is the number of frames in the
// PCM packet. |pts| is the presentation timestamp (in milliseconds since the
// Unix Epoch) and represents the time at which the decompressed packet should
// be presented to the user. Based on |frames| and the |channel_layout| value
// passed to OnAudioStreamStarted you can calculate the size of the |data|
// array in bytes.
///
void(CEF_CALLBACK* on_audio_stream_packet)(struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser,
const float** data,
int frames,
int64 pts);
///
// Called on the UI thread when the stream has stopped. OnAudioSteamStopped
// will always be called after OnAudioStreamStarted; both functions may be
// called multiple times for the same stream.
///
void(CEF_CALLBACK* on_audio_stream_stopped)(struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser);
///
// Called on the UI or audio stream thread when an error occurred. During the
// stream creation phase this callback will be called on the UI thread while
// in the capturing phase it will be called on the audio stream thread. The
// stream will be stopped immediately.
///
void(CEF_CALLBACK* on_audio_stream_error)(struct _cef_audio_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* message);
} cef_audio_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2b9508a328ed0218e2c576af455f8d76e5978545$
//
#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Callback structure used for asynchronous continuation of authentication
// requests.
@@ -54,21 +53,21 @@ typedef struct _cef_auth_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Continue the authentication request.
///
void(CEF_CALLBACK* cont)(struct _cef_auth_callback_t* self,
const cef_string_t* username,
const cef_string_t* password);
void (CEF_CALLBACK *cont)(struct _cef_auth_callback_t* self,
const cef_string_t* username, const cef_string_t* password);
///
// Cancel the authentication request.
///
void(CEF_CALLBACK* cancel)(struct _cef_auth_callback_t* self);
void (CEF_CALLBACK *cancel)(struct _cef_auth_callback_t* self);
} cef_auth_callback_t;
#ifdef __cplusplus
}
#endif

View File

@@ -27,6 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
@@ -44,9 +45,10 @@ extern "C" {
#endif
///
// All ref-counted framework structures must include this structure first.
// Structure defining the reference count implementation functions. All
// framework structures must include the cef_base_t structure first.
///
typedef struct _cef_base_ref_counted_t {
typedef struct _cef_base_t {
///
// Size of the data structure.
///
@@ -56,49 +58,30 @@ typedef struct _cef_base_ref_counted_t {
// Called to increment the reference count for the object. Should be called
// for every new copy of a pointer to a given object.
///
void(CEF_CALLBACK* add_ref)(struct _cef_base_ref_counted_t* self);
void (CEF_CALLBACK *add_ref)(struct _cef_base_t* self);
///
// Called to decrement the reference count for the object. If the reference
// count falls to 0 the object should self-delete. Returns true (1) if the
// resulting reference count is 0.
///
int(CEF_CALLBACK* release)(struct _cef_base_ref_counted_t* self);
int (CEF_CALLBACK *release)(struct _cef_base_t* self);
///
// Returns true (1) if the current reference count is 1.
///
int(CEF_CALLBACK* has_one_ref)(struct _cef_base_ref_counted_t* self);
int (CEF_CALLBACK *has_one_ref)(struct _cef_base_t* self);
} cef_base_t;
///
// Returns true (1) if the current reference count is at least 1.
///
int(CEF_CALLBACK* has_at_least_one_ref)(struct _cef_base_ref_counted_t* self);
} cef_base_ref_counted_t;
///
// All scoped framework structures must include this structure first.
///
typedef struct _cef_base_scoped_t {
///
// Size of the data structure.
///
size_t size;
// Check that the structure |s|, which is defined with a cef_base_t member named
// |base|, is large enough to contain the specified member |f|.
#define CEF_MEMBER_EXISTS(s, f) \
((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= \
reinterpret_cast<cef_base_t*>(s)->size)
///
// Called to delete this object. May be NULL if the object is not owned.
///
void(CEF_CALLBACK* del)(struct _cef_base_scoped_t* self);
#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))
} cef_base_scoped_t;
// Check that the structure |s|, which is defined with a size_t member at the
// top, is large enough to contain the specified member |f|.
#define CEF_MEMBER_EXISTS(s, f) \
((intptr_t) & \
((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= *reinterpret_cast<size_t*>(s))
#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))
#ifdef __cplusplus
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,20 +33,17 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=09b6ebd4116e983b4af634f1efa17b326a3fc517$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_devtools_message_observer_capi.h"
#include "include/capi/cef_drag_data_capi.h"
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_image_capi.h"
#include "include/capi/cef_navigation_entry_capi.h"
#include "include/capi/cef_registration_capi.h"
#include "include/capi/cef_process_message_capi.h"
#include "include/capi/cef_request_context_capi.h"
#ifdef __cplusplus
@@ -66,122 +63,128 @@ typedef struct _cef_browser_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns the browser host object. This function can only be called in the
// browser process.
///
struct _cef_browser_host_t*(CEF_CALLBACK* get_host)(
struct _cef_browser_host_t* (CEF_CALLBACK *get_host)(
struct _cef_browser_t* self);
///
// Returns true (1) if the browser can navigate backwards.
///
int(CEF_CALLBACK* can_go_back)(struct _cef_browser_t* self);
int (CEF_CALLBACK *can_go_back)(struct _cef_browser_t* self);
///
// Navigate backwards.
///
void(CEF_CALLBACK* go_back)(struct _cef_browser_t* self);
void (CEF_CALLBACK *go_back)(struct _cef_browser_t* self);
///
// Returns true (1) if the browser can navigate forwards.
///
int(CEF_CALLBACK* can_go_forward)(struct _cef_browser_t* self);
int (CEF_CALLBACK *can_go_forward)(struct _cef_browser_t* self);
///
// Navigate forwards.
///
void(CEF_CALLBACK* go_forward)(struct _cef_browser_t* self);
void (CEF_CALLBACK *go_forward)(struct _cef_browser_t* self);
///
// Returns true (1) if the browser is currently loading.
///
int(CEF_CALLBACK* is_loading)(struct _cef_browser_t* self);
int (CEF_CALLBACK *is_loading)(struct _cef_browser_t* self);
///
// Reload the current page.
///
void(CEF_CALLBACK* reload)(struct _cef_browser_t* self);
void (CEF_CALLBACK *reload)(struct _cef_browser_t* self);
///
// Reload the current page ignoring any cached data.
///
void(CEF_CALLBACK* reload_ignore_cache)(struct _cef_browser_t* self);
void (CEF_CALLBACK *reload_ignore_cache)(struct _cef_browser_t* self);
///
// Stop loading the page.
///
void(CEF_CALLBACK* stop_load)(struct _cef_browser_t* self);
void (CEF_CALLBACK *stop_load)(struct _cef_browser_t* self);
///
// Returns the globally unique identifier for this browser. This value is also
// used as the tabId for extension APIs.
// Returns the globally unique identifier for this browser.
///
int(CEF_CALLBACK* get_identifier)(struct _cef_browser_t* self);
int (CEF_CALLBACK *get_identifier)(struct _cef_browser_t* self);
///
// Returns true (1) if this object is pointing to the same handle as |that|
// object.
///
int(CEF_CALLBACK* is_same)(struct _cef_browser_t* self,
struct _cef_browser_t* that);
int (CEF_CALLBACK *is_same)(struct _cef_browser_t* self,
struct _cef_browser_t* that);
///
// Returns true (1) if the window is a popup window.
///
int(CEF_CALLBACK* is_popup)(struct _cef_browser_t* self);
int (CEF_CALLBACK *is_popup)(struct _cef_browser_t* self);
///
// Returns true (1) if a document has been loaded in the browser.
///
int(CEF_CALLBACK* has_document)(struct _cef_browser_t* self);
int (CEF_CALLBACK *has_document)(struct _cef_browser_t* self);
///
// Returns the main (top-level) frame for the browser window.
///
struct _cef_frame_t*(CEF_CALLBACK* get_main_frame)(
struct _cef_frame_t* (CEF_CALLBACK *get_main_frame)(
struct _cef_browser_t* self);
///
// Returns the focused frame for the browser window.
///
struct _cef_frame_t*(CEF_CALLBACK* get_focused_frame)(
struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)(
struct _cef_browser_t* self);
///
// Returns the frame with the specified identifier, or NULL if not found.
///
struct _cef_frame_t*(CEF_CALLBACK* get_frame_byident)(
struct _cef_browser_t* self,
int64 identifier);
struct _cef_frame_t* (CEF_CALLBACK *get_frame_byident)(
struct _cef_browser_t* self, int64 identifier);
///
// Returns the frame with the specified name, or NULL if not found.
///
struct _cef_frame_t*(CEF_CALLBACK* get_frame)(struct _cef_browser_t* self,
const cef_string_t* name);
struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self,
const cef_string_t* name);
///
// Returns the number of frames that currently exist.
///
size_t(CEF_CALLBACK* get_frame_count)(struct _cef_browser_t* self);
size_t (CEF_CALLBACK *get_frame_count)(struct _cef_browser_t* self);
///
// Returns the identifiers of all existing frames.
///
void(CEF_CALLBACK* get_frame_identifiers)(struct _cef_browser_t* self,
size_t* identifiersCount,
int64* identifiers);
void (CEF_CALLBACK *get_frame_identifiers)(struct _cef_browser_t* self,
size_t* identifiersCount, int64* identifiers);
///
// Returns the names of all existing frames.
///
void(CEF_CALLBACK* get_frame_names)(struct _cef_browser_t* self,
cef_string_list_t names);
void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self,
cef_string_list_t names);
///
// Send a message to the specified |target_process|. Returns true (1) if the
// message was sent successfully.
///
int (CEF_CALLBACK *send_process_message)(struct _cef_browser_t* self,
cef_process_id_t target_process,
struct _cef_process_message_t* message);
} cef_browser_t;
///
// Callback structure for cef_browser_host_t::RunFileDialog. The functions of
// this structure will be called on the browser process UI thread.
@@ -190,7 +193,7 @@ typedef struct _cef_run_file_dialog_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called asynchronously after the file dialog is dismissed.
@@ -199,12 +202,12 @@ typedef struct _cef_run_file_dialog_callback_t {
// |file_paths| will be a single value or a list of values depending on the
// dialog mode. If the selection was cancelled |file_paths| will be NULL.
///
void(CEF_CALLBACK* on_file_dialog_dismissed)(
struct _cef_run_file_dialog_callback_t* self,
int selected_accept_filter,
void (CEF_CALLBACK *on_file_dialog_dismissed)(
struct _cef_run_file_dialog_callback_t* self, int selected_accept_filter,
cef_string_list_t file_paths);
} cef_run_file_dialog_callback_t;
///
// Callback structure for cef_browser_host_t::GetNavigationEntries. The
// functions of this structure will be called on the browser process UI thread.
@@ -213,7 +216,7 @@ typedef struct _cef_navigation_entry_visitor_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Method that will be executed. Do not keep a reference to |entry| outside of
@@ -222,13 +225,12 @@ typedef struct _cef_navigation_entry_visitor_t {
// navigation entry. |index| is the 0-based index of this entry and |total| is
// the total number of entries.
///
int(CEF_CALLBACK* visit)(struct _cef_navigation_entry_visitor_t* self,
struct _cef_navigation_entry_t* entry,
int current,
int index,
int total);
int (CEF_CALLBACK *visit)(struct _cef_navigation_entry_visitor_t* self,
struct _cef_navigation_entry_t* entry, int current, int index,
int total);
} cef_navigation_entry_visitor_t;
///
// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
// structure will be called on the browser process UI thread.
@@ -237,19 +239,19 @@ typedef struct _cef_pdf_print_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Method that will be executed when the PDF printing has completed. |path| is
// the output path. |ok| will be true (1) if the printing completed
// successfully or false (0) otherwise.
///
void(CEF_CALLBACK* on_pdf_print_finished)(
struct _cef_pdf_print_callback_t* self,
const cef_string_t* path,
void (CEF_CALLBACK *on_pdf_print_finished)(
struct _cef_pdf_print_callback_t* self, const cef_string_t* path,
int ok);
} cef_pdf_print_callback_t;
///
// Callback structure for cef_browser_host_t::DownloadImage. The functions of
// this structure will be called on the browser process UI thread.
@@ -258,7 +260,7 @@ typedef struct _cef_download_image_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Method that will be executed when the image download has completed.
@@ -266,13 +268,13 @@ typedef struct _cef_download_image_callback_t {
// resulting HTTP status code. |image| is the resulting image, possibly at
// multiple scale factors, or NULL if the download failed.
///
void(CEF_CALLBACK* on_download_image_finished)(
void (CEF_CALLBACK *on_download_image_finished)(
struct _cef_download_image_callback_t* self,
const cef_string_t* image_url,
int http_status_code,
const cef_string_t* image_url, int http_status_code,
struct _cef_image_t* image);
} cef_download_image_callback_t;
///
// Structure used to represent the browser process aspects of a browser window.
// The functions of this structure can only be called in the browser process.
@@ -283,12 +285,12 @@ typedef struct _cef_browser_host_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns the hosted browser object.
///
struct _cef_browser_t*(CEF_CALLBACK* get_browser)(
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(
struct _cef_browser_host_t* self);
///
@@ -301,8 +303,8 @@ typedef struct _cef_browser_host_t {
// cef_life_span_handler_t::do_close() documentation for additional usage
// information.
///
void(CEF_CALLBACK* close_browser)(struct _cef_browser_host_t* self,
int force_close);
void (CEF_CALLBACK *close_browser)(struct _cef_browser_host_t* self,
int force_close);
///
// Helper for closing a browser. Call this function from the top-level window
@@ -312,19 +314,19 @@ typedef struct _cef_browser_host_t {
// and cef_life_span_handler_t::do_close() documentation for additional usage
// information. This function must be called on the browser process UI thread.
///
int(CEF_CALLBACK* try_close_browser)(struct _cef_browser_host_t* self);
int (CEF_CALLBACK *try_close_browser)(struct _cef_browser_host_t* self);
///
// Set whether the browser is focused.
///
void(CEF_CALLBACK* set_focus)(struct _cef_browser_host_t* self, int focus);
void (CEF_CALLBACK *set_focus)(struct _cef_browser_host_t* self, int focus);
///
// Retrieve the window handle for this browser. If this browser is wrapped in
// a cef_browser_view_t this function should be called on the browser process
// UI thread and it will return the handle for the top-level native window.
///
cef_window_handle_t(CEF_CALLBACK* get_window_handle)(
cef_window_handle_t (CEF_CALLBACK *get_window_handle)(
struct _cef_browser_host_t* self);
///
@@ -333,39 +335,39 @@ typedef struct _cef_browser_host_t {
// cef_browser_view_t. This function can be used in combination with custom
// handling of modal windows.
///
cef_window_handle_t(CEF_CALLBACK* get_opener_window_handle)(
cef_window_handle_t (CEF_CALLBACK *get_opener_window_handle)(
struct _cef_browser_host_t* self);
///
// Returns true (1) if this browser is wrapped in a cef_browser_view_t.
///
int(CEF_CALLBACK* has_view)(struct _cef_browser_host_t* self);
int (CEF_CALLBACK *has_view)(struct _cef_browser_host_t* self);
///
// Returns the client for this browser.
///
struct _cef_client_t*(CEF_CALLBACK* get_client)(
struct _cef_client_t* (CEF_CALLBACK *get_client)(
struct _cef_browser_host_t* self);
///
// Returns the request context for this browser.
///
struct _cef_request_context_t*(CEF_CALLBACK* get_request_context)(
struct _cef_request_context_t* (CEF_CALLBACK *get_request_context)(
struct _cef_browser_host_t* self);
///
// Get the current zoom level. The default zoom level is 0.0. This function
// can only be called on the UI thread.
///
double(CEF_CALLBACK* get_zoom_level)(struct _cef_browser_host_t* self);
double (CEF_CALLBACK *get_zoom_level)(struct _cef_browser_host_t* self);
///
// Change the zoom level to the specified value. Specify 0.0 to reset the zoom
// level. If called on the UI thread the change will be applied immediately.
// Otherwise, the change will be applied asynchronously on the UI thread.
///
void(CEF_CALLBACK* set_zoom_level)(struct _cef_browser_host_t* self,
double zoomLevel);
void (CEF_CALLBACK *set_zoom_level)(struct _cef_browser_host_t* self,
double zoomLevel);
///
// Call to run a file chooser dialog. Only a single file chooser dialog may be
@@ -383,20 +385,17 @@ typedef struct _cef_browser_host_t {
// dismissed or immediately if another dialog is already pending. The dialog
// will be initiated asynchronously on the UI thread.
///
void(CEF_CALLBACK* run_file_dialog)(
struct _cef_browser_host_t* self,
cef_file_dialog_mode_t mode,
const cef_string_t* title,
const cef_string_t* default_file_path,
cef_string_list_t accept_filters,
void (CEF_CALLBACK *run_file_dialog)(struct _cef_browser_host_t* self,
cef_file_dialog_mode_t mode, const cef_string_t* title,
const cef_string_t* default_file_path, cef_string_list_t accept_filters,
int selected_accept_filter,
struct _cef_run_file_dialog_callback_t* callback);
///
// Download the file at |url| using cef_download_handler_t.
///
void(CEF_CALLBACK* start_download)(struct _cef_browser_host_t* self,
const cef_string_t* url);
void (CEF_CALLBACK *start_download)(struct _cef_browser_host_t* self,
const cef_string_t* url);
///
// Download |image_url| and execute |callback| on completion with the images
@@ -410,18 +409,14 @@ typedef struct _cef_browser_host_t {
// unlimited. If |bypass_cache| is true (1) then |image_url| is requested from
// the server even if it is present in the browser cache.
///
void(CEF_CALLBACK* download_image)(
struct _cef_browser_host_t* self,
const cef_string_t* image_url,
int is_favicon,
uint32 max_image_size,
int bypass_cache,
struct _cef_download_image_callback_t* callback);
void (CEF_CALLBACK *download_image)(struct _cef_browser_host_t* self,
const cef_string_t* image_url, int is_favicon, uint32 max_image_size,
int bypass_cache, struct _cef_download_image_callback_t* callback);
///
// Print the current browser contents.
///
void(CEF_CALLBACK* print)(struct _cef_browser_host_t* self);
void (CEF_CALLBACK *print)(struct _cef_browser_host_t* self);
///
// Print the current browser contents to the PDF file specified by |path| and
@@ -429,35 +424,28 @@ typedef struct _cef_browser_host_t {
// |path| when done. For PDF printing to work on Linux you must implement the
// cef_print_handler_t::GetPdfPaperSize function.
///
void(CEF_CALLBACK* print_to_pdf)(
struct _cef_browser_host_t* self,
void (CEF_CALLBACK *print_to_pdf)(struct _cef_browser_host_t* self,
const cef_string_t* path,
const struct _cef_pdf_print_settings_t* settings,
struct _cef_pdf_print_callback_t* callback);
///
// Search for |searchText|. |identifier| must be a unique ID and these IDs
// must strictly increase so that newer requests always have greater IDs than
// older requests. If |identifier| is zero or less than the previous ID value
// then it will be automatically assigned a new valid ID. |forward| indicates
// whether to search forward or backward within the page. |matchCase|
// indicates whether the search should be case-sensitive. |findNext| indicates
// whether this is the first request or a follow-up. The cef_find_handler_t
// instance, if any, returned via cef_client_t::GetFindHandler will be called
// to report find results.
// Search for |searchText|. |identifier| can be used to have multiple searches
// running simultaniously. |forward| indicates whether to search forward or
// backward within the page. |matchCase| indicates whether the search should
// be case-sensitive. |findNext| indicates whether this is the first request
// or a follow-up. The cef_find_handler_t instance, if any, returned via
// cef_client_t::GetFindHandler will be called to report find results.
///
void(CEF_CALLBACK* find)(struct _cef_browser_host_t* self,
int identifier,
const cef_string_t* searchText,
int forward,
int matchCase,
int findNext);
void (CEF_CALLBACK *find)(struct _cef_browser_host_t* self, int identifier,
const cef_string_t* searchText, int forward, int matchCase,
int findNext);
///
// Cancel all searches that are currently going on.
///
void(CEF_CALLBACK* stop_finding)(struct _cef_browser_host_t* self,
int clearSelection);
void (CEF_CALLBACK *stop_finding)(struct _cef_browser_host_t* self,
int clearSelection);
///
// Open developer tools (DevTools) in its own browser. The DevTools browser
@@ -468,8 +456,7 @@ typedef struct _cef_browser_host_t {
// inspected. The |windowInfo| parameter will be ignored if this browser is
// wrapped in a cef_browser_view_t.
///
void(CEF_CALLBACK* show_dev_tools)(
struct _cef_browser_host_t* self,
void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_host_t* self,
const struct _cef_window_info_t* windowInfo,
struct _cef_client_t* client,
const struct _cef_browser_settings_t* settings,
@@ -478,78 +465,13 @@ typedef struct _cef_browser_host_t {
///
// Explicitly close the associated DevTools browser, if any.
///
void(CEF_CALLBACK* close_dev_tools)(struct _cef_browser_host_t* self);
void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_host_t* self);
///
// Returns true (1) if this browser currently has an associated DevTools
// browser. Must be called on the browser process UI thread.
///
int(CEF_CALLBACK* has_dev_tools)(struct _cef_browser_host_t* self);
///
// Send a function call message over the DevTools protocol. |message| must be
// a UTF8-encoded JSON dictionary that contains "id" (int), "function"
// (string) and "params" (dictionary, optional) values. See the DevTools
// protocol documentation at https://chromedevtools.github.io/devtools-
// protocol/ for details of supported functions and the expected "params"
// dictionary contents. |message| will be copied if necessary. This function
// will return true (1) if called on the UI thread and the message was
// successfully submitted for validation, otherwise false (0). Validation will
// be applied asynchronously and any messages that fail due to formatting
// errors or missing parameters may be discarded without notification. Prefer
// ExecuteDevToolsMethod if a more structured approach to message formatting
// is desired.
//
// Every valid function call will result in an asynchronous function result or
// error message that references the sent message "id". Event messages are
// received while notifications are enabled (for example, between function
// calls for "Page.enable" and "Page.disable"). All received messages will be
// delivered to the observer(s) registered with AddDevToolsMessageObserver.
// See cef_dev_tools_message_observer_t::OnDevToolsMessage documentation for
// details of received message contents.
//
// Usage of the SendDevToolsMessage, ExecuteDevToolsMethod and
// AddDevToolsMessageObserver functions does not require an active DevTools
// front-end or remote-debugging session. Other active DevTools sessions will
// continue to function independently. However, any modification of global
// browser state by one session may not be reflected in the UI of other
// sessions.
//
// Communication with the DevTools front-end (when displayed) can be logged
// for development purposes by passing the `--devtools-protocol-log-
// file=<path>` command-line flag.
///
int(CEF_CALLBACK* send_dev_tools_message)(struct _cef_browser_host_t* self,
const void* message,
size_t message_size);
///
// Execute a function call over the DevTools protocol. This is a more
// structured version of SendDevToolsMessage. |message_id| is an incremental
// number that uniquely identifies the message (pass 0 to have the next number
// assigned automatically based on previous values). |function| is the
// function name. |params| are the function parameters, which may be NULL. See
// the DevTools protocol documentation (linked above) for details of supported
// functions and the expected |params| dictionary contents. This function will
// return the assigned message ID if called on the UI thread and the message
// was successfully submitted for validation, otherwise 0. See the
// SendDevToolsMessage documentation for additional usage information.
///
int(CEF_CALLBACK* execute_dev_tools_method)(
struct _cef_browser_host_t* self,
int message_id,
const cef_string_t* method,
struct _cef_dictionary_value_t* params);
///
// Add an observer for DevTools protocol messages (function results and
// events). The observer will remain registered until the returned
// Registration object is destroyed. See the SendDevToolsMessage documentation
// for additional usage information.
///
struct _cef_registration_t*(CEF_CALLBACK* add_dev_tools_message_observer)(
struct _cef_browser_host_t* self,
struct _cef_dev_tools_message_observer_t* observer);
int (CEF_CALLBACK *has_dev_tools)(struct _cef_browser_host_t* self);
///
// Retrieve a snapshot of current navigation entries as values sent to the
@@ -557,28 +479,38 @@ typedef struct _cef_browser_host_t {
// navigation entry will be sent, otherwise all navigation entries will be
// sent.
///
void(CEF_CALLBACK* get_navigation_entries)(
struct _cef_browser_host_t* self,
struct _cef_navigation_entry_visitor_t* visitor,
int current_only);
void (CEF_CALLBACK *get_navigation_entries)(struct _cef_browser_host_t* self,
struct _cef_navigation_entry_visitor_t* visitor, int current_only);
///
// Set whether mouse cursor change is disabled.
///
void (CEF_CALLBACK *set_mouse_cursor_change_disabled)(
struct _cef_browser_host_t* self, int disabled);
///
// Returns true (1) if mouse cursor change is disabled.
///
int (CEF_CALLBACK *is_mouse_cursor_change_disabled)(
struct _cef_browser_host_t* self);
///
// If a misspelled word is currently selected in an editable node calling this
// function will replace it with the specified |word|.
///
void(CEF_CALLBACK* replace_misspelling)(struct _cef_browser_host_t* self,
const cef_string_t* word);
void (CEF_CALLBACK *replace_misspelling)(struct _cef_browser_host_t* self,
const cef_string_t* word);
///
// Add the specified |word| to the spelling dictionary.
///
void(CEF_CALLBACK* add_word_to_dictionary)(struct _cef_browser_host_t* self,
const cef_string_t* word);
void (CEF_CALLBACK *add_word_to_dictionary)(struct _cef_browser_host_t* self,
const cef_string_t* word);
///
// Returns true (1) if window rendering is disabled.
///
int(CEF_CALLBACK* is_window_rendering_disabled)(
int (CEF_CALLBACK *is_window_rendering_disabled)(
struct _cef_browser_host_t* self);
///
@@ -587,14 +519,14 @@ typedef struct _cef_browser_host_t {
// cef_render_handler_t::OnPaint asynchronously with the updated regions. This
// function is only used when window rendering is disabled.
///
void(CEF_CALLBACK* was_resized)(struct _cef_browser_host_t* self);
void (CEF_CALLBACK *was_resized)(struct _cef_browser_host_t* self);
///
// Notify the browser that it has been hidden or shown. Layouting and
// cef_render_handler_t::OnPaint notification will stop when the browser is
// hidden. This function is only used when window rendering is disabled.
///
void(CEF_CALLBACK* was_hidden)(struct _cef_browser_host_t* self, int hidden);
void (CEF_CALLBACK *was_hidden)(struct _cef_browser_host_t* self, int hidden);
///
// Send a notification to the browser that the screen info has changed. The
@@ -604,7 +536,7 @@ typedef struct _cef_browser_host_t {
// current display. This function is only used when window rendering is
// disabled.
///
void(CEF_CALLBACK* notify_screen_info_changed)(
void (CEF_CALLBACK *notify_screen_info_changed)(
struct _cef_browser_host_t* self);
///
@@ -612,41 +544,29 @@ typedef struct _cef_browser_host_t {
// asynchronously. This function is only used when window rendering is
// disabled.
///
void(CEF_CALLBACK* invalidate)(struct _cef_browser_host_t* self,
cef_paint_element_type_t type);
///
// Issue a BeginFrame request to Chromium. Only valid when
// cef_window_tInfo::external_begin_frame_enabled is set to true (1).
///
void(CEF_CALLBACK* send_external_begin_frame)(
struct _cef_browser_host_t* self);
void (CEF_CALLBACK *invalidate)(struct _cef_browser_host_t* self,
cef_paint_element_type_t type);
///
// Send a key event to the browser.
///
void(CEF_CALLBACK* send_key_event)(struct _cef_browser_host_t* self,
const struct _cef_key_event_t* event);
void (CEF_CALLBACK *send_key_event)(struct _cef_browser_host_t* self,
const struct _cef_key_event_t* event);
///
// Send a mouse click event to the browser. The |x| and |y| coordinates are
// relative to the upper-left corner of the view.
///
void(CEF_CALLBACK* send_mouse_click_event)(
struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event,
cef_mouse_button_type_t type,
int mouseUp,
int clickCount);
void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event, cef_mouse_button_type_t type,
int mouseUp, int clickCount);
///
// Send a mouse move event to the browser. The |x| and |y| coordinates are
// relative to the upper-left corner of the view.
///
void(CEF_CALLBACK* send_mouse_move_event)(
struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event,
int mouseLeave);
void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event, int mouseLeave);
///
// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
@@ -655,34 +575,26 @@ typedef struct _cef_browser_host_t {
// In order to scroll inside select popups with window rendering disabled
// cef_render_handler_t::GetScreenPoint should be implemented properly.
///
void(CEF_CALLBACK* send_mouse_wheel_event)(
struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event,
int deltaX,
int deltaY);
///
// Send a touch event to the browser for a windowless browser.
///
void(CEF_CALLBACK* send_touch_event)(struct _cef_browser_host_t* self,
const struct _cef_touch_event_t* event);
void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event, int deltaX, int deltaY);
///
// Send a focus event to the browser.
///
void(CEF_CALLBACK* send_focus_event)(struct _cef_browser_host_t* self,
int setFocus);
void (CEF_CALLBACK *send_focus_event)(struct _cef_browser_host_t* self,
int setFocus);
///
// Send a capture lost event to the browser.
///
void(CEF_CALLBACK* send_capture_lost_event)(struct _cef_browser_host_t* self);
void (CEF_CALLBACK *send_capture_lost_event)(
struct _cef_browser_host_t* self);
///
// Notify the browser that the window hosting it is about to be moved or
// resized. This function is only used on Windows and Linux.
///
void(CEF_CALLBACK* notify_move_or_resize_started)(
void (CEF_CALLBACK *notify_move_or_resize_started)(
struct _cef_browser_host_t* self);
///
@@ -692,7 +604,7 @@ typedef struct _cef_browser_host_t {
// requested rate. The minimum value is 1 and the maximum value is 60 (default
// 30). This function can only be called on the UI thread.
///
int(CEF_CALLBACK* get_windowless_frame_rate)(
int (CEF_CALLBACK *get_windowless_frame_rate)(
struct _cef_browser_host_t* self);
///
@@ -702,9 +614,8 @@ typedef struct _cef_browser_host_t {
// minimum value is 1 and the maximum value is 60 (default 30). Can also be
// set at browser creation via cef_browser_tSettings.windowless_frame_rate.
///
void(CEF_CALLBACK* set_windowless_frame_rate)(
struct _cef_browser_host_t* self,
int frame_rate);
void (CEF_CALLBACK *set_windowless_frame_rate)(
struct _cef_browser_host_t* self, int frame_rate);
///
// Begins a new composition or updates the existing composition. Blink has a
@@ -729,10 +640,8 @@ typedef struct _cef_browser_host_t {
//
// This function is only used when window rendering is disabled.
///
void(CEF_CALLBACK* ime_set_composition)(
struct _cef_browser_host_t* self,
const cef_string_t* text,
size_t underlinesCount,
void (CEF_CALLBACK *ime_set_composition)(struct _cef_browser_host_t* self,
const cef_string_t* text, size_t underlinesCount,
cef_composition_underline_t const* underlines,
const cef_range_t* replacement_range,
const cef_range_t* selection_range);
@@ -746,10 +655,9 @@ typedef struct _cef_browser_host_t {
// |relative_cursor_pos| values are only used on OS X. This function is only
// used when window rendering is disabled.
///
void(CEF_CALLBACK* ime_commit_text)(struct _cef_browser_host_t* self,
const cef_string_t* text,
const cef_range_t* replacement_range,
int relative_cursor_pos);
void (CEF_CALLBACK *ime_commit_text)(struct _cef_browser_host_t* self,
const cef_string_t* text, const cef_range_t* replacement_range,
int relative_cursor_pos);
///
// Completes the existing composition by applying the current composition node
@@ -757,16 +665,15 @@ typedef struct _cef_browser_host_t {
// will be discarded. See comments on ImeSetComposition for usage. This
// function is only used when window rendering is disabled.
///
void(CEF_CALLBACK* ime_finish_composing_text)(
struct _cef_browser_host_t* self,
int keep_selection);
void (CEF_CALLBACK *ime_finish_composing_text)(
struct _cef_browser_host_t* self, int keep_selection);
///
// Cancels the existing composition and discards the composition node contents
// without applying them. See comments on ImeSetComposition for usage. This
// function is only used when window rendering is disabled.
///
void(CEF_CALLBACK* ime_cancel_composition)(struct _cef_browser_host_t* self);
void (CEF_CALLBACK *ime_cancel_composition)(struct _cef_browser_host_t* self);
///
// Call this function when the user drags the mouse into the web view (before
@@ -777,8 +684,7 @@ typedef struct _cef_browser_host_t {
// cef_render_handler_t::StartDragging). This function is only used when
// window rendering is disabled.
///
void(CEF_CALLBACK* drag_target_drag_enter)(
struct _cef_browser_host_t* self,
void (CEF_CALLBACK *drag_target_drag_enter)(struct _cef_browser_host_t* self,
struct _cef_drag_data_t* drag_data,
const struct _cef_mouse_event_t* event,
cef_drag_operations_mask_t allowed_ops);
@@ -789,8 +695,7 @@ typedef struct _cef_browser_host_t {
// DragTargetDragLeave/DragTargetDrop). This function is only used when window
// rendering is disabled.
///
void(CEF_CALLBACK* drag_target_drag_over)(
struct _cef_browser_host_t* self,
void (CEF_CALLBACK *drag_target_drag_over)(struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event,
cef_drag_operations_mask_t allowed_ops);
@@ -799,7 +704,7 @@ typedef struct _cef_browser_host_t {
// calling DragTargetDragEnter). This function is only used when window
// rendering is disabled.
///
void(CEF_CALLBACK* drag_target_drag_leave)(struct _cef_browser_host_t* self);
void (CEF_CALLBACK *drag_target_drag_leave)(struct _cef_browser_host_t* self);
///
// Call this function when the user completes the drag operation by dropping
@@ -808,8 +713,8 @@ typedef struct _cef_browser_host_t {
// DragTargetDragEnter call. This function is only used when window rendering
// is disabled.
///
void(CEF_CALLBACK* drag_target_drop)(struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event);
void (CEF_CALLBACK *drag_target_drop)(struct _cef_browser_host_t* self,
const struct _cef_mouse_event_t* event);
///
// Call this function when the drag operation started by a
@@ -820,10 +725,8 @@ typedef struct _cef_browser_host_t {
// DragSource* mthods. This function is only used when window rendering is
// disabled.
///
void(CEF_CALLBACK* drag_source_ended_at)(struct _cef_browser_host_t* self,
int x,
int y,
cef_drag_operations_mask_t op);
void (CEF_CALLBACK *drag_source_ended_at)(struct _cef_browser_host_t* self,
int x, int y, cef_drag_operations_mask_t op);
///
// Call this function when the drag operation started by a
@@ -833,115 +736,41 @@ typedef struct _cef_browser_host_t {
// then all DragTarget* functions should be called before DragSource* mthods.
// This function is only used when window rendering is disabled.
///
void(CEF_CALLBACK* drag_source_system_drag_ended)(
void (CEF_CALLBACK *drag_source_system_drag_ended)(
struct _cef_browser_host_t* self);
///
// Returns the current visible navigation entry for this browser. This
// function can only be called on the UI thread.
///
struct _cef_navigation_entry_t*(CEF_CALLBACK* get_visible_navigation_entry)(
struct _cef_navigation_entry_t* (CEF_CALLBACK *get_visible_navigation_entry)(
struct _cef_browser_host_t* self);
///
// Set accessibility state for all frames. |accessibility_state| may be
// default, enabled or disabled. If |accessibility_state| is STATE_DEFAULT
// then accessibility will be disabled by default and the state may be further
// controlled with the "force-renderer-accessibility" and "disable-renderer-
// accessibility" command-line switches. If |accessibility_state| is
// STATE_ENABLED then accessibility will be enabled. If |accessibility_state|
// is STATE_DISABLED then accessibility will be completely disabled.
//
// For windowed browsers accessibility will be enabled in Complete mode (which
// corresponds to kAccessibilityModeComplete in Chromium). In this mode all
// platform accessibility objects will be created and managed by Chromium's
// internal implementation. The client needs only to detect the screen reader
// and call this function appropriately. For example, on macOS the client can
// handle the @"AXEnhancedUserStructure" accessibility attribute to detect
// VoiceOver state changes and on Windows the client can handle WM_GETOBJECT
// with OBJID_CLIENT to detect accessibility readers.
//
// For windowless browsers accessibility will be enabled in TreeOnly mode
// (which corresponds to kAccessibilityModeWebContentsOnly in Chromium). In
// this mode renderer accessibility is enabled, the full tree is computed, and
// events are passed to CefAccessibiltyHandler, but platform accessibility
// objects are not created. The client may implement platform accessibility
// objects using CefAccessibiltyHandler callbacks if desired.
///
void(CEF_CALLBACK* set_accessibility_state)(struct _cef_browser_host_t* self,
cef_state_t accessibility_state);
///
// Enable notifications of auto resize via
// cef_display_handler_t::OnAutoResize. Notifications are disabled by default.
// |min_size| and |max_size| define the range of allowed sizes.
///
void(CEF_CALLBACK* set_auto_resize_enabled)(struct _cef_browser_host_t* self,
int enabled,
const cef_size_t* min_size,
const cef_size_t* max_size);
///
// Returns the extension hosted in this browser or NULL if no extension is
// hosted. See cef_request_context_t::LoadExtension for details.
///
struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
struct _cef_browser_host_t* self);
///
// Returns true (1) if this browser is hosting an extension background script.
// Background hosts do not have a window and are not displayable. See
// cef_request_context_t::LoadExtension for details.
///
int(CEF_CALLBACK* is_background_host)(struct _cef_browser_host_t* self);
///
// Set whether the browser's audio is muted.
///
void(CEF_CALLBACK* set_audio_muted)(struct _cef_browser_host_t* self,
int mute);
///
// Returns true (1) if the browser's audio is muted. This function can only
// be called on the UI thread.
///
int(CEF_CALLBACK* is_audio_muted)(struct _cef_browser_host_t* self);
} cef_browser_host_t;
///
// Create a new browser window using the window parameters specified by
// |windowInfo|. All values will be copied internally and the actual window will
// be created on the UI thread. If |request_context| is NULL the global request
// context will be used. This function can be called on any browser process
// thread and will not block. The optional |extra_info| parameter provides an
// opportunity to specify extra information specific to the created browser that
// will be passed to cef_render_process_handler_t::on_browser_created() in the
// render process.
// thread and will not block.
///
CEF_EXPORT int cef_browser_host_create_browser(
const cef_window_info_t* windowInfo,
struct _cef_client_t* client,
const cef_string_t* url,
const struct _cef_browser_settings_t* settings,
struct _cef_dictionary_value_t* extra_info,
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
const cef_string_t* url, const struct _cef_browser_settings_t* settings,
struct _cef_request_context_t* request_context);
///
// Create a new browser window using the window parameters specified by
// |windowInfo|. If |request_context| is NULL the global request context will be
// used. This function can only be called on the browser process UI thread. The
// optional |extra_info| parameter provides an opportunity to specify extra
// information specific to the created browser that will be passed to
// cef_render_process_handler_t::on_browser_created() in the render process.
// used. This function can only be called on the browser process UI thread.
///
CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync(
const cef_window_info_t* windowInfo,
struct _cef_client_t* client,
const cef_string_t* url,
const struct _cef_browser_settings_t* settings,
struct _cef_dictionary_value_t* extra_info,
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
const cef_string_t* url, const struct _cef_browser_settings_t* settings,
struct _cef_request_context_t* request_context);
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,15 +33,12 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f0cd169568e9ea5bcc8bf2aa891691b76c05356d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_client_capi.h"
#include "include/capi/cef_command_line_capi.h"
#include "include/capi/cef_print_handler_capi.h"
#include "include/capi/cef_values_capi.h"
@@ -50,6 +47,7 @@
extern "C" {
#endif
///
// Structure used to implement browser process callbacks. The functions of this
// structure will be called on the browser process main thread unless otherwise
@@ -59,32 +57,13 @@ typedef struct _cef_browser_process_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Called on the browser process UI thread to retrieve the list of schemes
// that should support cookies. If |include_defaults| is true (1) the default
// schemes ("http", "https", "ws" and "wss") will also be supported. Providing
// an NULL |schemes| value and setting |include_defaults| to false (0) will
// disable all loading and saving of cookies.
//
// This state will apply to the cef_cookie_manager_t associated with the
// global cef_request_context_t. It will also be used as the initial state for
// any new cef_request_context_ts created by the client. After creating a new
// cef_request_context_t the cef_cookie_manager_t::SetSupportedSchemes
// function may be called on the associated cef_cookie_manager_t to futher
// override these values.
///
void(CEF_CALLBACK* get_cookieable_schemes)(
struct _cef_browser_process_handler_t* self,
cef_string_list_t schemes,
int* include_defaults);
cef_base_t base;
///
// Called on the browser process UI thread immediately after the CEF context
// has been initialized.
///
void(CEF_CALLBACK* on_context_initialized)(
void (CEF_CALLBACK *on_context_initialized)(
struct _cef_browser_process_handler_t* self);
///
@@ -94,15 +73,26 @@ typedef struct _cef_browser_process_handler_t {
// opportunity to modify the child process command line. Do not keep a
// reference to |command_line| outside of this function.
///
void(CEF_CALLBACK* on_before_child_process_launch)(
void (CEF_CALLBACK *on_before_child_process_launch)(
struct _cef_browser_process_handler_t* self,
struct _cef_command_line_t* command_line);
///
// Called on the browser process IO thread after the main thread has been
// created for a new render process. Provides an opportunity to specify extra
// information that will be passed to
// cef_render_process_handler_t::on_render_thread_created() in the render
// process. Do not keep a reference to |extra_info| outside of this function.
///
void (CEF_CALLBACK *on_render_process_thread_created)(
struct _cef_browser_process_handler_t* self,
struct _cef_list_value_t* extra_info);
///
// Return the handler for printing on Linux. If a print handler is not
// provided then printing will not be supported on the Linux platform.
///
struct _cef_print_handler_t*(CEF_CALLBACK* get_print_handler)(
struct _cef_print_handler_t* (CEF_CALLBACK *get_print_handler)(
struct _cef_browser_process_handler_t* self);
///
@@ -118,21 +108,11 @@ typedef struct _cef_browser_process_handler_t {
// specified delay and any currently pending scheduled call should be
// cancelled.
///
void(CEF_CALLBACK* on_schedule_message_pump_work)(
struct _cef_browser_process_handler_t* self,
int64 delay_ms);
///
// Return the default client for use with a newly created browser window. If
// null is returned the browser will be unmanaged (no callbacks will be
// executed for that browser) and application shutdown will be blocked until
// the browser window is closed manually. This function is currently only used
// with the chrome runtime.
///
struct _cef_client_t*(CEF_CALLBACK* get_default_client)(
struct _cef_browser_process_handler_t* self);
void (CEF_CALLBACK *on_schedule_message_pump_work)(
struct _cef_browser_process_handler_t* self, int64 delay_ms);
} cef_browser_process_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=cd8c183355a6808abd763ecc0396b5da6c15b3f9$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Generic callback structure used for asynchronous continuation.
///
@@ -53,19 +52,20 @@ typedef struct _cef_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Continue processing.
///
void(CEF_CALLBACK* cont)(struct _cef_callback_t* self);
void (CEF_CALLBACK *cont)(struct _cef_callback_t* self);
///
// Cancel processing.
///
void(CEF_CALLBACK* cancel)(struct _cef_callback_t* self);
void (CEF_CALLBACK *cancel)(struct _cef_callback_t* self);
} cef_callback_t;
///
// Generic callback structure used for asynchronous completion.
///
@@ -73,14 +73,15 @@ typedef struct _cef_completion_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Method that will be called once the task is complete.
///
void(CEF_CALLBACK* on_complete)(struct _cef_completion_callback_t* self);
void (CEF_CALLBACK *on_complete)(struct _cef_completion_callback_t* self);
} cef_completion_callback_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,14 +33,11 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=4cfcac55d2a1dee466a2a0753f30fb34a78ef3b2$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
#pragma once
#include "include/capi/cef_audio_handler_capi.h"
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_context_menu_handler_capi.h"
#include "include/capi/cef_dialog_handler_capi.h"
@@ -49,6 +46,7 @@
#include "include/capi/cef_drag_handler_capi.h"
#include "include/capi/cef_find_handler_capi.h"
#include "include/capi/cef_focus_handler_capi.h"
#include "include/capi/cef_geolocation_handler_capi.h"
#include "include/capi/cef_jsdialog_handler_capi.h"
#include "include/capi/cef_keyboard_handler_capi.h"
#include "include/capi/cef_life_span_handler_capi.h"
@@ -61,6 +59,7 @@
extern "C" {
#endif
///
// Implement this structure to provide handler implementations.
///
@@ -68,94 +67,95 @@ typedef struct _cef_client_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Return the handler for audio rendering events.
///
struct _cef_audio_handler_t*(CEF_CALLBACK* get_audio_handler)(
struct _cef_client_t* self);
cef_base_t base;
///
// Return the handler for context menus. If no handler is provided the default
// implementation will be used.
///
struct _cef_context_menu_handler_t*(CEF_CALLBACK* get_context_menu_handler)(
struct _cef_context_menu_handler_t* (CEF_CALLBACK *get_context_menu_handler)(
struct _cef_client_t* self);
///
// Return the handler for dialogs. If no handler is provided the default
// implementation will be used.
///
struct _cef_dialog_handler_t*(CEF_CALLBACK* get_dialog_handler)(
struct _cef_dialog_handler_t* (CEF_CALLBACK *get_dialog_handler)(
struct _cef_client_t* self);
///
// Return the handler for browser display state events.
///
struct _cef_display_handler_t*(CEF_CALLBACK* get_display_handler)(
struct _cef_display_handler_t* (CEF_CALLBACK *get_display_handler)(
struct _cef_client_t* self);
///
// Return the handler for download events. If no handler is returned downloads
// will not be allowed.
///
struct _cef_download_handler_t*(CEF_CALLBACK* get_download_handler)(
struct _cef_download_handler_t* (CEF_CALLBACK *get_download_handler)(
struct _cef_client_t* self);
///
// Return the handler for drag events.
///
struct _cef_drag_handler_t*(CEF_CALLBACK* get_drag_handler)(
struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)(
struct _cef_client_t* self);
///
// Return the handler for find result events.
///
struct _cef_find_handler_t*(CEF_CALLBACK* get_find_handler)(
struct _cef_find_handler_t* (CEF_CALLBACK *get_find_handler)(
struct _cef_client_t* self);
///
// Return the handler for focus events.
///
struct _cef_focus_handler_t*(CEF_CALLBACK* get_focus_handler)(
struct _cef_focus_handler_t* (CEF_CALLBACK *get_focus_handler)(
struct _cef_client_t* self);
///
// Return the handler for geolocation permissions requests. If no handler is
// provided geolocation access will be denied by default.
///
struct _cef_geolocation_handler_t* (CEF_CALLBACK *get_geolocation_handler)(
struct _cef_client_t* self);
///
// Return the handler for JavaScript dialogs. If no handler is provided the
// default implementation will be used.
///
struct _cef_jsdialog_handler_t*(CEF_CALLBACK* get_jsdialog_handler)(
struct _cef_jsdialog_handler_t* (CEF_CALLBACK *get_jsdialog_handler)(
struct _cef_client_t* self);
///
// Return the handler for keyboard events.
///
struct _cef_keyboard_handler_t*(CEF_CALLBACK* get_keyboard_handler)(
struct _cef_keyboard_handler_t* (CEF_CALLBACK *get_keyboard_handler)(
struct _cef_client_t* self);
///
// Return the handler for browser life span events.
///
struct _cef_life_span_handler_t*(CEF_CALLBACK* get_life_span_handler)(
struct _cef_life_span_handler_t* (CEF_CALLBACK *get_life_span_handler)(
struct _cef_client_t* self);
///
// Return the handler for browser load status events.
///
struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)(
struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)(
struct _cef_client_t* self);
///
// Return the handler for off-screen rendering events.
///
struct _cef_render_handler_t*(CEF_CALLBACK* get_render_handler)(
struct _cef_render_handler_t* (CEF_CALLBACK *get_render_handler)(
struct _cef_client_t* self);
///
// Return the handler for browser request events.
///
struct _cef_request_handler_t*(CEF_CALLBACK* get_request_handler)(
struct _cef_request_handler_t* (CEF_CALLBACK *get_request_handler)(
struct _cef_client_t* self);
///
@@ -163,14 +163,12 @@ typedef struct _cef_client_t {
// (1) if the message was handled or false (0) otherwise. Do not keep a
// reference to or attempt to access the message outside of this callback.
///
int(CEF_CALLBACK* on_process_message_received)(
struct _cef_client_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
cef_process_id_t source_process,
int (CEF_CALLBACK *on_process_message_received)(struct _cef_client_t* self,
struct _cef_browser_t* browser, cef_process_id_t source_process,
struct _cef_process_message_t* message);
} cef_client_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5af5bf1e877dd53f21f751d332a9e2166817324c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Structure used to create and/or parse command line arguments. Arguments with
// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
@@ -60,24 +59,24 @@ typedef struct _cef_command_line_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns true (1) if this object is valid. Do not call any other functions
// if this function returns false (0).
///
int(CEF_CALLBACK* is_valid)(struct _cef_command_line_t* self);
int (CEF_CALLBACK *is_valid)(struct _cef_command_line_t* self);
///
// Returns true (1) if the values of this object are read-only. Some APIs may
// expose read-only objects.
///
int(CEF_CALLBACK* is_read_only)(struct _cef_command_line_t* self);
int (CEF_CALLBACK *is_read_only)(struct _cef_command_line_t* self);
///
// Returns a writable copy of this object.
///
struct _cef_command_line_t*(CEF_CALLBACK* copy)(
struct _cef_command_line_t* (CEF_CALLBACK *copy)(
struct _cef_command_line_t* self);
///
@@ -85,117 +84,116 @@ typedef struct _cef_command_line_t {
// The first argument must be the name of the program. This function is only
// supported on non-Windows platforms.
///
void(CEF_CALLBACK* init_from_argv)(struct _cef_command_line_t* self,
int argc,
const char* const* argv);
void (CEF_CALLBACK *init_from_argv)(struct _cef_command_line_t* self,
int argc, const char* const* argv);
///
// Initialize the command line with the string returned by calling
// GetCommandLineW(). This function is only supported on Windows.
///
void(CEF_CALLBACK* init_from_string)(struct _cef_command_line_t* self,
const cef_string_t* command_line);
void (CEF_CALLBACK *init_from_string)(struct _cef_command_line_t* self,
const cef_string_t* command_line);
///
// Reset the command-line switches and arguments but leave the program
// component unchanged.
///
void(CEF_CALLBACK* reset)(struct _cef_command_line_t* self);
void (CEF_CALLBACK *reset)(struct _cef_command_line_t* self);
///
// Retrieve the original command line string as a vector of strings. The argv
// array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* }
///
void(CEF_CALLBACK* get_argv)(struct _cef_command_line_t* self,
cef_string_list_t argv);
void (CEF_CALLBACK *get_argv)(struct _cef_command_line_t* self,
cef_string_list_t argv);
///
// Constructs and returns the represented command line string. Use this
// function cautiously because quoting behavior is unclear.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_command_line_string)(
cef_string_userfree_t (CEF_CALLBACK *get_command_line_string)(
struct _cef_command_line_t* self);
///
// Get the program part of the command line string (the first item).
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_program)(
cef_string_userfree_t (CEF_CALLBACK *get_program)(
struct _cef_command_line_t* self);
///
// Set the program part of the command line string (the first item).
///
void(CEF_CALLBACK* set_program)(struct _cef_command_line_t* self,
const cef_string_t* program);
void (CEF_CALLBACK *set_program)(struct _cef_command_line_t* self,
const cef_string_t* program);
///
// Returns true (1) if the command line has switches.
///
int(CEF_CALLBACK* has_switches)(struct _cef_command_line_t* self);
int (CEF_CALLBACK *has_switches)(struct _cef_command_line_t* self);
///
// Returns true (1) if the command line contains the given switch.
///
int(CEF_CALLBACK* has_switch)(struct _cef_command_line_t* self,
const cef_string_t* name);
int (CEF_CALLBACK *has_switch)(struct _cef_command_line_t* self,
const cef_string_t* name);
///
// Returns the value associated with the given switch. If the switch has no
// value or isn't present this function returns the NULL string.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_switch_value)(
struct _cef_command_line_t* self,
const cef_string_t* name);
cef_string_userfree_t (CEF_CALLBACK *get_switch_value)(
struct _cef_command_line_t* self, const cef_string_t* name);
///
// Returns the map of switch names and values. If a switch has no value an
// NULL string is returned.
///
void(CEF_CALLBACK* get_switches)(struct _cef_command_line_t* self,
cef_string_map_t switches);
void (CEF_CALLBACK *get_switches)(struct _cef_command_line_t* self,
cef_string_map_t switches);
///
// Add a switch to the end of the command line. If the switch has no value
// pass an NULL value string.
///
void(CEF_CALLBACK* append_switch)(struct _cef_command_line_t* self,
const cef_string_t* name);
void (CEF_CALLBACK *append_switch)(struct _cef_command_line_t* self,
const cef_string_t* name);
///
// Add a switch with the specified value to the end of the command line.
///
void(CEF_CALLBACK* append_switch_with_value)(struct _cef_command_line_t* self,
const cef_string_t* name,
const cef_string_t* value);
void (CEF_CALLBACK *append_switch_with_value)(
struct _cef_command_line_t* self, const cef_string_t* name,
const cef_string_t* value);
///
// True if there are remaining command line arguments.
///
int(CEF_CALLBACK* has_arguments)(struct _cef_command_line_t* self);
int (CEF_CALLBACK *has_arguments)(struct _cef_command_line_t* self);
///
// Get the remaining command line arguments.
///
void(CEF_CALLBACK* get_arguments)(struct _cef_command_line_t* self,
cef_string_list_t arguments);
void (CEF_CALLBACK *get_arguments)(struct _cef_command_line_t* self,
cef_string_list_t arguments);
///
// Add an argument to the end of the command line.
///
void(CEF_CALLBACK* append_argument)(struct _cef_command_line_t* self,
const cef_string_t* argument);
void (CEF_CALLBACK *append_argument)(struct _cef_command_line_t* self,
const cef_string_t* argument);
///
// Insert a command before the current command. Common for debuggers, like
// "valgrind" or "gdb --args".
///
void(CEF_CALLBACK* prepend_wrapper)(struct _cef_command_line_t* self,
const cef_string_t* wrapper);
void (CEF_CALLBACK *prepend_wrapper)(struct _cef_command_line_t* self,
const cef_string_t* wrapper);
} cef_command_line_t;
///
// Create a new cef_command_line_t instance.
///
@@ -207,6 +205,7 @@ CEF_EXPORT cef_command_line_t* cef_command_line_create();
///
CEF_EXPORT cef_command_line_t* cef_command_line_get_global();
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=bd04d49bcd5d269f237c92163b40435d5588209b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
@@ -58,22 +56,22 @@ typedef struct _cef_run_context_menu_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Complete context menu display by selecting the specified |command_id| and
// |event_flags|.
///
void(CEF_CALLBACK* cont)(struct _cef_run_context_menu_callback_t* self,
int command_id,
cef_event_flags_t event_flags);
void (CEF_CALLBACK *cont)(struct _cef_run_context_menu_callback_t* self,
int command_id, cef_event_flags_t event_flags);
///
// Cancel context menu display.
///
void(CEF_CALLBACK* cancel)(struct _cef_run_context_menu_callback_t* self);
void (CEF_CALLBACK *cancel)(struct _cef_run_context_menu_callback_t* self);
} cef_run_context_menu_callback_t;
///
// Implement this structure to handle context menu events. The functions of this
// structure will be called on the UI thread.
@@ -82,7 +80,7 @@ typedef struct _cef_context_menu_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called before a context menu is displayed. |params| provides information
@@ -91,11 +89,9 @@ typedef struct _cef_context_menu_handler_t {
// modified to show a custom menu. Do not keep references to |params| or
// |model| outside of this callback.
///
void(CEF_CALLBACK* on_before_context_menu)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
struct _cef_context_menu_params_t* params,
void (CEF_CALLBACK *on_before_context_menu)(
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
struct _cef_menu_model_t* model);
///
@@ -106,10 +102,8 @@ typedef struct _cef_context_menu_handler_t {
// selected command ID. For default display return false (0). Do not keep
// references to |params| or |model| outside of this callback.
///
int(CEF_CALLBACK* run_context_menu)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
int (CEF_CALLBACK *run_context_menu)(struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
struct _cef_context_menu_params_t* params,
struct _cef_menu_model_t* model,
struct _cef_run_context_menu_callback_t* callback);
@@ -123,24 +117,21 @@ typedef struct _cef_context_menu_handler_t {
// on_before_context_menu(). Do not keep a reference to |params| outside of
// this callback.
///
int(CEF_CALLBACK* on_context_menu_command)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
struct _cef_context_menu_params_t* params,
int command_id,
cef_event_flags_t event_flags);
int (CEF_CALLBACK *on_context_menu_command)(
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
int command_id, cef_event_flags_t event_flags);
///
// Called when the context menu is dismissed irregardless of whether the menu
// was NULL or a command was selected.
///
void(CEF_CALLBACK* on_context_menu_dismissed)(
struct _cef_context_menu_handler_t* self,
struct _cef_browser_t* browser,
void (CEF_CALLBACK *on_context_menu_dismissed)(
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
struct _cef_frame_t* frame);
} cef_context_menu_handler_t;
///
// Provides information about the context menu state. The ethods of this
// structure can only be accessed on browser process the UI thread.
@@ -149,25 +140,25 @@ typedef struct _cef_context_menu_params_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns the X coordinate of the mouse where the context menu was invoked.
// Coords are relative to the associated RenderView's origin.
///
int(CEF_CALLBACK* get_xcoord)(struct _cef_context_menu_params_t* self);
int (CEF_CALLBACK *get_xcoord)(struct _cef_context_menu_params_t* self);
///
// Returns the Y coordinate of the mouse where the context menu was invoked.
// Coords are relative to the associated RenderView's origin.
///
int(CEF_CALLBACK* get_ycoord)(struct _cef_context_menu_params_t* self);
int (CEF_CALLBACK *get_ycoord)(struct _cef_context_menu_params_t* self);
///
// Returns flags representing the type of node that the context menu was
// invoked on.
///
cef_context_menu_type_flags_t(CEF_CALLBACK* get_type_flags)(
cef_context_menu_type_flags_t (CEF_CALLBACK *get_type_flags)(
struct _cef_context_menu_params_t* self);
///
@@ -175,7 +166,7 @@ typedef struct _cef_context_menu_params_t {
// context menu was invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_link_url)(
cef_string_userfree_t (CEF_CALLBACK *get_link_url)(
struct _cef_context_menu_params_t* self);
///
@@ -183,7 +174,7 @@ typedef struct _cef_context_menu_params_t {
// don't validate this field in the frontend process.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_unfiltered_link_url)(
cef_string_userfree_t (CEF_CALLBACK *get_unfiltered_link_url)(
struct _cef_context_menu_params_t* self);
///
@@ -191,14 +182,14 @@ typedef struct _cef_context_menu_params_t {
// invoked on. Example of elements with source URLs are img, audio, and video.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_source_url)(
cef_string_userfree_t (CEF_CALLBACK *get_source_url)(
struct _cef_context_menu_params_t* self);
///
// Returns true (1) if the context menu was invoked on an image which has non-
// NULL contents.
///
int(CEF_CALLBACK* has_image_contents)(
int (CEF_CALLBACK *has_image_contents)(
struct _cef_context_menu_params_t* self);
///
@@ -206,21 +197,21 @@ typedef struct _cef_context_menu_params_t {
// an image.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_title_text)(
cef_string_userfree_t (CEF_CALLBACK *get_title_text)(
struct _cef_context_menu_params_t* self);
///
// Returns the URL of the top level page that the context menu was invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_page_url)(
cef_string_userfree_t (CEF_CALLBACK *get_page_url)(
struct _cef_context_menu_params_t* self);
///
// Returns the URL of the subframe that the context menu was invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_frame_url)(
cef_string_userfree_t (CEF_CALLBACK *get_frame_url)(
struct _cef_context_menu_params_t* self);
///
@@ -228,20 +219,20 @@ typedef struct _cef_context_menu_params_t {
// invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_frame_charset)(
cef_string_userfree_t (CEF_CALLBACK *get_frame_charset)(
struct _cef_context_menu_params_t* self);
///
// Returns the type of context node that the context menu was invoked on.
///
cef_context_menu_media_type_t(CEF_CALLBACK* get_media_type)(
cef_context_menu_media_type_t (CEF_CALLBACK *get_media_type)(
struct _cef_context_menu_params_t* self);
///
// Returns flags representing the actions supported by the media element, if
// any, that the context menu was invoked on.
///
cef_context_menu_media_state_flags_t(CEF_CALLBACK* get_media_state_flags)(
cef_context_menu_media_state_flags_t (CEF_CALLBACK *get_media_state_flags)(
struct _cef_context_menu_params_t* self);
///
@@ -249,7 +240,7 @@ typedef struct _cef_context_menu_params_t {
// invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_selection_text)(
cef_string_userfree_t (CEF_CALLBACK *get_selection_text)(
struct _cef_context_menu_params_t* self);
///
@@ -257,7 +248,7 @@ typedef struct _cef_context_menu_params_t {
// invoked on.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_misspelled_word)(
cef_string_userfree_t (CEF_CALLBACK *get_misspelled_word)(
struct _cef_context_menu_params_t* self);
///
@@ -265,27 +256,26 @@ typedef struct _cef_context_menu_params_t {
// |suggestions| from the spell check service for the misspelled word if there
// is one.
///
int(CEF_CALLBACK* get_dictionary_suggestions)(
struct _cef_context_menu_params_t* self,
cef_string_list_t suggestions);
int (CEF_CALLBACK *get_dictionary_suggestions)(
struct _cef_context_menu_params_t* self, cef_string_list_t suggestions);
///
// Returns true (1) if the context menu was invoked on an editable node.
///
int(CEF_CALLBACK* is_editable)(struct _cef_context_menu_params_t* self);
int (CEF_CALLBACK *is_editable)(struct _cef_context_menu_params_t* self);
///
// Returns true (1) if the context menu was invoked on an editable node where
// spell-check is enabled.
///
int(CEF_CALLBACK* is_spell_check_enabled)(
int (CEF_CALLBACK *is_spell_check_enabled)(
struct _cef_context_menu_params_t* self);
///
// Returns flags representing the actions supported by the editable node, if
// any, that the context menu was invoked on.
///
cef_context_menu_edit_state_flags_t(CEF_CALLBACK* get_edit_state_flags)(
cef_context_menu_edit_state_flags_t (CEF_CALLBACK *get_edit_state_flags)(
struct _cef_context_menu_params_t* self);
///
@@ -293,14 +283,15 @@ typedef struct _cef_context_menu_params_t {
// renderer process (for example, plugin placeholder or pepper plugin menu
// items).
///
int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self);
int (CEF_CALLBACK *is_custom_menu)(struct _cef_context_menu_params_t* self);
///
// Returns true (1) if the context menu was invoked from a pepper plugin.
///
int(CEF_CALLBACK* is_pepper_menu)(struct _cef_context_menu_params_t* self);
int (CEF_CALLBACK *is_pepper_menu)(struct _cef_context_menu_params_t* self);
} cef_context_menu_params_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=20ba58ac3e861344ee738b58433869223c757e24$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
@@ -59,42 +57,35 @@ typedef struct _cef_cookie_manager_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Set the schemes supported by this manager. If |include_defaults| is true
// (1) the default schemes ("http", "https", "ws" and "wss") will also be
// supported. Calling this function with an NULL |schemes| value and
// |include_defaults| set to false (0) will disable all loading and saving of
// cookies for this manager. If |callback| is non-NULL it will be executed
// asnychronously on the UI thread after the change has been applied. Must be
// called before any cookies are accessed.
// Set the schemes supported by this manager. The default schemes ("http",
// "https", "ws" and "wss") will always be supported. If |callback| is non-
// NULL it will be executed asnychronously on the IO thread after the change
// has been applied. Must be called before any cookies are accessed.
///
void(CEF_CALLBACK* set_supported_schemes)(
struct _cef_cookie_manager_t* self,
cef_string_list_t schemes,
int include_defaults,
struct _cef_completion_callback_t* callback);
void (CEF_CALLBACK *set_supported_schemes)(struct _cef_cookie_manager_t* self,
cef_string_list_t schemes, struct _cef_completion_callback_t* callback);
///
// Visit all cookies on the UI thread. The returned cookies are ordered by
// Visit all cookies on the IO thread. The returned cookies are ordered by
// longest path, then by earliest creation date. Returns false (0) if cookies
// cannot be accessed.
///
int(CEF_CALLBACK* visit_all_cookies)(struct _cef_cookie_manager_t* self,
struct _cef_cookie_visitor_t* visitor);
int (CEF_CALLBACK *visit_all_cookies)(struct _cef_cookie_manager_t* self,
struct _cef_cookie_visitor_t* visitor);
///
// Visit a subset of cookies on the UI thread. The results are filtered by the
// Visit a subset of cookies on the IO thread. The results are filtered by the
// given url scheme, host, domain and path. If |includeHttpOnly| is true (1)
// HTTP-only cookies will also be included in the results. The returned
// cookies are ordered by longest path, then by earliest creation date.
// Returns false (0) if cookies cannot be accessed.
///
int(CEF_CALLBACK* visit_url_cookies)(struct _cef_cookie_manager_t* self,
const cef_string_t* url,
int includeHttpOnly,
struct _cef_cookie_visitor_t* visitor);
int (CEF_CALLBACK *visit_url_cookies)(struct _cef_cookie_manager_t* self,
const cef_string_t* url, int includeHttpOnly,
struct _cef_cookie_visitor_t* visitor);
///
// Sets a cookie given a valid URL and explicit user-provided cookie
@@ -102,13 +93,12 @@ typedef struct _cef_cookie_manager_t {
// check for disallowed characters (e.g. the ';' character is disallowed
// within the cookie value attribute) and fail without setting the cookie if
// such characters are found. If |callback| is non-NULL it will be executed
// asnychronously on the UI thread after the cookie has been set. Returns
// asnychronously on the IO thread after the cookie has been set. Returns
// false (0) if an invalid URL is specified or if cookies cannot be accessed.
///
int(CEF_CALLBACK* set_cookie)(struct _cef_cookie_manager_t* self,
const cef_string_t* url,
const struct _cef_cookie_t* cookie,
struct _cef_set_cookie_callback_t* callback);
int (CEF_CALLBACK *set_cookie)(struct _cef_cookie_manager_t* self,
const cef_string_t* url, const struct _cef_cookie_t* cookie,
struct _cef_set_cookie_callback_t* callback);
///
// Delete all cookies that match the specified parameters. If both |url| and
@@ -116,46 +106,73 @@ typedef struct _cef_cookie_manager_t {
// both will be deleted. If only |url| is specified all host cookies (but not
// domain cookies) irrespective of path will be deleted. If |url| is NULL all
// cookies for all hosts and domains will be deleted. If |callback| is non-
// NULL it will be executed asnychronously on the UI thread after the cookies
// NULL it will be executed asnychronously on the IO thread after the cookies
// have been deleted. Returns false (0) if a non-NULL invalid URL is specified
// or if cookies cannot be accessed. Cookies can alternately be deleted using
// the Visit*Cookies() functions.
///
int(CEF_CALLBACK* delete_cookies)(
struct _cef_cookie_manager_t* self,
const cef_string_t* url,
const cef_string_t* cookie_name,
int (CEF_CALLBACK *delete_cookies)(struct _cef_cookie_manager_t* self,
const cef_string_t* url, const cef_string_t* cookie_name,
struct _cef_delete_cookies_callback_t* callback);
///
// Sets the directory path that will be used for storing cookie data. If
// |path| is NULL data will be stored in memory only. Otherwise, data will be
// stored at the specified |path|. To persist session cookies (cookies without
// an expiry date or validity interval) set |persist_session_cookies| to true
// (1). Session cookies are generally intended to be transient and most Web
// browsers do not persist them. If |callback| is non-NULL it will be executed
// asnychronously on the IO thread after the manager's storage has been
// initialized. Returns false (0) if cookies cannot be accessed.
///
int (CEF_CALLBACK *set_storage_path)(struct _cef_cookie_manager_t* self,
const cef_string_t* path, int persist_session_cookies,
struct _cef_completion_callback_t* callback);
///
// Flush the backing store (if any) to disk. If |callback| is non-NULL it will
// be executed asnychronously on the UI thread after the flush is complete.
// be executed asnychronously on the IO thread after the flush is complete.
// Returns false (0) if cookies cannot be accessed.
///
int(CEF_CALLBACK* flush_store)(struct _cef_cookie_manager_t* self,
struct _cef_completion_callback_t* callback);
int (CEF_CALLBACK *flush_store)(struct _cef_cookie_manager_t* self,
struct _cef_completion_callback_t* callback);
} cef_cookie_manager_t;
///
// Returns the global cookie manager. By default data will be stored at
// CefSettings.cache_path if specified or in memory otherwise. If |callback| is
// non-NULL it will be executed asnychronously on the UI thread after the
// non-NULL it will be executed asnychronously on the IO thread after the
// manager's storage has been initialized. Using this function is equivalent to
// calling cef_request_context_t::cef_request_context_get_global_context()->GetD
// efaultCookieManager().
// calling cef_request_tContext::cef_request_context_get_global_context()->get_d
// efault_cookie_manager().
///
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
struct _cef_completion_callback_t* callback);
///
// Creates a new cookie manager. If |path| is NULL data will be stored in memory
// only. Otherwise, data will be stored at the specified |path|. To persist
// session cookies (cookies without an expiry date or validity interval) set
// |persist_session_cookies| to true (1). Session cookies are generally intended
// to be transient and most Web browsers do not persist them. If |callback| is
// non-NULL it will be executed asnychronously on the IO thread after the
// manager's storage has been initialized.
///
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager(
const cef_string_t* path, int persist_session_cookies,
struct _cef_completion_callback_t* callback);
///
// Structure to implement for visiting cookie values. The functions of this
// structure will always be called on the UI thread.
// structure will always be called on the IO thread.
///
typedef struct _cef_cookie_visitor_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Method that will be called once for each cookie. |count| is the 0-based
@@ -164,13 +181,12 @@ typedef struct _cef_cookie_visitor_t {
// Return false (0) to stop visiting cookies. This function may never be
// called if no cookies are found.
///
int(CEF_CALLBACK* visit)(struct _cef_cookie_visitor_t* self,
const struct _cef_cookie_t* cookie,
int count,
int total,
int* deleteCookie);
int (CEF_CALLBACK *visit)(struct _cef_cookie_visitor_t* self,
const struct _cef_cookie_t* cookie, int count, int total,
int* deleteCookie);
} cef_cookie_visitor_t;
///
// Structure to implement to be notified of asynchronous completion via
// cef_cookie_manager_t::set_cookie().
@@ -179,16 +195,17 @@ typedef struct _cef_set_cookie_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Method that will be called upon completion. |success| will be true (1) if
// the cookie was set successfully.
///
void(CEF_CALLBACK* on_complete)(struct _cef_set_cookie_callback_t* self,
int success);
void (CEF_CALLBACK *on_complete)(struct _cef_set_cookie_callback_t* self,
int success);
} cef_set_cookie_callback_t;
///
// Structure to implement to be notified of asynchronous completion via
// cef_cookie_manager_t::delete_cookies().
@@ -197,16 +214,17 @@ typedef struct _cef_delete_cookies_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Method that will be called upon completion. |num_deleted| will be the
// number of cookies that were deleted.
// number of cookies that were deleted or -1 if unknown.
///
void(CEF_CALLBACK* on_complete)(struct _cef_delete_cookies_callback_t* self,
int num_deleted);
void (CEF_CALLBACK *on_complete)(struct _cef_delete_cookies_callback_t* self,
int num_deleted);
} cef_delete_cookies_callback_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5e19231e3476eef376c2742e8d375bee7bd4ea2d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Crash reporting is configured using an INI-style config file named
// "crash_reporter.cfg". On Windows and Linux this file must be placed next to
@@ -62,9 +61,6 @@ extern "C" {
// information; default to "CEF">
// ExternalHandler=<Windows only; Name of the external handler exe to use
// instead of re-launching the main exe; default to empty>
// BrowserCrashForwardingEnabled=<macOS only; True if browser process crashes
// should be forwarded to the system crash
// reporter; default to false>
// ServerURL=<crash server URL; default to empty>
// RateLimitEnabled=<True if uploads should be rate limited; default to true>
// MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled;
@@ -96,12 +92,6 @@ extern "C" {
// directory. On Linux the CefSettings.browser_subprocess_path value will be
// used. On macOS the existing subprocess app bundle will be used.
//
// If "BrowserCrashForwardingEnabled" is set to true (1) on macOS then browser
// process crashes will be forwarded to the system crash reporter. This results
// in the crash UI dialog being displayed to the user and crash reports being
// logged under "~/Library/Logs/DiagnosticReports". Forwarding of crash reports
// from non-browser processes and Debug builds is always disabled.
//
// If "ServerURL" is set then crashes will be uploaded as a multi-part POST
// request to the specified URL. Otherwise, reports will only be stored locally
// on disk.
@@ -129,12 +119,14 @@ extern "C" {
//
// CrashKeys section:
//
// A maximum of 26 crash keys of each size can be specified for use by the
// application. Crash key values will be truncated based on the specified size
// (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of
// crash keys can be set from any thread or process using the
// CefSetCrashKeyValue function. These key/value pairs will be sent to the crash
// server along with the crash dump file.
// Any number of crash keys can be specified for use by the application. Crash
// key values will be truncated based on the specified size (small = 63 bytes,
// medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set
// from any thread or process using the CefSetCrashKeyValue function. These
// key/value pairs will be sent to the crash server along with the crash dump
// file. Medium and large values will be chunked for submission. For example, if
// your key is named "mykey" then the value will be broken into ordered chunks
// and submitted using keys named "mykey-1", "mykey-2", etc.
///
CEF_EXPORT int cef_crash_reporting_enabled();
@@ -142,7 +134,7 @@ CEF_EXPORT int cef_crash_reporting_enabled();
// Sets or clears a specific key-value pair from the crash metadata.
///
CEF_EXPORT void cef_set_crash_key_value(const cef_string_t* key,
const cef_string_t* value);
const cef_string_t* value);
#ifdef __cplusplus
}

View File

@@ -1,147 +0,0 @@
// Copyright (c) 2021 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1a256c04042ebd4867f39e1c31def558871b2bab$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_browser_t;
///
// Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The
// functions of this structure will be called on the browser process UI thread.
///
typedef struct _cef_dev_tools_message_observer_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Method that will be called on receipt of a DevTools protocol message.
// |browser| is the originating browser instance. |message| is a UTF8-encoded
// JSON dictionary representing either a function result or an event.
// |message| is only valid for the scope of this callback and should be copied
// if necessary. Return true (1) if the message was handled or false (0) if
// the message should be further processed and passed to the
// OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate.
//
// Method result dictionaries include an "id" (int) value that identifies the
// orginating function call sent from cef_browser_host_t::SendDevToolsMessage,
// and optionally either a "result" (dictionary) or "error" (dictionary)
// value. The "error" dictionary will contain "code" (int) and "message"
// (string) values. Event dictionaries include a "function" (string) value and
// optionally a "params" (dictionary) value. See the DevTools protocol
// documentation at https://chromedevtools.github.io/devtools-protocol/ for
// details of supported function calls and the expected "result" or "params"
// dictionary contents. JSON dictionaries can be parsed using the CefParseJSON
// function if desired, however be aware of performance considerations when
// parsing large messages (some of which may exceed 1MB in size).
///
int(CEF_CALLBACK* on_dev_tools_message)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser,
const void* message,
size_t message_size);
///
// Method that will be called after attempted execution of a DevTools protocol
// function. |browser| is the originating browser instance. |message_id| is
// the "id" value that identifies the originating function call message. If
// the function succeeded |success| will be true (1) and |result| will be the
// UTF8-encoded JSON "result" dictionary value (which may be NULL). If the
// function failed |success| will be false (0) and |result| will be the
// UTF8-encoded JSON "error" dictionary value. |result| is only valid for the
// scope of this callback and should be copied if necessary. See the
// OnDevToolsMessage documentation for additional details on |result|
// contents.
///
void(CEF_CALLBACK* on_dev_tools_method_result)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser,
int message_id,
int success,
const void* result,
size_t result_size);
///
// Method that will be called on receipt of a DevTools protocol event.
// |browser| is the originating browser instance. |function| is the "function"
// value. |params| is the UTF8-encoded JSON "params" dictionary value (which
// may be NULL). |params| is only valid for the scope of this callback and
// should be copied if necessary. See the OnDevToolsMessage documentation for
// additional details on |params| contents.
///
void(CEF_CALLBACK* on_dev_tools_event)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser,
const cef_string_t* method,
const void* params,
size_t params_size);
///
// Method that will be called when the DevTools agent has attached. |browser|
// is the originating browser instance. This will generally occur in response
// to the first message sent while the agent is detached.
///
void(CEF_CALLBACK* on_dev_tools_agent_attached)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser);
///
// Method that will be called when the DevTools agent has detached. |browser|
// is the originating browser instance. Any function results that were pending
// before the agent became detached will not be delivered, and any active
// event subscriptions will be canceled.
///
void(CEF_CALLBACK* on_dev_tools_agent_detached)(
struct _cef_dev_tools_message_observer_t* self,
struct _cef_browser_t* browser);
} cef_dev_tools_message_observer_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5ae5556e4085faf8cf17ee757f5eeac9197f75c0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
@@ -47,6 +45,7 @@
extern "C" {
#endif
///
// Callback structure for asynchronous continuation of file dialog requests.
///
@@ -54,7 +53,7 @@ typedef struct _cef_file_dialog_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Continue the file selection. |selected_accept_filter| should be the 0-based
@@ -63,16 +62,16 @@ typedef struct _cef_file_dialog_callback_t {
// or a list of values depending on the dialog mode. An NULL |file_paths|
// value is treated the same as calling cancel().
///
void(CEF_CALLBACK* cont)(struct _cef_file_dialog_callback_t* self,
int selected_accept_filter,
cef_string_list_t file_paths);
void (CEF_CALLBACK *cont)(struct _cef_file_dialog_callback_t* self,
int selected_accept_filter, cef_string_list_t file_paths);
///
// Cancel the file selection.
///
void(CEF_CALLBACK* cancel)(struct _cef_file_dialog_callback_t* self);
void (CEF_CALLBACK *cancel)(struct _cef_file_dialog_callback_t* self);
} cef_file_dialog_callback_t;
///
// Implement this structure to handle dialog events. The functions of this
// structure will be called on the browser process UI thread.
@@ -81,7 +80,7 @@ typedef struct _cef_dialog_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called to run a file chooser dialog. |mode| represents the type of dialog
@@ -98,17 +97,14 @@ typedef struct _cef_dialog_handler_t {
// return true (1) and execute |callback| either inline or at a later time. To
// display the default dialog return false (0).
///
int(CEF_CALLBACK* on_file_dialog)(
struct _cef_dialog_handler_t* self,
struct _cef_browser_t* browser,
cef_file_dialog_mode_t mode,
const cef_string_t* title,
const cef_string_t* default_file_path,
cef_string_list_t accept_filters,
int selected_accept_filter,
int (CEF_CALLBACK *on_file_dialog)(struct _cef_dialog_handler_t* self,
struct _cef_browser_t* browser, cef_file_dialog_mode_t mode,
const cef_string_t* title, const cef_string_t* default_file_path,
cef_string_list_t accept_filters, int selected_accept_filter,
struct _cef_file_dialog_callback_t* callback);
} cef_dialog_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=067fd169a30bec1ad8eeacc5ab1ac750cf59640e$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
@@ -48,6 +46,7 @@
extern "C" {
#endif
///
// Implement this structure to handle events related to browser display state.
// The functions of this structure will be called on the UI thread.
@@ -56,29 +55,26 @@ typedef struct _cef_display_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called when a frame's address has changed.
///
void(CEF_CALLBACK* on_address_change)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_string_t* url);
void (CEF_CALLBACK *on_address_change)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
const cef_string_t* url);
///
// Called when the page title changes.
///
void(CEF_CALLBACK* on_title_change)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* title);
void (CEF_CALLBACK *on_title_change)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* title);
///
// Called when the page icon changes.
///
void(CEF_CALLBACK* on_favicon_urlchange)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
cef_string_list_t icon_urls);
void (CEF_CALLBACK *on_favicon_urlchange)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, cef_string_list_t icon_urls);
///
// Called when web content in the page has toggled fullscreen mode. If
@@ -87,9 +83,8 @@ typedef struct _cef_display_handler_t {
// automatically return to its original size and position. The client is
// responsible for resizing the browser if desired.
///
void(CEF_CALLBACK* on_fullscreen_mode_change)(
struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
void (CEF_CALLBACK *on_fullscreen_mode_change)(
struct _cef_display_handler_t* self, struct _cef_browser_t* browser,
int fullscreen);
///
@@ -100,62 +95,26 @@ typedef struct _cef_display_handler_t {
// tooltip. When window rendering is disabled the application is responsible
// for drawing tooltips and the return value is ignored.
///
int(CEF_CALLBACK* on_tooltip)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
cef_string_t* text);
int (CEF_CALLBACK *on_tooltip)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, cef_string_t* text);
///
// Called when the browser receives a status message. |value| contains the
// text that will be displayed in the status message.
///
void(CEF_CALLBACK* on_status_message)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* value);
void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* value);
///
// Called to display a console message. Return true (1) to stop the message
// from being output to the console.
///
int(CEF_CALLBACK* on_console_message)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
cef_log_severity_t level,
const cef_string_t* message,
const cef_string_t* source,
int line);
///
// Called when auto-resize is enabled via
// cef_browser_host_t::SetAutoResizeEnabled and the contents have auto-
// resized. |new_size| will be the desired size in view coordinates. Return
// true (1) if the resize was handled or false (0) for default handling.
///
int(CEF_CALLBACK* on_auto_resize)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
const cef_size_t* new_size);
///
// Called when the overall page loading progress has changed. |progress|
// ranges from 0.0 to 1.0.
///
void(CEF_CALLBACK* on_loading_progress_change)(
struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
double progress);
///
// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
// |custom_cursor_info| will be populated with the custom cursor information.
// Return true (1) if the cursor change was handled or false (0) for default
// handling.
///
int(CEF_CALLBACK* on_cursor_change)(
struct _cef_display_handler_t* self,
struct _cef_browser_t* browser,
cef_cursor_handle_t cursor,
cef_cursor_type_t type,
const struct _cef_cursor_info_t* custom_cursor_info);
int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* message,
const cef_string_t* source, int line);
} cef_display_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0517dc6c42fdde9fecfc4549fab1ea12b614e143$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
@@ -57,7 +55,7 @@ typedef struct _cef_domvisitor_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Method executed for visiting the DOM. The document object passed to this
@@ -66,10 +64,11 @@ typedef struct _cef_domvisitor_t {
// keep references to or attempt to access any DOM objects outside the scope
// of this function.
///
void(CEF_CALLBACK* visit)(struct _cef_domvisitor_t* self,
struct _cef_domdocument_t* document);
void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self,
struct _cef_domdocument_t* document);
} cef_domvisitor_t;
///
// Structure used to represent a DOM document. The functions of this structure
// should only be called on the render process main thread thread.
@@ -78,87 +77,86 @@ typedef struct _cef_domdocument_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns the document type.
///
cef_dom_document_type_t(CEF_CALLBACK* get_type)(
cef_dom_document_type_t (CEF_CALLBACK *get_type)(
struct _cef_domdocument_t* self);
///
// Returns the root document node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_document)(
struct _cef_domnode_t* (CEF_CALLBACK *get_document)(
struct _cef_domdocument_t* self);
///
// Returns the BODY node of an HTML document.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_body)(
struct _cef_domnode_t* (CEF_CALLBACK *get_body)(
struct _cef_domdocument_t* self);
///
// Returns the HEAD node of an HTML document.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_head)(
struct _cef_domnode_t* (CEF_CALLBACK *get_head)(
struct _cef_domdocument_t* self);
///
// Returns the title of an HTML document.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_title)(
cef_string_userfree_t (CEF_CALLBACK *get_title)(
struct _cef_domdocument_t* self);
///
// Returns the document element with the specified ID value.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_element_by_id)(
struct _cef_domdocument_t* self,
const cef_string_t* id);
struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)(
struct _cef_domdocument_t* self, const cef_string_t* id);
///
// Returns the node that currently has keyboard focus.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_focused_node)(
struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)(
struct _cef_domdocument_t* self);
///
// Returns true (1) if a portion of the document is selected.
///
int(CEF_CALLBACK* has_selection)(struct _cef_domdocument_t* self);
int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self);
///
// Returns the selection offset within the start node.
///
int(CEF_CALLBACK* get_selection_start_offset)(
int (CEF_CALLBACK *get_selection_start_offset)(
struct _cef_domdocument_t* self);
///
// Returns the selection offset within the end node.
///
int(CEF_CALLBACK* get_selection_end_offset)(struct _cef_domdocument_t* self);
int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self);
///
// Returns the contents of this selection as markup.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_selection_as_markup)(
cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)(
struct _cef_domdocument_t* self);
///
// Returns the contents of this selection as text.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_selection_as_text)(
cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)(
struct _cef_domdocument_t* self);
///
// Returns the base URL for the document.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_base_url)(
cef_string_userfree_t (CEF_CALLBACK *get_base_url)(
struct _cef_domdocument_t* self);
///
@@ -166,11 +164,11 @@ typedef struct _cef_domdocument_t {
// partial URL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_complete_url)(
struct _cef_domdocument_t* self,
const cef_string_t* partialURL);
cef_string_userfree_t (CEF_CALLBACK *get_complete_url)(
struct _cef_domdocument_t* self, const cef_string_t* partialURL);
} cef_domdocument_t;
///
// Structure used to represent a DOM node. The functions of this structure
// should only be called on the render process main thread.
@@ -179,167 +177,168 @@ typedef struct _cef_domnode_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns the type for this node.
///
cef_dom_node_type_t(CEF_CALLBACK* get_type)(struct _cef_domnode_t* self);
cef_dom_node_type_t (CEF_CALLBACK *get_type)(struct _cef_domnode_t* self);
///
// Returns true (1) if this is a text node.
///
int(CEF_CALLBACK* is_text)(struct _cef_domnode_t* self);
int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self);
///
// Returns true (1) if this is an element node.
///
int(CEF_CALLBACK* is_element)(struct _cef_domnode_t* self);
int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self);
///
// Returns true (1) if this is an editable node.
///
int(CEF_CALLBACK* is_editable)(struct _cef_domnode_t* self);
int (CEF_CALLBACK *is_editable)(struct _cef_domnode_t* self);
///
// Returns true (1) if this is a form control element node.
///
int(CEF_CALLBACK* is_form_control_element)(struct _cef_domnode_t* self);
int (CEF_CALLBACK *is_form_control_element)(struct _cef_domnode_t* self);
///
// Returns the type of this form control element node.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_form_control_element_type)(
cef_string_userfree_t (CEF_CALLBACK *get_form_control_element_type)(
struct _cef_domnode_t* self);
///
// Returns true (1) if this object is pointing to the same handle as |that|
// object.
///
int(CEF_CALLBACK* is_same)(struct _cef_domnode_t* self,
struct _cef_domnode_t* that);
int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self,
struct _cef_domnode_t* that);
///
// Returns the name of this node.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_domnode_t* self);
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self);
///
// Returns the value of this node.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_value)(struct _cef_domnode_t* self);
cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self);
///
// Set the value of this node. Returns true (1) on success.
///
int(CEF_CALLBACK* set_value)(struct _cef_domnode_t* self,
const cef_string_t* value);
int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self,
const cef_string_t* value);
///
// Returns the contents of this node as markup.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_as_markup)(
cef_string_userfree_t (CEF_CALLBACK *get_as_markup)(
struct _cef_domnode_t* self);
///
// Returns the document associated with this node.
///
struct _cef_domdocument_t*(CEF_CALLBACK* get_document)(
struct _cef_domdocument_t* (CEF_CALLBACK *get_document)(
struct _cef_domnode_t* self);
///
// Returns the parent node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_parent)(struct _cef_domnode_t* self);
struct _cef_domnode_t* (CEF_CALLBACK *get_parent)(
struct _cef_domnode_t* self);
///
// Returns the previous sibling node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_previous_sibling)(
struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)(
struct _cef_domnode_t* self);
///
// Returns the next sibling node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_next_sibling)(
struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)(
struct _cef_domnode_t* self);
///
// Returns true (1) if this node has child nodes.
///
int(CEF_CALLBACK* has_children)(struct _cef_domnode_t* self);
int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self);
///
// Return the first child node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_first_child)(
struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)(
struct _cef_domnode_t* self);
///
// Returns the last child node.
///
struct _cef_domnode_t*(CEF_CALLBACK* get_last_child)(
struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)(
struct _cef_domnode_t* self);
// The following functions are valid only for element nodes.
///
// Returns the tag name of this element.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_element_tag_name)(
cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)(
struct _cef_domnode_t* self);
///
// Returns true (1) if this element has attributes.
///
int(CEF_CALLBACK* has_element_attributes)(struct _cef_domnode_t* self);
int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self);
///
// Returns true (1) if this element has an attribute named |attrName|.
///
int(CEF_CALLBACK* has_element_attribute)(struct _cef_domnode_t* self,
const cef_string_t* attrName);
int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self,
const cef_string_t* attrName);
///
// Returns the element attribute named |attrName|.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_element_attribute)(
struct _cef_domnode_t* self,
const cef_string_t* attrName);
cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)(
struct _cef_domnode_t* self, const cef_string_t* attrName);
///
// Returns a map of all element attributes.
///
void(CEF_CALLBACK* get_element_attributes)(struct _cef_domnode_t* self,
cef_string_map_t attrMap);
void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self,
cef_string_map_t attrMap);
///
// Set the value for the element attribute named |attrName|. Returns true (1)
// on success.
///
int(CEF_CALLBACK* set_element_attribute)(struct _cef_domnode_t* self,
const cef_string_t* attrName,
const cef_string_t* value);
int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self,
const cef_string_t* attrName, const cef_string_t* value);
///
// Returns the inner text of the element.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_element_inner_text)(
cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)(
struct _cef_domnode_t* self);
///
// Returns the bounds of the element.
///
cef_rect_t(CEF_CALLBACK* get_element_bounds)(struct _cef_domnode_t* self);
cef_rect_t (CEF_CALLBACK *get_element_bounds)(struct _cef_domnode_t* self);
} cef_domnode_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f0ceb73b289072a01c45c6e7abf339a4ec924d29$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
@@ -48,6 +46,7 @@
extern "C" {
#endif
///
// Callback structure used to asynchronously continue a download.
///
@@ -55,7 +54,7 @@ typedef struct _cef_before_download_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Call to continue the download. Set |download_path| to the full file path
@@ -63,11 +62,11 @@ typedef struct _cef_before_download_callback_t {
// suggested name and the default temp directory. Set |show_dialog| to true
// (1) if you do wish to show the default "Save As" dialog.
///
void(CEF_CALLBACK* cont)(struct _cef_before_download_callback_t* self,
const cef_string_t* download_path,
int show_dialog);
void (CEF_CALLBACK *cont)(struct _cef_before_download_callback_t* self,
const cef_string_t* download_path, int show_dialog);
} cef_before_download_callback_t;
///
// Callback structure used to asynchronously cancel a download.
///
@@ -75,24 +74,25 @@ typedef struct _cef_download_item_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Call to cancel the download.
///
void(CEF_CALLBACK* cancel)(struct _cef_download_item_callback_t* self);
void (CEF_CALLBACK *cancel)(struct _cef_download_item_callback_t* self);
///
// Call to pause the download.
///
void(CEF_CALLBACK* pause)(struct _cef_download_item_callback_t* self);
void (CEF_CALLBACK *pause)(struct _cef_download_item_callback_t* self);
///
// Call to resume the download.
///
void(CEF_CALLBACK* resume)(struct _cef_download_item_callback_t* self);
void (CEF_CALLBACK *resume)(struct _cef_download_item_callback_t* self);
} cef_download_item_callback_t;
///
// Structure used to handle file downloads. The functions of this structure will
// called on the browser process UI thread.
@@ -101,7 +101,7 @@ typedef struct _cef_download_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called before a download begins. |suggested_name| is the suggested name for
@@ -110,8 +110,7 @@ typedef struct _cef_download_handler_t {
// download if desired. Do not keep a reference to |download_item| outside of
// this function.
///
void(CEF_CALLBACK* on_before_download)(
struct _cef_download_handler_t* self,
void (CEF_CALLBACK *on_before_download)(struct _cef_download_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_download_item_t* download_item,
const cef_string_t* suggested_name,
@@ -124,13 +123,13 @@ typedef struct _cef_download_handler_t {
// download if desired. Do not keep a reference to |download_item| outside of
// this function.
///
void(CEF_CALLBACK* on_download_updated)(
struct _cef_download_handler_t* self,
void (CEF_CALLBACK *on_download_updated)(struct _cef_download_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_download_item_t* download_item,
struct _cef_download_item_callback_t* callback);
} cef_download_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d84044bb582b029af5fa46c75f35b3da948dffd2$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Structure used to represent a download item.
///
@@ -53,108 +52,109 @@ typedef struct _cef_download_item_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns true (1) if this object is valid. Do not call any other functions
// if this function returns false (0).
///
int(CEF_CALLBACK* is_valid)(struct _cef_download_item_t* self);
int (CEF_CALLBACK *is_valid)(struct _cef_download_item_t* self);
///
// Returns true (1) if the download is in progress.
///
int(CEF_CALLBACK* is_in_progress)(struct _cef_download_item_t* self);
int (CEF_CALLBACK *is_in_progress)(struct _cef_download_item_t* self);
///
// Returns true (1) if the download is complete.
///
int(CEF_CALLBACK* is_complete)(struct _cef_download_item_t* self);
int (CEF_CALLBACK *is_complete)(struct _cef_download_item_t* self);
///
// Returns true (1) if the download has been canceled or interrupted.
///
int(CEF_CALLBACK* is_canceled)(struct _cef_download_item_t* self);
int (CEF_CALLBACK *is_canceled)(struct _cef_download_item_t* self);
///
// Returns a simple speed estimate in bytes/s.
///
int64(CEF_CALLBACK* get_current_speed)(struct _cef_download_item_t* self);
int64 (CEF_CALLBACK *get_current_speed)(struct _cef_download_item_t* self);
///
// Returns the rough percent complete or -1 if the receive total size is
// unknown.
///
int(CEF_CALLBACK* get_percent_complete)(struct _cef_download_item_t* self);
int (CEF_CALLBACK *get_percent_complete)(struct _cef_download_item_t* self);
///
// Returns the total number of bytes.
///
int64(CEF_CALLBACK* get_total_bytes)(struct _cef_download_item_t* self);
int64 (CEF_CALLBACK *get_total_bytes)(struct _cef_download_item_t* self);
///
// Returns the number of received bytes.
///
int64(CEF_CALLBACK* get_received_bytes)(struct _cef_download_item_t* self);
int64 (CEF_CALLBACK *get_received_bytes)(struct _cef_download_item_t* self);
///
// Returns the time that the download started.
///
cef_time_t(CEF_CALLBACK* get_start_time)(struct _cef_download_item_t* self);
cef_time_t (CEF_CALLBACK *get_start_time)(struct _cef_download_item_t* self);
///
// Returns the time that the download ended.
///
cef_time_t(CEF_CALLBACK* get_end_time)(struct _cef_download_item_t* self);
cef_time_t (CEF_CALLBACK *get_end_time)(struct _cef_download_item_t* self);
///
// Returns the full path to the downloaded or downloading file.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_full_path)(
cef_string_userfree_t (CEF_CALLBACK *get_full_path)(
struct _cef_download_item_t* self);
///
// Returns the unique identifier for this download.
///
uint32(CEF_CALLBACK* get_id)(struct _cef_download_item_t* self);
uint32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self);
///
// Returns the URL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_url)(
cef_string_userfree_t (CEF_CALLBACK *get_url)(
struct _cef_download_item_t* self);
///
// Returns the original URL before any redirections.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_original_url)(
cef_string_userfree_t (CEF_CALLBACK *get_original_url)(
struct _cef_download_item_t* self);
///
// Returns the suggested file name.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_suggested_file_name)(
cef_string_userfree_t (CEF_CALLBACK *get_suggested_file_name)(
struct _cef_download_item_t* self);
///
// Returns the content disposition.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_content_disposition)(
cef_string_userfree_t (CEF_CALLBACK *get_content_disposition)(
struct _cef_download_item_t* self);
///
// Returns the mime type.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_mime_type)(
cef_string_userfree_t (CEF_CALLBACK *get_mime_type)(
struct _cef_download_item_t* self);
} cef_download_item_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,21 +33,19 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=9663321e2be1d000ac54e195c81f210ae40773d1$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_image_capi.h"
#include "include/capi/cef_stream_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
// Structure used to represent drag data. The functions of this structure may be
// called on any thread.
@@ -56,66 +54,66 @@ typedef struct _cef_drag_data_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns a copy of the current object.
///
struct _cef_drag_data_t*(CEF_CALLBACK* clone)(struct _cef_drag_data_t* self);
struct _cef_drag_data_t* (CEF_CALLBACK *clone)(struct _cef_drag_data_t* self);
///
// Returns true (1) if this object is read-only.
///
int(CEF_CALLBACK* is_read_only)(struct _cef_drag_data_t* self);
int (CEF_CALLBACK *is_read_only)(struct _cef_drag_data_t* self);
///
// Returns true (1) if the drag data is a link.
///
int(CEF_CALLBACK* is_link)(struct _cef_drag_data_t* self);
int (CEF_CALLBACK *is_link)(struct _cef_drag_data_t* self);
///
// Returns true (1) if the drag data is a text or html fragment.
///
int(CEF_CALLBACK* is_fragment)(struct _cef_drag_data_t* self);
int (CEF_CALLBACK *is_fragment)(struct _cef_drag_data_t* self);
///
// Returns true (1) if the drag data is a file.
///
int(CEF_CALLBACK* is_file)(struct _cef_drag_data_t* self);
int (CEF_CALLBACK *is_file)(struct _cef_drag_data_t* self);
///
// Return the link URL that is being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_link_url)(
cef_string_userfree_t (CEF_CALLBACK *get_link_url)(
struct _cef_drag_data_t* self);
///
// Return the title associated with the link being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_link_title)(
cef_string_userfree_t (CEF_CALLBACK *get_link_title)(
struct _cef_drag_data_t* self);
///
// Return the metadata, if any, associated with the link being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_link_metadata)(
cef_string_userfree_t (CEF_CALLBACK *get_link_metadata)(
struct _cef_drag_data_t* self);
///
// Return the plain text fragment that is being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_fragment_text)(
cef_string_userfree_t (CEF_CALLBACK *get_fragment_text)(
struct _cef_drag_data_t* self);
///
// Return the text/html fragment that is being dragged.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_fragment_html)(
cef_string_userfree_t (CEF_CALLBACK *get_fragment_html)(
struct _cef_drag_data_t* self);
///
@@ -123,14 +121,14 @@ typedef struct _cef_drag_data_t {
// resolving relative URLs and may be NULL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_fragment_base_url)(
cef_string_userfree_t (CEF_CALLBACK *get_fragment_base_url)(
struct _cef_drag_data_t* self);
///
// Return the name of the file being dragged out of the browser window.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_file_name)(
cef_string_userfree_t (CEF_CALLBACK *get_file_name)(
struct _cef_drag_data_t* self);
///
@@ -139,88 +137,73 @@ typedef struct _cef_drag_data_t {
// this function will return the size of the file contents in bytes. Call
// get_file_name() to get a suggested name for the file.
///
size_t(CEF_CALLBACK* get_file_contents)(struct _cef_drag_data_t* self,
struct _cef_stream_writer_t* writer);
size_t (CEF_CALLBACK *get_file_contents)(struct _cef_drag_data_t* self,
struct _cef_stream_writer_t* writer);
///
// Retrieve the list of file names that are being dragged into the browser
// window.
///
int(CEF_CALLBACK* get_file_names)(struct _cef_drag_data_t* self,
cef_string_list_t names);
int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self,
cef_string_list_t names);
///
// Set the link URL that is being dragged.
///
void(CEF_CALLBACK* set_link_url)(struct _cef_drag_data_t* self,
const cef_string_t* url);
void (CEF_CALLBACK *set_link_url)(struct _cef_drag_data_t* self,
const cef_string_t* url);
///
// Set the title associated with the link being dragged.
///
void(CEF_CALLBACK* set_link_title)(struct _cef_drag_data_t* self,
const cef_string_t* title);
void (CEF_CALLBACK *set_link_title)(struct _cef_drag_data_t* self,
const cef_string_t* title);
///
// Set the metadata associated with the link being dragged.
///
void(CEF_CALLBACK* set_link_metadata)(struct _cef_drag_data_t* self,
const cef_string_t* data);
void (CEF_CALLBACK *set_link_metadata)(struct _cef_drag_data_t* self,
const cef_string_t* data);
///
// Set the plain text fragment that is being dragged.
///
void(CEF_CALLBACK* set_fragment_text)(struct _cef_drag_data_t* self,
const cef_string_t* text);
void (CEF_CALLBACK *set_fragment_text)(struct _cef_drag_data_t* self,
const cef_string_t* text);
///
// Set the text/html fragment that is being dragged.
///
void(CEF_CALLBACK* set_fragment_html)(struct _cef_drag_data_t* self,
const cef_string_t* html);
void (CEF_CALLBACK *set_fragment_html)(struct _cef_drag_data_t* self,
const cef_string_t* html);
///
// Set the base URL that the fragment came from.
///
void(CEF_CALLBACK* set_fragment_base_url)(struct _cef_drag_data_t* self,
const cef_string_t* base_url);
void (CEF_CALLBACK *set_fragment_base_url)(struct _cef_drag_data_t* self,
const cef_string_t* base_url);
///
// Reset the file contents. You should do this before calling
// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
// to drag in this kind of data.
///
void(CEF_CALLBACK* reset_file_contents)(struct _cef_drag_data_t* self);
void (CEF_CALLBACK *reset_file_contents)(struct _cef_drag_data_t* self);
///
// Add a file that is being dragged into the webview.
///
void(CEF_CALLBACK* add_file)(struct _cef_drag_data_t* self,
const cef_string_t* path,
const cef_string_t* display_name);
///
// Get the image representation of drag data. May return NULL if no image
// representation is available.
///
struct _cef_image_t*(CEF_CALLBACK* get_image)(struct _cef_drag_data_t* self);
///
// Get the image hotspot (drag start location relative to image dimensions).
///
cef_point_t(CEF_CALLBACK* get_image_hotspot)(struct _cef_drag_data_t* self);
///
// Returns true (1) if an image representation of drag data is available.
///
int(CEF_CALLBACK* has_image)(struct _cef_drag_data_t* self);
void (CEF_CALLBACK *add_file)(struct _cef_drag_data_t* self,
const cef_string_t* path, const cef_string_t* display_name);
} cef_drag_data_t;
///
// Create a new cef_drag_data_t object.
///
CEF_EXPORT cef_drag_data_t* cef_drag_data_create();
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1cc1f134e68406ae3b05f7e181e12f27262772f0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
@@ -43,12 +41,12 @@
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_drag_data_capi.h"
#include "include/capi/cef_frame_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
// Implement this structure to handle events related to dragging. The functions
// of this structure will be called on the UI thread.
@@ -57,7 +55,7 @@ typedef struct _cef_drag_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called when an external drag event enters the browser window. |dragData|
@@ -65,10 +63,9 @@ typedef struct _cef_drag_handler_t {
// operation. Return false (0) for default drag handling behavior or true (1)
// to cancel the drag event.
///
int(CEF_CALLBACK* on_drag_enter)(struct _cef_drag_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_drag_data_t* dragData,
cef_drag_operations_mask_t mask);
int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self,
struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData,
cef_drag_operations_mask_t mask);
///
// Called whenever draggable regions for the browser window change. These can
@@ -77,14 +74,12 @@ typedef struct _cef_drag_handler_t {
// never be called. If the last draggable region is removed from a document
// this function will be called with an NULL vector.
///
void(CEF_CALLBACK* on_draggable_regions_changed)(
struct _cef_drag_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
size_t regionsCount,
cef_draggable_region_t const* regions);
void (CEF_CALLBACK *on_draggable_regions_changed)(
struct _cef_drag_handler_t* self, struct _cef_browser_t* browser,
size_t regionsCount, cef_draggable_region_t const* regions);
} cef_drag_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,130 +0,0 @@
// Copyright (c) 2021 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5d5251098be1477705de2a21502dec2d8338ce00$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_extension_handler_t;
struct _cef_request_context_t;
///
// Object representing an extension. Methods may be called on any thread unless
// otherwise indicated.
///
typedef struct _cef_extension_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Returns the unique extension identifier. This is calculated based on the
// extension public key, if available, or on the extension path. See
// https://developer.chrome.com/extensions/manifest/key for details.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
struct _cef_extension_t* self);
///
// Returns the absolute path to the extension directory on disk. This value
// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to
// cef_request_context_t::LoadExtension.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_path)(struct _cef_extension_t* self);
///
// Returns the extension manifest contents as a cef_dictionary_value_t object.
// See https://developer.chrome.com/extensions/manifest for details.
///
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_manifest)(
struct _cef_extension_t* self);
///
// Returns true (1) if this object is the same extension as |that| object.
// Extensions are considered the same if identifier, path and loader context
// match.
///
int(CEF_CALLBACK* is_same)(struct _cef_extension_t* self,
struct _cef_extension_t* that);
///
// Returns the handler for this extension. Will return NULL for internal
// extensions or if no handler was passed to
// cef_request_context_t::LoadExtension.
///
struct _cef_extension_handler_t*(CEF_CALLBACK* get_handler)(
struct _cef_extension_t* self);
///
// Returns the request context that loaded this extension. Will return NULL
// for internal extensions or if the extension has been unloaded. See the
// cef_request_context_t::LoadExtension documentation for more information
// about loader contexts. Must be called on the browser process UI thread.
///
struct _cef_request_context_t*(CEF_CALLBACK* get_loader_context)(
struct _cef_extension_t* self);
///
// Returns true (1) if this extension is currently loaded. Must be called on
// the browser process UI thread.
///
int(CEF_CALLBACK* is_loaded)(struct _cef_extension_t* self);
///
// Unload this extension if it is not an internal extension and is currently
// loaded. Will result in a call to
// cef_extension_handler_t::OnExtensionUnloaded on success.
///
void(CEF_CALLBACK* unload)(struct _cef_extension_t* self);
} cef_extension_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_

View File

@@ -1,210 +0,0 @@
// Copyright (c) 2021 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c952241dabb9d99109ebb64acba0124e43150628$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_extension_capi.h"
#include "include/capi/cef_stream_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_client_t;
///
// Callback structure used for asynchronous continuation of
// cef_extension_handler_t::GetExtensionResource.
///
typedef struct _cef_get_extension_resource_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Continue the request. Read the resource contents from |stream|.
///
void(CEF_CALLBACK* cont)(struct _cef_get_extension_resource_callback_t* self,
struct _cef_stream_reader_t* stream);
///
// Cancel the request.
///
void(CEF_CALLBACK* cancel)(
struct _cef_get_extension_resource_callback_t* self);
} cef_get_extension_resource_callback_t;
///
// Implement this structure to handle events related to browser extensions. The
// functions of this structure will be called on the UI thread. See
// cef_request_context_t::LoadExtension for information about extension loading.
///
typedef struct _cef_extension_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Called if the cef_request_context_t::LoadExtension request fails. |result|
// will be the error code.
///
void(CEF_CALLBACK* on_extension_load_failed)(
struct _cef_extension_handler_t* self,
cef_errorcode_t result);
///
// Called if the cef_request_context_t::LoadExtension request succeeds.
// |extension| is the loaded extension.
///
void(CEF_CALLBACK* on_extension_loaded)(struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension);
///
// Called after the cef_extension_t::Unload request has completed.
///
void(CEF_CALLBACK* on_extension_unloaded)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension);
///
// Called when an extension needs a browser to host a background script
// specified via the "background" manifest key. The browser will have no
// visible window and cannot be displayed. |extension| is the extension that
// is loading the background script. |url| is an internally generated
// reference to an HTML page that will be used to load the background script
// via a <script> src attribute. To allow creation of the browser optionally
// modify |client| and |settings| and return false (0). To cancel creation of
// the browser (and consequently cancel load of the background script) return
// true (1). Successful creation will be indicated by a call to
// cef_life_span_handler_t::OnAfterCreated, and
// cef_browser_host_t::IsBackgroundHost will return true (1) for the resulting
// browser. See https://developer.chrome.com/extensions/event_pages for more
// information about extension background script usage.
///
int(CEF_CALLBACK* on_before_background_browser)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
const cef_string_t* url,
struct _cef_client_t** client,
struct _cef_browser_settings_t* settings);
///
// Called when an extension API (e.g. chrome.tabs.create) requests creation of
// a new browser. |extension| and |browser| are the source of the API call.
// |active_browser| may optionally be specified via the windowId property or
// returned via the get_active_browser() callback and provides the default
// |client| and |settings| values for the new browser. |index| is the position
// value optionally specified via the index property. |url| is the URL that
// will be loaded in the browser. |active| is true (1) if the new browser
// should be active when opened. To allow creation of the browser optionally
// modify |windowInfo|, |client| and |settings| and return false (0). To
// cancel creation of the browser return true (1). Successful creation will be
// indicated by a call to cef_life_span_handler_t::OnAfterCreated. Any
// modifications to |windowInfo| will be ignored if |active_browser| is
// wrapped in a cef_browser_view_t.
///
int(CEF_CALLBACK* on_before_browser)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
struct _cef_browser_t* browser,
struct _cef_browser_t* active_browser,
int index,
const cef_string_t* url,
int active,
struct _cef_window_info_t* windowInfo,
struct _cef_client_t** client,
struct _cef_browser_settings_t* settings);
///
// Called when no tabId is specified to an extension API call that accepts a
// tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the
// source of the API call. Return the browser that will be acted on by the API
// call or return NULL to act on |browser|. The returned browser must share
// the same cef_request_context_t as |browser|. Incognito browsers should not
// be considered unless the source extension has incognito access enabled, in
// which case |include_incognito| will be true (1).
///
struct _cef_browser_t*(CEF_CALLBACK* get_active_browser)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
struct _cef_browser_t* browser,
int include_incognito);
///
// Called when the tabId associated with |target_browser| is specified to an
// extension API call that accepts a tabId parameter (e.g. chrome.tabs.*).
// |extension| and |browser| are the source of the API call. Return true (1)
// to allow access of false (0) to deny access. Access to incognito browsers
// should not be allowed unless the source extension has incognito access
// enabled, in which case |include_incognito| will be true (1).
///
int(CEF_CALLBACK* can_access_browser)(struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
struct _cef_browser_t* browser,
int include_incognito,
struct _cef_browser_t* target_browser);
///
// Called to retrieve an extension resource that would normally be loaded from
// disk (e.g. if a file parameter is specified to chrome.tabs.executeScript).
// |extension| and |browser| are the source of the resource request. |file| is
// the requested relative file path. To handle the resource request return
// true (1) and execute |callback| either synchronously or asynchronously. For
// the default behavior which reads the resource from the extension directory
// on disk return false (0). Localization substitutions will not be applied to
// resources handled via this function.
///
int(CEF_CALLBACK* get_extension_resource)(
struct _cef_extension_handler_t* self,
struct _cef_extension_t* extension,
struct _cef_browser_t* browser,
const cef_string_t* file,
struct _cef_get_extension_resource_callback_t* callback);
} cef_extension_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=00d75d4f1968686cec7db84a59df89d98d8fe146$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Creates a directory and all parent directories if they don't already exist.
// Returns true (1) on successful creation or if the directory already exists.
@@ -72,7 +71,7 @@ CEF_EXPORT int cef_get_temp_directory(cef_string_t* temp_dir);
// browser process UI or IO threads is not allowed.
///
CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix,
cef_string_t* new_temp_path);
cef_string_t* new_temp_path);
///
// Creates a directory within another directory. Extra characters will be
@@ -83,8 +82,7 @@ CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix,
// or IO threads is not allowed.
///
CEF_EXPORT int cef_create_temp_directory_in_directory(
const cef_string_t* base_dir,
const cef_string_t* prefix,
const cef_string_t* base_dir, const cef_string_t* prefix,
cef_string_t* new_dir);
///
@@ -111,18 +109,7 @@ CEF_EXPORT int cef_delete_file(const cef_string_t* path, int recursive);
// or IO threads is not allowed.
///
CEF_EXPORT int cef_zip_directory(const cef_string_t* src_dir,
const cef_string_t* dest_file,
int include_hidden_files);
///
// Loads the existing "Certificate Revocation Lists" file that is managed by
// Google Chrome. This file can generally be found in Chrome's User Data
// directory (e.g. "C:\Users\[User]\AppData\Local\Google\Chrome\User Data\" on
// Windows) and is updated periodically by Chrome's component updater service.
// Must be called in the browser process after the context has been initialized.
// See https://dev.chromium.org/Home/chromium-security/crlsets for background.
///
CEF_EXPORT void cef_load_crlsets_file(const cef_string_t* path);
const cef_string_t* dest_file, int include_hidden_files);
#ifdef __cplusplus
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=03bb69a14868a95abf3bf7b1608dc351480e307f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
@@ -47,6 +45,7 @@
extern "C" {
#endif
///
// Implement this structure to handle events related to find results. The
// functions of this structure will be called on the UI thread.
@@ -55,7 +54,7 @@ typedef struct _cef_find_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called to report find results returned by cef_browser_host_t::find().
@@ -65,15 +64,13 @@ typedef struct _cef_find_handler_t {
// current position in the search results, and |finalUpdate| is true (1) if
// this is the last find notification.
///
void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self,
struct _cef_browser_t* browser,
int identifier,
int count,
const cef_rect_t* selectionRect,
int activeMatchOrdinal,
int finalUpdate);
void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self,
struct _cef_browser_t* browser, int identifier, int count,
const cef_rect_t* selectionRect, int activeMatchOrdinal,
int finalUpdate);
} cef_find_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0fccb41381e922e9d9545ae45ba3e6cf1916c4b0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
@@ -49,6 +47,7 @@
extern "C" {
#endif
///
// Implement this structure to handle events related to focus. The functions of
// this structure will be called on the UI thread.
@@ -57,7 +56,7 @@ typedef struct _cef_focus_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called when the browser component is about to loose focus. For instance, if
@@ -65,26 +64,25 @@ typedef struct _cef_focus_handler_t {
// will be true (1) if the browser is giving focus to the next component and
// false (0) if the browser is giving focus to the previous component.
///
void(CEF_CALLBACK* on_take_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser,
int next);
void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser, int next);
///
// Called when the browser component is requesting focus. |source| indicates
// where the focus request is originating from. Return false (0) to allow the
// focus to be set or true (1) to cancel setting the focus.
///
int(CEF_CALLBACK* on_set_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser,
cef_focus_source_t source);
int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser, cef_focus_source_t source);
///
// Called when the browser component has received focus.
///
void(CEF_CALLBACK* on_got_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser);
void (CEF_CALLBACK *on_got_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser);
} cef_focus_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=bce865a34f45e6dee8f413f0d6bd7f4c37ab55c0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
@@ -42,7 +40,6 @@
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_dom_capi.h"
#include "include/capi/cef_process_message_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_stream_capi.h"
#include "include/capi/cef_string_visitor_capi.h"
@@ -52,8 +49,6 @@ extern "C" {
#endif
struct _cef_browser_t;
struct _cef_urlrequest_client_t;
struct _cef_urlrequest_t;
struct _cef_v8context_t;
///
@@ -66,84 +61,88 @@ typedef struct _cef_frame_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// True if this object is currently attached to a valid frame.
///
int(CEF_CALLBACK* is_valid)(struct _cef_frame_t* self);
int (CEF_CALLBACK *is_valid)(struct _cef_frame_t* self);
///
// Execute undo in this frame.
///
void(CEF_CALLBACK* undo)(struct _cef_frame_t* self);
void (CEF_CALLBACK *undo)(struct _cef_frame_t* self);
///
// Execute redo in this frame.
///
void(CEF_CALLBACK* redo)(struct _cef_frame_t* self);
void (CEF_CALLBACK *redo)(struct _cef_frame_t* self);
///
// Execute cut in this frame.
///
void(CEF_CALLBACK* cut)(struct _cef_frame_t* self);
void (CEF_CALLBACK *cut)(struct _cef_frame_t* self);
///
// Execute copy in this frame.
///
void(CEF_CALLBACK* copy)(struct _cef_frame_t* self);
void (CEF_CALLBACK *copy)(struct _cef_frame_t* self);
///
// Execute paste in this frame.
///
void(CEF_CALLBACK* paste)(struct _cef_frame_t* self);
void (CEF_CALLBACK *paste)(struct _cef_frame_t* self);
///
// Execute delete in this frame.
///
void(CEF_CALLBACK* del)(struct _cef_frame_t* self);
void (CEF_CALLBACK *del)(struct _cef_frame_t* self);
///
// Execute select all in this frame.
///
void(CEF_CALLBACK* select_all)(struct _cef_frame_t* self);
void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self);
///
// Save this frame's HTML source to a temporary file and open it in the
// default text viewing application. This function can only be called from the
// browser process.
///
void(CEF_CALLBACK* view_source)(struct _cef_frame_t* self);
void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self);
///
// Retrieve this frame's HTML source as a string sent to the specified
// visitor.
///
void(CEF_CALLBACK* get_source)(struct _cef_frame_t* self,
struct _cef_string_visitor_t* visitor);
void (CEF_CALLBACK *get_source)(struct _cef_frame_t* self,
struct _cef_string_visitor_t* visitor);
///
// Retrieve this frame's display text as a string sent to the specified
// visitor.
///
void(CEF_CALLBACK* get_text)(struct _cef_frame_t* self,
struct _cef_string_visitor_t* visitor);
void (CEF_CALLBACK *get_text)(struct _cef_frame_t* self,
struct _cef_string_visitor_t* visitor);
///
// Load the request represented by the |request| object.
//
// WARNING: This function will fail with "bad IPC message" reason
// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
// origin using some other mechanism (LoadURL, link click, etc).
///
void(CEF_CALLBACK* load_request)(struct _cef_frame_t* self,
struct _cef_request_t* request);
void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self,
struct _cef_request_t* request);
///
// Load the specified |url|.
///
void(CEF_CALLBACK* load_url)(struct _cef_frame_t* self,
const cef_string_t* url);
void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self,
const cef_string_t* url);
///
// Load the contents of |string_val| with the specified dummy |url|. |url|
// should have a standard scheme (for example, http scheme) or behaviors like
// link clicks and web security restrictions may not behave as expected.
///
void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self,
const cef_string_t* string_val, const cef_string_t* url);
///
// Execute a string of JavaScript code in this frame. The |script_url|
@@ -152,20 +151,19 @@ typedef struct _cef_frame_t {
// error. The |start_line| parameter is the base line number to use for error
// reporting.
///
void(CEF_CALLBACK* execute_java_script)(struct _cef_frame_t* self,
const cef_string_t* code,
const cef_string_t* script_url,
int start_line);
void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self,
const cef_string_t* code, const cef_string_t* script_url,
int start_line);
///
// Returns true (1) if this is the main (top-level) frame.
///
int(CEF_CALLBACK* is_main)(struct _cef_frame_t* self);
int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self);
///
// Returns true (1) if this is the focused frame.
///
int(CEF_CALLBACK* is_focused)(struct _cef_frame_t* self);
int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self);
///
// Returns the name for this frame. If the frame has an assigned name (for
@@ -175,84 +173,47 @@ typedef struct _cef_frame_t {
// value.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_frame_t* self);
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self);
///
// Returns the globally unique identifier for this frame or < 0 if the
// underlying frame does not yet exist.
///
int64(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self);
int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self);
///
// Returns the parent of this frame or NULL if this is the main (top-level)
// frame.
///
struct _cef_frame_t*(CEF_CALLBACK* get_parent)(struct _cef_frame_t* self);
struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self);
///
// Returns the URL currently loaded in this frame.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_frame_t* self);
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self);
///
// Returns the browser that this frame belongs to.
///
struct _cef_browser_t*(CEF_CALLBACK* get_browser)(struct _cef_frame_t* self);
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self);
///
// Get the V8 context associated with the frame. This function can only be
// called from the render process.
///
struct _cef_v8context_t*(CEF_CALLBACK* get_v8context)(
struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)(
struct _cef_frame_t* self);
///
// Visit the DOM document. This function can only be called from the render
// process.
///
void(CEF_CALLBACK* visit_dom)(struct _cef_frame_t* self,
struct _cef_domvisitor_t* visitor);
///
// Create a new URL request that will be treated as originating from this
// frame and the associated browser. This request may be intercepted by the
// client via cef_resource_request_handler_t or cef_scheme_handler_factory_t.
// Use cef_urlrequest_t::Create instead if you do not want the request to have
// this association, in which case it may be handled differently (see
// documentation on that function). Requests may originate from both the
// browser process and the render process.
//
// For requests originating from the browser process:
// - POST data may only contain a single element of type PDE_TYPE_FILE or
// PDE_TYPE_BYTES.
// For requests originating from the render process:
// - POST data may only contain a single element of type PDE_TYPE_BYTES.
// - If the response contains Content-Disposition or Mime-Type header values
// that would not normally be rendered then the response may receive
// special handling inside the browser (for example, via the file download
// code path instead of the URL request code path).
//
// The |request| object will be marked as read-only after calling this
// function.
///
struct _cef_urlrequest_t*(CEF_CALLBACK* create_urlrequest)(
struct _cef_frame_t* self,
struct _cef_request_t* request,
struct _cef_urlrequest_client_t* client);
///
// Send a message to the specified |target_process|. Message delivery is not
// guaranteed in all cases (for example, if the browser is closing,
// navigating, or if the target process crashes). Send an ACK message back
// from the target process if confirmation is required.
///
void(CEF_CALLBACK* send_process_message)(
struct _cef_frame_t* self,
cef_process_id_t target_process,
struct _cef_process_message_t* message);
void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self,
struct _cef_domvisitor_t* visitor);
} cef_frame_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,11 +33,9 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=273af5bd01c6ab5d4df8efb2af2b4e2da9c21760$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CALLBACK_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CALLBACK_CAPI_H_
#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
@@ -46,29 +44,36 @@
extern "C" {
#endif
///
// Callback structure used for asynchronous continuation of url requests.
// Implement this structure to receive geolocation updates. The functions of
// this structure will be called on the browser process UI thread.
///
typedef struct _cef_request_callback_t {
typedef struct _cef_get_geolocation_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Continue the url request. If |allow| is true (1) the request will be
// continued. Otherwise, the request will be canceled.
// Called with the 'best available' location information or, if the location
// update failed, with error information.
///
void(CEF_CALLBACK* cont)(struct _cef_request_callback_t* self, int allow);
void (CEF_CALLBACK *on_location_update)(
struct _cef_get_geolocation_callback_t* self,
const struct _cef_geoposition_t* position);
} cef_get_geolocation_callback_t;
///
// Cancel the url request.
///
void(CEF_CALLBACK* cancel)(struct _cef_request_callback_t* self);
} cef_request_callback_t;
///
// Request a one-time geolocation update. This function bypasses any user
// permission checks so should only be used by code that is allowed to access
// location information.
///
CEF_EXPORT int cef_get_geolocation(cef_get_geolocation_callback_t* callback);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CALLBACK_CAPI_H_
#endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,31 +33,73 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=8cde223bdb8d25ff163edd95da0d9e238b298016$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_
#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
// Generic callback structure used for managing the lifespan of a registration.
// Callback structure used for asynchronous continuation of geolocation
// permission requests.
///
typedef struct _cef_registration_t {
typedef struct _cef_geolocation_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
} cef_registration_t;
cef_base_t base;
///
// Call to allow or deny geolocation access.
///
void (CEF_CALLBACK *cont)(struct _cef_geolocation_callback_t* self,
int allow);
} cef_geolocation_callback_t;
///
// Implement this structure to handle events related to geolocation permission
// requests. The functions of this structure will be called on the browser
// process UI thread.
///
typedef struct _cef_geolocation_handler_t {
///
// Base structure.
///
cef_base_t base;
///
// Called when a page requests permission to access geolocation information.
// |requesting_url| is the URL requesting permission and |request_id| is the
// unique ID for the permission request. Return true (1) and call
// cef_geolocation_callback_t::cont() either in this function or at a later
// time to continue or cancel the request. Return false (0) to cancel the
// request immediately.
///
int (CEF_CALLBACK *on_request_geolocation_permission)(
struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser,
const cef_string_t* requesting_url, int request_id,
struct _cef_geolocation_callback_t* callback);
///
// Called when a geolocation access request is canceled. |request_id| is the
// unique ID for the permission request.
///
void (CEF_CALLBACK *on_cancel_geolocation_permission)(
struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser,
int request_id);
} cef_geolocation_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_
#endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d9da8862142742e780086714bbd4fb44ac95cf2c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
@@ -47,31 +45,32 @@
extern "C" {
#endif
///
// Container for a single image represented at different scale factors. All
// image representations should be the same size in density independent pixel
// (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels
// then the image at scale factor 2.0 should be 200x200 pixels -- both images
// will display with a DIP size of 100x100 units. The functions of this
// structure can be called on any browser process thread.
// structure must be called on the browser process UI thread.
///
typedef struct _cef_image_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns true (1) if this Image is NULL.
///
int(CEF_CALLBACK* is_empty)(struct _cef_image_t* self);
int (CEF_CALLBACK *is_empty)(struct _cef_image_t* self);
///
// Returns true (1) if this Image and |that| Image share the same underlying
// storage. Will also return true (1) if both images are NULL.
///
int(CEF_CALLBACK* is_same)(struct _cef_image_t* self,
struct _cef_image_t* that);
int (CEF_CALLBACK *is_same)(struct _cef_image_t* self,
struct _cef_image_t* that);
///
// Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA
@@ -80,57 +79,49 @@ typedef struct _cef_image_t {
// pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in size.
// |color_type| and |alpha_type| values specify the pixel format.
///
int(CEF_CALLBACK* add_bitmap)(struct _cef_image_t* self,
float scale_factor,
int pixel_width,
int pixel_height,
cef_color_type_t color_type,
cef_alpha_type_t alpha_type,
const void* pixel_data,
size_t pixel_data_size);
int (CEF_CALLBACK *add_bitmap)(struct _cef_image_t* self, float scale_factor,
int pixel_width, int pixel_height, cef_color_type_t color_type,
cef_alpha_type_t alpha_type, const void* pixel_data,
size_t pixel_data_size);
///
// Add a PNG image representation for |scale_factor|. |png_data| is the image
// data of size |png_data_size|. Any alpha transparency in the PNG data will
// be maintained.
///
int(CEF_CALLBACK* add_png)(struct _cef_image_t* self,
float scale_factor,
const void* png_data,
size_t png_data_size);
int (CEF_CALLBACK *add_png)(struct _cef_image_t* self, float scale_factor,
const void* png_data, size_t png_data_size);
///
// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
// image data of size |jpeg_data_size|. The JPEG format does not support
// transparency so the alpha byte will be set to 0xFF for all pixels.
///
int(CEF_CALLBACK* add_jpeg)(struct _cef_image_t* self,
float scale_factor,
const void* jpeg_data,
size_t jpeg_data_size);
int (CEF_CALLBACK *add_jpeg)(struct _cef_image_t* self, float scale_factor,
const void* jpeg_data, size_t jpeg_data_size);
///
// Returns the image width in density independent pixel (DIP) units.
///
size_t(CEF_CALLBACK* get_width)(struct _cef_image_t* self);
size_t (CEF_CALLBACK *get_width)(struct _cef_image_t* self);
///
// Returns the image height in density independent pixel (DIP) units.
///
size_t(CEF_CALLBACK* get_height)(struct _cef_image_t* self);
size_t (CEF_CALLBACK *get_height)(struct _cef_image_t* self);
///
// Returns true (1) if this image contains a representation for
// |scale_factor|.
///
int(CEF_CALLBACK* has_representation)(struct _cef_image_t* self,
float scale_factor);
int (CEF_CALLBACK *has_representation)(struct _cef_image_t* self,
float scale_factor);
///
// Removes the representation for |scale_factor|. Returns true (1) on success.
///
int(CEF_CALLBACK* remove_representation)(struct _cef_image_t* self,
float scale_factor);
int (CEF_CALLBACK *remove_representation)(struct _cef_image_t* self,
float scale_factor);
///
// Returns information for the representation that most closely matches
@@ -138,11 +129,9 @@ typedef struct _cef_image_t {
// representation. |pixel_width| and |pixel_height| are the representation
// size in pixel coordinates. Returns true (1) on success.
///
int(CEF_CALLBACK* get_representation_info)(struct _cef_image_t* self,
float scale_factor,
float* actual_scale_factor,
int* pixel_width,
int* pixel_height);
int (CEF_CALLBACK *get_representation_info)(struct _cef_image_t* self,
float scale_factor, float* actual_scale_factor, int* pixel_width,
int* pixel_height);
///
// Returns the bitmap representation that most closely matches |scale_factor|.
@@ -152,13 +141,10 @@ typedef struct _cef_image_t {
// Returns a cef_binary_value_t containing the pixel data on success or NULL
// on failure.
///
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_bitmap)(
struct _cef_image_t* self,
float scale_factor,
cef_color_type_t color_type,
cef_alpha_type_t alpha_type,
int* pixel_width,
int* pixel_height);
struct _cef_binary_value_t* (CEF_CALLBACK *get_as_bitmap)(
struct _cef_image_t* self, float scale_factor,
cef_color_type_t color_type, cef_alpha_type_t alpha_type,
int* pixel_width, int* pixel_height);
///
// Returns the PNG representation that most closely matches |scale_factor|. If
@@ -168,12 +154,9 @@ typedef struct _cef_image_t {
// cef_binary_value_t containing the PNG image data on success or NULL on
// failure.
///
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_png)(
struct _cef_image_t* self,
float scale_factor,
int with_transparency,
int* pixel_width,
int* pixel_height);
struct _cef_binary_value_t* (CEF_CALLBACK *get_as_png)(
struct _cef_image_t* self, float scale_factor, int with_transparency,
int* pixel_width, int* pixel_height);
///
// Returns the JPEG representation that most closely matches |scale_factor|.
@@ -184,20 +167,19 @@ typedef struct _cef_image_t {
// cef_binary_value_t containing the JPEG image data on success or NULL on
// failure.
///
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_jpeg)(
struct _cef_image_t* self,
float scale_factor,
int quality,
int* pixel_width,
int* pixel_height);
struct _cef_binary_value_t* (CEF_CALLBACK *get_as_jpeg)(
struct _cef_image_t* self, float scale_factor, int quality,
int* pixel_width, int* pixel_height);
} cef_image_t;
///
// Create a new cef_image_t. It will initially be NULL. Use the Add*() functions
// to add representations at different scale factors.
///
CEF_EXPORT cef_image_t* cef_image_create();
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d991e2a7d1a58a013e4d3a963361fed6918f4ec3$
//
#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
@@ -47,6 +45,7 @@
extern "C" {
#endif
///
// Callback structure used for asynchronous continuation of JavaScript dialog
// requests.
@@ -55,17 +54,17 @@ typedef struct _cef_jsdialog_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Continue the JS dialog request. Set |success| to true (1) if the OK button
// was pressed. The |user_input| value should be specified for prompt dialogs.
///
void(CEF_CALLBACK* cont)(struct _cef_jsdialog_callback_t* self,
int success,
const cef_string_t* user_input);
void (CEF_CALLBACK *cont)(struct _cef_jsdialog_callback_t* self, int success,
const cef_string_t* user_input);
} cef_jsdialog_callback_t;
///
// Implement this structure to handle events related to JavaScript dialogs. The
// functions of this structure will be called on the UI thread.
@@ -74,7 +73,7 @@ typedef struct _cef_jsdialog_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
@@ -93,14 +92,11 @@ typedef struct _cef_jsdialog_handler_t {
// the application must execute |callback| once the custom dialog is
// dismissed.
///
int(CEF_CALLBACK* on_jsdialog)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* origin_url,
cef_jsdialog_type_t dialog_type,
const cef_string_t* message_text,
const cef_string_t* default_prompt_text,
struct _cef_jsdialog_callback_t* callback,
int* suppress_message);
int (CEF_CALLBACK *on_jsdialog)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* origin_url,
cef_jsdialog_type_t dialog_type, const cef_string_t* message_text,
const cef_string_t* default_prompt_text,
struct _cef_jsdialog_callback_t* callback, int* suppress_message);
///
// Called to run a dialog asking the user if they want to leave a page. Return
@@ -110,11 +106,9 @@ typedef struct _cef_jsdialog_handler_t {
// dialog is used the application must execute |callback| once the custom
// dialog is dismissed.
///
int(CEF_CALLBACK* on_before_unload_dialog)(
struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* message_text,
int is_reload,
int (CEF_CALLBACK *on_before_unload_dialog)(
struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser,
const cef_string_t* message_text, int is_reload,
struct _cef_jsdialog_callback_t* callback);
///
@@ -122,17 +116,17 @@ typedef struct _cef_jsdialog_handler_t {
// be called due to events like page navigation irregardless of whether any
// dialogs are currently pending.
///
void(CEF_CALLBACK* on_reset_dialog_state)(
struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser);
void (CEF_CALLBACK *on_reset_dialog_state)(
struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser);
///
// Called when the default implementation dialog is closed.
///
void(CEF_CALLBACK* on_dialog_closed)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser);
void (CEF_CALLBACK *on_dialog_closed)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser);
} cef_jsdialog_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d804a2db0f9ac13afd249407c85cb8d5852508ac$
//
#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
@@ -47,6 +45,7 @@
extern "C" {
#endif
///
// Implement this structure to handle events related to keyboard input. The
// functions of this structure will be called on the UI thread.
@@ -55,7 +54,7 @@ typedef struct _cef_keyboard_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called before a keyboard event is sent to the renderer. |event| contains
@@ -64,11 +63,9 @@ typedef struct _cef_keyboard_handler_t {
// (0) otherwise. If the event will be handled in on_key_event() as a keyboard
// shortcut set |is_keyboard_shortcut| to true (1) and return false (0).
///
int(CEF_CALLBACK* on_pre_key_event)(struct _cef_keyboard_handler_t* self,
struct _cef_browser_t* browser,
const struct _cef_key_event_t* event,
cef_event_handle_t os_event,
int* is_keyboard_shortcut);
int (CEF_CALLBACK *on_pre_key_event)(struct _cef_keyboard_handler_t* self,
struct _cef_browser_t* browser, const struct _cef_key_event_t* event,
cef_event_handle_t os_event, int* is_keyboard_shortcut);
///
// Called after the renderer and JavaScript in the page has had a chance to
@@ -76,12 +73,12 @@ typedef struct _cef_keyboard_handler_t {
// |os_event| is the operating system event message, if any. Return true (1)
// if the keyboard event was handled or false (0) otherwise.
///
int(CEF_CALLBACK* on_key_event)(struct _cef_keyboard_handler_t* self,
struct _cef_browser_t* browser,
const struct _cef_key_event_t* event,
cef_event_handle_t os_event);
int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self,
struct _cef_browser_t* browser, const struct _cef_key_event_t* event,
cef_event_handle_t os_event);
} cef_keyboard_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d7521ac4f73dabd876344400a165d15954c770b0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
@@ -58,10 +56,10 @@ typedef struct _cef_life_span_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called on the UI thread before a new popup browser is created. The
// Called on the IO thread before a new popup browser is created. The
// |browser| and |frame| values represent the source of the popup request. The
// |target_url| and |target_frame_name| values indicate where the popup
// browser should navigate and may be NULL if not specified with the request.
@@ -78,34 +76,22 @@ typedef struct _cef_life_span_handler_t {
// is set to false (0) the new browser will not be scriptable and may not be
// hosted in the same renderer process as the source browser. Any
// modifications to |windowInfo| will be ignored if the parent browser is
// wrapped in a cef_browser_view_t. Popup browser creation will be canceled if
// the parent browser is destroyed before the popup browser creation completes
// (indicated by a call to OnAfterCreated for the popup browser). The
// |extra_info| parameter provides an opportunity to specify extra information
// specific to the created popup browser that will be passed to
// cef_render_process_handler_t::on_browser_created() in the render process.
// wrapped in a cef_browser_view_t.
///
int(CEF_CALLBACK* on_before_popup)(
struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_string_t* target_url,
const cef_string_t* target_frame_name,
cef_window_open_disposition_t target_disposition,
int user_gesture,
int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
const cef_string_t* target_url, const cef_string_t* target_frame_name,
cef_window_open_disposition_t target_disposition, int user_gesture,
const struct _cef_popup_features_t* popupFeatures,
struct _cef_window_info_t* windowInfo,
struct _cef_client_t** client,
struct _cef_browser_settings_t* settings,
struct _cef_dictionary_value_t** extra_info,
int* no_javascript_access);
struct _cef_window_info_t* windowInfo, struct _cef_client_t** client,
struct _cef_browser_settings_t* settings, int* no_javascript_access);
///
// Called after a new browser is created. This callback will be the first
// notification that references |browser|.
///
void(CEF_CALLBACK* on_after_created)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
void (CEF_CALLBACK *on_after_created)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
///
// Called when a browser has recieved a request to close. This may result
@@ -196,24 +182,21 @@ typedef struct _cef_life_span_handler_t {
// browsers
// exist.
///
int(CEF_CALLBACK* do_close)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
int (CEF_CALLBACK *do_close)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
///
// Called just before a browser is destroyed. Release all references to the
// browser object and do not attempt to execute any functions on the browser
// object (other than GetIdentifier or IsSame) after this callback returns.
// This callback will be the last notification that references |browser| on
// the UI thread. Any in-progress network requests associated with |browser|
// will be aborted when the browser is destroyed, and
// cef_resource_request_handler_t callbacks related to those requests may
// still arrive on the IO thread after this function is called. See do_close()
// documentation for additional usage information.
// object after this callback returns. This callback will be the last
// notification that references |browser|. See do_close() documentation for
// additional usage information.
///
void(CEF_CALLBACK* on_before_close)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
} cef_life_span_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6c6a719d7cbbc01adfdc9bbe0dff6da10e06e3f3$
//
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
@@ -48,6 +46,7 @@
extern "C" {
#endif
///
// Implement this structure to handle events related to browser load status. The
// functions of this structure will be called on the browser process UI thread
@@ -57,7 +56,7 @@ typedef struct _cef_load_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called when the loading state has changed. This callback will be executed
@@ -66,59 +65,51 @@ typedef struct _cef_load_handler_t {
// of failure. It will be called before any calls to OnLoadStart and after all
// calls to OnLoadError and/or OnLoadEnd.
///
void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser,
int isLoading,
int canGoBack,
int canGoForward);
void (CEF_CALLBACK *on_loading_state_change)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser, int isLoading, int canGoBack,
int canGoForward);
///
// Called after a navigation has been committed and before the browser begins
// loading contents in the frame. The |frame| value will never be NULL -- call
// the is_main() function to check if this frame is the main frame.
// |transition_type| provides information about the source of the navigation
// and an accurate value is only available in the browser process. Multiple
// frames may be loading at the same time. Sub-frames may start or continue
// loading after the main frame load has ended. This function will not be
// called for same page navigations (fragments, history state, etc.) or for
// navigations that fail or are canceled before commit. For notification of
// overall browser load status use OnLoadingStateChange instead.
// Called when the browser begins loading a frame. The |frame| value will
// never be NULL -- call the is_main() function to check if this frame is the
// main frame. |transition_type| provides information about the source of the
// navigation and an accurate value is only available in the browser process.
// Multiple frames may be loading at the same time. Sub-frames may start or
// continue loading after the main frame load has ended. This function will
// always be called for all frames irrespective of whether the request
// completes successfully. For notification of overall browser load status use
// OnLoadingStateChange instead.
///
void(CEF_CALLBACK* on_load_start)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
cef_transition_type_t transition_type);
void (CEF_CALLBACK *on_load_start)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
cef_transition_type_t transition_type);
///
// Called when the browser is done loading a frame. The |frame| value will
// never be NULL -- call the is_main() function to check if this frame is the
// main frame. Multiple frames may be loading at the same time. Sub-frames may
// start or continue loading after the main frame load has ended. This
// function will not be called for same page navigations (fragments, history
// state, etc.) or for navigations that fail or are canceled before commit.
// For notification of overall browser load status use OnLoadingStateChange
// instead.
// function will always be called for all frames irrespective of whether the
// request completes successfully. For notification of overall browser load
// status use OnLoadingStateChange instead.
///
void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
int httpStatusCode);
void (CEF_CALLBACK *on_load_end)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
int httpStatusCode);
///
// Called when a navigation fails or is canceled. This function may be called
// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
// after commit. |errorCode| is the error code number, |errorText| is the
// error text and |failedUrl| is the URL that failed to load. See
// net\base\net_error_list.h for complete descriptions of the error codes.
// Called when the resource load for a navigation fails or is canceled.
// |errorCode| is the error code number, |errorText| is the error text and
// |failedUrl| is the URL that failed to load. See net\base\net_error_list.h
// for complete descriptions of the error codes.
///
void(CEF_CALLBACK* on_load_error)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
cef_errorcode_t errorCode,
const cef_string_t* errorText,
const cef_string_t* failedUrl);
void (CEF_CALLBACK *on_load_error)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
cef_errorcode_t errorCode, const cef_string_t* errorText,
const cef_string_t* failedUrl);
} cef_load_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,345 +0,0 @@
// Copyright (c) 2021 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=3767c7759578cd4abc1c2ecef504e7ed60775abb$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_registration_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_media_observer_t;
struct _cef_media_route_create_callback_t;
struct _cef_media_route_t;
struct _cef_media_sink_device_info_callback_t;
struct _cef_media_sink_t;
struct _cef_media_source_t;
///
// Supports discovery of and communication with media devices on the local
// network via the Cast and DIAL protocols. The functions of this structure may
// be called on any browser process thread unless otherwise indicated.
///
typedef struct _cef_media_router_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Add an observer for MediaRouter events. The observer will remain registered
// until the returned Registration object is destroyed.
///
struct _cef_registration_t*(CEF_CALLBACK* add_observer)(
struct _cef_media_router_t* self,
struct _cef_media_observer_t* observer);
///
// Returns a MediaSource object for the specified media source URN. Supported
// URN schemes include "cast:" and "dial:", and will be already known by the
// client application (e.g. "cast:<appId>?clientId=<clientId>").
///
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
struct _cef_media_router_t* self,
const cef_string_t* urn);
///
// Trigger an asynchronous call to cef_media_observer_t::OnSinks on all
// registered observers.
///
void(CEF_CALLBACK* notify_current_sinks)(struct _cef_media_router_t* self);
///
// Create a new route between |source| and |sink|. Source and sink must be
// valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and
// a route between them must not already exist. |callback| will be executed on
// success or failure. If route creation succeeds it will also trigger an
// asynchronous call to cef_media_observer_t::OnRoutes on all registered
// observers.
///
void(CEF_CALLBACK* create_route)(
struct _cef_media_router_t* self,
struct _cef_media_source_t* source,
struct _cef_media_sink_t* sink,
struct _cef_media_route_create_callback_t* callback);
///
// Trigger an asynchronous call to cef_media_observer_t::OnRoutes on all
// registered observers.
///
void(CEF_CALLBACK* notify_current_routes)(struct _cef_media_router_t* self);
} cef_media_router_t;
///
// Returns the MediaRouter object associated with the global request context.
// Equivalent to calling cef_request_context_t::cef_request_context_get_global_c
// ontext()->get_media_router().
///
CEF_EXPORT cef_media_router_t* cef_media_router_get_global();
///
// Implemented by the client to observe MediaRouter events and registered via
// cef_media_router_t::AddObserver. The functions of this structure will be
// called on the browser process UI thread.
///
typedef struct _cef_media_observer_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// The list of available media sinks has changed or
// cef_media_router_t::NotifyCurrentSinks was called.
///
void(CEF_CALLBACK* on_sinks)(struct _cef_media_observer_t* self,
size_t sinksCount,
struct _cef_media_sink_t* const* sinks);
///
// The list of available media routes has changed or
// cef_media_router_t::NotifyCurrentRoutes was called.
///
void(CEF_CALLBACK* on_routes)(struct _cef_media_observer_t* self,
size_t routesCount,
struct _cef_media_route_t* const* routes);
///
// The connection state of |route| has changed.
///
void(CEF_CALLBACK* on_route_state_changed)(
struct _cef_media_observer_t* self,
struct _cef_media_route_t* route,
cef_media_route_connection_state_t state);
///
// A message was recieved over |route|. |message| is only valid for the scope
// of this callback and should be copied if necessary.
///
void(CEF_CALLBACK* on_route_message_received)(
struct _cef_media_observer_t* self,
struct _cef_media_route_t* route,
const void* message,
size_t message_size);
} cef_media_observer_t;
///
// Represents the route between a media source and sink. Instances of this
// object are created via cef_media_router_t::CreateRoute and retrieved via
// cef_media_observer_t::OnRoutes. Contains the status and metadata of a routing
// operation. The functions of this structure may be called on any browser
// process thread unless otherwise indicated.
///
typedef struct _cef_media_route_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Returns the ID for this route.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_route_t* self);
///
// Returns the source associated with this route.
///
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
struct _cef_media_route_t* self);
///
// Returns the sink associated with this route.
///
struct _cef_media_sink_t*(CEF_CALLBACK* get_sink)(
struct _cef_media_route_t* self);
///
// Send a message over this route. |message| will be copied if necessary.
///
void(CEF_CALLBACK* send_route_message)(struct _cef_media_route_t* self,
const void* message,
size_t message_size);
///
// Terminate this route. Will result in an asynchronous call to
// cef_media_observer_t::OnRoutes on all registered observers.
///
void(CEF_CALLBACK* terminate)(struct _cef_media_route_t* self);
} cef_media_route_t;
///
// Callback structure for cef_media_router_t::CreateRoute. The functions of this
// structure will be called on the browser process UI thread.
///
typedef struct _cef_media_route_create_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Method that will be executed when the route creation has finished. |result|
// will be CEF_MRCR_OK if the route creation succeeded. |error| will be a
// description of the error if the route creation failed. |route| is the
// resulting route, or NULL if the route creation failed.
///
void(CEF_CALLBACK* on_media_route_create_finished)(
struct _cef_media_route_create_callback_t* self,
cef_media_route_create_result_t result,
const cef_string_t* error,
struct _cef_media_route_t* route);
} cef_media_route_create_callback_t;
///
// Represents a sink to which media can be routed. Instances of this object are
// retrieved via cef_media_observer_t::OnSinks. The functions of this structure
// may be called on any browser process thread unless otherwise indicated.
///
typedef struct _cef_media_sink_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Returns the ID for this sink.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_sink_t* self);
///
// Returns the name of this sink.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_media_sink_t* self);
///
// Returns the description of this sink.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_description)(
struct _cef_media_sink_t* self);
///
// Returns the icon type for this sink.
///
cef_media_sink_icon_type_t(CEF_CALLBACK* get_icon_type)(
struct _cef_media_sink_t* self);
///
// Asynchronously retrieves device info.
///
void(CEF_CALLBACK* get_device_info)(
struct _cef_media_sink_t* self,
struct _cef_media_sink_device_info_callback_t* callback);
///
// Returns true (1) if this sink accepts content via Cast.
///
int(CEF_CALLBACK* is_cast_sink)(struct _cef_media_sink_t* self);
///
// Returns true (1) if this sink accepts content via DIAL.
///
int(CEF_CALLBACK* is_dial_sink)(struct _cef_media_sink_t* self);
///
// Returns true (1) if this sink is compatible with |source|.
///
int(CEF_CALLBACK* is_compatible_with)(struct _cef_media_sink_t* self,
struct _cef_media_source_t* source);
} cef_media_sink_t;
///
// Callback structure for cef_media_sink_t::GetDeviceInfo. The functions of this
// structure will be called on the browser process UI thread.
///
typedef struct _cef_media_sink_device_info_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Method that will be executed asyncronously once device information has been
// retrieved.
///
void(CEF_CALLBACK* on_media_sink_device_info)(
struct _cef_media_sink_device_info_callback_t* self,
const struct _cef_media_sink_device_info_t* device_info);
} cef_media_sink_device_info_callback_t;
///
// Represents a source from which media can be routed. Instances of this object
// are retrieved via cef_media_router_t::GetSource. The functions of this
// structure may be called on any browser process thread unless otherwise
// indicated.
///
typedef struct _cef_media_source_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Returns the ID (media source URN or URL) for this source.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_source_t* self);
///
// Returns true (1) if this source outputs its content via Cast.
///
int(CEF_CALLBACK* is_cast_source)(struct _cef_media_source_t* self);
///
// Returns true (1) if this source outputs its content via DIAL.
///
int(CEF_CALLBACK* is_dial_source)(struct _cef_media_source_t* self);
} cef_media_source_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=28fa978051bd3ddff69d58e0dc8f445f64a61480$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
@@ -47,6 +45,7 @@
extern "C" {
#endif
///
// Supports creation and modification of menus. See cef_menu_id_t for the
// command ids that have default implementations. All user-defined command ids
@@ -57,453 +56,339 @@ typedef struct _cef_menu_model_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Returns true (1) if this menu is a submenu.
///
int(CEF_CALLBACK* is_sub_menu)(struct _cef_menu_model_t* self);
cef_base_t base;
///
// Clears the menu. Returns true (1) on success.
///
int(CEF_CALLBACK* clear)(struct _cef_menu_model_t* self);
int (CEF_CALLBACK *clear)(struct _cef_menu_model_t* self);
///
// Returns the number of items in this menu.
///
int(CEF_CALLBACK* get_count)(struct _cef_menu_model_t* self);
int (CEF_CALLBACK *get_count)(struct _cef_menu_model_t* self);
///
// Add a separator to the menu. Returns true (1) on success.
///
int(CEF_CALLBACK* add_separator)(struct _cef_menu_model_t* self);
int (CEF_CALLBACK *add_separator)(struct _cef_menu_model_t* self);
///
// Add an item to the menu. Returns true (1) on success.
///
int(CEF_CALLBACK* add_item)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* label);
int (CEF_CALLBACK *add_item)(struct _cef_menu_model_t* self, int command_id,
const cef_string_t* label);
///
// Add a check item to the menu. Returns true (1) on success.
///
int(CEF_CALLBACK* add_check_item)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* label);
int (CEF_CALLBACK *add_check_item)(struct _cef_menu_model_t* self,
int command_id, const cef_string_t* label);
///
// Add a radio item to the menu. Only a single item with the specified
// |group_id| can be checked at a time. Returns true (1) on success.
///
int(CEF_CALLBACK* add_radio_item)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* label,
int group_id);
int (CEF_CALLBACK *add_radio_item)(struct _cef_menu_model_t* self,
int command_id, const cef_string_t* label, int group_id);
///
// Add a sub-menu to the menu. The new sub-menu is returned.
///
struct _cef_menu_model_t*(CEF_CALLBACK* add_sub_menu)(
struct _cef_menu_model_t* self,
int command_id,
struct _cef_menu_model_t* (CEF_CALLBACK *add_sub_menu)(
struct _cef_menu_model_t* self, int command_id,
const cef_string_t* label);
///
// Insert a separator in the menu at the specified |index|. Returns true (1)
// on success.
///
int(CEF_CALLBACK* insert_separator_at)(struct _cef_menu_model_t* self,
int index);
int (CEF_CALLBACK *insert_separator_at)(struct _cef_menu_model_t* self,
int index);
///
// Insert an item in the menu at the specified |index|. Returns true (1) on
// success.
///
int(CEF_CALLBACK* insert_item_at)(struct _cef_menu_model_t* self,
int index,
int command_id,
const cef_string_t* label);
int (CEF_CALLBACK *insert_item_at)(struct _cef_menu_model_t* self, int index,
int command_id, const cef_string_t* label);
///
// Insert a check item in the menu at the specified |index|. Returns true (1)
// on success.
///
int(CEF_CALLBACK* insert_check_item_at)(struct _cef_menu_model_t* self,
int index,
int command_id,
const cef_string_t* label);
int (CEF_CALLBACK *insert_check_item_at)(struct _cef_menu_model_t* self,
int index, int command_id, const cef_string_t* label);
///
// Insert a radio item in the menu at the specified |index|. Only a single
// item with the specified |group_id| can be checked at a time. Returns true
// (1) on success.
///
int(CEF_CALLBACK* insert_radio_item_at)(struct _cef_menu_model_t* self,
int index,
int command_id,
const cef_string_t* label,
int group_id);
int (CEF_CALLBACK *insert_radio_item_at)(struct _cef_menu_model_t* self,
int index, int command_id, const cef_string_t* label, int group_id);
///
// Insert a sub-menu in the menu at the specified |index|. The new sub-menu is
// returned.
///
struct _cef_menu_model_t*(CEF_CALLBACK* insert_sub_menu_at)(
struct _cef_menu_model_t* self,
int index,
int command_id,
struct _cef_menu_model_t* (CEF_CALLBACK *insert_sub_menu_at)(
struct _cef_menu_model_t* self, int index, int command_id,
const cef_string_t* label);
///
// Removes the item with the specified |command_id|. Returns true (1) on
// success.
///
int(CEF_CALLBACK* remove)(struct _cef_menu_model_t* self, int command_id);
int (CEF_CALLBACK *remove)(struct _cef_menu_model_t* self, int command_id);
///
// Removes the item at the specified |index|. Returns true (1) on success.
///
int(CEF_CALLBACK* remove_at)(struct _cef_menu_model_t* self, int index);
int (CEF_CALLBACK *remove_at)(struct _cef_menu_model_t* self, int index);
///
// Returns the index associated with the specified |command_id| or -1 if not
// found due to the command id not existing in the menu.
///
int(CEF_CALLBACK* get_index_of)(struct _cef_menu_model_t* self,
int command_id);
int (CEF_CALLBACK *get_index_of)(struct _cef_menu_model_t* self,
int command_id);
///
// Returns the command id at the specified |index| or -1 if not found due to
// invalid range or the index being a separator.
///
int(CEF_CALLBACK* get_command_id_at)(struct _cef_menu_model_t* self,
int index);
int (CEF_CALLBACK *get_command_id_at)(struct _cef_menu_model_t* self,
int index);
///
// Sets the command id at the specified |index|. Returns true (1) on success.
///
int(CEF_CALLBACK* set_command_id_at)(struct _cef_menu_model_t* self,
int index,
int command_id);
int (CEF_CALLBACK *set_command_id_at)(struct _cef_menu_model_t* self,
int index, int command_id);
///
// Returns the label for the specified |command_id| or NULL if not found.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_label)(struct _cef_menu_model_t* self,
int command_id);
cef_string_userfree_t (CEF_CALLBACK *get_label)(
struct _cef_menu_model_t* self, int command_id);
///
// Returns the label at the specified |index| or NULL if not found due to
// invalid range or the index being a separator.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(
CEF_CALLBACK* get_label_at)(struct _cef_menu_model_t* self, int index);
cef_string_userfree_t (CEF_CALLBACK *get_label_at)(
struct _cef_menu_model_t* self, int index);
///
// Sets the label for the specified |command_id|. Returns true (1) on success.
///
int(CEF_CALLBACK* set_label)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* label);
int (CEF_CALLBACK *set_label)(struct _cef_menu_model_t* self, int command_id,
const cef_string_t* label);
///
// Set the label at the specified |index|. Returns true (1) on success.
///
int(CEF_CALLBACK* set_label_at)(struct _cef_menu_model_t* self,
int index,
const cef_string_t* label);
int (CEF_CALLBACK *set_label_at)(struct _cef_menu_model_t* self, int index,
const cef_string_t* label);
///
// Returns the item type for the specified |command_id|.
///
cef_menu_item_type_t(CEF_CALLBACK* get_type)(struct _cef_menu_model_t* self,
int command_id);
cef_menu_item_type_t (CEF_CALLBACK *get_type)(struct _cef_menu_model_t* self,
int command_id);
///
// Returns the item type at the specified |index|.
///
cef_menu_item_type_t(
CEF_CALLBACK* get_type_at)(struct _cef_menu_model_t* self, int index);
cef_menu_item_type_t (CEF_CALLBACK *get_type_at)(
struct _cef_menu_model_t* self, int index);
///
// Returns the group id for the specified |command_id| or -1 if invalid.
///
int(CEF_CALLBACK* get_group_id)(struct _cef_menu_model_t* self,
int command_id);
int (CEF_CALLBACK *get_group_id)(struct _cef_menu_model_t* self,
int command_id);
///
// Returns the group id at the specified |index| or -1 if invalid.
///
int(CEF_CALLBACK* get_group_id_at)(struct _cef_menu_model_t* self, int index);
int (CEF_CALLBACK *get_group_id_at)(struct _cef_menu_model_t* self,
int index);
///
// Sets the group id for the specified |command_id|. Returns true (1) on
// success.
///
int(CEF_CALLBACK* set_group_id)(struct _cef_menu_model_t* self,
int command_id,
int group_id);
int (CEF_CALLBACK *set_group_id)(struct _cef_menu_model_t* self,
int command_id, int group_id);
///
// Sets the group id at the specified |index|. Returns true (1) on success.
///
int(CEF_CALLBACK* set_group_id_at)(struct _cef_menu_model_t* self,
int index,
int group_id);
int (CEF_CALLBACK *set_group_id_at)(struct _cef_menu_model_t* self, int index,
int group_id);
///
// Returns the submenu for the specified |command_id| or NULL if invalid.
///
struct _cef_menu_model_t*(CEF_CALLBACK* get_sub_menu)(
struct _cef_menu_model_t* self,
int command_id);
struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu)(
struct _cef_menu_model_t* self, int command_id);
///
// Returns the submenu at the specified |index| or NULL if invalid.
///
struct _cef_menu_model_t*(
CEF_CALLBACK* get_sub_menu_at)(struct _cef_menu_model_t* self, int index);
struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu_at)(
struct _cef_menu_model_t* self, int index);
///
// Returns true (1) if the specified |command_id| is visible.
///
int(CEF_CALLBACK* is_visible)(struct _cef_menu_model_t* self, int command_id);
int (CEF_CALLBACK *is_visible)(struct _cef_menu_model_t* self,
int command_id);
///
// Returns true (1) if the specified |index| is visible.
///
int(CEF_CALLBACK* is_visible_at)(struct _cef_menu_model_t* self, int index);
int (CEF_CALLBACK *is_visible_at)(struct _cef_menu_model_t* self, int index);
///
// Change the visibility of the specified |command_id|. Returns true (1) on
// success.
///
int(CEF_CALLBACK* set_visible)(struct _cef_menu_model_t* self,
int command_id,
int visible);
int (CEF_CALLBACK *set_visible)(struct _cef_menu_model_t* self,
int command_id, int visible);
///
// Change the visibility at the specified |index|. Returns true (1) on
// success.
///
int(CEF_CALLBACK* set_visible_at)(struct _cef_menu_model_t* self,
int index,
int visible);
int (CEF_CALLBACK *set_visible_at)(struct _cef_menu_model_t* self, int index,
int visible);
///
// Returns true (1) if the specified |command_id| is enabled.
///
int(CEF_CALLBACK* is_enabled)(struct _cef_menu_model_t* self, int command_id);
int (CEF_CALLBACK *is_enabled)(struct _cef_menu_model_t* self,
int command_id);
///
// Returns true (1) if the specified |index| is enabled.
///
int(CEF_CALLBACK* is_enabled_at)(struct _cef_menu_model_t* self, int index);
int (CEF_CALLBACK *is_enabled_at)(struct _cef_menu_model_t* self, int index);
///
// Change the enabled status of the specified |command_id|. Returns true (1)
// on success.
///
int(CEF_CALLBACK* set_enabled)(struct _cef_menu_model_t* self,
int command_id,
int enabled);
int (CEF_CALLBACK *set_enabled)(struct _cef_menu_model_t* self,
int command_id, int enabled);
///
// Change the enabled status at the specified |index|. Returns true (1) on
// success.
///
int(CEF_CALLBACK* set_enabled_at)(struct _cef_menu_model_t* self,
int index,
int enabled);
int (CEF_CALLBACK *set_enabled_at)(struct _cef_menu_model_t* self, int index,
int enabled);
///
// Returns true (1) if the specified |command_id| is checked. Only applies to
// check and radio items.
///
int(CEF_CALLBACK* is_checked)(struct _cef_menu_model_t* self, int command_id);
int (CEF_CALLBACK *is_checked)(struct _cef_menu_model_t* self,
int command_id);
///
// Returns true (1) if the specified |index| is checked. Only applies to check
// and radio items.
///
int(CEF_CALLBACK* is_checked_at)(struct _cef_menu_model_t* self, int index);
int (CEF_CALLBACK *is_checked_at)(struct _cef_menu_model_t* self, int index);
///
// Check the specified |command_id|. Only applies to check and radio items.
// Returns true (1) on success.
///
int(CEF_CALLBACK* set_checked)(struct _cef_menu_model_t* self,
int command_id,
int checked);
int (CEF_CALLBACK *set_checked)(struct _cef_menu_model_t* self,
int command_id, int checked);
///
// Check the specified |index|. Only applies to check and radio items. Returns
// true (1) on success.
///
int(CEF_CALLBACK* set_checked_at)(struct _cef_menu_model_t* self,
int index,
int checked);
int (CEF_CALLBACK *set_checked_at)(struct _cef_menu_model_t* self, int index,
int checked);
///
// Returns true (1) if the specified |command_id| has a keyboard accelerator
// assigned.
///
int(CEF_CALLBACK* has_accelerator)(struct _cef_menu_model_t* self,
int command_id);
int (CEF_CALLBACK *has_accelerator)(struct _cef_menu_model_t* self,
int command_id);
///
// Returns true (1) if the specified |index| has a keyboard accelerator
// assigned.
///
int(CEF_CALLBACK* has_accelerator_at)(struct _cef_menu_model_t* self,
int index);
int (CEF_CALLBACK *has_accelerator_at)(struct _cef_menu_model_t* self,
int index);
///
// Set the keyboard accelerator for the specified |command_id|. |key_code| can
// be any virtual key or character value. Returns true (1) on success.
///
int(CEF_CALLBACK* set_accelerator)(struct _cef_menu_model_t* self,
int command_id,
int key_code,
int shift_pressed,
int ctrl_pressed,
int alt_pressed);
int (CEF_CALLBACK *set_accelerator)(struct _cef_menu_model_t* self,
int command_id, int key_code, int shift_pressed, int ctrl_pressed,
int alt_pressed);
///
// Set the keyboard accelerator at the specified |index|. |key_code| can be
// any virtual key or character value. Returns true (1) on success.
///
int(CEF_CALLBACK* set_accelerator_at)(struct _cef_menu_model_t* self,
int index,
int key_code,
int shift_pressed,
int ctrl_pressed,
int alt_pressed);
int (CEF_CALLBACK *set_accelerator_at)(struct _cef_menu_model_t* self,
int index, int key_code, int shift_pressed, int ctrl_pressed,
int alt_pressed);
///
// Remove the keyboard accelerator for the specified |command_id|. Returns
// true (1) on success.
///
int(CEF_CALLBACK* remove_accelerator)(struct _cef_menu_model_t* self,
int command_id);
int (CEF_CALLBACK *remove_accelerator)(struct _cef_menu_model_t* self,
int command_id);
///
// Remove the keyboard accelerator at the specified |index|. Returns true (1)
// on success.
///
int(CEF_CALLBACK* remove_accelerator_at)(struct _cef_menu_model_t* self,
int index);
int (CEF_CALLBACK *remove_accelerator_at)(struct _cef_menu_model_t* self,
int index);
///
// Retrieves the keyboard accelerator for the specified |command_id|. Returns
// true (1) on success.
///
int(CEF_CALLBACK* get_accelerator)(struct _cef_menu_model_t* self,
int command_id,
int* key_code,
int* shift_pressed,
int* ctrl_pressed,
int* alt_pressed);
int (CEF_CALLBACK *get_accelerator)(struct _cef_menu_model_t* self,
int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed,
int* alt_pressed);
///
// Retrieves the keyboard accelerator for the specified |index|. Returns true
// (1) on success.
///
int(CEF_CALLBACK* get_accelerator_at)(struct _cef_menu_model_t* self,
int index,
int* key_code,
int* shift_pressed,
int* ctrl_pressed,
int* alt_pressed);
///
// Set the explicit color for |command_id| and |color_type| to |color|.
// Specify a |color| value of 0 to remove the explicit color. If no explicit
// color or default color is set for |color_type| then the system color will
// be used. Returns true (1) on success.
///
int(CEF_CALLBACK* set_color)(struct _cef_menu_model_t* self,
int command_id,
cef_menu_color_type_t color_type,
cef_color_t color);
///
// Set the explicit color for |command_id| and |index| to |color|. Specify a
// |color| value of 0 to remove the explicit color. Specify an |index| value
// of -1 to set the default color for items that do not have an explicit color
// set. If no explicit color or default color is set for |color_type| then the
// system color will be used. Returns true (1) on success.
///
int(CEF_CALLBACK* set_color_at)(struct _cef_menu_model_t* self,
int index,
cef_menu_color_type_t color_type,
cef_color_t color);
///
// Returns in |color| the color that was explicitly set for |command_id| and
// |color_type|. If a color was not set then 0 will be returned in |color|.
// Returns true (1) on success.
///
int(CEF_CALLBACK* get_color)(struct _cef_menu_model_t* self,
int command_id,
cef_menu_color_type_t color_type,
cef_color_t* color);
///
// Returns in |color| the color that was explicitly set for |command_id| and
// |color_type|. Specify an |index| value of -1 to return the default color in
// |color|. If a color was not set then 0 will be returned in |color|. Returns
// true (1) on success.
///
int(CEF_CALLBACK* get_color_at)(struct _cef_menu_model_t* self,
int index,
cef_menu_color_type_t color_type,
cef_color_t* color);
///
// Sets the font list for the specified |command_id|. If |font_list| is NULL
// the system font will be used. Returns true (1) on success. The format is
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma-
// separated list of font family names, - STYLES is an optional space-
// separated list of style names (case-sensitive
// "Bold" and "Italic" are supported), and
// - SIZE is an integer font size in pixels with the suffix "px".
//
// Here are examples of valid font description strings: - "Arial, Helvetica,
// Bold Italic 14px" - "Arial, 14px"
///
int(CEF_CALLBACK* set_font_list)(struct _cef_menu_model_t* self,
int command_id,
const cef_string_t* font_list);
///
// Sets the font list for the specified |index|. Specify an |index| value of
// -1 to set the default font. If |font_list| is NULL the system font will be
// used. Returns true (1) on success. The format is
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma-
// separated list of font family names, - STYLES is an optional space-
// separated list of style names (case-sensitive
// "Bold" and "Italic" are supported), and
// - SIZE is an integer font size in pixels with the suffix "px".
//
// Here are examples of valid font description strings: - "Arial, Helvetica,
// Bold Italic 14px" - "Arial, 14px"
///
int(CEF_CALLBACK* set_font_list_at)(struct _cef_menu_model_t* self,
int index,
const cef_string_t* font_list);
int (CEF_CALLBACK *get_accelerator_at)(struct _cef_menu_model_t* self,
int index, int* key_code, int* shift_pressed, int* ctrl_pressed,
int* alt_pressed);
} cef_menu_model_t;
///
// Create a new MenuModel with the specified |delegate|.
///
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
struct _cef_menu_model_delegate_t* delegate);
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=edc411cb0447a6c2965cdeb5f709fe56c43ec2bb$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
@@ -57,65 +55,37 @@ typedef struct _cef_menu_model_delegate_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Perform the action associated with the specified |command_id| and optional
// |event_flags|.
///
void(CEF_CALLBACK* execute_command)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
int command_id,
cef_event_flags_t event_flags);
///
// Called when the user moves the mouse outside the menu and over the owning
// window.
///
void(CEF_CALLBACK* mouse_outside_menu)(
struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
const cef_point_t* screen_point);
///
// Called on unhandled open submenu keyboard commands. |is_rtl| will be true
// (1) if the menu is displaying a right-to-left language.
///
void(CEF_CALLBACK* unhandled_open_submenu)(
struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
int is_rtl);
///
// Called on unhandled close submenu keyboard commands. |is_rtl| will be true
// (1) if the menu is displaying a right-to-left language.
///
void(CEF_CALLBACK* unhandled_close_submenu)(
struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
int is_rtl);
void (CEF_CALLBACK *execute_command)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model, int command_id,
cef_event_flags_t event_flags);
///
// The menu is about to show.
///
void(CEF_CALLBACK* menu_will_show)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model);
void (CEF_CALLBACK *menu_will_show)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model);
///
// The menu has closed.
///
void(CEF_CALLBACK* menu_closed)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model);
void (CEF_CALLBACK *menu_closed)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model);
///
// Optionally modify a menu item label. Return true (1) if |label| was
// modified.
///
int(CEF_CALLBACK* format_label)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model,
cef_string_t* label);
int (CEF_CALLBACK *format_label)(struct _cef_menu_model_delegate_t* self,
struct _cef_menu_model_t* menu_model, cef_string_t* label);
} cef_menu_model_delegate_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f14afbd6941bcb37b14cce81569882512c3d7194$
//
#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
@@ -47,6 +45,7 @@
extern "C" {
#endif
///
// Structure used to represent an entry in navigation history.
///
@@ -54,61 +53,61 @@ typedef struct _cef_navigation_entry_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns true (1) if this object is valid. Do not call any other functions
// if this function returns false (0).
///
int(CEF_CALLBACK* is_valid)(struct _cef_navigation_entry_t* self);
int (CEF_CALLBACK *is_valid)(struct _cef_navigation_entry_t* self);
///
// Returns the actual URL of the page. For some pages this may be data: URL or
// similar. Use get_display_url() to return a display-friendly version.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_url)(
cef_string_userfree_t (CEF_CALLBACK *get_url)(
struct _cef_navigation_entry_t* self);
///
// Returns a display-friendly version of the URL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_display_url)(
cef_string_userfree_t (CEF_CALLBACK *get_display_url)(
struct _cef_navigation_entry_t* self);
///
// Returns the original URL that was entered by the user before any redirects.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_original_url)(
cef_string_userfree_t (CEF_CALLBACK *get_original_url)(
struct _cef_navigation_entry_t* self);
///
// Returns the title set by the page. This value may be NULL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_title)(
cef_string_userfree_t (CEF_CALLBACK *get_title)(
struct _cef_navigation_entry_t* self);
///
// Returns the transition type which indicates what the user did to move to
// this page from the previous page.
///
cef_transition_type_t(CEF_CALLBACK* get_transition_type)(
cef_transition_type_t (CEF_CALLBACK *get_transition_type)(
struct _cef_navigation_entry_t* self);
///
// Returns true (1) if this navigation includes post data.
///
int(CEF_CALLBACK* has_post_data)(struct _cef_navigation_entry_t* self);
int (CEF_CALLBACK *has_post_data)(struct _cef_navigation_entry_t* self);
///
// Returns the time for the last known successful navigation completion. A
// navigation may be completed more than once if the page is reloaded. May be
// 0 if the navigation has not yet completed.
///
cef_time_t(CEF_CALLBACK* get_completion_time)(
cef_time_t (CEF_CALLBACK *get_completion_time)(
struct _cef_navigation_entry_t* self);
///
@@ -116,15 +115,17 @@ typedef struct _cef_navigation_entry_t {
// response. May be 0 if the response has not yet been received or if the
// navigation has not yet completed.
///
int(CEF_CALLBACK* get_http_status_code)(struct _cef_navigation_entry_t* self);
int (CEF_CALLBACK *get_http_status_code)(
struct _cef_navigation_entry_t* self);
///
// Returns the SSL information for this navigation entry.
///
struct _cef_sslstatus_t*(CEF_CALLBACK* get_sslstatus)(
struct _cef_sslstatus_t* (CEF_CALLBACK *get_sslstatus)(
struct _cef_navigation_entry_t* self);
} cef_navigation_entry_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6798e6147540596c1abac8c7457d9d1d4d99bd54$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Add an entry to the cross-origin access whitelist.
//
@@ -83,20 +82,16 @@ extern "C" {
// |source_origin| is invalid or the whitelist cannot be accessed.
///
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
const cef_string_t* source_origin,
const cef_string_t* target_protocol,
const cef_string_t* target_domain,
int allow_target_subdomains);
const cef_string_t* source_origin, const cef_string_t* target_protocol,
const cef_string_t* target_domain, int allow_target_subdomains);
///
// Remove an entry from the cross-origin access whitelist. Returns false (0) if
// |source_origin| is invalid or the whitelist cannot be accessed.
///
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
const cef_string_t* source_origin,
const cef_string_t* target_protocol,
const cef_string_t* target_domain,
int allow_target_subdomains);
const cef_string_t* source_origin, const cef_string_t* target_protocol,
const cef_string_t* target_domain, int allow_target_subdomains);
///
// Remove all entries from the cross-origin access whitelist. Returns false (0)

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=84149324b177c47287b935dcb3d5900a33acfdf5$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
@@ -46,12 +44,13 @@
extern "C" {
#endif
///
// Parse the specified |url| into its component parts. Returns false (0) if the
// URL is NULL or invalid.
///
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
struct _cef_urlparts_t* parts);
struct _cef_urlparts_t* parts);
///
// Creates a URL from the specified |parts|, which must contain a non-NULL spec
@@ -59,7 +58,7 @@ CEF_EXPORT int cef_parse_url(const cef_string_t* url,
// if |parts| isn't initialized as described.
///
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
cef_string_t* url);
cef_string_t* url);
///
// This is a convenience function for formatting a URL in a concise and human-
@@ -72,16 +71,16 @@ CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
// for URLs which will be parsed or sent to other applications.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t
cef_format_url_for_security_display(const cef_string_t* origin_url);
CEF_EXPORT cef_string_userfree_t cef_format_url_for_security_display(
const cef_string_t* origin_url);
///
// Returns the mime type for the specified file extension or an NULL string if
// unknown.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t
cef_get_mime_type(const cef_string_t* extension);
CEF_EXPORT cef_string_userfree_t cef_get_mime_type(
const cef_string_t* extension);
///
// Get the extensions associated with the given mime type. This should be passed
@@ -90,14 +89,14 @@ cef_get_mime_type(const cef_string_t* extension);
// elements in the provided vector will not be erased.
///
CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type,
cef_string_list_t extensions);
cef_string_list_t extensions);
///
// Encodes |data| as a base64 string.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data,
size_t data_size);
size_t data_size);
///
// Decodes the base64 encoded string |data|. The returned value will be NULL if
@@ -114,7 +113,7 @@ CEF_EXPORT struct _cef_binary_value_t* cef_base64decode(
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text,
int use_plus);
int use_plus);
///
// Unescapes |text| and returns the result. Unescaping consists of looking for
@@ -127,38 +126,25 @@ CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text,
// supports further customization the decoding process.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t
cef_uridecode(const cef_string_t* text,
int convert_to_utf8,
cef_uri_unescape_rule_t unescape_rule);
CEF_EXPORT cef_string_userfree_t cef_uridecode(const cef_string_t* text,
int convert_to_utf8, cef_uri_unescape_rule_t unescape_rule);
///
// Parses the specified |json_string| and returns a dictionary or list
// representation. If JSON parsing fails this function returns NULL.
///
CEF_EXPORT struct _cef_value_t* cef_parse_json(
const cef_string_t* json_string,
cef_json_parser_options_t options);
///
// Parses the specified UTF8-encoded |json| buffer of size |json_size| and
// returns a dictionary or list representation. If JSON parsing fails this
// function returns NULL.
///
CEF_EXPORT struct _cef_value_t* cef_parse_json_buffer(
const void* json,
size_t json_size,
CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string,
cef_json_parser_options_t options);
///
// Parses the specified |json_string| and returns a dictionary or list
// representation. If JSON parsing fails this function returns NULL and
// populates |error_msg_out| with a formatted error message.
// populates |error_code_out| and |error_msg_out| with an error code and a
// formatted error message respectively.
///
CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
const cef_string_t* json_string,
cef_json_parser_options_t options,
cef_string_t* error_msg_out);
const cef_string_t* json_string, cef_json_parser_options_t options,
cef_json_parser_error_t* error_code_out, cef_string_t* error_msg_out);
///
// Generates a JSON string from the specified root |node| which should be a
@@ -166,8 +152,8 @@ CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
// requires exclusive access to |node| including any underlying data.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t
cef_write_json(struct _cef_value_t* node, cef_json_writer_options_t options);
CEF_EXPORT cef_string_userfree_t cef_write_json(struct _cef_value_t* node,
cef_json_writer_options_t options);
#ifdef __cplusplus
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0ae1fe7f7141eb05eb7fd44c2d41e4c576afae1e$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Retrieve the path associated with the specified |key|. Returns true (1) on
// success. Can be called on any thread in the browser process.

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=54ed1e16c5c1d133bcd097350c5f5871228efd4f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
@@ -48,6 +46,7 @@
extern "C" {
#endif
///
// Callback structure for asynchronous continuation of print dialog requests.
///
@@ -55,20 +54,21 @@ typedef struct _cef_print_dialog_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Continue printing with the specified |settings|.
///
void(CEF_CALLBACK* cont)(struct _cef_print_dialog_callback_t* self,
struct _cef_print_settings_t* settings);
void (CEF_CALLBACK *cont)(struct _cef_print_dialog_callback_t* self,
struct _cef_print_settings_t* settings);
///
// Cancel the printing.
///
void(CEF_CALLBACK* cancel)(struct _cef_print_dialog_callback_t* self);
void (CEF_CALLBACK *cancel)(struct _cef_print_dialog_callback_t* self);
} cef_print_dialog_callback_t;
///
// Callback structure for asynchronous continuation of print job requests.
///
@@ -76,24 +76,24 @@ typedef struct _cef_print_job_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Indicate completion of the print job.
///
void(CEF_CALLBACK* cont)(struct _cef_print_job_callback_t* self);
void (CEF_CALLBACK *cont)(struct _cef_print_job_callback_t* self);
} cef_print_job_callback_t;
///
// Implement this structure to handle printing on Linux. Each browser will have
// only one print job in progress at a time. The functions of this structure
// will be called on the browser process UI thread.
// Implement this structure to handle printing on Linux. The functions of this
// structure will be called on the browser process UI thread.
///
typedef struct _cef_print_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called when printing has started for the specified |browser|. This function
@@ -101,56 +101,48 @@ typedef struct _cef_print_handler_t {
// how printing was initiated (e.g. cef_browser_host_t::print(), JavaScript
// window.print() or PDF extension print button).
///
void(CEF_CALLBACK* on_print_start)(struct _cef_print_handler_t* self,
struct _cef_browser_t* browser);
void (CEF_CALLBACK *on_print_start)(struct _cef_print_handler_t* self,
struct _cef_browser_t* browser);
///
// Synchronize |settings| with client state. If |get_defaults| is true (1)
// then populate |settings| with the default print settings. Do not keep a
// reference to |settings| outside of this callback.
///
void(CEF_CALLBACK* on_print_settings)(struct _cef_print_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_print_settings_t* settings,
int get_defaults);
void (CEF_CALLBACK *on_print_settings)(struct _cef_print_handler_t* self,
struct _cef_print_settings_t* settings, int get_defaults);
///
// Show the print dialog. Execute |callback| once the dialog is dismissed.
// Return true (1) if the dialog will be displayed or false (0) to cancel the
// printing immediately.
///
int(CEF_CALLBACK* on_print_dialog)(
struct _cef_print_handler_t* self,
struct _cef_browser_t* browser,
int has_selection,
struct _cef_print_dialog_callback_t* callback);
int (CEF_CALLBACK *on_print_dialog)(struct _cef_print_handler_t* self,
int has_selection, struct _cef_print_dialog_callback_t* callback);
///
// Send the print job to the printer. Execute |callback| once the job is
// completed. Return true (1) if the job will proceed or false (0) to cancel
// the job immediately.
///
int(CEF_CALLBACK* on_print_job)(struct _cef_print_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* document_name,
const cef_string_t* pdf_file_path,
struct _cef_print_job_callback_t* callback);
int (CEF_CALLBACK *on_print_job)(struct _cef_print_handler_t* self,
const cef_string_t* document_name, const cef_string_t* pdf_file_path,
struct _cef_print_job_callback_t* callback);
///
// Reset client state related to printing.
///
void(CEF_CALLBACK* on_print_reset)(struct _cef_print_handler_t* self,
struct _cef_browser_t* browser);
void (CEF_CALLBACK *on_print_reset)(struct _cef_print_handler_t* self);
///
// Return the PDF paper size in device units. Used in combination with
// cef_browser_host_t::print_to_pdf().
///
cef_size_t(CEF_CALLBACK* get_pdf_paper_size)(
struct _cef_print_handler_t* self,
int device_units_per_inch);
cef_size_t (CEF_CALLBACK *get_pdf_paper_size)(
struct _cef_print_handler_t* self, int device_units_per_inch);
} cef_print_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=4b52323c4ce2d0ebcc3438e16fc9a9b181a58adc$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Structure representing print settings.
///
@@ -53,37 +52,43 @@ typedef struct _cef_print_settings_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns true (1) if this object is valid. Do not call any other functions
// if this function returns false (0).
///
int(CEF_CALLBACK* is_valid)(struct _cef_print_settings_t* self);
int (CEF_CALLBACK *is_valid)(struct _cef_print_settings_t* self);
///
// Returns true (1) if the values of this object are read-only. Some APIs may
// expose read-only objects.
///
int(CEF_CALLBACK* is_read_only)(struct _cef_print_settings_t* self);
int (CEF_CALLBACK *is_read_only)(struct _cef_print_settings_t* self);
///
// Returns a writable copy of this object.
///
struct _cef_print_settings_t* (CEF_CALLBACK *copy)(
struct _cef_print_settings_t* self);
///
// Set the page orientation.
///
void(CEF_CALLBACK* set_orientation)(struct _cef_print_settings_t* self,
int landscape);
void (CEF_CALLBACK *set_orientation)(struct _cef_print_settings_t* self,
int landscape);
///
// Returns true (1) if the orientation is landscape.
///
int(CEF_CALLBACK* is_landscape)(struct _cef_print_settings_t* self);
int (CEF_CALLBACK *is_landscape)(struct _cef_print_settings_t* self);
///
// Set the printer printable area in device units. Some platforms already
// provide flipped area. Set |landscape_needs_flip| to false (0) on those
// platforms to avoid double flipping.
///
void(CEF_CALLBACK* set_printer_printable_area)(
void (CEF_CALLBACK *set_printer_printable_area)(
struct _cef_print_settings_t* self,
const cef_size_t* physical_size_device_units,
const cef_rect_t* printable_area_device_units,
@@ -92,109 +97,109 @@ typedef struct _cef_print_settings_t {
///
// Set the device name.
///
void(CEF_CALLBACK* set_device_name)(struct _cef_print_settings_t* self,
const cef_string_t* name);
void (CEF_CALLBACK *set_device_name)(struct _cef_print_settings_t* self,
const cef_string_t* name);
///
// Get the device name.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_device_name)(
cef_string_userfree_t (CEF_CALLBACK *get_device_name)(
struct _cef_print_settings_t* self);
///
// Set the DPI (dots per inch).
///
void(CEF_CALLBACK* set_dpi)(struct _cef_print_settings_t* self, int dpi);
void (CEF_CALLBACK *set_dpi)(struct _cef_print_settings_t* self, int dpi);
///
// Get the DPI (dots per inch).
///
int(CEF_CALLBACK* get_dpi)(struct _cef_print_settings_t* self);
int (CEF_CALLBACK *get_dpi)(struct _cef_print_settings_t* self);
///
// Set the page ranges.
///
void(CEF_CALLBACK* set_page_ranges)(struct _cef_print_settings_t* self,
size_t rangesCount,
cef_range_t const* ranges);
void (CEF_CALLBACK *set_page_ranges)(struct _cef_print_settings_t* self,
size_t rangesCount, cef_range_t const* ranges);
///
// Returns the number of page ranges that currently exist.
///
size_t(CEF_CALLBACK* get_page_ranges_count)(
size_t (CEF_CALLBACK *get_page_ranges_count)(
struct _cef_print_settings_t* self);
///
// Retrieve the page ranges.
///
void(CEF_CALLBACK* get_page_ranges)(struct _cef_print_settings_t* self,
size_t* rangesCount,
cef_range_t* ranges);
void (CEF_CALLBACK *get_page_ranges)(struct _cef_print_settings_t* self,
size_t* rangesCount, cef_range_t* ranges);
///
// Set whether only the selection will be printed.
///
void(CEF_CALLBACK* set_selection_only)(struct _cef_print_settings_t* self,
int selection_only);
void (CEF_CALLBACK *set_selection_only)(struct _cef_print_settings_t* self,
int selection_only);
///
// Returns true (1) if only the selection will be printed.
///
int(CEF_CALLBACK* is_selection_only)(struct _cef_print_settings_t* self);
int (CEF_CALLBACK *is_selection_only)(struct _cef_print_settings_t* self);
///
// Set whether pages will be collated.
///
void(CEF_CALLBACK* set_collate)(struct _cef_print_settings_t* self,
int collate);
void (CEF_CALLBACK *set_collate)(struct _cef_print_settings_t* self,
int collate);
///
// Returns true (1) if pages will be collated.
///
int(CEF_CALLBACK* will_collate)(struct _cef_print_settings_t* self);
int (CEF_CALLBACK *will_collate)(struct _cef_print_settings_t* self);
///
// Set the color model.
///
void(CEF_CALLBACK* set_color_model)(struct _cef_print_settings_t* self,
cef_color_model_t model);
void (CEF_CALLBACK *set_color_model)(struct _cef_print_settings_t* self,
cef_color_model_t model);
///
// Get the color model.
///
cef_color_model_t(CEF_CALLBACK* get_color_model)(
cef_color_model_t (CEF_CALLBACK *get_color_model)(
struct _cef_print_settings_t* self);
///
// Set the number of copies.
///
void(CEF_CALLBACK* set_copies)(struct _cef_print_settings_t* self,
int copies);
void (CEF_CALLBACK *set_copies)(struct _cef_print_settings_t* self,
int copies);
///
// Get the number of copies.
///
int(CEF_CALLBACK* get_copies)(struct _cef_print_settings_t* self);
int (CEF_CALLBACK *get_copies)(struct _cef_print_settings_t* self);
///
// Set the duplex mode.
///
void(CEF_CALLBACK* set_duplex_mode)(struct _cef_print_settings_t* self,
cef_duplex_mode_t mode);
void (CEF_CALLBACK *set_duplex_mode)(struct _cef_print_settings_t* self,
cef_duplex_mode_t mode);
///
// Get the duplex mode.
///
cef_duplex_mode_t(CEF_CALLBACK* get_duplex_mode)(
cef_duplex_mode_t (CEF_CALLBACK *get_duplex_mode)(
struct _cef_print_settings_t* self);
} cef_print_settings_t;
///
// Create a new cef_print_settings_t object.
///
CEF_EXPORT cef_print_settings_t* cef_print_settings_create();
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=53ff22b73527aa331d2bd96e008f4cb4f0413042$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
@@ -47,6 +45,7 @@
extern "C" {
#endif
///
// Structure representing a message. Can be used on any process and thread.
///
@@ -54,46 +53,48 @@ typedef struct _cef_process_message_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns true (1) if this object is valid. Do not call any other functions
// if this function returns false (0).
///
int(CEF_CALLBACK* is_valid)(struct _cef_process_message_t* self);
int (CEF_CALLBACK *is_valid)(struct _cef_process_message_t* self);
///
// Returns true (1) if the values of this object are read-only. Some APIs may
// expose read-only objects.
///
int(CEF_CALLBACK* is_read_only)(struct _cef_process_message_t* self);
int (CEF_CALLBACK *is_read_only)(struct _cef_process_message_t* self);
///
// Returns a writable copy of this object.
///
struct _cef_process_message_t*(CEF_CALLBACK* copy)(
struct _cef_process_message_t* (CEF_CALLBACK *copy)(
struct _cef_process_message_t* self);
///
// Returns the message name.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_name)(
cef_string_userfree_t (CEF_CALLBACK *get_name)(
struct _cef_process_message_t* self);
///
// Returns the list of arguments.
///
struct _cef_list_value_t*(CEF_CALLBACK* get_argument_list)(
struct _cef_list_value_t* (CEF_CALLBACK *get_argument_list)(
struct _cef_process_message_t* self);
} cef_process_message_t;
///
// Create a new cef_process_message_t object with the specified name.
///
CEF_EXPORT cef_process_message_t* cef_process_message_create(
const cef_string_t* name);
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c476a8d22852994d9d9695db901efaef13bbfc9d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
@@ -46,6 +44,7 @@
extern "C" {
#endif
///
// Launches the process specified via |command_line|. Returns true (1) upon
// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,14 +33,11 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=e4bdab963041a270edabc0954b415eb4cae8e5cb$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_accessibility_handler_capi.h"
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_drag_data_capi.h"
@@ -49,6 +46,7 @@
extern "C" {
#endif
///
// Implement this structure to handle events when window rendering is disabled.
// The functions of this structure will be called on the UI thread.
@@ -57,42 +55,29 @@ typedef struct _cef_render_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Return the handler for accessibility notifications. If no handler is
// provided the default implementation will be used.
///
struct _cef_accessibility_handler_t*(CEF_CALLBACK* get_accessibility_handler)(
struct _cef_render_handler_t* self);
cef_base_t base;
///
// Called to retrieve the root window rectangle in screen coordinates. Return
// true (1) if the rectangle was provided. If this function returns false (0)
// the rectangle from GetViewRect will be used.
// true (1) if the rectangle was provided.
///
int(CEF_CALLBACK* get_root_screen_rect)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
cef_rect_t* rect);
int (CEF_CALLBACK *get_root_screen_rect)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, cef_rect_t* rect);
///
// Called to retrieve the view rectangle which is relative to screen
// coordinates. This function must always provide a non-NULL rectangle.
// coordinates. Return true (1) if the rectangle was provided.
///
void(CEF_CALLBACK* get_view_rect)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
cef_rect_t* rect);
int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, cef_rect_t* rect);
///
// Called to retrieve the translation from view coordinates to actual screen
// coordinates. Return true (1) if the screen coordinates were provided.
///
int(CEF_CALLBACK* get_screen_point)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
int viewX,
int viewY,
int* screenX,
int* screenY);
int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, int viewX, int viewY, int* screenX,
int* screenY);
///
// Called to allow the client to fill in the CefScreenInfo object with
@@ -103,25 +88,22 @@ typedef struct _cef_render_handler_t {
// will be used. If the rectangle is still NULL or invalid popups may not be
// drawn correctly.
///
int(CEF_CALLBACK* get_screen_info)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_screen_info_t* screen_info);
int (CEF_CALLBACK *get_screen_info)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, struct _cef_screen_info_t* screen_info);
///
// Called when the browser wants to show or hide the popup widget. The popup
// should be shown if |show| is true (1) and hidden if |show| is false (0).
///
void(CEF_CALLBACK* on_popup_show)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
int show);
void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, int show);
///
// Called when the browser wants to move or resize the popup widget. |rect|
// contains the new location and size in view coordinates.
///
void(CEF_CALLBACK* on_popup_size)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
const cef_rect_t* rect);
void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, const cef_rect_t* rect);
///
// Called when an element should be painted. Pixel values passed to this
@@ -131,33 +113,21 @@ typedef struct _cef_render_handler_t {
// contains the pixel data for the whole image. |dirtyRects| contains the set
// of rectangles in pixel coordinates that need to be repainted. |buffer| will
// be |width|*|height|*4 bytes in size and represents a BGRA image with an
// upper-left origin. This function is only called when
// cef_window_tInfo::shared_texture_enabled is set to false (0).
// upper-left origin.
///
void(CEF_CALLBACK* on_paint)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
cef_paint_element_type_t type,
size_t dirtyRectsCount,
cef_rect_t const* dirtyRects,
const void* buffer,
int width,
int height);
void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, cef_paint_element_type_t type,
size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer,
int width, int height);
///
// Called when an element has been rendered to the shared texture handle.
// |type| indicates whether the element is the view or the popup widget.
// |dirtyRects| contains the set of rectangles in pixel coordinates that need
// to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that
// can be accessed via ID3D11Device using the OpenSharedResource function.
// This function is only called when cef_window_tInfo::shared_texture_enabled
// is set to true (1), and is currently only supported on Windows.
// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
// |custom_cursor_info| will be populated with the custom cursor information.
///
void(CEF_CALLBACK* on_accelerated_paint)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
cef_paint_element_type_t type,
size_t dirtyRectsCount,
cef_rect_t const* dirtyRects,
void* shared_handle);
void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, cef_cursor_handle_t cursor,
cef_cursor_type_t type,
const struct _cef_cursor_info_t* custom_cursor_info);
///
// Called when the user starts dragging content in the web view. Contextual
@@ -173,66 +143,37 @@ typedef struct _cef_render_handler_t {
// synchronously or asynchronously to inform the web view that the drag
// operation has ended.
///
int(CEF_CALLBACK* start_dragging)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_drag_data_t* drag_data,
cef_drag_operations_mask_t allowed_ops,
int x,
int y);
int (CEF_CALLBACK *start_dragging)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, struct _cef_drag_data_t* drag_data,
cef_drag_operations_mask_t allowed_ops, int x, int y);
///
// Called when the web view wants to update the mouse cursor during a drag &
// drop operation. |operation| describes the allowed operation (none, move,
// copy, link).
///
void(CEF_CALLBACK* update_drag_cursor)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
cef_drag_operations_mask_t operation);
void (CEF_CALLBACK *update_drag_cursor)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, cef_drag_operations_mask_t operation);
///
// Called when the scroll offset has changed.
///
void(CEF_CALLBACK* on_scroll_offset_changed)(
struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
double x,
double y);
void (CEF_CALLBACK *on_scroll_offset_changed)(
struct _cef_render_handler_t* self, struct _cef_browser_t* browser,
double x, double y);
///
// Called when the IME composition range has changed. |selected_range| is the
// range of characters that have been selected. |character_bounds| is the
// bounds of each character in view coordinates.
///
void(CEF_CALLBACK* on_ime_composition_range_changed)(
struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
const cef_range_t* selected_range,
size_t character_boundsCount,
void (CEF_CALLBACK *on_ime_composition_range_changed)(
struct _cef_render_handler_t* self, struct _cef_browser_t* browser,
const cef_range_t* selected_range, size_t character_boundsCount,
cef_rect_t const* character_bounds);
///
// Called when text selection has changed for the specified |browser|.
// |selected_text| is the currently selected text and |selected_range| is the
// character range.
///
void(CEF_CALLBACK* on_text_selection_changed)(
struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* selected_text,
const cef_range_t* selected_range);
///
// Called when an on-screen keyboard should be shown or hidden for the
// specified |browser|. |input_mode| specifies what kind of keyboard should be
// opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing keyboard
// for this browser should be hidden.
///
void(CEF_CALLBACK* on_virtual_keyboard_requested)(
struct _cef_render_handler_t* self,
struct _cef_browser_t* browser,
cef_text_input_mode_t input_mode);
} cef_render_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=41339414bca54054046a8f7fbce402a0e0dd8020$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
@@ -53,6 +51,7 @@
extern "C" {
#endif
///
// Structure used to implement render process callbacks. The functions of this
// structure will be called on the render process main thread (TID_RENDERER)
@@ -62,41 +61,57 @@ typedef struct _cef_render_process_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Called after the render process main thread has been created. |extra_info|
// is a read-only value originating from
// cef_browser_process_handler_t::on_render_process_thread_created(). Do not
// keep a reference to |extra_info| outside of this function.
///
void (CEF_CALLBACK *on_render_thread_created)(
struct _cef_render_process_handler_t* self,
struct _cef_list_value_t* extra_info);
///
// Called after WebKit has been initialized.
///
void(CEF_CALLBACK* on_web_kit_initialized)(
void (CEF_CALLBACK *on_web_kit_initialized)(
struct _cef_render_process_handler_t* self);
///
// Called after a browser has been created. When browsing cross-origin a new
// browser will be created before the old browser with the same identifier is
// destroyed. |extra_info| is a read-only value originating from
// cef_browser_host_t::cef_browser_host_create_browser(),
// cef_browser_host_t::cef_browser_host_create_browser_sync(),
// cef_life_span_handler_t::on_before_popup() or
// cef_browser_view_t::cef_browser_view_create().
// destroyed.
///
void(CEF_CALLBACK* on_browser_created)(
void (CEF_CALLBACK *on_browser_created)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_dictionary_value_t* extra_info);
struct _cef_browser_t* browser);
///
// Called before a browser is destroyed.
///
void(CEF_CALLBACK* on_browser_destroyed)(
void (CEF_CALLBACK *on_browser_destroyed)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser);
///
// Return the handler for browser load status events.
///
struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)(
struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)(
struct _cef_render_process_handler_t* self);
///
// Called before browser navigation. Return true (1) to cancel the navigation
// or false (0) to allow the navigation to proceed. The |request| object
// cannot be modified in this callback.
///
int (CEF_CALLBACK *on_before_navigation)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
struct _cef_request_t* request, cef_navigation_type_t navigation_type,
int is_redirect);
///
// Called immediately after the V8 context for a frame has been created. To
// retrieve the JavaScript 'window' object use the
@@ -105,20 +120,18 @@ typedef struct _cef_render_process_handler_t {
// on the associated thread can be retrieved via the
// cef_v8context_t::get_task_runner() function.
///
void(CEF_CALLBACK* on_context_created)(
void (CEF_CALLBACK *on_context_created)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
struct _cef_v8context_t* context);
///
// Called immediately before the V8 context for a frame is released. No
// references to the context should be kept after this function is called.
///
void(CEF_CALLBACK* on_context_released)(
void (CEF_CALLBACK *on_context_released)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
struct _cef_v8context_t* context);
///
@@ -126,12 +139,10 @@ typedef struct _cef_render_process_handler_t {
// callback is disabled by default. To enable set
// CefSettings.uncaught_exception_stack_size > 0.
///
void(CEF_CALLBACK* on_uncaught_exception)(
void (CEF_CALLBACK *on_uncaught_exception)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
struct _cef_v8context_t* context,
struct _cef_v8exception_t* exception,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
struct _cef_v8context_t* context, struct _cef_v8exception_t* exception,
struct _cef_v8stack_trace_t* stackTrace);
///
@@ -142,10 +153,9 @@ typedef struct _cef_render_process_handler_t {
// keep references to or attempt to access any DOM objects outside the scope
// of this function.
///
void(CEF_CALLBACK* on_focused_node_changed)(
void (CEF_CALLBACK *on_focused_node_changed)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
struct _cef_domnode_t* node);
///
@@ -153,14 +163,13 @@ typedef struct _cef_render_process_handler_t {
// (1) if the message was handled or false (0) otherwise. Do not keep a
// reference to or attempt to access the message outside of this callback.
///
int(CEF_CALLBACK* on_process_message_received)(
int (CEF_CALLBACK *on_process_message_received)(
struct _cef_render_process_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
cef_process_id_t source_process,
struct _cef_browser_t* browser, cef_process_id_t source_process,
struct _cef_process_message_t* message);
} cef_render_process_handler_t;
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
// Copyright (c) 2017 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
@@ -33,8 +33,6 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a5e9055958c3588d583d4d128a5d7c8639f39946$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
@@ -57,147 +55,123 @@ typedef struct _cef_request_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns true (1) if this object is read-only.
///
int(CEF_CALLBACK* is_read_only)(struct _cef_request_t* self);
int (CEF_CALLBACK *is_read_only)(struct _cef_request_t* self);
///
// Get the fully qualified URL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_request_t* self);
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self);
///
// Set the fully qualified URL.
///
void(CEF_CALLBACK* set_url)(struct _cef_request_t* self,
const cef_string_t* url);
void (CEF_CALLBACK *set_url)(struct _cef_request_t* self,
const cef_string_t* url);
///
// Get the request function type. The value will default to POST if post data
// is provided and GET otherwise.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_method)(struct _cef_request_t* self);
cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self);
///
// Set the request function type.
///
void(CEF_CALLBACK* set_method)(struct _cef_request_t* self,
const cef_string_t* method);
void (CEF_CALLBACK *set_method)(struct _cef_request_t* self,
const cef_string_t* method);
///
// Set the referrer URL and policy. If non-NULL the referrer URL must be fully
// qualified with an HTTP or HTTPS scheme component. Any username, password or
// ref component will be removed.
///
void(CEF_CALLBACK* set_referrer)(struct _cef_request_t* self,
const cef_string_t* referrer_url,
cef_referrer_policy_t policy);
void (CEF_CALLBACK *set_referrer)(struct _cef_request_t* self,
const cef_string_t* referrer_url, cef_referrer_policy_t policy);
///
// Get the referrer URL.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_referrer_url)(
cef_string_userfree_t (CEF_CALLBACK *get_referrer_url)(
struct _cef_request_t* self);
///
// Get the referrer policy.
///
cef_referrer_policy_t(CEF_CALLBACK* get_referrer_policy)(
cef_referrer_policy_t (CEF_CALLBACK *get_referrer_policy)(
struct _cef_request_t* self);
///
// Get the post data.
///
struct _cef_post_data_t*(CEF_CALLBACK* get_post_data)(
struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)(
struct _cef_request_t* self);
///
// Set the post data.
///
void(CEF_CALLBACK* set_post_data)(struct _cef_request_t* self,
struct _cef_post_data_t* postData);
void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self,
struct _cef_post_data_t* postData);
///
// Get the header values. Will not include the Referer value if any.
///
void(CEF_CALLBACK* get_header_map)(struct _cef_request_t* self,
cef_string_multimap_t headerMap);
void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self,
cef_string_multimap_t headerMap);
///
// Set the header values. If a Referer value exists in the header map it will
// be removed and ignored.
///
void(CEF_CALLBACK* set_header_map)(struct _cef_request_t* self,
cef_string_multimap_t headerMap);
///
// Returns the first header value for |name| or an NULL string if not found.
// Will not return the Referer value if any. Use GetHeaderMap instead if
// |name| might have multiple values.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_header_by_name)(
struct _cef_request_t* self,
const cef_string_t* name);
///
// Set the header |name| to |value|. If |overwrite| is true (1) any existing
// values will be replaced with the new value. If |overwrite| is false (0) any
// existing values will not be overwritten. The Referer value cannot be set
// using this function.
///
void(CEF_CALLBACK* set_header_by_name)(struct _cef_request_t* self,
const cef_string_t* name,
const cef_string_t* value,
int overwrite);
void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self,
cef_string_multimap_t headerMap);
///
// Set all values at one time.
///
void(CEF_CALLBACK* set)(struct _cef_request_t* self,
const cef_string_t* url,
const cef_string_t* method,
struct _cef_post_data_t* postData,
cef_string_multimap_t headerMap);
void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url,
const cef_string_t* method, struct _cef_post_data_t* postData,
cef_string_multimap_t headerMap);
///
// Get the flags used in combination with cef_urlrequest_t. See
// cef_urlrequest_flags_t for supported values.
///
int(CEF_CALLBACK* get_flags)(struct _cef_request_t* self);
int (CEF_CALLBACK *get_flags)(struct _cef_request_t* self);
///
// Set the flags used in combination with cef_urlrequest_t. See
// cef_urlrequest_flags_t for supported values.
///
void(CEF_CALLBACK* set_flags)(struct _cef_request_t* self, int flags);
///
// Get the URL to the first party for cookies used in combination with
// cef_urlrequest_t.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_first_party_for_cookies)(
struct _cef_request_t* self);
void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self, int flags);
///
// Set the URL to the first party for cookies used in combination with
// cef_urlrequest_t.
///
void(CEF_CALLBACK* set_first_party_for_cookies)(struct _cef_request_t* self,
const cef_string_t* url);
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)(
struct _cef_request_t* self);
///
// Get the URL to the first party for cookies used in combination with
// cef_urlrequest_t.
///
void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self,
const cef_string_t* url);
///
// Get the resource type for this request. Only available in the browser
// process.
///
cef_resource_type_t(CEF_CALLBACK* get_resource_type)(
cef_resource_type_t (CEF_CALLBACK *get_resource_type)(
struct _cef_request_t* self);
///
@@ -205,22 +179,24 @@ typedef struct _cef_request_t {
// process and only applies to requests that represent a main frame or sub-
// frame navigation.
///
cef_transition_type_t(CEF_CALLBACK* get_transition_type)(
cef_transition_type_t (CEF_CALLBACK *get_transition_type)(
struct _cef_request_t* self);
///
// Returns the globally unique identifier for this request or 0 if not
// specified. Can be used by cef_resource_request_handler_t implementations in
// the browser process to track a single request across multiple callbacks.
// specified. Can be used by cef_request_tHandler implementations in the
// browser process to track a single request across multiple callbacks.
///
uint64(CEF_CALLBACK* get_identifier)(struct _cef_request_t* self);
uint64 (CEF_CALLBACK *get_identifier)(struct _cef_request_t* self);
} cef_request_t;
///
// Create a new cef_request_t object.
///
CEF_EXPORT cef_request_t* cef_request_create();
///
// Structure used to represent post data for a web request. The functions of
// this structure may be called on any thread.
@@ -229,12 +205,12 @@ typedef struct _cef_post_data_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns true (1) if this object is read-only.
///
int(CEF_CALLBACK* is_read_only)(struct _cef_post_data_t* self);
int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_t* self);
///
// Returns true (1) if the underlying POST data includes elements that are not
@@ -242,44 +218,45 @@ typedef struct _cef_post_data_t {
// upload data). Modifying cef_post_data_t objects with excluded elements may
// result in the request failing.
///
int(CEF_CALLBACK* has_excluded_elements)(struct _cef_post_data_t* self);
int (CEF_CALLBACK *has_excluded_elements)(struct _cef_post_data_t* self);
///
// Returns the number of existing post data elements.
///
size_t(CEF_CALLBACK* get_element_count)(struct _cef_post_data_t* self);
size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self);
///
// Retrieve the post data elements.
///
void(CEF_CALLBACK* get_elements)(struct _cef_post_data_t* self,
size_t* elementsCount,
struct _cef_post_data_element_t** elements);
void (CEF_CALLBACK *get_elements)(struct _cef_post_data_t* self,
size_t* elementsCount, struct _cef_post_data_element_t** elements);
///
// Remove the specified post data element. Returns true (1) if the removal
// succeeds.
///
int(CEF_CALLBACK* remove_element)(struct _cef_post_data_t* self,
struct _cef_post_data_element_t* element);
int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self,
struct _cef_post_data_element_t* element);
///
// Add the specified post data element. Returns true (1) if the add succeeds.
///
int(CEF_CALLBACK* add_element)(struct _cef_post_data_t* self,
struct _cef_post_data_element_t* element);
int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self,
struct _cef_post_data_element_t* element);
///
// Remove all existing post data elements.
///
void(CEF_CALLBACK* remove_elements)(struct _cef_post_data_t* self);
void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self);
} cef_post_data_t;
///
// Create a new cef_post_data_t object.
///
CEF_EXPORT cef_post_data_t* cef_post_data_create();
///
// Structure used to represent a single element in the request post data. The
// functions of this structure may be called on any thread.
@@ -288,64 +265,64 @@ typedef struct _cef_post_data_element_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
cef_base_t base;
///
// Returns true (1) if this object is read-only.
///
int(CEF_CALLBACK* is_read_only)(struct _cef_post_data_element_t* self);
int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_element_t* self);
///
// Remove all contents from the post data element.
///
void(CEF_CALLBACK* set_to_empty)(struct _cef_post_data_element_t* self);
void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self);
///
// The post data element will represent a file.
///
void(CEF_CALLBACK* set_to_file)(struct _cef_post_data_element_t* self,
const cef_string_t* fileName);
void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self,
const cef_string_t* fileName);
///
// The post data element will represent bytes. The bytes passed in will be
// copied.
///
void(CEF_CALLBACK* set_to_bytes)(struct _cef_post_data_element_t* self,
size_t size,
const void* bytes);
void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self,
size_t size, const void* bytes);
///
// Return the type of this post data element.
///
cef_postdataelement_type_t(CEF_CALLBACK* get_type)(
cef_postdataelement_type_t (CEF_CALLBACK *get_type)(
struct _cef_post_data_element_t* self);
///
// Return the file name.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_file)(
cef_string_userfree_t (CEF_CALLBACK *get_file)(
struct _cef_post_data_element_t* self);
///
// Return the number of bytes.
///
size_t(CEF_CALLBACK* get_bytes_count)(struct _cef_post_data_element_t* self);
size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self);
///
// Read up to |size| bytes into |bytes| and return the number of bytes
// actually read.
///
size_t(CEF_CALLBACK* get_bytes)(struct _cef_post_data_element_t* self,
size_t size,
void* bytes);
size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self,
size_t size, void* bytes);
} cef_post_data_element_t;
///
// Create a new cef_post_data_element_t object.
///
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
#ifdef __cplusplus
}
#endif

Some files were not shown because too many files have changed in this diff Show More