mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4d96f07fa | ||
|
|
38a79951bd | ||
|
|
09ee681fc4 | ||
|
|
5b52963ff1 | ||
|
|
b356923f5c | ||
|
|
1d9e261d11 | ||
|
|
0fd0d6f4b5 | ||
|
|
10b22a327d | ||
|
|
0bace85a34 | ||
|
|
6a963ca044 | ||
|
|
4b61a8c493 | ||
|
|
1ca15ab88b | ||
|
|
ffef496b4f | ||
|
|
89e9ab5eee | ||
|
|
1c8e13da00 | ||
|
|
b156d790e3 | ||
|
|
f7bea2419e | ||
|
|
2ca342be3a | ||
|
|
c543ee7ea9 | ||
|
|
db9541fd94 | ||
|
|
0c2cc26f2b | ||
|
|
f065600a2c | ||
|
|
7827ac9545 | ||
|
|
7644125cac | ||
|
|
40dcd29b63 | ||
|
|
7eb813e7e7 | ||
|
|
506b164714 | ||
|
|
9059374bf6 | ||
|
|
5c40d9fcee | ||
|
|
24b43360f2 | ||
|
|
ab0fdbc7a3 |
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen and what happened instead.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Versions (please complete the following information):**
|
|
||||||
- OS: [e.g. Windows 10, MacOS 13.2, Ubuntu 22.10]
|
|
||||||
- CEF Version: [e.g. 111.2.2]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Does the problem reproduce with the cefclient or cefsimple sample application at the same version?
|
|
||||||
|
|
||||||
Does the problem reproduce with Google Chrome at the same version?
|
|
||||||
|
|
||||||
Add any other context about the problem here.
|
|
||||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
||||||
@@ -7,6 +7,6 @@
|
|||||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||||
|
|
||||||
{
|
{
|
||||||
'chromium_checkout': 'refs/tags/124.0.6367.207',
|
'chromium_checkout': 'refs/tags/94.0.4606.81',
|
||||||
'depot_tools_checkout': '19199514e8'
|
'depot_tools_checkout': '64a9f33bdd'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,16 +33,17 @@
|
|||||||
'chrome/browser/extensions/chrome_extension_web_contents_observer.*',
|
'chrome/browser/extensions/chrome_extension_web_contents_observer.*',
|
||||||
'chrome/browser/extensions/component_loader.*',
|
'chrome/browser/extensions/component_loader.*',
|
||||||
'chrome/browser/extensions/extension_service.*',
|
'chrome/browser/extensions/extension_service.*',
|
||||||
|
'chrome/browser/printing/print_view_manager*',
|
||||||
|
'chrome/browser/printing/printing_message_filter*',
|
||||||
'chrome/browser/profiles/profile.h',
|
'chrome/browser/profiles/profile.h',
|
||||||
'chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.*',
|
'chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.*',
|
||||||
'chrome/common/extensions/api/*_features.json',
|
'chrome/common/extensions/api/*_features.json',
|
||||||
'chrome/renderer/chrome_content_renderer_client.*',
|
'chrome/renderer/chrome_content_renderer_client.*',
|
||||||
'chrome/renderer/extensions/chrome_extensions_renderer_client.*',
|
'chrome/renderer/extensions/chrome_extensions_renderer_client.*',
|
||||||
'components/content_settings/core/common/content_settings_types.mojom',
|
|
||||||
'components/permissions/request_type.h',
|
|
||||||
'content/browser/renderer_host/render_widget_host_view_base.*',
|
'content/browser/renderer_host/render_widget_host_view_base.*',
|
||||||
'content/public/browser/content_browser_client.*',
|
'content/public/browser/content_browser_client.*',
|
||||||
'content/public/browser/render_widget_host_view.h',
|
'content/public/browser/render_widget_host_view.h',
|
||||||
|
'content/public/browser/storage_partition.h',
|
||||||
'content/public/browser/web_contents_delegate.h',
|
'content/public/browser/web_contents_delegate.h',
|
||||||
'content/public/common/content_features.cc',
|
'content/public/common/content_features.cc',
|
||||||
'content/shell/BUILD.gn',
|
'content/shell/BUILD.gn',
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
# distribution include:
|
# distribution include:
|
||||||
#
|
#
|
||||||
# Linux: Ninja, GCC 7.5.0+, Unix Makefiles
|
# Linux: Ninja, GCC 7.5.0+, Unix Makefiles
|
||||||
# MacOS: Ninja, Xcode 12.2 to 15.0
|
# MacOS: Ninja, Xcode 12.2 to 12.5
|
||||||
# Windows: Ninja, Visual Studio 2022
|
# Windows: Ninja, Visual Studio 2019+
|
||||||
#
|
#
|
||||||
# Ninja is a cross-platform open-source tool for running fast builds using
|
# 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
|
# pre-installed platform toolchains (GNU, clang, Xcode or MSVC). It can be
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#
|
#
|
||||||
# The below requirements must be met to build this CEF binary distribution.
|
# The below requirements must be met to build this CEF binary distribution.
|
||||||
#
|
#
|
||||||
# - CMake version 3.21 or newer.
|
# - CMake version 2.8.12.1 or newer.
|
||||||
#
|
#
|
||||||
# - Linux requirements:
|
# - Linux requirements:
|
||||||
# Currently supported distributions include Debian 10 (Buster), Ubuntu 18
|
# Currently supported distributions include Debian 10 (Buster), Ubuntu 18
|
||||||
@@ -48,15 +48,15 @@
|
|||||||
# libgtk3.0-dev (required by the cefclient target only)
|
# libgtk3.0-dev (required by the cefclient target only)
|
||||||
#
|
#
|
||||||
# - MacOS requirements:
|
# - MacOS requirements:
|
||||||
# Xcode 12.2 to 15.0 building on MacOS 10.15.4 (Catalina) or newer. Only
|
# Xcode 12.2 to 12.5 building on MacOS 10.15.4 (Catalina) or newer. Only
|
||||||
# 64-bit builds are supported. The Xcode command-line tools must also be
|
# 64-bit builds are supported. The Xcode command-line tools must also be
|
||||||
# installed. Newer Xcode versions may not have been been tested and are not
|
# installed. Newer Xcode versions may not have been been tested and are not
|
||||||
# recommended.
|
# recommended.
|
||||||
#
|
#
|
||||||
# - Windows requirements:
|
# - Windows requirements:
|
||||||
# Visual Studio 2022 building on Windows 10 or newer. Windows 10/11 64-bit is
|
# Visual Studio 2019 or newer building on Windows 7 or newer. Windows 10
|
||||||
# recommended. Newer versions will likely also work but may not have been
|
# 64-bit is recommended. Newer versions will likely also work but may not have
|
||||||
# tested.
|
# been tested.
|
||||||
#
|
#
|
||||||
# BUILD EXAMPLES
|
# BUILD EXAMPLES
|
||||||
#
|
#
|
||||||
@@ -96,35 +96,35 @@
|
|||||||
# > ninja cefclient cefsimple
|
# > ninja cefclient cefsimple
|
||||||
#
|
#
|
||||||
# To perform a Windows build using a 32-bit CEF binary distribution:
|
# To perform a Windows build using a 32-bit CEF binary distribution:
|
||||||
# Using the Visual Studio 2022 IDE:
|
# Using the Visual Studio 2019 IDE:
|
||||||
# > cmake -G "Visual Studio 17" -A Win32 ..
|
# > cmake -G "Visual Studio 16" -A Win32 ..
|
||||||
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
|
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
|
||||||
#
|
#
|
||||||
# Using Ninja with Visual Studio 2022 command-line tools:
|
# Using Ninja with Visual Studio 2019 command-line tools:
|
||||||
# (this path may be different depending on your Visual Studio installation)
|
# (this path may be different depending on your Visual Studio installation)
|
||||||
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars32.bat"
|
# > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars32.bat"
|
||||||
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
# > ninja cefclient cefsimple
|
# > ninja cefclient cefsimple
|
||||||
#
|
#
|
||||||
# To perform a Windows build using a 64-bit CEF binary distribution:
|
# To perform a Windows build using a 64-bit CEF binary distribution:
|
||||||
# Using the Visual Studio 2022 IDE:
|
# Using the Visual Studio 2019 IDE:
|
||||||
# > cmake -G "Visual Studio 17" -A x64 ..
|
# > cmake -G "Visual Studio 16" -A x64 ..
|
||||||
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
|
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
|
||||||
#
|
#
|
||||||
# Using Ninja with Visual Studio 2022 command-line tools:
|
# Using Ninja with Visual Studio 2019 command-line tools:
|
||||||
# (this path may be different depending on your Visual Studio installation)
|
# (this path may be different depending on your Visual Studio installation)
|
||||||
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat"
|
# > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
# > ninja cefclient cefsimple
|
# > ninja cefclient cefsimple
|
||||||
#
|
#
|
||||||
# To perform a Windows build using an ARM64 CEF binary distribution:
|
# To perform a Windows build using an ARM64 CEF binary distribution:
|
||||||
# Using the Visual Studio 2022 IDE:
|
# Using the Visual Studio 2019 IDE:
|
||||||
# > cmake -G "Visual Studio 17" -A arm64 ..
|
# > cmake -G "Visual Studio 16" -A arm64 ..
|
||||||
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
|
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
|
||||||
#
|
#
|
||||||
# Using Ninja with Visual Studio 2022 command-line tools:
|
# Using Ninja with Visual Studio 2019 command-line tools:
|
||||||
# (this path may be different depending on your Visual Studio installation)
|
# (this path may be different depending on your Visual Studio installation)
|
||||||
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
|
# > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
|
||||||
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
# > ninja cefsimple
|
# > ninja cefsimple
|
||||||
|
|
||||||
@@ -132,8 +132,7 @@
|
|||||||
# Global setup.
|
# Global setup.
|
||||||
#
|
#
|
||||||
|
|
||||||
# For VS2022 and Xcode 12+ support.
|
cmake_minimum_required(VERSION 2.8.12.1)
|
||||||
cmake_minimum_required(VERSION 3.21)
|
|
||||||
|
|
||||||
# Only generate Debug and Release configuration types.
|
# Only generate Debug and Release configuration types.
|
||||||
set(CMAKE_CONFIGURATION_TYPES Debug Release)
|
set(CMAKE_CONFIGURATION_TYPES Debug Release)
|
||||||
@@ -234,22 +233,3 @@ endif()
|
|||||||
|
|
||||||
# Display configuration settings.
|
# Display configuration settings.
|
||||||
PRINT_CEF_CONFIG()
|
PRINT_CEF_CONFIG()
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Define the API documentation target.
|
|
||||||
#
|
|
||||||
|
|
||||||
find_package(Doxygen)
|
|
||||||
if(DOXYGEN_FOUND)
|
|
||||||
add_custom_target(apidocs ALL
|
|
||||||
# Generate documentation in the docs/html directory.
|
|
||||||
COMMAND "${DOXYGEN_EXECUTABLE}" Doxyfile
|
|
||||||
# Write a docs/index.html file.
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL='html/index.html'\"/></head></html>" > docs/index.html
|
|
||||||
WORKING_DIRECTORY "${CEF_ROOT}"
|
|
||||||
COMMENT "Generating API documentation with Doxygen..."
|
|
||||||
VERBATIM )
|
|
||||||
else()
|
|
||||||
message(WARNING "Doxygen must be installed to generate API documentation.")
|
|
||||||
endif()
|
|
||||||
|
|||||||
23
README.md
23
README.md
@@ -9,8 +9,8 @@ The Chromium Embedded Framework (CEF) is a simple framework for embedding Chromi
|
|||||||
* Branches and Building - https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
* Branches and Building - https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||||
* Announcements - https://groups.google.com/forum/#!forum/cef-announce
|
* Announcements - https://groups.google.com/forum/#!forum/cef-announce
|
||||||
* Support Forum - http://www.magpcss.org/ceforum/
|
* Support Forum - http://www.magpcss.org/ceforum/
|
||||||
* Issue Tracker - https://github.com/chromiumembedded/cef/issues
|
* CEF1 C++ API Docs - http://magpcss.org/ceforum/apidocs/
|
||||||
* C++ API Docs - [Stable release docs](https://cef-builds.spotifycdn.com/docs/stable.html) / [Beta release docs](https://cef-builds.spotifycdn.com/docs/beta.html)
|
* CEF3 C++ API Docs - http://magpcss.org/ceforum/apidocs3/
|
||||||
* Downloads - https://cef-builds.spotifycdn.com/index.html
|
* Downloads - https://cef-builds.spotifycdn.com/index.html
|
||||||
* Donations - http://www.magpcss.org/ceforum/donate.php
|
* Donations - http://www.magpcss.org/ceforum/donate.php
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ Numerous individuals and organizations contribute time and resources to support
|
|||||||
|
|
||||||
# Getting Started
|
# Getting Started
|
||||||
|
|
||||||
Users new to CEF development should start by reading the [Tutorial](https://bitbucket.org/chromiumembedded/cef/wiki/Tutorial) Wiki page for an overview of CEF usage and then proceed to the [GeneralUsage](https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage) Wiki page for a more in-depth discussion or architectural and usage issues. Complete API documentation is available [here](https://cef-builds.spotifycdn.com/docs/stable.html). CEF support and related discussion is available on the [CEF Forum](http://www.magpcss.org/ceforum/).
|
Users new to CEF development should start by reading the [Tutorial](https://bitbucket.org/chromiumembedded/cef/wiki/Tutorial) Wiki page for an overview of CEF usage and then proceed to the [GeneralUsage](https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage) Wiki page for a more in-depth discussion or architectural and usage issues. Complete API documentation is available [here](http://magpcss.org/ceforum/apidocs3/). CEF support and related discussion is available on the [CEF Forum](http://www.magpcss.org/ceforum/).
|
||||||
|
|
||||||
# Binary Distributions
|
# Binary Distributions
|
||||||
|
|
||||||
@@ -45,12 +45,15 @@ The base CEF framework includes support for the C and C++ programming languages.
|
|||||||
|
|
||||||
* .Net (CEF3) - https://github.com/cefsharp/CefSharp
|
* .Net (CEF3) - https://github.com/cefsharp/CefSharp
|
||||||
* .Net (CEF1) - https://bitbucket.org/fddima/cefglue
|
* .Net (CEF1) - https://bitbucket.org/fddima/cefglue
|
||||||
* .Net/Mono (CEF3) - https://gitlab.com/xiliumhq/chromiumembedded/cefglue
|
* .Net/Mono (CEF3) - https://bitbucket.org/xilium/xilium.cefglue
|
||||||
* Delphi - https://github.com/hgourvest/dcef3
|
* .Net (CEF3) - https://bitbucket.org/chromiumfx/chromiumfx
|
||||||
* Delphi - https://github.com/salvadordf/CEF4Delphi
|
* 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
|
||||||
* Go - https://github.com/CzarekTomczak/cef2go
|
* Go - https://github.com/CzarekTomczak/cef2go
|
||||||
* Go - https://github.com/energye/energy
|
|
||||||
* Java - https://bitbucket.org/chromiumembedded/java-cef
|
* Java - https://bitbucket.org/chromiumembedded/java-cef
|
||||||
|
* Java - http://code.google.com/p/javacef/
|
||||||
* Python - http://code.google.com/p/cefpython/
|
* Python - http://code.google.com/p/cefpython/
|
||||||
|
|
||||||
If you're the maintainer of a project not listed above and would like your project listed here please either post to the [CEF Forum](http://www.magpcss.org/ceforum/) or contact Marshall directly.
|
If you're the maintainer of a project not listed above and would like your project listed here please either post to the [CEF Forum](http://www.magpcss.org/ceforum/) or contact Marshall directly.
|
||||||
@@ -59,7 +62,7 @@ If you're the maintainer of a project not listed above and would like your proje
|
|||||||
|
|
||||||
CEF is still very much a work in progress. Some ways that you can help out:
|
CEF is still very much a work in progress. Some ways that you can help out:
|
||||||
|
|
||||||
\- Vote for issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) that are important to you. This helps with development prioritization.
|
\- Vote for issues in the [CEF issue tracker](https://bitbucket.org/chromiumembedded/cef/issues?status=new&status=open) that are important to you. This helps with development prioritization.
|
||||||
|
|
||||||
\- Report any bugs that you find or feature requests that are important to you. Make sure to first search for existing issues before creating new ones. Please use the [CEF Forum](http://magpcss.org/ceforum) and not the issue tracker for usage questions. Each CEF issue should:
|
\- Report any bugs that you find or feature requests that are important to you. Make sure to first search for existing issues before creating new ones. Please use the [CEF Forum](http://magpcss.org/ceforum) and not the issue tracker for usage questions. Each CEF issue should:
|
||||||
|
|
||||||
@@ -70,7 +73,7 @@ CEF is still very much a work in progress. Some ways that you can help out:
|
|||||||
|
|
||||||
\- Write unit tests for new or existing functionality.
|
\- Write unit tests for new or existing functionality.
|
||||||
|
|
||||||
\- Pull requests and patches are welcome. View open issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) or search for TODO(cef) in the source code for ideas.
|
\- Pull requests and patches are welcome. View open issues in the [CEF issue tracker](https://bitbucket.org/chromiumembedded/cef/issues?status=new&status=open) or search for TODO(cef) in the source code for ideas.
|
||||||
|
|
||||||
If you would like to contribute source code changes to CEF please follow the below guidelines:
|
If you would like to contribute source code changes to CEF please follow the below guidelines:
|
||||||
|
|
||||||
@@ -79,6 +82,6 @@ If you would like to contribute source code changes to CEF please follow the bel
|
|||||||
\- Submit a [pull request](https://bitbucket.org/chromiumembedded/cef/wiki/ContributingWithGit) or create a patch with your changes and attach it to the CEF issue. Changes should:
|
\- Submit a [pull request](https://bitbucket.org/chromiumembedded/cef/wiki/ContributingWithGit) or create a patch with your changes and attach it to the CEF issue. Changes should:
|
||||||
|
|
||||||
* 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.
|
* 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 C++ style guide](https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md).
|
* 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.
|
* Include new or modified unit tests as appropriate to the functionality.
|
||||||
* Not include unnecessary or unrelated changes.
|
* Not include unnecessary or unrelated changes.
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
@echo off
|
@echo off
|
||||||
python3.bat tools\gclient_hook.py
|
python.bat tools\gclient_hook.py
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
python3 tools/gclient_hook.py
|
python tools/gclient_hook.py
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
|
# Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights
|
||||||
# reserved. Use of this source code is governed by a BSD-style license that
|
# reserved. Use of this source code is governed by a BSD-style license that
|
||||||
# can be found in the LICENSE file.
|
# can be found in the LICENSE file.
|
||||||
#
|
#
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
# by hand. See the translator.README.txt file in the tools directory for
|
# by hand. See the translator.README.txt file in the tools directory for
|
||||||
# more information.
|
# more information.
|
||||||
#
|
#
|
||||||
# $hash=3b28f3236c16d2b776a44674ae3bae0a070e9f27$
|
# $hash=216bf0511bdceca67cdbdcf30f8316db2d00e276$
|
||||||
#
|
#
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,6 @@
|
|||||||
'include/cef_browser_process_handler.h',
|
'include/cef_browser_process_handler.h',
|
||||||
'include/cef_callback.h',
|
'include/cef_callback.h',
|
||||||
'include/cef_client.h',
|
'include/cef_client.h',
|
||||||
'include/cef_command_handler.h',
|
|
||||||
'include/cef_command_line.h',
|
'include/cef_command_line.h',
|
||||||
'include/cef_context_menu_handler.h',
|
'include/cef_context_menu_handler.h',
|
||||||
'include/cef_cookie.h',
|
'include/cef_cookie.h',
|
||||||
@@ -55,8 +54,6 @@
|
|||||||
'include/cef_origin_whitelist.h',
|
'include/cef_origin_whitelist.h',
|
||||||
'include/cef_parser.h',
|
'include/cef_parser.h',
|
||||||
'include/cef_path_util.h',
|
'include/cef_path_util.h',
|
||||||
'include/cef_permission_handler.h',
|
|
||||||
'include/cef_preference.h',
|
|
||||||
'include/cef_print_handler.h',
|
'include/cef_print_handler.h',
|
||||||
'include/cef_print_settings.h',
|
'include/cef_print_settings.h',
|
||||||
'include/cef_process_message.h',
|
'include/cef_process_message.h',
|
||||||
@@ -65,6 +62,7 @@
|
|||||||
'include/cef_render_handler.h',
|
'include/cef_render_handler.h',
|
||||||
'include/cef_render_process_handler.h',
|
'include/cef_render_process_handler.h',
|
||||||
'include/cef_request.h',
|
'include/cef_request.h',
|
||||||
|
'include/cef_request_callback.h',
|
||||||
'include/cef_request_context.h',
|
'include/cef_request_context.h',
|
||||||
'include/cef_request_context_handler.h',
|
'include/cef_request_context_handler.h',
|
||||||
'include/cef_request_handler.h',
|
'include/cef_request_handler.h',
|
||||||
@@ -76,8 +74,6 @@
|
|||||||
'include/cef_response_filter.h',
|
'include/cef_response_filter.h',
|
||||||
'include/cef_scheme.h',
|
'include/cef_scheme.h',
|
||||||
'include/cef_server.h',
|
'include/cef_server.h',
|
||||||
'include/cef_shared_memory_region.h',
|
|
||||||
'include/cef_shared_process_message_builder.h',
|
|
||||||
'include/cef_ssl_info.h',
|
'include/cef_ssl_info.h',
|
||||||
'include/cef_ssl_status.h',
|
'include/cef_ssl_status.h',
|
||||||
'include/cef_stream.h',
|
'include/cef_stream.h',
|
||||||
@@ -85,16 +81,15 @@
|
|||||||
'include/cef_task.h',
|
'include/cef_task.h',
|
||||||
'include/cef_thread.h',
|
'include/cef_thread.h',
|
||||||
'include/cef_trace.h',
|
'include/cef_trace.h',
|
||||||
'include/cef_unresponsive_process_callback.h',
|
|
||||||
'include/cef_urlrequest.h',
|
'include/cef_urlrequest.h',
|
||||||
'include/cef_v8.h',
|
'include/cef_v8.h',
|
||||||
'include/cef_values.h',
|
'include/cef_values.h',
|
||||||
'include/cef_waitable_event.h',
|
'include/cef_waitable_event.h',
|
||||||
|
'include/cef_web_plugin.h',
|
||||||
'include/cef_x509_certificate.h',
|
'include/cef_x509_certificate.h',
|
||||||
'include/cef_xml_reader.h',
|
'include/cef_xml_reader.h',
|
||||||
'include/cef_zip_reader.h',
|
'include/cef_zip_reader.h',
|
||||||
'include/test/cef_test_helpers.h',
|
'include/test/cef_test_helpers.h',
|
||||||
'include/test/cef_test_server.h',
|
|
||||||
'include/test/cef_translator_test.h',
|
'include/test/cef_translator_test.h',
|
||||||
'include/views/cef_box_layout.h',
|
'include/views/cef_box_layout.h',
|
||||||
'include/views/cef_browser_view.h',
|
'include/views/cef_browser_view.h',
|
||||||
@@ -127,7 +122,6 @@
|
|||||||
'include/capi/cef_browser_process_handler_capi.h',
|
'include/capi/cef_browser_process_handler_capi.h',
|
||||||
'include/capi/cef_callback_capi.h',
|
'include/capi/cef_callback_capi.h',
|
||||||
'include/capi/cef_client_capi.h',
|
'include/capi/cef_client_capi.h',
|
||||||
'include/capi/cef_command_handler_capi.h',
|
|
||||||
'include/capi/cef_command_line_capi.h',
|
'include/capi/cef_command_line_capi.h',
|
||||||
'include/capi/cef_context_menu_handler_capi.h',
|
'include/capi/cef_context_menu_handler_capi.h',
|
||||||
'include/capi/cef_cookie_capi.h',
|
'include/capi/cef_cookie_capi.h',
|
||||||
@@ -160,8 +154,6 @@
|
|||||||
'include/capi/cef_origin_whitelist_capi.h',
|
'include/capi/cef_origin_whitelist_capi.h',
|
||||||
'include/capi/cef_parser_capi.h',
|
'include/capi/cef_parser_capi.h',
|
||||||
'include/capi/cef_path_util_capi.h',
|
'include/capi/cef_path_util_capi.h',
|
||||||
'include/capi/cef_permission_handler_capi.h',
|
|
||||||
'include/capi/cef_preference_capi.h',
|
|
||||||
'include/capi/cef_print_handler_capi.h',
|
'include/capi/cef_print_handler_capi.h',
|
||||||
'include/capi/cef_print_settings_capi.h',
|
'include/capi/cef_print_settings_capi.h',
|
||||||
'include/capi/cef_process_message_capi.h',
|
'include/capi/cef_process_message_capi.h',
|
||||||
@@ -170,6 +162,7 @@
|
|||||||
'include/capi/cef_render_handler_capi.h',
|
'include/capi/cef_render_handler_capi.h',
|
||||||
'include/capi/cef_render_process_handler_capi.h',
|
'include/capi/cef_render_process_handler_capi.h',
|
||||||
'include/capi/cef_request_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_capi.h',
|
||||||
'include/capi/cef_request_context_handler_capi.h',
|
'include/capi/cef_request_context_handler_capi.h',
|
||||||
'include/capi/cef_request_handler_capi.h',
|
'include/capi/cef_request_handler_capi.h',
|
||||||
@@ -181,8 +174,6 @@
|
|||||||
'include/capi/cef_response_filter_capi.h',
|
'include/capi/cef_response_filter_capi.h',
|
||||||
'include/capi/cef_scheme_capi.h',
|
'include/capi/cef_scheme_capi.h',
|
||||||
'include/capi/cef_server_capi.h',
|
'include/capi/cef_server_capi.h',
|
||||||
'include/capi/cef_shared_memory_region_capi.h',
|
|
||||||
'include/capi/cef_shared_process_message_builder_capi.h',
|
|
||||||
'include/capi/cef_ssl_info_capi.h',
|
'include/capi/cef_ssl_info_capi.h',
|
||||||
'include/capi/cef_ssl_status_capi.h',
|
'include/capi/cef_ssl_status_capi.h',
|
||||||
'include/capi/cef_stream_capi.h',
|
'include/capi/cef_stream_capi.h',
|
||||||
@@ -190,16 +181,15 @@
|
|||||||
'include/capi/cef_task_capi.h',
|
'include/capi/cef_task_capi.h',
|
||||||
'include/capi/cef_thread_capi.h',
|
'include/capi/cef_thread_capi.h',
|
||||||
'include/capi/cef_trace_capi.h',
|
'include/capi/cef_trace_capi.h',
|
||||||
'include/capi/cef_unresponsive_process_callback_capi.h',
|
|
||||||
'include/capi/cef_urlrequest_capi.h',
|
'include/capi/cef_urlrequest_capi.h',
|
||||||
'include/capi/cef_v8_capi.h',
|
'include/capi/cef_v8_capi.h',
|
||||||
'include/capi/cef_values_capi.h',
|
'include/capi/cef_values_capi.h',
|
||||||
'include/capi/cef_waitable_event_capi.h',
|
'include/capi/cef_waitable_event_capi.h',
|
||||||
|
'include/capi/cef_web_plugin_capi.h',
|
||||||
'include/capi/cef_x509_certificate_capi.h',
|
'include/capi/cef_x509_certificate_capi.h',
|
||||||
'include/capi/cef_xml_reader_capi.h',
|
'include/capi/cef_xml_reader_capi.h',
|
||||||
'include/capi/cef_zip_reader_capi.h',
|
'include/capi/cef_zip_reader_capi.h',
|
||||||
'include/capi/test/cef_test_helpers_capi.h',
|
'include/capi/test/cef_test_helpers_capi.h',
|
||||||
'include/capi/test/cef_test_server_capi.h',
|
|
||||||
'include/capi/test/cef_translator_test_capi.h',
|
'include/capi/test/cef_translator_test_capi.h',
|
||||||
'include/capi/views/cef_box_layout_capi.h',
|
'include/capi/views/cef_box_layout_capi.h',
|
||||||
'include/capi/views/cef_browser_view_capi.h',
|
'include/capi/views/cef_browser_view_capi.h',
|
||||||
@@ -256,8 +246,6 @@
|
|||||||
'libcef_dll/cpptoc/callback_cpptoc.h',
|
'libcef_dll/cpptoc/callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/client_ctocpp.cc',
|
'libcef_dll/ctocpp/client_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/client_ctocpp.h',
|
'libcef_dll/ctocpp/client_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/command_handler_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/command_handler_ctocpp.h',
|
|
||||||
'libcef_dll/cpptoc/command_line_cpptoc.cc',
|
'libcef_dll/cpptoc/command_line_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/command_line_cpptoc.h',
|
'libcef_dll/cpptoc/command_line_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/completion_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/completion_callback_ctocpp.cc',
|
||||||
@@ -340,8 +328,6 @@
|
|||||||
'libcef_dll/cpptoc/list_value_cpptoc.h',
|
'libcef_dll/cpptoc/list_value_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/load_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/load_handler_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/load_handler_ctocpp.h',
|
'libcef_dll/ctocpp/load_handler_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/media_access_callback_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/media_access_callback_cpptoc.h',
|
|
||||||
'libcef_dll/ctocpp/media_observer_ctocpp.cc',
|
'libcef_dll/ctocpp/media_observer_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/media_observer_ctocpp.h',
|
'libcef_dll/ctocpp/media_observer_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/media_route_cpptoc.cc',
|
'libcef_dll/cpptoc/media_route_cpptoc.cc',
|
||||||
@@ -378,18 +364,10 @@
|
|||||||
'libcef_dll/ctocpp/views/panel_delegate_ctocpp.h',
|
'libcef_dll/ctocpp/views/panel_delegate_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/pdf_print_callback_ctocpp.h',
|
'libcef_dll/ctocpp/pdf_print_callback_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/permission_handler_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/permission_handler_ctocpp.h',
|
|
||||||
'libcef_dll/cpptoc/permission_prompt_callback_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/permission_prompt_callback_cpptoc.h',
|
|
||||||
'libcef_dll/cpptoc/post_data_cpptoc.cc',
|
'libcef_dll/cpptoc/post_data_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/post_data_cpptoc.h',
|
'libcef_dll/cpptoc/post_data_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/post_data_element_cpptoc.cc',
|
'libcef_dll/cpptoc/post_data_element_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/post_data_element_cpptoc.h',
|
'libcef_dll/cpptoc/post_data_element_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/preference_manager_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/preference_manager_cpptoc.h',
|
|
||||||
'libcef_dll/cpptoc/preference_registrar_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/preference_registrar_cpptoc.h',
|
|
||||||
'libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/print_dialog_callback_cpptoc.h',
|
'libcef_dll/cpptoc/print_dialog_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/print_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/print_handler_ctocpp.cc',
|
||||||
@@ -410,6 +388,8 @@
|
|||||||
'libcef_dll/ctocpp/render_process_handler_ctocpp.h',
|
'libcef_dll/ctocpp/render_process_handler_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/request_cpptoc.cc',
|
'libcef_dll/cpptoc/request_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/request_cpptoc.h',
|
'libcef_dll/cpptoc/request_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/request_callback_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/request_callback_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/request_context_cpptoc.cc',
|
'libcef_dll/cpptoc/request_context_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/request_context_cpptoc.h',
|
'libcef_dll/cpptoc/request_context_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/request_context_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/request_context_handler_ctocpp.cc',
|
||||||
@@ -438,8 +418,6 @@
|
|||||||
'libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h',
|
'libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h',
|
'libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.h',
|
|
||||||
'libcef_dll/cpptoc/sslinfo_cpptoc.cc',
|
'libcef_dll/cpptoc/sslinfo_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/sslinfo_cpptoc.h',
|
'libcef_dll/cpptoc/sslinfo_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/sslstatus_cpptoc.cc',
|
'libcef_dll/cpptoc/sslstatus_cpptoc.cc',
|
||||||
@@ -458,10 +436,6 @@
|
|||||||
'libcef_dll/ctocpp/server_handler_ctocpp.h',
|
'libcef_dll/ctocpp/server_handler_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.h',
|
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/shared_memory_region_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/shared_memory_region_cpptoc.h',
|
|
||||||
'libcef_dll/cpptoc/shared_process_message_builder_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/shared_process_message_builder_cpptoc.h',
|
|
||||||
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
|
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/stream_reader_cpptoc.h',
|
'libcef_dll/cpptoc/stream_reader_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/stream_writer_cpptoc.cc',
|
'libcef_dll/cpptoc/stream_writer_cpptoc.cc',
|
||||||
@@ -472,12 +446,6 @@
|
|||||||
'libcef_dll/ctocpp/task_ctocpp.h',
|
'libcef_dll/ctocpp/task_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/task_runner_cpptoc.cc',
|
'libcef_dll/cpptoc/task_runner_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/task_runner_cpptoc.h',
|
'libcef_dll/cpptoc/task_runner_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/test/test_server_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/test/test_server_cpptoc.h',
|
|
||||||
'libcef_dll/cpptoc/test/test_server_connection_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/test/test_server_connection_cpptoc.h',
|
|
||||||
'libcef_dll/ctocpp/test/test_server_handler_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/test/test_server_handler_ctocpp.h',
|
|
||||||
'libcef_dll/cpptoc/views/textfield_cpptoc.cc',
|
'libcef_dll/cpptoc/views/textfield_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/views/textfield_cpptoc.h',
|
'libcef_dll/cpptoc/views/textfield_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc',
|
'libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc',
|
||||||
@@ -510,8 +478,6 @@
|
|||||||
'libcef_dll/cpptoc/urlrequest_cpptoc.h',
|
'libcef_dll/cpptoc/urlrequest_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/urlrequest_client_ctocpp.cc',
|
'libcef_dll/ctocpp/urlrequest_client_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/urlrequest_client_ctocpp.h',
|
'libcef_dll/ctocpp/urlrequest_client_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/unresponsive_process_callback_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/unresponsive_process_callback_cpptoc.h',
|
|
||||||
'libcef_dll/ctocpp/v8accessor_ctocpp.cc',
|
'libcef_dll/ctocpp/v8accessor_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/v8accessor_ctocpp.h',
|
'libcef_dll/ctocpp/v8accessor_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc',
|
||||||
@@ -538,6 +504,12 @@
|
|||||||
'libcef_dll/ctocpp/views/view_delegate_ctocpp.h',
|
'libcef_dll/ctocpp/views/view_delegate_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/waitable_event_cpptoc.cc',
|
'libcef_dll/cpptoc/waitable_event_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/waitable_event_cpptoc.h',
|
'libcef_dll/cpptoc/waitable_event_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/web_plugin_info_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/web_plugin_info_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/views/window_cpptoc.cc',
|
'libcef_dll/cpptoc/views/window_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/views/window_cpptoc.h',
|
'libcef_dll/cpptoc/views/window_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/views/window_delegate_ctocpp.cc',
|
'libcef_dll/ctocpp/views/window_delegate_ctocpp.cc',
|
||||||
@@ -586,8 +558,6 @@
|
|||||||
'libcef_dll/ctocpp/callback_ctocpp.h',
|
'libcef_dll/ctocpp/callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/client_cpptoc.cc',
|
'libcef_dll/cpptoc/client_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/client_cpptoc.h',
|
'libcef_dll/cpptoc/client_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/command_handler_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/command_handler_cpptoc.h',
|
|
||||||
'libcef_dll/ctocpp/command_line_ctocpp.cc',
|
'libcef_dll/ctocpp/command_line_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/command_line_ctocpp.h',
|
'libcef_dll/ctocpp/command_line_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/completion_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/completion_callback_cpptoc.cc',
|
||||||
@@ -670,8 +640,6 @@
|
|||||||
'libcef_dll/ctocpp/list_value_ctocpp.h',
|
'libcef_dll/ctocpp/list_value_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/load_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/load_handler_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/load_handler_cpptoc.h',
|
'libcef_dll/cpptoc/load_handler_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/media_access_callback_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/media_access_callback_ctocpp.h',
|
|
||||||
'libcef_dll/cpptoc/media_observer_cpptoc.cc',
|
'libcef_dll/cpptoc/media_observer_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/media_observer_cpptoc.h',
|
'libcef_dll/cpptoc/media_observer_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/media_route_ctocpp.cc',
|
'libcef_dll/ctocpp/media_route_ctocpp.cc',
|
||||||
@@ -708,18 +676,10 @@
|
|||||||
'libcef_dll/cpptoc/views/panel_delegate_cpptoc.h',
|
'libcef_dll/cpptoc/views/panel_delegate_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/pdf_print_callback_cpptoc.h',
|
'libcef_dll/cpptoc/pdf_print_callback_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/permission_handler_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/permission_handler_cpptoc.h',
|
|
||||||
'libcef_dll/ctocpp/permission_prompt_callback_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/permission_prompt_callback_ctocpp.h',
|
|
||||||
'libcef_dll/ctocpp/post_data_ctocpp.cc',
|
'libcef_dll/ctocpp/post_data_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/post_data_ctocpp.h',
|
'libcef_dll/ctocpp/post_data_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/post_data_element_ctocpp.cc',
|
'libcef_dll/ctocpp/post_data_element_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/post_data_element_ctocpp.h',
|
'libcef_dll/ctocpp/post_data_element_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/preference_manager_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/preference_manager_ctocpp.h',
|
|
||||||
'libcef_dll/ctocpp/preference_registrar_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/preference_registrar_ctocpp.h',
|
|
||||||
'libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/print_dialog_callback_ctocpp.h',
|
'libcef_dll/ctocpp/print_dialog_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/print_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/print_handler_cpptoc.cc',
|
||||||
@@ -740,6 +700,8 @@
|
|||||||
'libcef_dll/cpptoc/render_process_handler_cpptoc.h',
|
'libcef_dll/cpptoc/render_process_handler_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/request_ctocpp.cc',
|
'libcef_dll/ctocpp/request_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/request_ctocpp.h',
|
'libcef_dll/ctocpp/request_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/request_callback_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/request_callback_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/request_context_ctocpp.cc',
|
'libcef_dll/ctocpp/request_context_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/request_context_ctocpp.h',
|
'libcef_dll/ctocpp/request_context_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/request_context_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/request_context_handler_cpptoc.cc',
|
||||||
@@ -768,8 +730,6 @@
|
|||||||
'libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h',
|
'libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h',
|
'libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.h',
|
|
||||||
'libcef_dll/ctocpp/sslinfo_ctocpp.cc',
|
'libcef_dll/ctocpp/sslinfo_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/sslinfo_ctocpp.h',
|
'libcef_dll/ctocpp/sslinfo_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/sslstatus_ctocpp.cc',
|
'libcef_dll/ctocpp/sslstatus_ctocpp.cc',
|
||||||
@@ -788,10 +748,6 @@
|
|||||||
'libcef_dll/cpptoc/server_handler_cpptoc.h',
|
'libcef_dll/cpptoc/server_handler_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.h',
|
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/shared_memory_region_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/shared_memory_region_ctocpp.h',
|
|
||||||
'libcef_dll/ctocpp/shared_process_message_builder_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/shared_process_message_builder_ctocpp.h',
|
|
||||||
'libcef_dll/ctocpp/stream_reader_ctocpp.cc',
|
'libcef_dll/ctocpp/stream_reader_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/stream_reader_ctocpp.h',
|
'libcef_dll/ctocpp/stream_reader_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/stream_writer_ctocpp.cc',
|
'libcef_dll/ctocpp/stream_writer_ctocpp.cc',
|
||||||
@@ -802,12 +758,6 @@
|
|||||||
'libcef_dll/cpptoc/task_cpptoc.h',
|
'libcef_dll/cpptoc/task_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/task_runner_ctocpp.cc',
|
'libcef_dll/ctocpp/task_runner_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/task_runner_ctocpp.h',
|
'libcef_dll/ctocpp/task_runner_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/test/test_server_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/test/test_server_ctocpp.h',
|
|
||||||
'libcef_dll/ctocpp/test/test_server_connection_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/test/test_server_connection_ctocpp.h',
|
|
||||||
'libcef_dll/cpptoc/test/test_server_handler_cpptoc.cc',
|
|
||||||
'libcef_dll/cpptoc/test/test_server_handler_cpptoc.h',
|
|
||||||
'libcef_dll/ctocpp/views/textfield_ctocpp.cc',
|
'libcef_dll/ctocpp/views/textfield_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/views/textfield_ctocpp.h',
|
'libcef_dll/ctocpp/views/textfield_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc',
|
'libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc',
|
||||||
@@ -840,8 +790,6 @@
|
|||||||
'libcef_dll/ctocpp/urlrequest_ctocpp.h',
|
'libcef_dll/ctocpp/urlrequest_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/urlrequest_client_cpptoc.cc',
|
'libcef_dll/cpptoc/urlrequest_client_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/urlrequest_client_cpptoc.h',
|
'libcef_dll/cpptoc/urlrequest_client_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/unresponsive_process_callback_ctocpp.cc',
|
|
||||||
'libcef_dll/ctocpp/unresponsive_process_callback_ctocpp.h',
|
|
||||||
'libcef_dll/cpptoc/v8accessor_cpptoc.cc',
|
'libcef_dll/cpptoc/v8accessor_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/v8accessor_cpptoc.h',
|
'libcef_dll/cpptoc/v8accessor_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc',
|
||||||
@@ -868,6 +816,12 @@
|
|||||||
'libcef_dll/cpptoc/views/view_delegate_cpptoc.h',
|
'libcef_dll/cpptoc/views/view_delegate_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/waitable_event_ctocpp.cc',
|
'libcef_dll/ctocpp/waitable_event_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/waitable_event_ctocpp.h',
|
'libcef_dll/ctocpp/waitable_event_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/web_plugin_info_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/web_plugin_info_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/views/window_ctocpp.cc',
|
'libcef_dll/ctocpp/views/window_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/views/window_ctocpp.h',
|
'libcef_dll/ctocpp/views/window_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/views/window_delegate_cpptoc.cc',
|
'libcef_dll/cpptoc/views/window_delegate_cpptoc.cc',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
'include/base/cef_atomic_flag.h',
|
'include/base/cef_atomic_flag.h',
|
||||||
'include/base/cef_atomic_ref_count.h',
|
'include/base/cef_atomic_ref_count.h',
|
||||||
'include/base/cef_auto_reset.h',
|
'include/base/cef_auto_reset.h',
|
||||||
|
'include/base/cef_basictypes.h',
|
||||||
'include/base/cef_bind.h',
|
'include/base/cef_bind.h',
|
||||||
'include/base/cef_build.h',
|
'include/base/cef_build.h',
|
||||||
'include/base/cef_callback.h',
|
'include/base/cef_callback.h',
|
||||||
@@ -16,6 +17,7 @@
|
|||||||
'include/base/cef_callback_list.h',
|
'include/base/cef_callback_list.h',
|
||||||
'include/base/cef_cancelable_callback.h',
|
'include/base/cef_cancelable_callback.h',
|
||||||
'include/base/cef_compiler_specific.h',
|
'include/base/cef_compiler_specific.h',
|
||||||
|
'include/base/cef_cxx17_backports.h',
|
||||||
'include/base/cef_lock.h',
|
'include/base/cef_lock.h',
|
||||||
'include/base/cef_logging.h',
|
'include/base/cef_logging.h',
|
||||||
'include/base/cef_macros.h',
|
'include/base/cef_macros.h',
|
||||||
@@ -23,24 +25,24 @@
|
|||||||
'include/base/cef_ptr_util.h',
|
'include/base/cef_ptr_util.h',
|
||||||
'include/base/cef_ref_counted.h',
|
'include/base/cef_ref_counted.h',
|
||||||
'include/base/cef_scoped_refptr.h',
|
'include/base/cef_scoped_refptr.h',
|
||||||
|
'include/base/cef_template_util.h',
|
||||||
'include/base/cef_thread_checker.h',
|
'include/base/cef_thread_checker.h',
|
||||||
'include/base/cef_trace_event.h',
|
'include/base/cef_trace_event.h',
|
||||||
'include/base/cef_tuple.h',
|
'include/base/cef_tuple.h',
|
||||||
'include/base/cef_weak_ptr.h',
|
'include/base/cef_weak_ptr.h',
|
||||||
'include/base/internal/cef_bind_internal.h',
|
'include/base/internal/cef_bind_internal.h',
|
||||||
'include/base/internal/cef_callback_internal.h',
|
'include/base/internal/cef_callback_internal.h',
|
||||||
'include/base/internal/cef_color_id_macros.inc',
|
|
||||||
'include/base/internal/cef_lock_impl.h',
|
'include/base/internal/cef_lock_impl.h',
|
||||||
'include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h',
|
'include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h',
|
||||||
'include/base/internal/cef_scoped_policy.h',
|
'include/base/internal/cef_scoped_policy.h',
|
||||||
'include/base/internal/cef_thread_checker_impl.h',
|
'include/base/internal/cef_thread_checker_impl.h',
|
||||||
'include/cef_api_hash.h',
|
'include/cef_api_hash.h',
|
||||||
'include/cef_base.h',
|
'include/cef_base.h',
|
||||||
|
'include/cef_config.h',
|
||||||
'include/cef_version.h',
|
'include/cef_version.h',
|
||||||
'include/internal/cef_export.h',
|
'include/internal/cef_export.h',
|
||||||
'include/internal/cef_ptr.h',
|
'include/internal/cef_ptr.h',
|
||||||
'include/internal/cef_string_wrappers.h',
|
'include/internal/cef_string_wrappers.h',
|
||||||
'include/internal/cef_time_wrappers.h',
|
|
||||||
'include/internal/cef_types_wrappers.h',
|
'include/internal/cef_types_wrappers.h',
|
||||||
],
|
],
|
||||||
'includes_common_capi': [
|
'includes_common_capi': [
|
||||||
@@ -54,9 +56,6 @@
|
|||||||
'include/internal/cef_time.h',
|
'include/internal/cef_time.h',
|
||||||
'include/internal/cef_trace_event_internal.h',
|
'include/internal/cef_trace_event_internal.h',
|
||||||
'include/internal/cef_types.h',
|
'include/internal/cef_types.h',
|
||||||
'include/internal/cef_types_color.h',
|
|
||||||
'include/internal/cef_types_content_settings.h',
|
|
||||||
'include/internal/cef_types_geometry.h',
|
|
||||||
],
|
],
|
||||||
'includes_capi': [
|
'includes_capi': [
|
||||||
'include/capi/cef_base_capi.h',
|
'include/capi/cef_base_capi.h',
|
||||||
@@ -80,7 +79,6 @@
|
|||||||
'include/internal/cef_win.h',
|
'include/internal/cef_win.h',
|
||||||
],
|
],
|
||||||
'includes_win_capi': [
|
'includes_win_capi': [
|
||||||
'include/internal/cef_app_win.h',
|
|
||||||
'include/internal/cef_types_win.h',
|
'include/internal/cef_types_win.h',
|
||||||
],
|
],
|
||||||
'includes_mac': [
|
'includes_mac': [
|
||||||
@@ -114,7 +112,6 @@
|
|||||||
'libcef_dll/resource.h',
|
'libcef_dll/resource.h',
|
||||||
'libcef_dll/shutdown_checker.cc',
|
'libcef_dll/shutdown_checker.cc',
|
||||||
'libcef_dll/shutdown_checker.h',
|
'libcef_dll/shutdown_checker.h',
|
||||||
'libcef_dll/template_util.h',
|
|
||||||
'libcef_dll/transfer_util.cc',
|
'libcef_dll/transfer_util.cc',
|
||||||
'libcef_dll/transfer_util.h',
|
'libcef_dll/transfer_util.h',
|
||||||
'libcef_dll/wrapper_types.h',
|
'libcef_dll/wrapper_types.h',
|
||||||
@@ -141,7 +138,6 @@
|
|||||||
'libcef_dll/ctocpp/ctocpp_scoped.h',
|
'libcef_dll/ctocpp/ctocpp_scoped.h',
|
||||||
'libcef_dll/shutdown_checker.cc',
|
'libcef_dll/shutdown_checker.cc',
|
||||||
'libcef_dll/shutdown_checker.h',
|
'libcef_dll/shutdown_checker.h',
|
||||||
'libcef_dll/template_util.h',
|
|
||||||
'libcef_dll/transfer_util.cc',
|
'libcef_dll/transfer_util.cc',
|
||||||
'libcef_dll/transfer_util.h',
|
'libcef_dll/transfer_util.h',
|
||||||
'libcef_dll/wrapper_types.h',
|
'libcef_dll/wrapper_types.h',
|
||||||
@@ -149,8 +145,6 @@
|
|||||||
'libcef_dll/wrapper/cef_byte_read_handler.cc',
|
'libcef_dll/wrapper/cef_byte_read_handler.cc',
|
||||||
'libcef_dll/wrapper/cef_closure_task.cc',
|
'libcef_dll/wrapper/cef_closure_task.cc',
|
||||||
'libcef_dll/wrapper/cef_message_router.cc',
|
'libcef_dll/wrapper/cef_message_router.cc',
|
||||||
'libcef_dll/wrapper/cef_message_router_utils.cc',
|
|
||||||
'libcef_dll/wrapper/cef_message_router_utils.h',
|
|
||||||
'libcef_dll/wrapper/cef_resource_manager.cc',
|
'libcef_dll/wrapper/cef_resource_manager.cc',
|
||||||
'libcef_dll/wrapper/cef_scoped_temp_dir.cc',
|
'libcef_dll/wrapper/cef_scoped_temp_dir.cc',
|
||||||
'libcef_dll/wrapper/cef_stream_resource_handler.cc',
|
'libcef_dll/wrapper/cef_stream_resource_handler.cc',
|
||||||
@@ -181,16 +175,12 @@
|
|||||||
'tests/shared/browser/resource_util.h',
|
'tests/shared/browser/resource_util.h',
|
||||||
],
|
],
|
||||||
'shared_sources_common': [
|
'shared_sources_common': [
|
||||||
'tests/shared/common/binary_value_utils.cc',
|
|
||||||
'tests/shared/common/binary_value_utils.h',
|
|
||||||
'tests/shared/common/client_app.cc',
|
'tests/shared/common/client_app.cc',
|
||||||
'tests/shared/common/client_app.h',
|
'tests/shared/common/client_app.h',
|
||||||
'tests/shared/common/client_app_other.cc',
|
'tests/shared/common/client_app_other.cc',
|
||||||
'tests/shared/common/client_app_other.h',
|
'tests/shared/common/client_app_other.h',
|
||||||
'tests/shared/common/client_switches.cc',
|
'tests/shared/common/client_switches.cc',
|
||||||
'tests/shared/common/client_switches.h',
|
'tests/shared/common/client_switches.h',
|
||||||
'tests/shared/common/string_util.cc',
|
|
||||||
'tests/shared/common/string_util.h',
|
|
||||||
],
|
],
|
||||||
'shared_sources_renderer': [
|
'shared_sources_renderer': [
|
||||||
'tests/shared/renderer/client_app_renderer.cc',
|
'tests/shared/renderer/client_app_renderer.cc',
|
||||||
@@ -222,10 +212,6 @@
|
|||||||
'tests/shared/browser/util_win.h',
|
'tests/shared/browser/util_win.h',
|
||||||
],
|
],
|
||||||
'cefclient_sources_browser': [
|
'cefclient_sources_browser': [
|
||||||
'tests/cefclient/browser/base_client_handler.cc',
|
|
||||||
'tests/cefclient/browser/base_client_handler.h',
|
|
||||||
'tests/cefclient/browser/binary_transfer_test.cc',
|
|
||||||
'tests/cefclient/browser/binary_transfer_test.h',
|
|
||||||
'tests/cefclient/browser/binding_test.cc',
|
'tests/cefclient/browser/binding_test.cc',
|
||||||
'tests/cefclient/browser/binding_test.h',
|
'tests/cefclient/browser/binding_test.h',
|
||||||
'tests/cefclient/browser/browser_window.cc',
|
'tests/cefclient/browser/browser_window.cc',
|
||||||
@@ -241,14 +227,9 @@
|
|||||||
'tests/cefclient/browser/client_handler_osr.h',
|
'tests/cefclient/browser/client_handler_osr.h',
|
||||||
'tests/cefclient/browser/client_handler_std.cc',
|
'tests/cefclient/browser/client_handler_std.cc',
|
||||||
'tests/cefclient/browser/client_handler_std.h',
|
'tests/cefclient/browser/client_handler_std.h',
|
||||||
'tests/cefclient/browser/client_prefs.cc',
|
|
||||||
'tests/cefclient/browser/client_prefs.h',
|
|
||||||
'tests/cefclient/browser/client_types.h',
|
'tests/cefclient/browser/client_types.h',
|
||||||
'tests/cefclient/browser/default_client_handler.h',
|
|
||||||
'tests/cefclient/browser/dialog_test.cc',
|
'tests/cefclient/browser/dialog_test.cc',
|
||||||
'tests/cefclient/browser/dialog_test.h',
|
'tests/cefclient/browser/dialog_test.h',
|
||||||
'tests/cefclient/browser/hang_test.cc',
|
|
||||||
'tests/cefclient/browser/hang_test.h',
|
|
||||||
'tests/cefclient/browser/image_cache.cc',
|
'tests/cefclient/browser/image_cache.cc',
|
||||||
'tests/cefclient/browser/image_cache.h',
|
'tests/cefclient/browser/image_cache.h',
|
||||||
'tests/cefclient/browser/main_context.cc',
|
'tests/cefclient/browser/main_context.cc',
|
||||||
@@ -306,20 +287,15 @@
|
|||||||
'tests/cefclient/renderer/client_app_delegates_renderer.cc',
|
'tests/cefclient/renderer/client_app_delegates_renderer.cc',
|
||||||
'tests/cefclient/renderer/client_renderer.cc',
|
'tests/cefclient/renderer/client_renderer.cc',
|
||||||
'tests/cefclient/renderer/client_renderer.h',
|
'tests/cefclient/renderer/client_renderer.h',
|
||||||
'tests/cefclient/renderer/ipc_performance_test.cc',
|
|
||||||
'tests/cefclient/renderer/ipc_performance_test.h',
|
|
||||||
'tests/cefclient/renderer/performance_test.cc',
|
'tests/cefclient/renderer/performance_test.cc',
|
||||||
'tests/cefclient/renderer/performance_test.h',
|
'tests/cefclient/renderer/performance_test.h',
|
||||||
'tests/cefclient/renderer/performance_test_setup.h',
|
'tests/cefclient/renderer/performance_test_setup.h',
|
||||||
'tests/cefclient/renderer/performance_test_tests.cc',
|
'tests/cefclient/renderer/performance_test_tests.cc',
|
||||||
],
|
],
|
||||||
'cefclient_sources_resources': [
|
'cefclient_sources_resources': [
|
||||||
'tests/cefclient/resources/binary_transfer.html',
|
|
||||||
'tests/cefclient/resources/binding.html',
|
'tests/cefclient/resources/binding.html',
|
||||||
'tests/cefclient/resources/dialogs.html',
|
'tests/cefclient/resources/dialogs.html',
|
||||||
'tests/cefclient/resources/draggable.html',
|
'tests/cefclient/resources/draggable.html',
|
||||||
'tests/cefclient/resources/hang.html',
|
|
||||||
'tests/cefclient/resources/ipc_performance.html',
|
|
||||||
'tests/cefclient/resources/localstorage.html',
|
'tests/cefclient/resources/localstorage.html',
|
||||||
'tests/cefclient/resources/logo.png',
|
'tests/cefclient/resources/logo.png',
|
||||||
'tests/cefclient/resources/media_router.html',
|
'tests/cefclient/resources/media_router.html',
|
||||||
@@ -403,7 +379,6 @@
|
|||||||
'tests/cefclient/browser/temp_window_mac.mm',
|
'tests/cefclient/browser/temp_window_mac.mm',
|
||||||
'tests/cefclient/browser/text_input_client_osr_mac.h',
|
'tests/cefclient/browser/text_input_client_osr_mac.h',
|
||||||
'tests/cefclient/browser/text_input_client_osr_mac.mm',
|
'tests/cefclient/browser/text_input_client_osr_mac.mm',
|
||||||
'tests/cefclient/browser/views_window_mac.mm',
|
|
||||||
'tests/cefclient/browser/window_test_runner_mac.h',
|
'tests/cefclient/browser/window_test_runner_mac.h',
|
||||||
'tests/cefclient/browser/window_test_runner_mac.mm',
|
'tests/cefclient/browser/window_test_runner_mac.mm',
|
||||||
'tests/cefclient/cefclient_mac.mm',
|
'tests/cefclient/cefclient_mac.mm',
|
||||||
@@ -471,16 +446,9 @@
|
|||||||
'tests/cefsimple/cefsimple_linux.cc',
|
'tests/cefsimple/cefsimple_linux.cc',
|
||||||
'tests/cefsimple/simple_handler_linux.cc',
|
'tests/cefsimple/simple_handler_linux.cc',
|
||||||
],
|
],
|
||||||
'ceftests_data_resources': [
|
|
||||||
'tests/ceftests/resources/net/data/ssl/certificates/expired_cert.pem',
|
|
||||||
'tests/ceftests/resources/net/data/ssl/certificates/localhost_cert.pem',
|
|
||||||
'tests/ceftests/resources/net/data/ssl/certificates/ok_cert.pem',
|
|
||||||
'tests/ceftests/resources/net/data/ssl/certificates/root_ca_cert.pem',
|
|
||||||
],
|
|
||||||
'ceftests_sources_common': [
|
'ceftests_sources_common': [
|
||||||
'tests/ceftests/audio_output_unittest.cc',
|
'tests/ceftests/audio_output_unittest.cc',
|
||||||
'tests/ceftests/browser_info_map_unittest.cc',
|
'tests/ceftests/browser_info_map_unittest.cc',
|
||||||
'tests/ceftests/certificate_error_unittest.cc',
|
|
||||||
'tests/ceftests/command_line_unittest.cc',
|
'tests/ceftests/command_line_unittest.cc',
|
||||||
'tests/ceftests/cookie_unittest.cc',
|
'tests/ceftests/cookie_unittest.cc',
|
||||||
'tests/ceftests/cors_unittest.cc',
|
'tests/ceftests/cors_unittest.cc',
|
||||||
@@ -500,27 +468,18 @@
|
|||||||
'tests/ceftests/file_util_unittest.cc',
|
'tests/ceftests/file_util_unittest.cc',
|
||||||
'tests/ceftests/frame_handler_unittest.cc',
|
'tests/ceftests/frame_handler_unittest.cc',
|
||||||
'tests/ceftests/frame_unittest.cc',
|
'tests/ceftests/frame_unittest.cc',
|
||||||
'tests/ceftests/hsts_redirect_unittest.cc',
|
|
||||||
'tests/ceftests/image_unittest.cc',
|
'tests/ceftests/image_unittest.cc',
|
||||||
'tests/ceftests/image_util.cc',
|
'tests/ceftests/image_util.cc',
|
||||||
'tests/ceftests/image_util.h',
|
'tests/ceftests/image_util.h',
|
||||||
'tests/ceftests/jsdialog_unittest.cc',
|
'tests/ceftests/jsdialog_unittest.cc',
|
||||||
'tests/ceftests/life_span_unittest.cc',
|
'tests/ceftests/life_span_unittest.cc',
|
||||||
'tests/ceftests/media_access_unittest.cc',
|
'tests/ceftests/message_router_unittest.cc',
|
||||||
'tests/ceftests/message_router_binary_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_harness_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_multi_query_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_single_query_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_threshold_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_unittest_utils.cc',
|
|
||||||
'tests/ceftests/message_router_unittest_utils.h',
|
|
||||||
'tests/ceftests/navigation_unittest.cc',
|
'tests/ceftests/navigation_unittest.cc',
|
||||||
'tests/ceftests/os_rendering_unittest.cc',
|
'tests/ceftests/os_rendering_unittest.cc',
|
||||||
'tests/ceftests/osr_accessibility_unittest.cc',
|
'tests/ceftests/osr_accessibility_unittest.cc',
|
||||||
'tests/ceftests/osr_display_unittest.cc',
|
'tests/ceftests/osr_display_unittest.cc',
|
||||||
'tests/ceftests/parser_unittest.cc',
|
'tests/ceftests/parser_unittest.cc',
|
||||||
'tests/ceftests/pdf_viewer_unittest.cc',
|
'tests/ceftests/plugin_unittest.cc',
|
||||||
'tests/ceftests/permission_prompt_unittest.cc',
|
|
||||||
'tests/ceftests/preference_unittest.cc',
|
'tests/ceftests/preference_unittest.cc',
|
||||||
'tests/ceftests/print_unittest.cc',
|
'tests/ceftests/print_unittest.cc',
|
||||||
'tests/ceftests/process_message_unittest.cc',
|
'tests/ceftests/process_message_unittest.cc',
|
||||||
@@ -537,8 +496,6 @@
|
|||||||
'tests/ceftests/scheme_handler_unittest.cc',
|
'tests/ceftests/scheme_handler_unittest.cc',
|
||||||
'tests/ceftests/scoped_temp_dir_unittest.cc',
|
'tests/ceftests/scoped_temp_dir_unittest.cc',
|
||||||
'tests/ceftests/server_unittest.cc',
|
'tests/ceftests/server_unittest.cc',
|
||||||
'tests/ceftests/send_shared_process_message_unittest.cc',
|
|
||||||
"tests/ceftests/shared_process_message_unittest.cc",
|
|
||||||
'tests/ceftests/stream_unittest.cc',
|
'tests/ceftests/stream_unittest.cc',
|
||||||
'tests/ceftests/stream_resource_handler_unittest.cc',
|
'tests/ceftests/stream_resource_handler_unittest.cc',
|
||||||
'tests/ceftests/string_unittest.cc',
|
'tests/ceftests/string_unittest.cc',
|
||||||
@@ -550,21 +507,11 @@
|
|||||||
'tests/ceftests/test_request.h',
|
'tests/ceftests/test_request.h',
|
||||||
'tests/ceftests/test_server.cc',
|
'tests/ceftests/test_server.cc',
|
||||||
'tests/ceftests/test_server.h',
|
'tests/ceftests/test_server.h',
|
||||||
'tests/ceftests/test_server_observer.h',
|
|
||||||
'tests/ceftests/test_server_observer.cc',
|
|
||||||
'tests/ceftests/test_server_observer_unittest.cc',
|
|
||||||
'tests/ceftests/test_server_manager.h',
|
|
||||||
'tests/ceftests/test_server_manager.cc',
|
|
||||||
'tests/ceftests/test_server_runner.h',
|
|
||||||
'tests/ceftests/test_server_runner.cc',
|
|
||||||
'tests/ceftests/test_server_runner_normal.cc',
|
|
||||||
'tests/ceftests/test_server_runner_test.cc',
|
|
||||||
'tests/ceftests/test_server_unittest.cc',
|
'tests/ceftests/test_server_unittest.cc',
|
||||||
'tests/ceftests/test_suite.cc',
|
'tests/ceftests/test_suite.cc',
|
||||||
'tests/ceftests/test_suite.h',
|
'tests/ceftests/test_suite.h',
|
||||||
'tests/ceftests/test_util.cc',
|
'tests/ceftests/test_util.cc',
|
||||||
'tests/ceftests/test_util.h',
|
'tests/ceftests/test_util.h',
|
||||||
'tests/ceftests/time_unittest.cc',
|
|
||||||
'tests/ceftests/thread_helper.cc',
|
'tests/ceftests/thread_helper.cc',
|
||||||
'tests/ceftests/thread_helper.h',
|
'tests/ceftests/thread_helper.h',
|
||||||
'tests/ceftests/thread_unittest.cc',
|
'tests/ceftests/thread_unittest.cc',
|
||||||
@@ -588,7 +535,6 @@
|
|||||||
'tests/ceftests/zip_reader_unittest.cc',
|
'tests/ceftests/zip_reader_unittest.cc',
|
||||||
],
|
],
|
||||||
'ceftests_sources_win': [
|
'ceftests_sources_win': [
|
||||||
'tests/ceftests/resource_util_win_dir.cc',
|
|
||||||
'tests/ceftests/resource_util_win_idmap.cc',
|
'tests/ceftests/resource_util_win_idmap.cc',
|
||||||
'tests/ceftests/resources/win/ceftests.rc',
|
'tests/ceftests/resources/win/ceftests.rc',
|
||||||
],
|
],
|
||||||
@@ -614,17 +560,9 @@
|
|||||||
'tests/ceftests/cors_unittest.cc',
|
'tests/ceftests/cors_unittest.cc',
|
||||||
'tests/ceftests/dom_unittest.cc',
|
'tests/ceftests/dom_unittest.cc',
|
||||||
'tests/ceftests/frame_unittest.cc',
|
'tests/ceftests/frame_unittest.cc',
|
||||||
'tests/ceftests/media_access_unittest.cc',
|
'tests/ceftests/message_router_unittest.cc',
|
||||||
'tests/ceftests/message_router_binary_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_harness_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_multi_query_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_single_query_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_threshold_unittest.cc',
|
|
||||||
'tests/ceftests/message_router_unittest_utils.cc',
|
|
||||||
'tests/ceftests/message_router_unittest_utils.h',
|
|
||||||
'tests/ceftests/navigation_unittest.cc',
|
'tests/ceftests/navigation_unittest.cc',
|
||||||
'tests/ceftests/pdf_viewer_unittest.cc',
|
'tests/ceftests/plugin_unittest.cc',
|
||||||
'tests/ceftests/permission_prompt_unittest.cc',
|
|
||||||
'tests/ceftests/preference_unittest.cc',
|
'tests/ceftests/preference_unittest.cc',
|
||||||
'tests/ceftests/process_message_unittest.cc',
|
'tests/ceftests/process_message_unittest.cc',
|
||||||
'tests/ceftests/request_handler_unittest.cc',
|
'tests/ceftests/request_handler_unittest.cc',
|
||||||
@@ -634,8 +572,6 @@
|
|||||||
'tests/ceftests/routing_test_handler.cc',
|
'tests/ceftests/routing_test_handler.cc',
|
||||||
'tests/ceftests/routing_test_handler.h',
|
'tests/ceftests/routing_test_handler.h',
|
||||||
'tests/ceftests/scheme_handler_unittest.cc',
|
'tests/ceftests/scheme_handler_unittest.cc',
|
||||||
'tests/ceftests/send_shared_process_message_unittest.cc',
|
|
||||||
"tests/ceftests/shared_process_message_unittest.cc",
|
|
||||||
'tests/ceftests/urlrequest_unittest.cc',
|
'tests/ceftests/urlrequest_unittest.cc',
|
||||||
'tests/ceftests/test_handler.cc',
|
'tests/ceftests/test_handler.cc',
|
||||||
'tests/ceftests/test_handler.h',
|
'tests/ceftests/test_handler.h',
|
||||||
@@ -643,14 +579,6 @@
|
|||||||
'tests/ceftests/test_request.h',
|
'tests/ceftests/test_request.h',
|
||||||
'tests/ceftests/test_server.cc',
|
'tests/ceftests/test_server.cc',
|
||||||
'tests/ceftests/test_server.h',
|
'tests/ceftests/test_server.h',
|
||||||
'tests/ceftests/test_server_observer.h',
|
|
||||||
'tests/ceftests/test_server_observer.cc',
|
|
||||||
'tests/ceftests/test_server_manager.h',
|
|
||||||
'tests/ceftests/test_server_manager.cc',
|
|
||||||
'tests/ceftests/test_server_runner.h',
|
|
||||||
'tests/ceftests/test_server_runner.cc',
|
|
||||||
'tests/ceftests/test_server_runner_normal.cc',
|
|
||||||
'tests/ceftests/test_server_runner_test.cc',
|
|
||||||
'tests/ceftests/test_suite.cc',
|
'tests/ceftests/test_suite.cc',
|
||||||
'tests/ceftests/test_suite.h',
|
'tests/ceftests/test_suite.h',
|
||||||
'tests/ceftests/test_util.cc',
|
'tests/ceftests/test_util.cc',
|
||||||
|
|||||||
@@ -95,62 +95,41 @@ macro(SET_CEF_TARGET_OUT_DIR)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# Copy a list of files from one directory to another. Relative file paths are maintained.
|
# Copy a list of files from one directory to another. Relative files paths are maintained.
|
||||||
|
# The path component of the source |file_list| will be removed.
|
||||||
macro(COPY_FILES target file_list source_dir target_dir)
|
macro(COPY_FILES target file_list source_dir target_dir)
|
||||||
foreach(FILENAME ${file_list})
|
foreach(FILENAME ${file_list})
|
||||||
set(source_file ${source_dir}/${FILENAME})
|
set(source_file ${source_dir}/${FILENAME})
|
||||||
|
|
||||||
# Remove the target file path component.
|
|
||||||
get_filename_component(target_name ${FILENAME} NAME)
|
get_filename_component(target_name ${FILENAME} NAME)
|
||||||
set(target_file ${target_dir}/${target_name})
|
set(target_file ${target_dir}/${target_name})
|
||||||
|
|
||||||
COPY_SINGLE_FILE(${target} ${source_file} ${target_file})
|
string(FIND ${source_file} "$<CONFIGURATION>" _pos)
|
||||||
endforeach()
|
if(NOT ${_pos} EQUAL -1)
|
||||||
endmacro()
|
# Must test with an actual configuration directory.
|
||||||
|
string(REPLACE "$<CONFIGURATION>" "Release" existing_source_file ${source_file})
|
||||||
# Copy a list of files from one directory to another. Relative file paths are maintained.
|
if(NOT EXISTS ${existing_source_file})
|
||||||
macro(COPY_RESOURCES target file_list prefix_list source_dir target_dir)
|
string(REPLACE "$<CONFIGURATION>" "Debug" existing_source_file ${source_file})
|
||||||
foreach(FILENAME ${file_list})
|
endif()
|
||||||
set(source_file ${source_dir}/${FILENAME})
|
else()
|
||||||
|
set(existing_source_file ${source_file})
|
||||||
# Remove one or more prefixes from the source paths.
|
|
||||||
set(TARGET_FILENAME "${FILENAME}")
|
|
||||||
foreach(PREFIX ${prefix_list})
|
|
||||||
string(REGEX REPLACE "^.*${PREFIX}" "" TARGET_FILENAME ${TARGET_FILENAME})
|
|
||||||
endforeach()
|
|
||||||
set(target_file ${target_dir}/${TARGET_FILENAME})
|
|
||||||
|
|
||||||
COPY_SINGLE_FILE(${target} ${source_file} ${target_file})
|
|
||||||
endforeach()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(COPY_SINGLE_FILE target source_file target_file)
|
|
||||||
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()
|
endif()
|
||||||
else()
|
|
||||||
set(existing_source_file ${source_file})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(IS_DIRECTORY ${existing_source_file})
|
if(IS_DIRECTORY ${existing_source_file})
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${target}
|
TARGET ${target}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${source_file}" "${target_file}"
|
COMMAND ${CMAKE_COMMAND} -E copy_directory "${source_file}" "${target_file}"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${target}
|
TARGET ${target}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${source_file}" "${target_file}"
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${source_file}" "${target_file}"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,18 @@ endif()
|
|||||||
|
|
||||||
# Determine the project architecture.
|
# Determine the project architecture.
|
||||||
if(NOT DEFINED PROJECT_ARCH)
|
if(NOT DEFINED PROJECT_ARCH)
|
||||||
if(("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64") OR
|
if(OS_WINDOWS AND "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64")
|
||||||
("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM64"))
|
|
||||||
set(PROJECT_ARCH "arm64")
|
set(PROJECT_ARCH "arm64")
|
||||||
elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||||
set(PROJECT_ARCH "x86_64")
|
set(PROJECT_ARCH "x86_64")
|
||||||
else()
|
else()
|
||||||
set(PROJECT_ARCH "x86")
|
set(PROJECT_ARCH "x86")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(OS_MAC)
|
||||||
|
# PROJECT_ARCH should be specified on Mac OS X.
|
||||||
|
message(WARNING "No PROJECT_ARCH value specified, using ${PROJECT_ARCH}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
|
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
|
||||||
@@ -101,7 +105,7 @@ if(OS_LINUX)
|
|||||||
-fno-rtti # Disable real-time type information
|
-fno-rtti # Disable real-time type information
|
||||||
-fno-threadsafe-statics # Don't generate thread-safe statics
|
-fno-threadsafe-statics # Don't generate thread-safe statics
|
||||||
-fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions
|
-fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions
|
||||||
-std=c++17 # Use the C++17 language standard
|
-std=c++14 # Use the C++14 language standard
|
||||||
-Wsign-compare # Warn about mixed signed/unsigned type comparisons
|
-Wsign-compare # Warn about mixed signed/unsigned type comparisons
|
||||||
)
|
)
|
||||||
list(APPEND CEF_COMPILER_FLAGS_DEBUG
|
list(APPEND CEF_COMPILER_FLAGS_DEBUG
|
||||||
@@ -223,6 +227,7 @@ if(OS_LINUX)
|
|||||||
snapshot_blob.bin
|
snapshot_blob.bin
|
||||||
v8_context_snapshot.bin
|
v8_context_snapshot.bin
|
||||||
vk_swiftshader_icd.json
|
vk_swiftshader_icd.json
|
||||||
|
swiftshader
|
||||||
)
|
)
|
||||||
|
|
||||||
# List of CEF resource files.
|
# List of CEF resource files.
|
||||||
@@ -272,7 +277,7 @@ if(OS_MAC)
|
|||||||
-fno-threadsafe-statics # Don't generate thread-safe statics
|
-fno-threadsafe-statics # Don't generate thread-safe statics
|
||||||
-fobjc-call-cxx-cdtors # Call the constructor/destructor of C++ instance variables in ObjC objects
|
-fobjc-call-cxx-cdtors # Call the constructor/destructor of C++ instance variables in ObjC objects
|
||||||
-fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions
|
-fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions
|
||||||
-std=c++17 # Use the C++17 language standard
|
-std=c++14 # Use the C++14 language standard
|
||||||
-Wno-narrowing # Don't warn about type narrowing
|
-Wno-narrowing # Don't warn about type narrowing
|
||||||
-Wsign-compare # Warn about mixed signed/unsigned type comparisons
|
-Wsign-compare # Warn about mixed signed/unsigned type comparisons
|
||||||
)
|
)
|
||||||
@@ -304,14 +309,13 @@ if(OS_MAC)
|
|||||||
# Standard libraries.
|
# Standard libraries.
|
||||||
set(CEF_STANDARD_LIBS
|
set(CEF_STANDARD_LIBS
|
||||||
-lpthread
|
-lpthread
|
||||||
"-framework AppKit"
|
|
||||||
"-framework Cocoa"
|
"-framework Cocoa"
|
||||||
"-framework IOSurface"
|
"-framework AppKit"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Find the newest available base SDK.
|
# Find the newest available base SDK.
|
||||||
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
foreach(OS_VERSION 14.2 14.0 10.15)
|
foreach(OS_VERSION 10.15 10.14 10.13 10.12 10.11)
|
||||||
set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
|
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}")
|
if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
|
||||||
set(CMAKE_OSX_SYSROOT ${SDK})
|
set(CMAKE_OSX_SYSROOT ${SDK})
|
||||||
@@ -319,7 +323,7 @@ if(OS_MAC)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Target SDK.
|
# Target SDK.
|
||||||
set(CEF_TARGET_SDK "10.15")
|
set(CEF_TARGET_SDK "10.11")
|
||||||
list(APPEND CEF_COMPILER_FLAGS
|
list(APPEND CEF_COMPILER_FLAGS
|
||||||
-mmacosx-version-min=${CEF_TARGET_SDK}
|
-mmacosx-version-min=${CEF_TARGET_SDK}
|
||||||
)
|
)
|
||||||
@@ -347,10 +351,6 @@ if(OS_MAC)
|
|||||||
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
|
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CEF_STANDARD_LIBS
|
|
||||||
-lsandbox
|
|
||||||
)
|
|
||||||
|
|
||||||
# CEF sandbox library paths.
|
# CEF sandbox library paths.
|
||||||
set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a")
|
set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a")
|
||||||
set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a")
|
set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a")
|
||||||
@@ -360,7 +360,6 @@ if(OS_MAC)
|
|||||||
# Format is "<name suffix>:<target suffix>:<plist suffix>".
|
# Format is "<name suffix>:<target suffix>:<plist suffix>".
|
||||||
set(CEF_HELPER_APP_SUFFIXES
|
set(CEF_HELPER_APP_SUFFIXES
|
||||||
"::"
|
"::"
|
||||||
" (Alerts):_alerts:.alerts"
|
|
||||||
" (GPU):_gpu:.gpu"
|
" (GPU):_gpu:.gpu"
|
||||||
" (Plugin):_plugin:.plugin"
|
" (Plugin):_plugin:.plugin"
|
||||||
" (Renderer):_renderer:.renderer"
|
" (Renderer):_renderer:.renderer"
|
||||||
@@ -428,75 +427,17 @@ if(OS_WINDOWS)
|
|||||||
/Ob2 # Inline any suitable function
|
/Ob2 # Inline any suitable function
|
||||||
/GF # Enable string pooling
|
/GF # Enable string pooling
|
||||||
)
|
)
|
||||||
list(APPEND CEF_CXX_COMPILER_FLAGS
|
|
||||||
/std:c++17 # Use the C++17 language standard
|
|
||||||
)
|
|
||||||
list(APPEND CEF_LINKER_FLAGS_DEBUG
|
list(APPEND CEF_LINKER_FLAGS_DEBUG
|
||||||
/DEBUG # Generate debug information
|
/DEBUG # Generate debug information
|
||||||
)
|
)
|
||||||
list(APPEND CEF_EXE_LINKER_FLAGS
|
list(APPEND CEF_EXE_LINKER_FLAGS
|
||||||
/MANIFEST:NO # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
|
/MANIFEST:NO # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
|
||||||
/LARGEADDRESSAWARE # Allow 32-bit processes to access 3GB of RAM
|
/LARGEADDRESSAWARE # Allow 32-bit processes to access 3GB of RAM
|
||||||
|
|
||||||
# Delayload most libraries as the dlls are simply not required at startup (or
|
|
||||||
# at all, depending on the process type). Some dlls open handles when they are
|
|
||||||
# loaded, and we may not want them to be loaded in renderers or other sandboxed
|
|
||||||
# processes. Conversely, some dlls must be loaded before sandbox lockdown. In
|
|
||||||
# unsandboxed processes they will load when first needed. The linker will
|
|
||||||
# automatically ignore anything which is not linked to the binary at all (it is
|
|
||||||
# harmless to have an unmatched /delayload). This list should be kept in sync
|
|
||||||
# with Chromium's "delayloads" target from the //build/config/win/BUILD.gn file.
|
|
||||||
/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll
|
|
||||||
/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll
|
|
||||||
/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll
|
|
||||||
/DELAYLOAD:advapi32.dll
|
|
||||||
/DELAYLOAD:comctl32.dll
|
|
||||||
/DELAYLOAD:comdlg32.dll
|
|
||||||
/DELAYLOAD:credui.dll
|
|
||||||
/DELAYLOAD:cryptui.dll
|
|
||||||
/DELAYLOAD:d3d11.dll
|
|
||||||
/DELAYLOAD:d3d9.dll
|
|
||||||
/DELAYLOAD:dwmapi.dll
|
|
||||||
/DELAYLOAD:dxgi.dll
|
|
||||||
/DELAYLOAD:dxva2.dll
|
|
||||||
/DELAYLOAD:esent.dll
|
|
||||||
/DELAYLOAD:gdi32.dll
|
|
||||||
/DELAYLOAD:hid.dll
|
|
||||||
/DELAYLOAD:imagehlp.dll
|
|
||||||
/DELAYLOAD:imm32.dll
|
|
||||||
/DELAYLOAD:msi.dll
|
|
||||||
/DELAYLOAD:netapi32.dll
|
|
||||||
/DELAYLOAD:ncrypt.dll
|
|
||||||
/DELAYLOAD:ole32.dll
|
|
||||||
/DELAYLOAD:oleacc.dll
|
|
||||||
/DELAYLOAD:propsys.dll
|
|
||||||
/DELAYLOAD:psapi.dll
|
|
||||||
/DELAYLOAD:rpcrt4.dll
|
|
||||||
/DELAYLOAD:rstrtmgr.dll
|
|
||||||
/DELAYLOAD:setupapi.dll
|
|
||||||
/DELAYLOAD:shell32.dll
|
|
||||||
/DELAYLOAD:shlwapi.dll
|
|
||||||
/DELAYLOAD:uiautomationcore.dll
|
|
||||||
/DELAYLOAD:urlmon.dll
|
|
||||||
/DELAYLOAD:user32.dll
|
|
||||||
/DELAYLOAD:usp10.dll
|
|
||||||
/DELAYLOAD:uxtheme.dll
|
|
||||||
/DELAYLOAD:wer.dll
|
|
||||||
/DELAYLOAD:wevtapi.dll
|
|
||||||
/DELAYLOAD:wininet.dll
|
|
||||||
/DELAYLOAD:winusb.dll
|
|
||||||
/DELAYLOAD:wsock32.dll
|
|
||||||
/DELAYLOAD:wtsapi32.dll
|
|
||||||
)
|
)
|
||||||
list(APPEND CEF_COMPILER_DEFINES
|
list(APPEND CEF_COMPILER_DEFINES
|
||||||
WIN32 _WIN32 _WINDOWS # Windows platform
|
WIN32 _WIN32 _WINDOWS # Windows platform
|
||||||
UNICODE _UNICODE # Unicode build
|
UNICODE _UNICODE # Unicode build
|
||||||
# Targeting Windows 10. We can't say `=_WIN32_WINNT_WIN10` here because
|
WINVER=0x0601 _WIN32_WINNT=0x601 # Targeting Windows 7
|
||||||
# some files do `#if WINVER < 0x0600` without including windows.h before,
|
|
||||||
# and then _WIN32_WINNT_WIN10 isn't yet known to be 0x0A00.
|
|
||||||
WINVER=0x0A00
|
|
||||||
_WIN32_WINNT=0x0A00
|
|
||||||
NTDDI_VERSION=NTDDI_WIN10_FE
|
|
||||||
NOMINMAX # Use the standard's templated min/max
|
NOMINMAX # Use the standard's templated min/max
|
||||||
WIN32_LEAN_AND_MEAN # Exclude less common API declarations
|
WIN32_LEAN_AND_MEAN # Exclude less common API declarations
|
||||||
_HAS_EXCEPTIONS=0 # Disable exceptions
|
_HAS_EXCEPTIONS=0 # Disable exceptions
|
||||||
@@ -505,23 +446,6 @@ if(OS_WINDOWS)
|
|||||||
NDEBUG _NDEBUG # Not a debug build
|
NDEBUG _NDEBUG # Not a debug build
|
||||||
)
|
)
|
||||||
|
|
||||||
if(PROJECT_ARCH STREQUAL "x86")
|
|
||||||
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB minimum
|
|
||||||
# needed by CEF's main thread. This saves significant memory on threads
|
|
||||||
# (like those in the Windows thread pool, and others) whose stack size we
|
|
||||||
# can only control through this setting. The main thread (in 32-bit builds
|
|
||||||
# only) uses fibers to switch to a 4MiB stack at runtime via
|
|
||||||
# CefRunWinMainWithPreferredStackSize().
|
|
||||||
list(APPEND CEF_EXE_LINKER_FLAGS
|
|
||||||
/STACK:0x80000
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
# Increase the initial stack size to 8MiB from the default 1MiB.
|
|
||||||
list(APPEND CEF_EXE_LINKER_FLAGS
|
|
||||||
/STACK:0x800000
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Standard libraries.
|
# Standard libraries.
|
||||||
set(CEF_STANDARD_LIBS
|
set(CEF_STANDARD_LIBS
|
||||||
comctl32.lib
|
comctl32.lib
|
||||||
@@ -544,7 +468,6 @@ if(OS_WINDOWS)
|
|||||||
# List of CEF binary files.
|
# List of CEF binary files.
|
||||||
set(CEF_BINARY_FILES
|
set(CEF_BINARY_FILES
|
||||||
chrome_elf.dll
|
chrome_elf.dll
|
||||||
d3dcompiler_47.dll
|
|
||||||
libcef.dll
|
libcef.dll
|
||||||
libEGL.dll
|
libEGL.dll
|
||||||
libGLESv2.dll
|
libGLESv2.dll
|
||||||
@@ -553,12 +476,12 @@ if(OS_WINDOWS)
|
|||||||
vk_swiftshader.dll
|
vk_swiftshader.dll
|
||||||
vk_swiftshader_icd.json
|
vk_swiftshader_icd.json
|
||||||
vulkan-1.dll
|
vulkan-1.dll
|
||||||
|
swiftshader
|
||||||
)
|
)
|
||||||
|
|
||||||
if(PROJECT_ARCH STREQUAL "x86_64")
|
if(NOT PROJECT_ARCH STREQUAL "arm64")
|
||||||
list(APPEND CEF_BINARY_FILES
|
list(APPEND CEF_BINARY_FILES
|
||||||
dxil.dll
|
d3dcompiler_47.dll
|
||||||
dxcompiler.dll
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -585,18 +508,14 @@ if(OS_WINDOWS)
|
|||||||
Advapi32.lib
|
Advapi32.lib
|
||||||
dbghelp.lib
|
dbghelp.lib
|
||||||
Delayimp.lib
|
Delayimp.lib
|
||||||
ntdll.lib
|
|
||||||
OleAut32.lib
|
OleAut32.lib
|
||||||
PowrProf.lib
|
PowrProf.lib
|
||||||
Propsys.lib
|
Propsys.lib
|
||||||
psapi.lib
|
psapi.lib
|
||||||
SetupAPI.lib
|
SetupAPI.lib
|
||||||
Shell32.lib
|
Shell32.lib
|
||||||
Shcore.lib
|
|
||||||
Userenv.lib
|
|
||||||
version.lib
|
version.lib
|
||||||
wbemuuid.lib
|
wbemuuid.lib
|
||||||
WindowsApp.lib
|
|
||||||
winmm.lib
|
winmm.lib
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -45,49 +45,39 @@
|
|||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
|
#include "include/base/cef_macros.h"
|
||||||
#include "include/base/cef_thread_checker.h"
|
#include "include/base/cef_thread_checker.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
|
|
||||||
///
|
// A flag that can safely be set from one thread and read from other threads.
|
||||||
/// A flag that can safely be set from one thread and read from other threads.
|
//
|
||||||
///
|
// This class IS NOT intended for synchronization between threads.
|
||||||
/// This class IS NOT intended for synchronization between threads.
|
|
||||||
///
|
|
||||||
class AtomicFlag {
|
class AtomicFlag {
|
||||||
public:
|
public:
|
||||||
AtomicFlag();
|
AtomicFlag();
|
||||||
|
|
||||||
AtomicFlag(const AtomicFlag&) = delete;
|
|
||||||
AtomicFlag& operator=(const AtomicFlag&) = delete;
|
|
||||||
|
|
||||||
~AtomicFlag();
|
~AtomicFlag();
|
||||||
|
|
||||||
///
|
// Set the flag. Must always be called from the same thread.
|
||||||
/// Set the flag. Must always be called from the same thread.
|
|
||||||
///
|
|
||||||
void Set();
|
void Set();
|
||||||
|
|
||||||
///
|
// Returns true iff the flag was set. If this returns true, the current thread
|
||||||
/// Returns true iff the flag was set. If this returns true, the current
|
// is guaranteed to be synchronized with all memory operations on the thread
|
||||||
/// thread is guaranteed to be synchronized with all memory operations on the
|
// which invoked Set() up until at least the first call to Set() on it.
|
||||||
/// thread which invoked Set() up until at least the first call to Set() on
|
|
||||||
/// it.
|
|
||||||
///
|
|
||||||
bool IsSet() const {
|
bool IsSet() const {
|
||||||
// Inline here: this has a measurable performance impact on base::WeakPtr.
|
// Inline here: this has a measurable performance impact on base::WeakPtr.
|
||||||
return flag_.load(std::memory_order_acquire) != 0;
|
return flag_.load(std::memory_order_acquire) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Resets the flag. Be careful when using this: callers might not expect
|
||||||
/// Resets the flag. Be careful when using this: callers might not expect
|
// IsSet() to return false after returning true once.
|
||||||
/// IsSet() to return false after returning true once.
|
|
||||||
///
|
|
||||||
void UnsafeResetForTesting();
|
void UnsafeResetForTesting();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::atomic<uint_fast8_t> flag_{0};
|
std::atomic<uint_fast8_t> flag_{0};
|
||||||
base::ThreadChecker set_thread_checker_;
|
base::ThreadChecker set_thread_checker_;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(AtomicFlag);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|||||||
@@ -58,25 +58,19 @@ class AtomicRefCount {
|
|||||||
explicit constexpr AtomicRefCount(int initial_value)
|
explicit constexpr AtomicRefCount(int initial_value)
|
||||||
: ref_count_(initial_value) {}
|
: ref_count_(initial_value) {}
|
||||||
|
|
||||||
///
|
// Increment a reference count.
|
||||||
/// Increment a reference count.
|
// Returns the previous value of the count.
|
||||||
/// Returns the previous value of the count.
|
|
||||||
///
|
|
||||||
int Increment() { return Increment(1); }
|
int Increment() { return Increment(1); }
|
||||||
|
|
||||||
///
|
// Increment a reference count by "increment", which must exceed 0.
|
||||||
/// Increment a reference count by "increment", which must exceed 0.
|
// Returns the previous value of the count.
|
||||||
/// Returns the previous value of the count.
|
|
||||||
///
|
|
||||||
int Increment(int increment) {
|
int Increment(int increment) {
|
||||||
return ref_count_.fetch_add(increment, std::memory_order_relaxed);
|
return ref_count_.fetch_add(increment, std::memory_order_relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Decrement a reference count, and return whether the result is non-zero.
|
||||||
/// Decrement a reference count, and return whether the result is non-zero.
|
// Insert barriers to ensure that state written before the reference count
|
||||||
/// 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.
|
||||||
/// became zero will be visible to a thread that has just made the count zero.
|
|
||||||
///
|
|
||||||
bool Decrement() {
|
bool Decrement() {
|
||||||
// TODO(jbroman): Technically this doesn't need to be an acquire operation
|
// TODO(jbroman): Technically this doesn't need to be an acquire operation
|
||||||
// unless the result is 1 (i.e., the ref count did indeed reach zero).
|
// unless the result is 1 (i.e., the ref count did indeed reach zero).
|
||||||
@@ -85,29 +79,23 @@ class AtomicRefCount {
|
|||||||
return ref_count_.fetch_sub(1, std::memory_order_acq_rel) != 1;
|
return ref_count_.fetch_sub(1, std::memory_order_acq_rel) != 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Return whether the reference count is one. If the reference count is used
|
||||||
/// 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
|
||||||
/// 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
|
||||||
/// 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
|
||||||
/// 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
|
||||||
/// barrier needed for the owning thread to act on the object, knowing that it
|
// has exclusive access to the object.
|
||||||
/// has exclusive access to the object.
|
|
||||||
///
|
|
||||||
bool IsOne() const { return ref_count_.load(std::memory_order_acquire) == 1; }
|
bool IsOne() const { return ref_count_.load(std::memory_order_acquire) == 1; }
|
||||||
|
|
||||||
///
|
// Return whether the reference count is zero. With conventional object
|
||||||
/// Return whether the reference count is zero. With conventional object
|
// referencing counting, the object will be destroyed, so the reference count
|
||||||
/// referencing counting, the object will be destroyed, so the reference count
|
// should never be zero. Hence this is generally used for a debug check.
|
||||||
/// should never be zero. Hence this is generally used for a debug check.
|
|
||||||
///
|
|
||||||
bool IsZero() const {
|
bool IsZero() const {
|
||||||
return ref_count_.load(std::memory_order_acquire) == 0;
|
return ref_count_.load(std::memory_order_acquire) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Returns the current reference count (with no barriers). This is subtle, and
|
||||||
/// Returns the current reference count (with no barriers). This is subtle,
|
// should be used only for debugging.
|
||||||
/// and should be used only for debugging.
|
|
||||||
///
|
|
||||||
int SubtleRefCountForDebug() const {
|
int SubtleRefCountForDebug() const {
|
||||||
return ref_count_.load(std::memory_order_relaxed);
|
return ref_count_.load(std::memory_order_relaxed);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,9 +73,8 @@ class AutoReset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
~AutoReset() {
|
~AutoReset() {
|
||||||
if (scoped_variable_) {
|
if (scoped_variable_)
|
||||||
*scoped_variable_ = std::move(original_value_);
|
*scoped_variable_ = std::move(original_value_);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -26,54 +27,60 @@
|
|||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// 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=3d208a996f65f37012460edb1890773218580913$
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_SHARED_MEMORY_REGION_CAPI_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_SHARED_MEMORY_REGION_CAPI_H_
|
#define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "include/capi/cef_base_capi.h"
|
#include <limits.h> // For UINT_MAX
|
||||||
|
#include <stddef.h> // For size_t
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#include "include/base/cef_build.h"
|
||||||
extern "C" {
|
|
||||||
|
// The NSPR system headers define 64-bit as |long| when possible, except on
|
||||||
|
// Mac OS X. In order to not have typedef mismatches, we do the same on LP64.
|
||||||
|
//
|
||||||
|
// 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;
|
||||||
|
#else
|
||||||
|
typedef long long int64;
|
||||||
|
typedef unsigned long long uint64;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
// TODO: Remove these type guards. These are to avoid conflicts with
|
||||||
/// Structure that wraps platform-dependent share memory region mapping.
|
// obsolete/protypes.h in the Gecko SDK.
|
||||||
///
|
#ifndef _INT32
|
||||||
typedef struct _cef_shared_memory_region_t {
|
#define _INT32
|
||||||
///
|
typedef int int32;
|
||||||
/// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns true (1) if the mapping is valid.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* is_valid)(struct _cef_shared_memory_region_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns the size of the mapping in bytes. Returns 0 for invalid instances.
|
|
||||||
///
|
|
||||||
size_t(CEF_CALLBACK* size)(struct _cef_shared_memory_region_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns the pointer to the memory. Returns nullptr for invalid instances.
|
|
||||||
/// The returned pointer is only valid for the life span of this object.
|
|
||||||
///
|
|
||||||
void*(CEF_CALLBACK* memory)(struct _cef_shared_memory_region_t* self);
|
|
||||||
} cef_shared_memory_region_t;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CAPI_CEF_SHARED_MEMORY_REGION_CAPI_H_
|
// 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;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// UTF-16 character type.
|
||||||
|
#ifndef char16
|
||||||
|
#if defined(WCHAR_T_IS_UTF16)
|
||||||
|
typedef wchar_t char16;
|
||||||
|
#elif defined(WCHAR_T_IS_UTF32)
|
||||||
|
typedef unsigned short char16;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
|
||||||
@@ -28,42 +28,44 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
///
|
// -----------------------------------------------------------------------------
|
||||||
/// \file
|
// Usage documentation
|
||||||
/// base::BindOnce() and base::BindRepeating() are helpers for creating
|
// -----------------------------------------------------------------------------
|
||||||
/// base::OnceCallback and base::RepeatingCallback objects respectively.
|
//
|
||||||
///
|
// Overview:
|
||||||
/// For a runnable object of n-arity, the base::Bind*() family allows partial
|
// base::BindOnce() and base::BindRepeating() are helpers for creating
|
||||||
/// application of the first m arguments. The remaining n - m arguments must be
|
// base::OnceCallback and base::RepeatingCallback objects respectively.
|
||||||
/// passed when invoking the callback with Run().
|
//
|
||||||
///
|
// For a runnable object of n-arity, the base::Bind*() family allows partial
|
||||||
/// <pre>
|
// application of the first m arguments. The remaining n - m arguments must be
|
||||||
/// // The first argument is bound at callback creation; the remaining
|
// passed when invoking the callback with Run().
|
||||||
/// // two must be passed when calling Run() on the callback object.
|
//
|
||||||
/// base::OnceCallback<long(int, long)> cb = base::BindOnce(
|
// // The first argument is bound at callback creation; the remaining
|
||||||
/// [](short x, int y, long z) { return x * y * z; }, 42);
|
// // two must be passed when calling Run() on the callback object.
|
||||||
/// </pre>
|
// base::OnceCallback<long(int, long)> cb = base::BindOnce(
|
||||||
///
|
// [](short x, int y, long z) { return x * y * z; }, 42);
|
||||||
/// When binding to a method, the receiver object must also be specified at
|
//
|
||||||
/// callback creation time. When Run() is invoked, the method will be invoked on
|
// When binding to a method, the receiver object must also be specified at
|
||||||
/// the specified receiver object.
|
// callback creation time. When Run() is invoked, the method will be invoked on
|
||||||
///
|
// the specified receiver object.
|
||||||
/// <pre>
|
//
|
||||||
/// class C : public base::RefCounted<C> { void F(); };
|
// class C : public base::RefCounted<C> { void F(); };
|
||||||
/// auto instance = base::MakeRefCounted<C>();
|
// auto instance = base::MakeRefCounted<C>();
|
||||||
/// auto cb = base::BindOnce(&C::F, instance);
|
// auto cb = base::BindOnce(&C::F, instance);
|
||||||
/// std::move(cb).Run(); // Identical to instance->F()
|
// std::move(cb).Run(); // Identical to instance->F()
|
||||||
/// </pre>
|
//
|
||||||
///
|
// base::Bind is currently a type alias for base::BindRepeating(). In the
|
||||||
/// See https://chromium.googlesource.com/chromium/src/+/lkgr/docs/callback.md
|
// future, we expect to flip this to default to base::BindOnce().
|
||||||
/// for the full documentation.
|
//
|
||||||
///
|
// See //docs/callback.md for the full documentation.
|
||||||
|
//
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
// Implementation notes
|
// Implementation notes
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// If you're reading the implementation, before proceeding further, you should
|
// If you're reading the implementation, before proceeding further, you should
|
||||||
// read the top comment of base/internal/cef_bind_internal.h for a definition
|
// read the top comment of base/internal/cef_bind_internal.h for a definition of
|
||||||
// of common terms and concepts.
|
// common terms and concepts.
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_BIND_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_BIND_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_BIND_H_
|
#define CEF_INCLUDE_BASE_CEF_BIND_H_
|
||||||
@@ -71,7 +73,7 @@
|
|||||||
|
|
||||||
#if defined(USING_CHROMIUM_INCLUDES)
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
// When building CEF include the Chromium header directly.
|
// When building CEF include the Chromium header directly.
|
||||||
#include "base/functional/bind.h"
|
#include "base/bind.h"
|
||||||
#else // !USING_CHROMIUM_INCLUDES
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
// The following is substantially similar to the Chromium implementation.
|
// The following is substantially similar to the Chromium implementation.
|
||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
@@ -84,6 +86,7 @@
|
|||||||
|
|
||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
#include "include/base/cef_compiler_specific.h"
|
#include "include/base/cef_compiler_specific.h"
|
||||||
|
#include "include/base/cef_template_util.h"
|
||||||
#include "include/base/internal/cef_bind_internal.h"
|
#include "include/base/internal/cef_bind_internal.h"
|
||||||
|
|
||||||
#if defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
|
#if defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
|
||||||
@@ -92,45 +95,51 @@
|
|||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
|
|
||||||
///
|
// Bind as OnceCallback.
|
||||||
/// Bind as OnceCallback.
|
|
||||||
///
|
|
||||||
template <typename Functor, typename... Args>
|
template <typename Functor, typename... Args>
|
||||||
inline OnceCallback<cef_internal::MakeUnboundRunType<Functor, Args...>>
|
inline OnceCallback<internal::MakeUnboundRunType<Functor, Args...>> BindOnce(
|
||||||
BindOnce(Functor&& functor, Args&&... args) {
|
Functor&& functor,
|
||||||
static_assert(!cef_internal::IsOnceCallback<std::decay_t<Functor>>() ||
|
Args&&... args) {
|
||||||
|
static_assert(!internal::IsOnceCallback<std::decay_t<Functor>>() ||
|
||||||
(std::is_rvalue_reference<Functor&&>() &&
|
(std::is_rvalue_reference<Functor&&>() &&
|
||||||
!std::is_const<std::remove_reference_t<Functor>>()),
|
!std::is_const<std::remove_reference_t<Functor>>()),
|
||||||
"BindOnce requires non-const rvalue for OnceCallback binding."
|
"BindOnce requires non-const rvalue for OnceCallback binding."
|
||||||
" I.e.: base::BindOnce(std::move(callback)).");
|
" I.e.: base::BindOnce(std::move(callback)).");
|
||||||
static_assert(
|
static_assert(
|
||||||
std::conjunction<cef_internal::AssertBindArgIsNotBasePassed<
|
conjunction<
|
||||||
std::decay_t<Args>>...>::value,
|
internal::AssertBindArgIsNotBasePassed<std::decay_t<Args>>...>::value,
|
||||||
"Use std::move() instead of base::Passed() with base::BindOnce()");
|
"Use std::move() instead of base::Passed() with base::BindOnce()");
|
||||||
|
|
||||||
return cef_internal::BindImpl<OnceCallback>(std::forward<Functor>(functor),
|
return internal::BindImpl<OnceCallback>(std::forward<Functor>(functor),
|
||||||
std::forward<Args>(args)...);
|
std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Bind as RepeatingCallback.
|
||||||
/// Bind as RepeatingCallback.
|
|
||||||
///
|
|
||||||
template <typename Functor, typename... Args>
|
template <typename Functor, typename... Args>
|
||||||
inline RepeatingCallback<cef_internal::MakeUnboundRunType<Functor, Args...>>
|
inline RepeatingCallback<internal::MakeUnboundRunType<Functor, Args...>>
|
||||||
BindRepeating(Functor&& functor, Args&&... args) {
|
BindRepeating(Functor&& functor, Args&&... args) {
|
||||||
static_assert(
|
static_assert(
|
||||||
!cef_internal::IsOnceCallback<std::decay_t<Functor>>(),
|
!internal::IsOnceCallback<std::decay_t<Functor>>(),
|
||||||
"BindRepeating cannot bind OnceCallback. Use BindOnce with std::move().");
|
"BindRepeating cannot bind OnceCallback. Use BindOnce with std::move().");
|
||||||
|
|
||||||
return cef_internal::BindImpl<RepeatingCallback>(
|
return internal::BindImpl<RepeatingCallback>(std::forward<Functor>(functor),
|
||||||
std::forward<Functor>(functor), std::forward<Args>(args)...);
|
std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Unannotated Bind.
|
||||||
/// Special cases for binding to a base::Callback without extra bound arguments.
|
// TODO(tzik): Deprecate this and migrate to OnceCallback and
|
||||||
/// We CHECK() the validity of callback to guard against null pointers
|
// RepeatingCallback, once they get ready.
|
||||||
/// accidentally ending up in posted tasks, causing hard-to-debug crashes.
|
template <typename Functor, typename... Args>
|
||||||
///
|
inline Callback<internal::MakeUnboundRunType<Functor, Args...>> Bind(
|
||||||
|
Functor&& functor,
|
||||||
|
Args&&... args) {
|
||||||
|
return base::BindRepeating(std::forward<Functor>(functor),
|
||||||
|
std::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special cases for binding to a base::Callback without extra bound arguments.
|
||||||
|
// We CHECK() the validity of callback to guard against null pointers
|
||||||
|
// accidentally ending up in posted tasks, causing hard-to-debug crashes.
|
||||||
template <typename Signature>
|
template <typename Signature>
|
||||||
OnceCallback<Signature> BindOnce(OnceCallback<Signature> callback) {
|
OnceCallback<Signature> BindOnce(OnceCallback<Signature> callback) {
|
||||||
CHECK(callback);
|
CHECK(callback);
|
||||||
@@ -150,231 +159,204 @@ RepeatingCallback<Signature> BindRepeating(
|
|||||||
return callback;
|
return callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
template <typename Signature>
|
||||||
/// Unretained() allows binding a non-refcounted class, and to disable
|
Callback<Signature> Bind(Callback<Signature> callback) {
|
||||||
/// refcounting on arguments that are refcounted objects.
|
CHECK(callback);
|
||||||
///
|
return callback;
|
||||||
/// EXAMPLE OF Unretained():
|
|
||||||
///
|
|
||||||
/// <pre>
|
|
||||||
/// class Foo {
|
|
||||||
/// public:
|
|
||||||
/// void func() { cout << "Foo:f" << endl; }
|
|
||||||
/// };
|
|
||||||
///
|
|
||||||
/// // In some function somewhere.
|
|
||||||
/// Foo foo;
|
|
||||||
/// OnceClosure foo_callback =
|
|
||||||
/// BindOnce(&Foo::func, Unretained(&foo));
|
|
||||||
/// std::move(foo_callback).Run(); // Prints "Foo:f".
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// Without the Unretained() wrapper on |&foo|, the above call would fail
|
|
||||||
/// to compile because Foo does not support the AddRef() and Release() methods.
|
|
||||||
///
|
|
||||||
template <typename T>
|
|
||||||
inline cef_internal::UnretainedWrapper<T> Unretained(T* o) {
|
|
||||||
return cef_internal::UnretainedWrapper<T>(o);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Unretained() allows binding a non-refcounted class, and to disable
|
||||||
/// RetainedRef() accepts a ref counted object and retains a reference to it.
|
// refcounting on arguments that are refcounted objects.
|
||||||
/// When the callback is called, the object is passed as a raw pointer.
|
//
|
||||||
///
|
// EXAMPLE OF Unretained():
|
||||||
/// EXAMPLE OF RetainedRef():
|
//
|
||||||
///
|
// class Foo {
|
||||||
/// <pre>
|
// public:
|
||||||
/// void foo(RefCountedBytes* bytes) {}
|
// void func() { cout << "Foo:f" << endl; }
|
||||||
///
|
// };
|
||||||
/// scoped_refptr<RefCountedBytes> bytes = ...;
|
//
|
||||||
/// OnceClosure callback = BindOnce(&foo, base::RetainedRef(bytes));
|
// // In some function somewhere.
|
||||||
/// std::move(callback).Run();
|
// Foo foo;
|
||||||
/// </pre>
|
// OnceClosure foo_callback =
|
||||||
///
|
// BindOnce(&Foo::func, Unretained(&foo));
|
||||||
/// Without RetainedRef, the scoped_refptr would try to implicitly convert to
|
// std::move(foo_callback).Run(); // Prints "Foo:f".
|
||||||
/// a raw pointer and fail compilation:
|
//
|
||||||
///
|
// Without the Unretained() wrapper on |&foo|, the above call would fail
|
||||||
/// <pre>
|
// to compile because Foo does not support the AddRef() and Release() methods.
|
||||||
/// OnceClosure callback = BindOnce(&foo, bytes); // ERROR!
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline cef_internal::RetainedRefWrapper<T> RetainedRef(T* o) {
|
inline internal::UnretainedWrapper<T> Unretained(T* o) {
|
||||||
return cef_internal::RetainedRefWrapper<T>(o);
|
return internal::UnretainedWrapper<T>(o);
|
||||||
}
|
|
||||||
template <typename T>
|
|
||||||
inline cef_internal::RetainedRefWrapper<T> RetainedRef(scoped_refptr<T> o) {
|
|
||||||
return cef_internal::RetainedRefWrapper<T>(std::move(o));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// RetainedRef() accepts a ref counted object and retains a reference to it.
|
||||||
/// Owned() transfers ownership of an object to the callback resulting from
|
// When the callback is called, the object is passed as a raw pointer.
|
||||||
/// bind; the object will be deleted when the callback is deleted.
|
//
|
||||||
///
|
// EXAMPLE OF RetainedRef():
|
||||||
/// EXAMPLE OF Owned():
|
//
|
||||||
///
|
// void foo(RefCountedBytes* bytes) {}
|
||||||
/// <pre>
|
//
|
||||||
/// void foo(int* arg) { cout << *arg << endl }
|
// scoped_refptr<RefCountedBytes> bytes = ...;
|
||||||
///
|
// OnceClosure callback = BindOnce(&foo, base::RetainedRef(bytes));
|
||||||
/// int* pn = new int(1);
|
// std::move(callback).Run();
|
||||||
/// RepeatingClosure foo_callback = BindRepeating(&foo, Owned(pn));
|
//
|
||||||
///
|
// Without RetainedRef, the scoped_refptr would try to implicitly convert to
|
||||||
/// foo_callback.Run(); // Prints "1"
|
// a raw pointer and fail compilation:
|
||||||
/// foo_callback.Run(); // Prints "1"
|
//
|
||||||
/// *pn = 2;
|
// OnceClosure callback = BindOnce(&foo, bytes); // ERROR!
|
||||||
/// foo_callback.Run(); // Prints "2"
|
|
||||||
///
|
|
||||||
/// foo_callback.Reset(); // |pn| is deleted. Also will happen when
|
|
||||||
/// // |foo_callback| goes out of scope.
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// Without Owned(), someone would have to know to delete |pn| when the last
|
|
||||||
/// reference to the callback is deleted.
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline cef_internal::OwnedWrapper<T> Owned(T* o) {
|
inline internal::RetainedRefWrapper<T> RetainedRef(T* o) {
|
||||||
return cef_internal::OwnedWrapper<T>(o);
|
return internal::RetainedRefWrapper<T>(o);
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
inline internal::RetainedRefWrapper<T> RetainedRef(scoped_refptr<T> o) {
|
||||||
|
return internal::RetainedRefWrapper<T>(std::move(o));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Owned() transfers ownership of an object to the callback resulting from
|
||||||
|
// bind; the object will be deleted when the callback is deleted.
|
||||||
|
//
|
||||||
|
// EXAMPLE OF Owned():
|
||||||
|
//
|
||||||
|
// void foo(int* arg) { cout << *arg << endl }
|
||||||
|
//
|
||||||
|
// int* pn = new int(1);
|
||||||
|
// RepeatingClosure foo_callback = BindRepeating(&foo, Owned(pn));
|
||||||
|
//
|
||||||
|
// foo_callback.Run(); // Prints "1"
|
||||||
|
// foo_callback.Run(); // Prints "1"
|
||||||
|
// *pn = 2;
|
||||||
|
// foo_callback.Run(); // Prints "2"
|
||||||
|
//
|
||||||
|
// foo_callback.Reset(); // |pn| is deleted. Also will happen when
|
||||||
|
// // |foo_callback| goes out of scope.
|
||||||
|
//
|
||||||
|
// Without Owned(), someone would have to know to delete |pn| when the last
|
||||||
|
// reference to the callback is deleted.
|
||||||
|
template <typename T>
|
||||||
|
inline internal::OwnedWrapper<T> Owned(T* o) {
|
||||||
|
return internal::OwnedWrapper<T>(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, typename Deleter>
|
template <typename T, typename Deleter>
|
||||||
inline cef_internal::OwnedWrapper<T, Deleter> Owned(
|
inline internal::OwnedWrapper<T, Deleter> Owned(
|
||||||
std::unique_ptr<T, Deleter>&& ptr) {
|
std::unique_ptr<T, Deleter>&& ptr) {
|
||||||
return cef_internal::OwnedWrapper<T, Deleter>(std::move(ptr));
|
return internal::OwnedWrapper<T, Deleter>(std::move(ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// OwnedRef() stores an object in the callback resulting from
|
||||||
/// OwnedRef() stores an object in the callback resulting from
|
// bind and passes a reference to the object to the bound function.
|
||||||
/// bind and passes a reference to the object to the bound function.
|
//
|
||||||
///
|
// EXAMPLE OF OwnedRef():
|
||||||
/// EXAMPLE OF OwnedRef():
|
//
|
||||||
///
|
// void foo(int& arg) { cout << ++arg << endl }
|
||||||
/// <pre>
|
//
|
||||||
/// void foo(int& arg) { cout << ++arg << endl }
|
// int counter = 0;
|
||||||
///
|
// RepeatingClosure foo_callback = BindRepeating(&foo, OwnedRef(counter));
|
||||||
/// int counter = 0;
|
//
|
||||||
/// RepeatingClosure foo_callback = BindRepeating(&foo, OwnedRef(counter));
|
// foo_callback.Run(); // Prints "1"
|
||||||
///
|
// foo_callback.Run(); // Prints "2"
|
||||||
/// foo_callback.Run(); // Prints "1"
|
// foo_callback.Run(); // Prints "3"
|
||||||
/// foo_callback.Run(); // Prints "2"
|
//
|
||||||
/// foo_callback.Run(); // Prints "3"
|
// cout << counter; // Prints "0", OwnedRef creates a copy of counter.
|
||||||
///
|
//
|
||||||
/// cout << counter; // Prints "0", OwnedRef creates a copy of counter.
|
// Supports OnceCallbacks as well, useful to pass placeholder arguments:
|
||||||
/// </pre>
|
//
|
||||||
///
|
// void bar(int& ignore, const std::string& s) { cout << s << endl }
|
||||||
/// Supports OnceCallbacks as well, useful to pass placeholder arguments:
|
//
|
||||||
///
|
// OnceClosure bar_callback = BindOnce(&bar, OwnedRef(0), "Hello");
|
||||||
/// <pre>
|
//
|
||||||
/// void bar(int& ignore, const std::string& s) { cout << s << endl }
|
// std::move(bar_callback).Run(); // Prints "Hello"
|
||||||
///
|
//
|
||||||
/// OnceClosure bar_callback = BindOnce(&bar, OwnedRef(0), "Hello");
|
// Without OwnedRef() it would not be possible to pass a mutable reference to an
|
||||||
///
|
// object owned by the callback.
|
||||||
/// std::move(bar_callback).Run(); // Prints "Hello"
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// Without OwnedRef() it would not be possible to pass a mutable reference to
|
|
||||||
/// an object owned by the callback.
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
cef_internal::OwnedRefWrapper<std::decay_t<T>> OwnedRef(T&& t) {
|
internal::OwnedRefWrapper<std::decay_t<T>> OwnedRef(T&& t) {
|
||||||
return cef_internal::OwnedRefWrapper<std::decay_t<T>>(std::forward<T>(t));
|
return internal::OwnedRefWrapper<std::decay_t<T>>(std::forward<T>(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Passed() is for transferring movable-but-not-copyable types (eg. unique_ptr)
|
||||||
/// Passed() is for transferring movable-but-not-copyable types (eg. unique_ptr)
|
// through a RepeatingCallback. Logically, this signifies a destructive transfer
|
||||||
/// through a RepeatingCallback. Logically, this signifies a destructive
|
// of the state of the argument into the target function. Invoking
|
||||||
/// transfer of the state of the argument into the target function. Invoking
|
// RepeatingCallback::Run() twice on a callback that was created with a Passed()
|
||||||
/// RepeatingCallback::Run() twice on a callback that was created with a
|
// argument will CHECK() because the first invocation would have already
|
||||||
/// Passed() argument will CHECK() because the first invocation would have
|
// transferred ownership to the target function.
|
||||||
/// already transferred ownership to the target function.
|
//
|
||||||
///
|
// Note that Passed() is not necessary with BindOnce(), as std::move() does the
|
||||||
/// Note that Passed() is not necessary with BindOnce(), as std::move() does the
|
// same thing. Avoid Passed() in favor of std::move() with BindOnce().
|
||||||
/// same thing. Avoid Passed() in favor of std::move() with BindOnce().
|
//
|
||||||
///
|
// EXAMPLE OF Passed():
|
||||||
/// EXAMPLE OF Passed():
|
//
|
||||||
///
|
// void TakesOwnership(std::unique_ptr<Foo> arg) { }
|
||||||
/// <pre>
|
// std::unique_ptr<Foo> CreateFoo() { return std::make_unique<Foo>();
|
||||||
/// void TakesOwnership(std::unique_ptr<Foo> arg) { }
|
// }
|
||||||
/// std::unique_ptr<Foo> CreateFoo() { return std::make_unique<Foo>();
|
//
|
||||||
/// }
|
// auto f = std::make_unique<Foo>();
|
||||||
///
|
//
|
||||||
/// auto f = std::make_unique<Foo>();
|
// // |cb| is given ownership of Foo(). |f| is now NULL.
|
||||||
///
|
// // You can use std::move(f) in place of &f, but it's more verbose.
|
||||||
/// // |cb| is given ownership of Foo(). |f| is now NULL.
|
// RepeatingClosure cb = BindRepeating(&TakesOwnership, Passed(&f));
|
||||||
/// // You can use std::move(f) in place of &f, but it's more verbose.
|
//
|
||||||
/// RepeatingClosure cb = BindRepeating(&TakesOwnership, Passed(&f));
|
// // Run was never called so |cb| still owns Foo() and deletes
|
||||||
///
|
// // it on Reset().
|
||||||
/// // Run was never called so |cb| still owns Foo() and deletes
|
// cb.Reset();
|
||||||
/// // it on Reset().
|
//
|
||||||
/// cb.Reset();
|
// // |cb| is given a new Foo created by CreateFoo().
|
||||||
///
|
// cb = BindRepeating(&TakesOwnership, Passed(CreateFoo()));
|
||||||
/// // |cb| is given a new Foo created by CreateFoo().
|
//
|
||||||
/// cb = BindRepeating(&TakesOwnership, Passed(CreateFoo()));
|
// // |arg| in TakesOwnership() is given ownership of Foo(). |cb|
|
||||||
///
|
// // no longer owns Foo() and, if reset, would not delete Foo().
|
||||||
/// // |arg| in TakesOwnership() is given ownership of Foo(). |cb|
|
// cb.Run(); // Foo() is now transferred to |arg| and deleted.
|
||||||
/// // no longer owns Foo() and, if reset, would not delete Foo().
|
// cb.Run(); // This CHECK()s since Foo() already been used once.
|
||||||
/// cb.Run(); // Foo() is now transferred to |arg| and deleted.
|
//
|
||||||
/// cb.Run(); // This CHECK()s since Foo() already been used once.
|
// We offer 2 syntaxes for calling Passed(). The first takes an rvalue and is
|
||||||
/// </pre>
|
// best suited for use with the return value of a function or other temporary
|
||||||
///
|
// rvalues. The second takes a pointer to the scoper and is just syntactic sugar
|
||||||
/// We offer 2 syntaxes for calling Passed(). The first takes an rvalue and is
|
// to avoid having to write Passed(std::move(scoper)).
|
||||||
/// best suited for use with the return value of a function or other temporary
|
//
|
||||||
/// rvalues. The second takes a pointer to the scoper and is just syntactic
|
// Both versions of Passed() prevent T from being an lvalue reference. The first
|
||||||
/// sugar to avoid having to write Passed(std::move(scoper)).
|
// via use of enable_if, and the second takes a T* which will not bind to T&.
|
||||||
///
|
|
||||||
/// Both versions of Passed() prevent T from being an lvalue reference. The
|
|
||||||
/// first via use of enable_if, and the second takes a T* which will not bind to
|
|
||||||
/// T&.
|
|
||||||
///
|
|
||||||
template <typename T,
|
template <typename T,
|
||||||
std::enable_if_t<!std::is_lvalue_reference<T>::value>* = nullptr>
|
std::enable_if_t<!std::is_lvalue_reference<T>::value>* = nullptr>
|
||||||
inline cef_internal::PassedWrapper<T> Passed(T&& scoper) {
|
inline internal::PassedWrapper<T> Passed(T&& scoper) {
|
||||||
return cef_internal::PassedWrapper<T>(std::move(scoper));
|
return internal::PassedWrapper<T>(std::move(scoper));
|
||||||
}
|
}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline cef_internal::PassedWrapper<T> Passed(T* scoper) {
|
inline internal::PassedWrapper<T> Passed(T* scoper) {
|
||||||
return cef_internal::PassedWrapper<T>(std::move(*scoper));
|
return internal::PassedWrapper<T>(std::move(*scoper));
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// IgnoreResult() is used to adapt a function or callback with a return type to
|
||||||
/// IgnoreResult() is used to adapt a function or callback with a return type to
|
// one with a void return. This is most useful if you have a function with,
|
||||||
/// one with a void return. This is most useful if you have a function with,
|
// say, a pesky ignorable bool return that you want to use with PostTask or
|
||||||
/// say, a pesky ignorable bool return that you want to use with PostTask or
|
// something else that expect a callback with a void return.
|
||||||
/// something else that expect a callback with a void return.
|
//
|
||||||
///
|
// EXAMPLE OF IgnoreResult():
|
||||||
/// EXAMPLE OF IgnoreResult():
|
//
|
||||||
///
|
// int DoSomething(int arg) { cout << arg << endl; }
|
||||||
/// <pre>
|
//
|
||||||
/// int DoSomething(int arg) { cout << arg << endl; }
|
// // Assign to a callback with a void return type.
|
||||||
///
|
// OnceCallback<void(int)> cb = BindOnce(IgnoreResult(&DoSomething));
|
||||||
/// // Assign to a callback with a void return type.
|
// std::move(cb).Run(1); // Prints "1".
|
||||||
/// OnceCallback<void(int)> cb = BindOnce(IgnoreResult(&DoSomething));
|
//
|
||||||
/// std::move(cb).Run(1); // Prints "1".
|
// // Prints "2" on |ml|.
|
||||||
///
|
// ml->PostTask(FROM_HERE, BindOnce(IgnoreResult(&DoSomething), 2);
|
||||||
/// // Prints "2" on |ml|.
|
|
||||||
/// ml->PostTask(FROM_HERE, BindOnce(IgnoreResult(&DoSomething), 2);
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline cef_internal::IgnoreResultHelper<T> IgnoreResult(T data) {
|
inline internal::IgnoreResultHelper<T> IgnoreResult(T data) {
|
||||||
return cef_internal::IgnoreResultHelper<T>(std::move(data));
|
return internal::IgnoreResultHelper<T>(std::move(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
|
#if defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
|
||||||
|
|
||||||
///
|
// RetainBlock() is used to adapt an Objective-C block when Automated Reference
|
||||||
/// RetainBlock() is used to adapt an Objective-C block when Automated Reference
|
// Counting (ARC) is disabled. This is unnecessary when ARC is enabled, as the
|
||||||
/// Counting (ARC) is disabled. This is unnecessary when ARC is enabled, as the
|
// BindOnce and BindRepeating already support blocks then.
|
||||||
/// BindOnce and BindRepeating already support blocks then.
|
//
|
||||||
///
|
// EXAMPLE OF RetainBlock():
|
||||||
/// EXAMPLE OF RetainBlock():
|
//
|
||||||
///
|
// // Wrap the block and bind it to a callback.
|
||||||
/// <pre>
|
// OnceCallback<void(int)> cb =
|
||||||
/// // Wrap the block and bind it to a callback.
|
// BindOnce(RetainBlock(^(int n) { NSLog(@"%d", n); }));
|
||||||
/// OnceCallback<void(int)> cb =
|
// std::move(cb).Run(1); // Logs "1".
|
||||||
/// BindOnce(RetainBlock(^(int n) { NSLog(@"%d", n); }));
|
|
||||||
/// std::move(cb).Run(1); // Logs "1".
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
template <typename R, typename... Args>
|
template <typename R, typename... Args>
|
||||||
base::mac::ScopedBlock<R (^)(Args...)> RetainBlock(R (^block)(Args...)) {
|
base::mac::ScopedBlock<R (^)(Args...)> RetainBlock(R (^block)(Args...)) {
|
||||||
return base::mac::ScopedBlock<R (^)(Args...)>(block,
|
return base::mac::ScopedBlock<R (^)(Args...)>(block,
|
||||||
|
|||||||
@@ -27,40 +27,36 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
/// \file
|
// This file adds defines about the platform we're currently building on.
|
||||||
/// This file adds defines about the platform we're currently building on.
|
//
|
||||||
///
|
// Operating System:
|
||||||
/// <pre>
|
// OS_AIX / OS_ANDROID / OS_ASMJS / OS_FREEBSD / OS_FUCHSIA / OS_IOS /
|
||||||
/// Operating System:
|
// OS_LINUX / OS_MAC / OS_NACL (SFI or NONSFI) / OS_NETBSD / OS_OPENBSD /
|
||||||
/// OS_AIX / OS_ANDROID / OS_ASMJS / OS_FREEBSD / OS_FUCHSIA / OS_IOS /
|
// OS_QNX / OS_SOLARIS / OS_WIN
|
||||||
/// OS_LINUX / OS_MAC / OS_NACL (SFI or NONSFI) / OS_NETBSD / OS_OPENBSD /
|
// Operating System family:
|
||||||
/// OS_QNX / OS_SOLARIS / OS_WIN
|
// OS_APPLE: IOS or MAC
|
||||||
/// Operating System family:
|
// OS_BSD: FREEBSD or NETBSD or OPENBSD
|
||||||
/// OS_APPLE: IOS or MAC
|
// OS_POSIX: AIX or ANDROID or ASMJS or CHROMEOS or FREEBSD or IOS or LINUX
|
||||||
/// OS_BSD: FREEBSD or NETBSD or OPENBSD
|
// or MAC or NACL or NETBSD or OPENBSD or QNX or SOLARIS
|
||||||
/// OS_POSIX: AIX or ANDROID or ASMJS or CHROMEOS or FREEBSD or IOS or LINUX
|
//
|
||||||
/// or MAC or NACL or NETBSD or OPENBSD or QNX or SOLARIS
|
// /!\ Note: OS_CHROMEOS is set by the build system, not this file
|
||||||
///
|
//
|
||||||
/// /!\ Note: OS_CHROMEOS is set by the build system, not this file
|
// Compiler:
|
||||||
///
|
// COMPILER_MSVC / COMPILER_GCC
|
||||||
/// Compiler:
|
//
|
||||||
/// COMPILER_MSVC / COMPILER_GCC
|
// Processor:
|
||||||
///
|
// ARCH_CPU_ARM64 / ARCH_CPU_ARMEL / ARCH_CPU_MIPS / ARCH_CPU_MIPS64 /
|
||||||
/// Processor:
|
// ARCH_CPU_MIPS64EL / ARCH_CPU_MIPSEL / ARCH_CPU_PPC64 / ARCH_CPU_S390 /
|
||||||
/// ARCH_CPU_ARM64 / ARCH_CPU_ARMEL / ARCH_CPU_MIPS / ARCH_CPU_MIPS64 /
|
// ARCH_CPU_S390X / ARCH_CPU_X86 / ARCH_CPU_X86_64
|
||||||
/// ARCH_CPU_MIPS64EL / ARCH_CPU_MIPSEL / ARCH_CPU_PPC64 / ARCH_CPU_S390 /
|
// Processor family:
|
||||||
/// ARCH_CPU_S390X / ARCH_CPU_X86 / ARCH_CPU_X86_64
|
// ARCH_CPU_ARM_FAMILY: ARMEL or ARM64
|
||||||
/// Processor family:
|
// ARCH_CPU_MIPS_FAMILY: MIPS64EL or MIPSEL or MIPS64 or MIPS
|
||||||
/// ARCH_CPU_ARM_FAMILY: ARMEL or ARM64
|
// ARCH_CPU_PPC64_FAMILY: PPC64
|
||||||
/// ARCH_CPU_MIPS_FAMILY: MIPS64EL or MIPSEL or MIPS64 or MIPS
|
// ARCH_CPU_S390_FAMILY: S390 or S390X
|
||||||
/// ARCH_CPU_PPC64_FAMILY: PPC64
|
// ARCH_CPU_X86_FAMILY: X86 or X86_64
|
||||||
/// ARCH_CPU_S390_FAMILY: S390 or S390X
|
// Processor features:
|
||||||
/// ARCH_CPU_X86_FAMILY: X86 or X86_64
|
// ARCH_CPU_31_BITS / ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
|
||||||
/// Processor features:
|
// ARCH_CPU_BIG_ENDIAN / ARCH_CPU_LITTLE_ENDIAN
|
||||||
/// ARCH_CPU_31_BITS / ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
|
|
||||||
/// ARCH_CPU_BIG_ENDIAN / ARCH_CPU_LITTLE_ENDIAN
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
|
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||||
@@ -232,19 +228,19 @@
|
|||||||
|
|
||||||
// Type detection for wchar_t.
|
// Type detection for wchar_t.
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#define WCHAR_T_IS_16_BIT
|
#define WCHAR_T_IS_UTF16
|
||||||
#elif defined(OS_FUCHSIA)
|
#elif defined(OS_FUCHSIA)
|
||||||
#define WCHAR_T_IS_32_BIT
|
#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__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
|
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
|
||||||
#define WCHAR_T_IS_32_BIT
|
#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)
|
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
|
||||||
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
|
// 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
|
// compile in this mode (in particular, Chrome doesn't). This is intended for
|
||||||
// other projects using base who manage their own dependencies and make sure
|
// other projects using base who manage their own dependencies and make sure
|
||||||
// short wchar works for them.
|
// short wchar works for them.
|
||||||
#define WCHAR_T_IS_16_BIT
|
#define WCHAR_T_IS_UTF16
|
||||||
#else
|
#else
|
||||||
#error Please add support for your compiler in include/base/cef_build.h
|
#error Please add support for your compiler in include/base/cef_build.h
|
||||||
#endif
|
#endif
|
||||||
@@ -253,7 +249,7 @@
|
|||||||
// The compiler thinks std::string::const_iterator and "const char*" are
|
// The compiler thinks std::string::const_iterator and "const char*" are
|
||||||
// equivalent types.
|
// equivalent types.
|
||||||
#define STD_STRING_ITERATOR_IS_CHAR_POINTER
|
#define STD_STRING_ITERATOR_IS_CHAR_POINTER
|
||||||
// The compiler thinks std::u16string::const_iterator and "char16_t*" are
|
// The compiler thinks std::u16string::const_iterator and "char16*" are
|
||||||
// equivalent types.
|
// equivalent types.
|
||||||
#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
|
#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -28,38 +28,43 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
/// \file
|
// -----------------------------------------------------------------------------
|
||||||
/// A callback is similar in concept to a function pointer: it wraps a runnable
|
// Usage documentation
|
||||||
/// object such as a function, method, lambda, or even another callback,
|
// -----------------------------------------------------------------------------
|
||||||
/// allowing the runnable object to be invoked later via the callback object.
|
//
|
||||||
///
|
// Overview:
|
||||||
/// Unlike function pointers, callbacks are created with base::BindOnce() or
|
// A callback is similar in concept to a function pointer: it wraps a runnable
|
||||||
/// base::BindRepeating() and support partial function application.
|
// object such as a function, method, lambda, or even another callback, allowing
|
||||||
///
|
// the runnable object to be invoked later via the callback object.
|
||||||
/// A base::OnceCallback may be Run() at most once; a base::RepeatingCallback
|
//
|
||||||
/// may be Run() any number of times. |is_null()| is guaranteed to return true
|
// Unlike function pointers, callbacks are created with base::BindOnce() or
|
||||||
/// for a moved-from callback.
|
// base::BindRepeating() and support partial function application.
|
||||||
///
|
//
|
||||||
/// <pre>
|
// A base::OnceCallback may be Run() at most once; a base::RepeatingCallback may
|
||||||
/// // The lambda takes two arguments, but the first argument |x| is bound at
|
// be Run() any number of times. |is_null()| is guaranteed to return true for a
|
||||||
/// // callback creation.
|
// moved-from callback.
|
||||||
/// base::OnceCallback<int(int)> cb = base::BindOnce([] (int x, int y) {
|
//
|
||||||
/// return x + y;
|
// // The lambda takes two arguments, but the first argument |x| is bound at
|
||||||
/// }, 1);
|
// // callback creation.
|
||||||
/// // Run() only needs the remaining unbound argument |y|.
|
// base::OnceCallback<int(int)> cb = base::BindOnce([] (int x, int y) {
|
||||||
/// printf("1 + 2 = %d\n", std::move(cb).Run(2)); // Prints 3
|
// return x + y;
|
||||||
/// printf("cb is null? %s\n",
|
// }, 1);
|
||||||
/// cb.is_null() ? "true" : "false"); // Prints true
|
// // Run() only needs the remaining unbound argument |y|.
|
||||||
/// std::move(cb).Run(2); // Crashes since |cb| has already run.
|
// printf("1 + 2 = %d\n", std::move(cb).Run(2)); // Prints 3
|
||||||
/// </pre>
|
// printf("cb is null? %s\n",
|
||||||
///
|
// cb.is_null() ? "true" : "false"); // Prints true
|
||||||
/// Callbacks also support cancellation. A common use is binding the receiver
|
// std::move(cb).Run(2); // Crashes since |cb| has already run.
|
||||||
/// object as a WeakPtr<T>. If that weak pointer is invalidated, calling Run()
|
//
|
||||||
/// will be a no-op. Note that |IsCancelled()| and |is_null()| are distinct:
|
// Callbacks also support cancellation. A common use is binding the receiver
|
||||||
/// simply cancelling a callback will not also make it null.
|
// object as a WeakPtr<T>. If that weak pointer is invalidated, calling Run()
|
||||||
///
|
// will be a no-op. Note that |IsCancelled()| and |is_null()| are distinct:
|
||||||
/// See https://chromium.googlesource.com/chromium/src/+/lkgr/docs/callback.md
|
// simply cancelling a callback will not also make it null.
|
||||||
/// for the full documentation.
|
//
|
||||||
|
// base::Callback is currently a type alias for base::RepeatingCallback. In the
|
||||||
|
// future, we expect to flip this to default to base::OnceCallback.
|
||||||
|
//
|
||||||
|
// See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/callback.md
|
||||||
|
// for the full documentation.
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_CALLBACK_H_
|
#define CEF_INCLUDE_BASE_CEF_CALLBACK_H_
|
||||||
@@ -67,7 +72,7 @@
|
|||||||
|
|
||||||
#if defined(USING_CHROMIUM_INCLUDES)
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
// When building CEF include the Chromium header directly.
|
// When building CEF include the Chromium header directly.
|
||||||
#include "base/functional/callback.h"
|
#include "base/callback.h"
|
||||||
#else // !USING_CHROMIUM_INCLUDES
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
// The following is substantially similar to the Chromium implementation.
|
// The following is substantially similar to the Chromium implementation.
|
||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
@@ -83,18 +88,18 @@
|
|||||||
namespace base {
|
namespace base {
|
||||||
|
|
||||||
template <typename R, typename... Args>
|
template <typename R, typename... Args>
|
||||||
class OnceCallback<R(Args...)> : public cef_internal::CallbackBase {
|
class OnceCallback<R(Args...)> : public internal::CallbackBase {
|
||||||
public:
|
public:
|
||||||
using ResultType = R;
|
using ResultType = R;
|
||||||
using RunType = R(Args...);
|
using RunType = R(Args...);
|
||||||
using PolymorphicInvoke = R (*)(cef_internal::BindStateBase*,
|
using PolymorphicInvoke = R (*)(internal::BindStateBase*,
|
||||||
cef_internal::PassingType<Args>...);
|
internal::PassingType<Args>...);
|
||||||
|
|
||||||
constexpr OnceCallback() = default;
|
constexpr OnceCallback() = default;
|
||||||
OnceCallback(std::nullptr_t) = delete;
|
OnceCallback(std::nullptr_t) = delete;
|
||||||
|
|
||||||
explicit OnceCallback(cef_internal::BindStateBase* bind_state)
|
explicit OnceCallback(internal::BindStateBase* bind_state)
|
||||||
: cef_internal::CallbackBase(bind_state) {}
|
: internal::CallbackBase(bind_state) {}
|
||||||
|
|
||||||
OnceCallback(const OnceCallback&) = delete;
|
OnceCallback(const OnceCallback&) = delete;
|
||||||
OnceCallback& operator=(const OnceCallback&) = delete;
|
OnceCallback& operator=(const OnceCallback&) = delete;
|
||||||
@@ -103,14 +108,14 @@ class OnceCallback<R(Args...)> : public cef_internal::CallbackBase {
|
|||||||
OnceCallback& operator=(OnceCallback&&) noexcept = default;
|
OnceCallback& operator=(OnceCallback&&) noexcept = default;
|
||||||
|
|
||||||
OnceCallback(RepeatingCallback<RunType> other)
|
OnceCallback(RepeatingCallback<RunType> other)
|
||||||
: cef_internal::CallbackBase(std::move(other)) {}
|
: internal::CallbackBase(std::move(other)) {}
|
||||||
|
|
||||||
OnceCallback& operator=(RepeatingCallback<RunType> other) {
|
OnceCallback& operator=(RepeatingCallback<RunType> other) {
|
||||||
static_cast<cef_internal::CallbackBase&>(*this) = std::move(other);
|
static_cast<internal::CallbackBase&>(*this) = std::move(other);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
R Run(Args... args) const& {
|
R Run(Args... args) const & {
|
||||||
static_assert(!sizeof(*this),
|
static_assert(!sizeof(*this),
|
||||||
"OnceCallback::Run() may only be invoked on a non-const "
|
"OnceCallback::Run() may only be invoked on a non-const "
|
||||||
"rvalue, i.e. std::move(callback).Run().");
|
"rvalue, i.e. std::move(callback).Run().");
|
||||||
@@ -142,7 +147,7 @@ class OnceCallback<R(Args...)> : public cef_internal::CallbackBase {
|
|||||||
OnceCallback<ThenR(Args...)> Then(OnceCallback<ThenR(ThenArgs...)> then) && {
|
OnceCallback<ThenR(Args...)> Then(OnceCallback<ThenR(ThenArgs...)> then) && {
|
||||||
CHECK(then);
|
CHECK(then);
|
||||||
return BindOnce(
|
return BindOnce(
|
||||||
cef_internal::ThenHelper<
|
internal::ThenHelper<
|
||||||
OnceCallback, OnceCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
|
OnceCallback, OnceCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
|
||||||
std::move(*this), std::move(then));
|
std::move(*this), std::move(then));
|
||||||
}
|
}
|
||||||
@@ -155,7 +160,7 @@ class OnceCallback<R(Args...)> : public cef_internal::CallbackBase {
|
|||||||
RepeatingCallback<ThenR(ThenArgs...)> then) && {
|
RepeatingCallback<ThenR(ThenArgs...)> then) && {
|
||||||
CHECK(then);
|
CHECK(then);
|
||||||
return BindOnce(
|
return BindOnce(
|
||||||
cef_internal::ThenHelper<
|
internal::ThenHelper<
|
||||||
OnceCallback,
|
OnceCallback,
|
||||||
RepeatingCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
|
RepeatingCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
|
||||||
std::move(*this), std::move(then));
|
std::move(*this), std::move(then));
|
||||||
@@ -163,19 +168,18 @@ class OnceCallback<R(Args...)> : public cef_internal::CallbackBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename... Args>
|
template <typename R, typename... Args>
|
||||||
class RepeatingCallback<R(Args...)>
|
class RepeatingCallback<R(Args...)> : public internal::CallbackBaseCopyable {
|
||||||
: public cef_internal::CallbackBaseCopyable {
|
|
||||||
public:
|
public:
|
||||||
using ResultType = R;
|
using ResultType = R;
|
||||||
using RunType = R(Args...);
|
using RunType = R(Args...);
|
||||||
using PolymorphicInvoke = R (*)(cef_internal::BindStateBase*,
|
using PolymorphicInvoke = R (*)(internal::BindStateBase*,
|
||||||
cef_internal::PassingType<Args>...);
|
internal::PassingType<Args>...);
|
||||||
|
|
||||||
constexpr RepeatingCallback() = default;
|
constexpr RepeatingCallback() = default;
|
||||||
RepeatingCallback(std::nullptr_t) = delete;
|
RepeatingCallback(std::nullptr_t) = delete;
|
||||||
|
|
||||||
explicit RepeatingCallback(cef_internal::BindStateBase* bind_state)
|
explicit RepeatingCallback(internal::BindStateBase* bind_state)
|
||||||
: cef_internal::CallbackBaseCopyable(bind_state) {}
|
: internal::CallbackBaseCopyable(bind_state) {}
|
||||||
|
|
||||||
// Copyable and movable.
|
// Copyable and movable.
|
||||||
RepeatingCallback(const RepeatingCallback&) = default;
|
RepeatingCallback(const RepeatingCallback&) = default;
|
||||||
@@ -191,7 +195,7 @@ class RepeatingCallback<R(Args...)>
|
|||||||
return !operator==(other);
|
return !operator==(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
R Run(Args... args) const& {
|
R Run(Args... args) const & {
|
||||||
PolymorphicInvoke f =
|
PolymorphicInvoke f =
|
||||||
reinterpret_cast<PolymorphicInvoke>(this->polymorphic_invoke());
|
reinterpret_cast<PolymorphicInvoke>(this->polymorphic_invoke());
|
||||||
return f(this->bind_state_.get(), std::forward<Args>(args)...);
|
return f(this->bind_state_.get(), std::forward<Args>(args)...);
|
||||||
@@ -225,7 +229,7 @@ class RepeatingCallback<R(Args...)>
|
|||||||
RepeatingCallback<ThenR(ThenArgs...)> then) const& {
|
RepeatingCallback<ThenR(ThenArgs...)> then) const& {
|
||||||
CHECK(then);
|
CHECK(then);
|
||||||
return BindRepeating(
|
return BindRepeating(
|
||||||
cef_internal::ThenHelper<
|
internal::ThenHelper<
|
||||||
RepeatingCallback,
|
RepeatingCallback,
|
||||||
RepeatingCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
|
RepeatingCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
|
||||||
*this, std::move(then));
|
*this, std::move(then));
|
||||||
@@ -236,7 +240,7 @@ class RepeatingCallback<R(Args...)>
|
|||||||
RepeatingCallback<ThenR(ThenArgs...)> then) && {
|
RepeatingCallback<ThenR(ThenArgs...)> then) && {
|
||||||
CHECK(then);
|
CHECK(then);
|
||||||
return BindRepeating(
|
return BindRepeating(
|
||||||
cef_internal::ThenHelper<
|
internal::ThenHelper<
|
||||||
RepeatingCallback,
|
RepeatingCallback,
|
||||||
RepeatingCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
|
RepeatingCallback<ThenR(ThenArgs...)>>::CreateTrampoline(),
|
||||||
std::move(*this), std::move(then));
|
std::move(*this), std::move(then));
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#if defined(USING_CHROMIUM_INCLUDES)
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
// When building CEF include the Chromium header directly.
|
// When building CEF include the Chromium header directly.
|
||||||
#include "base/functional/callback_forward.h"
|
#include "base/callback_forward.h"
|
||||||
#else // !USING_CHROMIUM_INCLUDES
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
// The following is substantially similar to the Chromium implementation.
|
// The following is substantially similar to the Chromium implementation.
|
||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
@@ -48,13 +48,15 @@ class OnceCallback;
|
|||||||
template <typename Signature>
|
template <typename Signature>
|
||||||
class RepeatingCallback;
|
class RepeatingCallback;
|
||||||
|
|
||||||
///
|
template <typename Signature>
|
||||||
/// Syntactic sugar to make OnceClosure<void()> and RepeatingClosure<void()>
|
using Callback = RepeatingCallback<Signature>;
|
||||||
/// easier to declare since they will be used in a lot of APIs with delayed
|
|
||||||
/// execution.
|
// Syntactic sugar to make OnceClosure<void()> and RepeatingClosure<void()>
|
||||||
///
|
// easier to declare since they will be used in a lot of APIs with delayed
|
||||||
|
// execution.
|
||||||
using OnceClosure = OnceCallback<void()>;
|
using OnceClosure = OnceCallback<void()>;
|
||||||
using RepeatingClosure = RepeatingCallback<void()>;
|
using RepeatingClosure = RepeatingCallback<void()>;
|
||||||
|
using Closure = Callback<void()>;
|
||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#if defined(USING_CHROMIUM_INCLUDES)
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
// When building CEF include the Chromium header directly.
|
// When building CEF include the Chromium header directly.
|
||||||
#include "base/functional/callback_helpers.h"
|
#include "base/callback_helpers.h"
|
||||||
#else // !USING_CHROMIUM_INCLUDES
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
// The following is substantially similar to the Chromium implementation.
|
// The following is substantially similar to the Chromium implementation.
|
||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
@@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
#include "include/base/cef_bind.h"
|
#include "include/base/cef_bind.h"
|
||||||
#include "include/base/cef_callback.h"
|
#include "include/base/cef_callback.h"
|
||||||
|
#include "include/base/cef_compiler_specific.h"
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
@@ -75,32 +76,24 @@ struct IsOnceCallbackImpl<OnceCallback<R(Args...)>> : std::true_type {};
|
|||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
///
|
// IsBaseCallback<T>::value is true when T is any of the Closure or Callback
|
||||||
/// IsBaseCallback<T>::value is true when T is any of the Closure or Callback
|
// family of types.
|
||||||
/// family of types.
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using IsBaseCallback = internal::IsBaseCallbackImpl<std::decay_t<T>>;
|
using IsBaseCallback = internal::IsBaseCallbackImpl<std::decay_t<T>>;
|
||||||
|
|
||||||
///
|
// IsOnceCallback<T>::value is true when T is a OnceClosure or OnceCallback
|
||||||
/// IsOnceCallback<T>::value is true when T is a OnceClosure or OnceCallback
|
// type.
|
||||||
/// type.
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using IsOnceCallback = internal::IsOnceCallbackImpl<std::decay_t<T>>;
|
using IsOnceCallback = internal::IsOnceCallbackImpl<std::decay_t<T>>;
|
||||||
|
|
||||||
///
|
// SFINAE friendly enabler allowing to overload methods for both Repeating and
|
||||||
/// SFINAE friendly enabler allowing to overload methods for both Repeating and
|
// OnceCallbacks.
|
||||||
/// OnceCallbacks.
|
//
|
||||||
///
|
// Usage:
|
||||||
/// Usage:
|
// template <template <typename> class CallbackType,
|
||||||
/// <pre>
|
// ... other template args ...,
|
||||||
/// template <template <typename> class CallbackType,
|
// typename = EnableIfIsBaseCallback<CallbackType>>
|
||||||
/// ... other template args ...,
|
// void DoStuff(CallbackType<...> cb, ...);
|
||||||
/// typename = EnableIfIsBaseCallback<CallbackType>>
|
|
||||||
/// void DoStuff(CallbackType<...> cb, ...);
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
template <template <typename> class CallbackType>
|
template <template <typename> class CallbackType>
|
||||||
using EnableIfIsBaseCallback =
|
using EnableIfIsBaseCallback =
|
||||||
std::enable_if_t<IsBaseCallback<CallbackType<void()>>::value>;
|
std::enable_if_t<IsBaseCallback<CallbackType<void()>>::value>;
|
||||||
@@ -137,16 +130,13 @@ class OnceCallbackHolder final {
|
|||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
///
|
// Wraps the given OnceCallback into a RepeatingCallback that relays its
|
||||||
/// Wraps the given OnceCallback into a RepeatingCallback that relays its
|
// invocation to the original OnceCallback on the first invocation. The
|
||||||
/// invocation to the original OnceCallback on the first invocation. The
|
// following invocations are just ignored.
|
||||||
/// following invocations are just ignored.
|
//
|
||||||
///
|
// Note that this deliberately subverts the Once/Repeating paradigm of Callbacks
|
||||||
/// Note that this deliberately subverts the Once/Repeating paradigm of
|
// but helps ease the migration from old-style Callbacks. Avoid if possible; use
|
||||||
/// Callbacks but helps ease the migration from old-style Callbacks. Avoid if
|
// if necessary for migration. TODO(tzik): Remove it. https://crbug.com/730593
|
||||||
/// possible; use if necessary for migration.
|
|
||||||
///
|
|
||||||
// TODO(tzik): Remove it. https://crbug.com/730593
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
RepeatingCallback<void(Args...)> AdaptCallbackForRepeating(
|
RepeatingCallback<void(Args...)> AdaptCallbackForRepeating(
|
||||||
OnceCallback<void(Args...)> callback) {
|
OnceCallback<void(Args...)> callback) {
|
||||||
@@ -156,11 +146,9 @@ RepeatingCallback<void(Args...)> AdaptCallbackForRepeating(
|
|||||||
/*ignore_extra_runs=*/true));
|
/*ignore_extra_runs=*/true));
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Wraps the given OnceCallback and returns two OnceCallbacks with an identical
|
||||||
/// Wraps the given OnceCallback and returns two OnceCallbacks with an identical
|
// signature. On first invokation of either returned callbacks, the original
|
||||||
/// signature. On first invokation of either returned callbacks, the original
|
// callback is invoked. Invoking the remaining callback results in a crash.
|
||||||
/// callback is invoked. Invoking the remaining callback results in a crash.
|
|
||||||
///
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
std::pair<OnceCallback<void(Args...)>, OnceCallback<void(Args...)>>
|
std::pair<OnceCallback<void(Args...)>, OnceCallback<void(Args...)>>
|
||||||
SplitOnceCallback(OnceCallback<void(Args...)> callback) {
|
SplitOnceCallback(OnceCallback<void(Args...)> callback) {
|
||||||
@@ -171,12 +159,10 @@ SplitOnceCallback(OnceCallback<void(Args...)> callback) {
|
|||||||
return std::make_pair(wrapped_once, wrapped_once);
|
return std::make_pair(wrapped_once, wrapped_once);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// ScopedClosureRunner is akin to std::unique_ptr<> for Closures. It ensures
|
||||||
/// ScopedClosureRunner is akin to std::unique_ptr<> for Closures. It ensures
|
// that the Closure is executed no matter how the current scope exits.
|
||||||
/// that the Closure is executed no matter how the current scope exits.
|
// If you are looking for "ScopedCallback", "CallbackRunner", or
|
||||||
/// If you are looking for "ScopedCallback", "CallbackRunner", or
|
// "CallbackScoper" this is the class you want.
|
||||||
/// "CallbackScoper" this is the class you want.
|
|
||||||
///
|
|
||||||
class ScopedClosureRunner {
|
class ScopedClosureRunner {
|
||||||
public:
|
public:
|
||||||
ScopedClosureRunner();
|
ScopedClosureRunner();
|
||||||
@@ -198,15 +184,13 @@ class ScopedClosureRunner {
|
|||||||
void ReplaceClosure(OnceClosure closure);
|
void ReplaceClosure(OnceClosure closure);
|
||||||
|
|
||||||
// Releases the Closure without calling.
|
// Releases the Closure without calling.
|
||||||
[[nodiscard]] OnceClosure Release();
|
OnceClosure Release() WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OnceClosure closure_;
|
OnceClosure closure_;
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// Creates a null callback.
|
||||||
/// Creates a null callback.
|
|
||||||
///
|
|
||||||
class NullCallback {
|
class NullCallback {
|
||||||
public:
|
public:
|
||||||
template <typename R, typename... Args>
|
template <typename R, typename... Args>
|
||||||
@@ -219,9 +203,7 @@ class NullCallback {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// Creates a callback that does nothing when called.
|
||||||
/// Creates a callback that does nothing when called.
|
|
||||||
///
|
|
||||||
class DoNothing {
|
class DoNothing {
|
||||||
public:
|
public:
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
@@ -244,11 +226,9 @@ class DoNothing {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// Useful for creating a Closure that will delete a pointer when invoked. Only
|
||||||
/// Useful for creating a Closure that will delete a pointer when invoked. Only
|
// use this when necessary. In most cases MessageLoop::DeleteSoon() is a better
|
||||||
/// use this when necessary. In most cases MessageLoop::DeleteSoon() is a better
|
// fit.
|
||||||
/// fit.
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void DeletePointer(T* obj) {
|
void DeletePointer(T* obj) {
|
||||||
delete obj;
|
delete obj;
|
||||||
|
|||||||
@@ -28,57 +28,54 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
///
|
// OVERVIEW:
|
||||||
/// \file
|
//
|
||||||
/// A container for a list of callbacks. Provides callers the ability to
|
// A container for a list of callbacks. Provides callers the ability to manually
|
||||||
/// manually or automatically unregister callbacks at any time, including during
|
// or automatically unregister callbacks at any time, including during callback
|
||||||
/// callback notification.
|
// notification.
|
||||||
///
|
//
|
||||||
/// TYPICAL USAGE:
|
// TYPICAL USAGE:
|
||||||
///
|
//
|
||||||
/// <pre>
|
// class MyWidget {
|
||||||
/// class MyWidget {
|
// public:
|
||||||
/// public:
|
// using CallbackList = base::RepeatingCallbackList<void(const Foo&)>;
|
||||||
/// using CallbackList = base::RepeatingCallbackList<void(const Foo&)>;
|
//
|
||||||
///
|
// // Registers |cb| to be called whenever NotifyFoo() is executed.
|
||||||
/// // Registers |cb| to be called whenever NotifyFoo() is executed.
|
// CallbackListSubscription RegisterCallback(CallbackList::CallbackType cb) {
|
||||||
/// CallbackListSubscription RegisterCallback(CallbackList::CallbackType cb) {
|
// return callback_list_.Add(std::move(cb));
|
||||||
/// return callback_list_.Add(std::move(cb));
|
// }
|
||||||
/// }
|
//
|
||||||
///
|
// private:
|
||||||
/// private:
|
// // Calls all registered callbacks, with |foo| as the supplied arg.
|
||||||
/// // Calls all registered callbacks, with |foo| as the supplied arg.
|
// void NotifyFoo(const Foo& foo) {
|
||||||
/// void NotifyFoo(const Foo& foo) {
|
// callback_list_.Notify(foo);
|
||||||
/// callback_list_.Notify(foo);
|
// }
|
||||||
/// }
|
//
|
||||||
///
|
// CallbackList callback_list_;
|
||||||
/// CallbackList callback_list_;
|
// };
|
||||||
/// };
|
//
|
||||||
///
|
//
|
||||||
///
|
// class MyWidgetListener {
|
||||||
/// class MyWidgetListener {
|
// private:
|
||||||
/// private:
|
// void OnFoo(const Foo& foo) {
|
||||||
/// void OnFoo(const Foo& foo) {
|
// // Called whenever MyWidget::NotifyFoo() is executed, unless
|
||||||
/// // Called whenever MyWidget::NotifyFoo() is executed, unless
|
// // |foo_subscription_| has been destroyed.
|
||||||
/// // |foo_subscription_| has been destroyed.
|
// }
|
||||||
/// }
|
//
|
||||||
///
|
// // Automatically deregisters the callback when deleted (e.g. in
|
||||||
/// // Automatically deregisters the callback when deleted (e.g. in
|
// // ~MyWidgetListener()). Unretained(this) is safe here since the
|
||||||
/// // ~MyWidgetListener()). Unretained(this) is safe here since the
|
// // ScopedClosureRunner does not outlive |this|.
|
||||||
/// // ScopedClosureRunner does not outlive |this|.
|
// CallbackListSubscription foo_subscription_ =
|
||||||
/// CallbackListSubscription foo_subscription_ =
|
// MyWidget::Get()->RegisterCallback(
|
||||||
/// MyWidget::Get()->RegisterCallback(
|
// base::BindRepeating(&MyWidgetListener::OnFoo,
|
||||||
/// base::BindRepeating(&MyWidgetListener::OnFoo,
|
// base::Unretained(this)));
|
||||||
/// base::Unretained(this)));
|
// };
|
||||||
/// };
|
//
|
||||||
/// </pre>
|
// UNSUPPORTED:
|
||||||
///
|
//
|
||||||
/// UNSUPPORTED:
|
// * Destroying the CallbackList during callback notification.
|
||||||
///
|
//
|
||||||
/// * Destroying the CallbackList during callback notification.
|
// This is possible to support, but not currently necessary.
|
||||||
///
|
|
||||||
/// This is possible to support, but not currently necessary.
|
|
||||||
///
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
|
#define CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
|
||||||
@@ -86,7 +83,7 @@
|
|||||||
|
|
||||||
#if defined(USING_CHROMIUM_INCLUDES)
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
// When building CEF include the Chromium header directly.
|
// When building CEF include the Chromium header directly.
|
||||||
#include "base/functional/callback_list.h"
|
#include "base/callback_list.h"
|
||||||
#else // !USING_CHROMIUM_INCLUDES
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
// The following is substantially similar to the Chromium implementation.
|
// The following is substantially similar to the Chromium implementation.
|
||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
@@ -101,6 +98,7 @@
|
|||||||
#include "include/base/cef_bind.h"
|
#include "include/base/cef_bind.h"
|
||||||
#include "include/base/cef_callback.h"
|
#include "include/base/cef_callback.h"
|
||||||
#include "include/base/cef_callback_helpers.h"
|
#include "include/base/cef_callback_helpers.h"
|
||||||
|
#include "include/base/cef_compiler_specific.h"
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
#include "include/base/cef_weak_ptr.h"
|
#include "include/base/cef_weak_ptr.h"
|
||||||
|
|
||||||
@@ -193,7 +191,7 @@ class CallbackListBase {
|
|||||||
|
|
||||||
// Registers |cb| for future notifications. Returns a CallbackListSubscription
|
// Registers |cb| for future notifications. Returns a CallbackListSubscription
|
||||||
// whose destruction will cancel |cb|.
|
// whose destruction will cancel |cb|.
|
||||||
[[nodiscard]] CallbackListSubscription Add(CallbackType cb) {
|
CallbackListSubscription Add(CallbackType cb) WARN_UNUSED_RESULT {
|
||||||
DCHECK(!cb.is_null());
|
DCHECK(!cb.is_null());
|
||||||
return CallbackListSubscription(base::BindOnce(
|
return CallbackListSubscription(base::BindOnce(
|
||||||
&CallbackListBase::CancelCallback, weak_ptr_factory_.GetWeakPtr(),
|
&CallbackListBase::CancelCallback, weak_ptr_factory_.GetWeakPtr(),
|
||||||
@@ -242,9 +240,8 @@ class CallbackListBase {
|
|||||||
// the reentrant Notify() call.
|
// the reentrant Notify() call.
|
||||||
template <typename... RunArgs>
|
template <typename... RunArgs>
|
||||||
void Notify(RunArgs&&... args) {
|
void Notify(RunArgs&&... args) {
|
||||||
if (empty()) {
|
if (empty())
|
||||||
return; // Nothing to do.
|
return; // Nothing to do.
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
AutoReset<bool> iterating(&iterating_, true);
|
AutoReset<bool> iterating(&iterating_, true);
|
||||||
@@ -258,20 +255,18 @@ class CallbackListBase {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
for (auto it = next_valid(callbacks_.begin()); it != callbacks_.end();
|
for (auto it = next_valid(callbacks_.begin()); it != callbacks_.end();
|
||||||
it = next_valid(it)) {
|
it = next_valid(it))
|
||||||
// NOTE: Intentionally does not call std::forward<RunArgs>(args)...,
|
// NOTE: Intentionally does not call std::forward<RunArgs>(args)...,
|
||||||
// since that would allow move-only arguments.
|
// since that would allow move-only arguments.
|
||||||
static_cast<CallbackListImpl*>(this)->RunCallback(it++, args...);
|
static_cast<CallbackListImpl*>(this)->RunCallback(it++, args...);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-entrant invocations shouldn't prune anything from the list. This can
|
// Re-entrant invocations shouldn't prune anything from the list. This can
|
||||||
// invalidate iterators from underneath higher call frames. It's safe to
|
// invalidate iterators from underneath higher call frames. It's safe to
|
||||||
// simply do nothing, since the outermost frame will continue through here
|
// simply do nothing, since the outermost frame will continue through here
|
||||||
// and prune all null callbacks below.
|
// and prune all null callbacks below.
|
||||||
if (iterating_) {
|
if (iterating_)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
// Any null callbacks remaining in the list were canceled due to
|
// Any null callbacks remaining in the list were canceled due to
|
||||||
// Subscription destruction during iteration, and can safely be erased now.
|
// Subscription destruction during iteration, and can safely be erased now.
|
||||||
@@ -285,9 +280,8 @@ class CallbackListBase {
|
|||||||
// that were executed above have all been removed regardless of whether
|
// that were executed above have all been removed regardless of whether
|
||||||
// they're counted in |erased_callbacks_|.
|
// they're counted in |erased_callbacks_|.
|
||||||
if (removal_callback_ &&
|
if (removal_callback_ &&
|
||||||
(erased_callbacks || IsOnceCallback<CallbackType>::value)) {
|
(erased_callbacks || IsOnceCallback<CallbackType>::value))
|
||||||
removal_callback_.Run(); // May delete |this|!
|
removal_callback_.Run(); // May delete |this|!
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -299,9 +293,8 @@ class CallbackListBase {
|
|||||||
private:
|
private:
|
||||||
// Cancels the callback pointed to by |it|, which is guaranteed to be valid.
|
// Cancels the callback pointed to by |it|, which is guaranteed to be valid.
|
||||||
void CancelCallback(const typename Callbacks::iterator& it) {
|
void CancelCallback(const typename Callbacks::iterator& it) {
|
||||||
if (static_cast<CallbackListImpl*>(this)->CancelNullCallback(it)) {
|
if (static_cast<CallbackListImpl*>(this)->CancelNullCallback(it))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (iterating_) {
|
if (iterating_) {
|
||||||
// Calling erase() here is unsafe, since the loop in Notify() may be
|
// Calling erase() here is unsafe, since the loop in Notify() may be
|
||||||
@@ -311,9 +304,8 @@ class CallbackListBase {
|
|||||||
it->Reset();
|
it->Reset();
|
||||||
} else {
|
} else {
|
||||||
callbacks_.erase(it);
|
callbacks_.erase(it);
|
||||||
if (removal_callback_) {
|
if (removal_callback_)
|
||||||
removal_callback_.Run(); // May delete |this|!
|
removal_callback_.Run(); // May delete |this|!
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,9 +382,9 @@ class RepeatingCallbackList
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// Syntactic sugar to parallel that used for Callbacks.
|
||||||
/// Syntactic sugar to parallel that used for Callbacks.
|
// ClosureList explicitly not provided since it is not used, and CallbackList
|
||||||
///
|
// is deprecated. {Once,Repeating}ClosureList should instead be used.
|
||||||
using OnceClosureList = OnceCallbackList<void()>;
|
using OnceClosureList = OnceCallbackList<void()>;
|
||||||
using RepeatingClosureList = RepeatingCallbackList<void()>;
|
using RepeatingClosureList = RepeatingCallbackList<void()>;
|
||||||
|
|
||||||
|
|||||||
@@ -28,51 +28,44 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
///
|
// CancelableCallback is a wrapper around base::Callback that allows
|
||||||
/// \file
|
// cancellation of a callback. CancelableCallback takes a reference on the
|
||||||
/// CancelableCallback is a wrapper around base::Callback that allows
|
// wrapped callback until this object is destroyed or Reset()/Cancel() are
|
||||||
/// cancellation of a callback. CancelableCallback takes a reference on the
|
// called.
|
||||||
/// wrapped callback until this object is destroyed or Reset()/Cancel() are
|
//
|
||||||
/// called.
|
// NOTE:
|
||||||
///
|
//
|
||||||
/// NOTE:
|
// Calling CancelableCallback::Cancel() brings the object back to its natural,
|
||||||
///
|
// default-constructed state, i.e., CancelableCallback::callback() will return
|
||||||
/// Calling CancelableCallback::Cancel() brings the object back to its natural,
|
// a null callback.
|
||||||
/// default-constructed state, i.e., CancelableCallback::callback() will return
|
//
|
||||||
/// a null callback.
|
// THREAD-SAFETY:
|
||||||
///
|
//
|
||||||
/// THREAD-SAFETY:
|
// CancelableCallback objects must be created on, posted to, cancelled on, and
|
||||||
///
|
// destroyed on the same thread.
|
||||||
/// CancelableCallback objects must be created on, posted to, cancelled on, and
|
//
|
||||||
/// destroyed on the same thread.
|
//
|
||||||
///
|
// EXAMPLE USAGE:
|
||||||
///
|
//
|
||||||
/// EXAMPLE USAGE:
|
// In the following example, the test is verifying that RunIntensiveTest()
|
||||||
///
|
// Quit()s the message loop within 4 seconds. The cancelable callback is posted
|
||||||
/// In the following example, the test is verifying that RunIntensiveTest()
|
// to the message loop, the intensive test runs, the message loop is run,
|
||||||
/// Quit()s the message loop within 4 seconds. The cancelable callback is posted
|
// then the callback is cancelled.
|
||||||
/// to the message loop, the intensive test runs, the message loop is run,
|
//
|
||||||
/// then the callback is cancelled.
|
// RunLoop run_loop;
|
||||||
///
|
//
|
||||||
/// <pre>
|
// void TimeoutCallback(const std::string& timeout_message) {
|
||||||
/// RunLoop run_loop;
|
// FAIL() << timeout_message;
|
||||||
///
|
// run_loop.QuitWhenIdle();
|
||||||
/// void TimeoutCallback(const std::string& timeout_message) {
|
// }
|
||||||
/// FAIL() << timeout_message;
|
//
|
||||||
/// run_loop.QuitWhenIdle();
|
// CancelableOnceClosure timeout(
|
||||||
/// }
|
// base::BindOnce(&TimeoutCallback, "Test timed out."));
|
||||||
///
|
// ThreadTaskRunnerHandle::Get()->PostDelayedTask(FROM_HERE, timeout.callback(),
|
||||||
/// CancelableOnceClosure timeout(
|
// TimeDelta::FromSeconds(4));
|
||||||
/// base::BindOnce(&TimeoutCallback, "Test timed out."));
|
// RunIntensiveTest();
|
||||||
/// ThreadTaskRunnerHandle::Get()->PostDelayedTask(FROM_HERE,
|
// run_loop.Run();
|
||||||
/// timeout.callback(),
|
// timeout.Cancel(); // Hopefully this is hit before the timeout callback runs.
|
||||||
/// TimeDelta::FromSeconds(4));
|
|
||||||
/// RunIntensiveTest();
|
|
||||||
/// run_loop.Run();
|
|
||||||
/// // Hopefully this is hit before the timeout callback runs.
|
|
||||||
/// timeout.Cancel();
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
|
#define CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
|
||||||
@@ -90,10 +83,10 @@
|
|||||||
|
|
||||||
#include "include/base/cef_bind.h"
|
#include "include/base/cef_bind.h"
|
||||||
#include "include/base/cef_callback.h"
|
#include "include/base/cef_callback.h"
|
||||||
#include "include/base/cef_compiler_specific.h"
|
|
||||||
#include "include/base/cef_logging.h"
|
|
||||||
#include "include/base/cef_weak_ptr.h"
|
|
||||||
#include "include/base/internal/cef_callback_internal.h"
|
#include "include/base/internal/cef_callback_internal.h"
|
||||||
|
#include "include/base/cef_logging.h"
|
||||||
|
#include "include/base/cef_compiler_specific.h"
|
||||||
|
#include "include/base/cef_weak_ptr.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
@@ -120,7 +113,9 @@ class CancelableCallbackImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the wrapped callback has been cancelled.
|
// 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
|
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
||||||
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
||||||
@@ -133,9 +128,8 @@ class CancelableCallbackImpl {
|
|||||||
|
|
||||||
// Returns a callback that can be disabled by calling Cancel().
|
// Returns a callback that can be disabled by calling Cancel().
|
||||||
CallbackType callback() const {
|
CallbackType callback() const {
|
||||||
if (!callback_) {
|
if (!callback_)
|
||||||
return CallbackType();
|
return CallbackType();
|
||||||
}
|
|
||||||
CallbackType forwarder;
|
CallbackType forwarder;
|
||||||
MakeForwarder(&forwarder);
|
MakeForwarder(&forwarder);
|
||||||
return forwarder;
|
return forwarder;
|
||||||
@@ -174,10 +168,8 @@ class CancelableCallbackImpl {
|
|||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
///
|
// Consider using base::WeakPtr directly instead of base::CancelableCallback for
|
||||||
/// Consider using base::WeakPtr directly instead of base::CancelableCallback
|
// the task cancellation.
|
||||||
/// for the task cancellation.
|
|
||||||
///
|
|
||||||
template <typename Signature>
|
template <typename Signature>
|
||||||
using CancelableOnceCallback =
|
using CancelableOnceCallback =
|
||||||
internal::CancelableCallbackImpl<OnceCallback<Signature>>;
|
internal::CancelableCallbackImpl<OnceCallback<Signature>>;
|
||||||
@@ -188,6 +180,10 @@ using CancelableRepeatingCallback =
|
|||||||
internal::CancelableCallbackImpl<RepeatingCallback<Signature>>;
|
internal::CancelableCallbackImpl<RepeatingCallback<Signature>>;
|
||||||
using CancelableRepeatingClosure = CancelableRepeatingCallback<void()>;
|
using CancelableRepeatingClosure = CancelableRepeatingCallback<void()>;
|
||||||
|
|
||||||
|
template <typename Signature>
|
||||||
|
using CancelableCallback = CancelableRepeatingCallback<Signature>;
|
||||||
|
using CancelableClosure = CancelableCallback<void()>;
|
||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
#endif // !USING_CHROMIUM_INCLUDES
|
#endif // !USING_CHROMIUM_INCLUDES
|
||||||
|
|||||||
@@ -32,7 +32,12 @@
|
|||||||
#define CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_
|
#define CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(USING_CHROMIUM_INCLUDES)
|
#if defined(BASE_COMPILER_SPECIFIC_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.
|
// When building CEF include the Chromium header directly.
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#else // !USING_CHROMIUM_INCLUDES
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
@@ -71,6 +76,23 @@
|
|||||||
#define __has_attribute(x) 0
|
#define __has_attribute(x) 0
|
||||||
#endif // !defined(__has_attribute)
|
#endif // !defined(__has_attribute)
|
||||||
|
|
||||||
|
// Annotate a variable indicating it's ok if the variable is not used.
|
||||||
|
// (Typically used to silence a compiler warning when the assignment
|
||||||
|
// is important for some other reason.)
|
||||||
|
// Use like:
|
||||||
|
// int x = ...;
|
||||||
|
// ALLOW_UNUSED_LOCAL(x);
|
||||||
|
#define ALLOW_UNUSED_LOCAL(x) (void)x
|
||||||
|
|
||||||
|
// Annotate a typedef or function indicating it's ok if it's not used.
|
||||||
|
// Use like:
|
||||||
|
// typedef Foo Bar ALLOW_UNUSED_TYPE;
|
||||||
|
#if defined(COMPILER_GCC) || defined(__clang__)
|
||||||
|
#define ALLOW_UNUSED_TYPE __attribute__((unused))
|
||||||
|
#else
|
||||||
|
#define ALLOW_UNUSED_TYPE
|
||||||
|
#endif
|
||||||
|
|
||||||
// Annotate a function indicating it should not be inlined.
|
// Annotate a function indicating it should not be inlined.
|
||||||
// Use like:
|
// Use like:
|
||||||
// NOINLINE void DoStuff() { ... }
|
// NOINLINE void DoStuff() { ... }
|
||||||
@@ -131,6 +153,17 @@
|
|||||||
#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
|
#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Annotate a function indicating the caller must examine the return value.
|
||||||
|
// Use like:
|
||||||
|
// int foo() WARN_UNUSED_RESULT;
|
||||||
|
// To explicitly ignore a result, see |ignore_result()| in base/macros.h.
|
||||||
|
#undef WARN_UNUSED_RESULT
|
||||||
|
#if defined(COMPILER_GCC) || defined(__clang__)
|
||||||
|
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||||
|
#else
|
||||||
|
#define WARN_UNUSED_RESULT
|
||||||
|
#endif
|
||||||
|
|
||||||
// In case the compiler supports it NO_UNIQUE_ADDRESS evaluates to the C++20
|
// In case the compiler supports it NO_UNIQUE_ADDRESS evaluates to the C++20
|
||||||
// attribute [[no_unique_address]]. This allows annotating data members so that
|
// attribute [[no_unique_address]]. This allows annotating data members so that
|
||||||
// they need not have an address distinct from all other non-static data members
|
// they need not have an address distinct from all other non-static data members
|
||||||
@@ -251,6 +284,13 @@
|
|||||||
#define HAS_FEATURE(FEATURE) 0
|
#define HAS_FEATURE(FEATURE) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Macro for telling -Wimplicit-fallthrough that a fallthrough is intentional.
|
||||||
|
#if defined(__clang__)
|
||||||
|
#define FALLTHROUGH [[clang::fallthrough]]
|
||||||
|
#else
|
||||||
|
#define FALLTHROUGH
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(COMPILER_GCC)
|
#if defined(COMPILER_GCC)
|
||||||
#define PRETTY_FUNCTION __PRETTY_FUNCTION__
|
#define PRETTY_FUNCTION __PRETTY_FUNCTION__
|
||||||
#elif defined(COMPILER_MSVC)
|
#elif defined(COMPILER_MSVC)
|
||||||
@@ -379,4 +419,5 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // !USING_CHROMIUM_INCLUDES
|
#endif // !USING_CHROMIUM_INCLUDES
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_
|
#endif // CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_
|
||||||
|
|||||||
133
include/base/cef_cxx17_backports.h
Normal file
133
include/base/cef_cxx17_backports.h
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
// Copyright (c) 2021 Marshall A. Greenblatt. Portions copyright (c) 2021
|
||||||
|
// 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_CXX17_BACKPORTS_H_
|
||||||
|
#define CEF_INCLUDE_BASE_CEF_CXX17_BACKPORTS_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
|
// When building CEF include the Chromium header directly.
|
||||||
|
// TODO(cef): Change to "base/cxx17_backports.h" in M93.
|
||||||
|
#include "base/stl_util.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 <array>
|
||||||
|
#include <initializer_list>
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
|
||||||
|
// C++14 implementation of C++17's std::size():
|
||||||
|
// http://en.cppreference.com/w/cpp/iterator/size
|
||||||
|
template <typename Container>
|
||||||
|
constexpr auto size(const Container& c) -> decltype(c.size()) {
|
||||||
|
return c.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t N>
|
||||||
|
constexpr size_t size(const T (&array)[N]) noexcept {
|
||||||
|
return N;
|
||||||
|
}
|
||||||
|
|
||||||
|
// C++14 implementation of C++17's std::empty():
|
||||||
|
// http://en.cppreference.com/w/cpp/iterator/empty
|
||||||
|
template <typename Container>
|
||||||
|
constexpr auto empty(const Container& c) -> decltype(c.empty()) {
|
||||||
|
return c.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t N>
|
||||||
|
constexpr bool empty(const T (&array)[N]) noexcept {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
constexpr bool empty(std::initializer_list<T> il) noexcept {
|
||||||
|
return il.size() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// C++14 implementation of C++17's std::data():
|
||||||
|
// http://en.cppreference.com/w/cpp/iterator/data
|
||||||
|
template <typename Container>
|
||||||
|
constexpr auto data(Container& c) -> decltype(c.data()) {
|
||||||
|
return c.data();
|
||||||
|
}
|
||||||
|
|
||||||
|
// std::basic_string::data() had no mutable overload prior to C++17 [1].
|
||||||
|
// Hence this overload is provided.
|
||||||
|
// Note: str[0] is safe even for empty strings, as they are guaranteed to be
|
||||||
|
// null-terminated [2].
|
||||||
|
//
|
||||||
|
// [1] http://en.cppreference.com/w/cpp/string/basic_string/data
|
||||||
|
// [2] http://en.cppreference.com/w/cpp/string/basic_string/operator_at
|
||||||
|
template <typename CharT, typename Traits, typename Allocator>
|
||||||
|
CharT* data(std::basic_string<CharT, Traits, Allocator>& str) {
|
||||||
|
return std::addressof(str[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Container>
|
||||||
|
constexpr auto data(const Container& c) -> decltype(c.data()) {
|
||||||
|
return c.data();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t N>
|
||||||
|
constexpr T* data(T (&array)[N]) noexcept {
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
constexpr const T* data(std::initializer_list<T> il) noexcept {
|
||||||
|
return il.begin();
|
||||||
|
}
|
||||||
|
|
||||||
|
// std::array::data() was not constexpr prior to C++17 [1].
|
||||||
|
// Hence these overloads are provided.
|
||||||
|
//
|
||||||
|
// [1] https://en.cppreference.com/w/cpp/container/array/data
|
||||||
|
template <typename T, size_t N>
|
||||||
|
constexpr T* data(std::array<T, N>& array) noexcept {
|
||||||
|
return !array.empty() ? &array[0] : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t N>
|
||||||
|
constexpr const T* data(const std::array<T, N>& array) noexcept {
|
||||||
|
return !array.empty() ? &array[0] : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace base
|
||||||
|
|
||||||
|
#endif // !USING_CHROMIUM_INCLUDES
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_BASE_CEF_CXX17_BACKPORTS_H_
|
||||||
@@ -41,35 +41,28 @@
|
|||||||
// updated to match.
|
// updated to match.
|
||||||
|
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
|
#include "include/base/cef_macros.h"
|
||||||
#include "include/base/cef_platform_thread.h"
|
#include "include/base/cef_platform_thread.h"
|
||||||
#include "include/base/internal/cef_lock_impl.h"
|
#include "include/base/internal/cef_lock_impl.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
namespace cef_internal {
|
namespace cef_internal {
|
||||||
|
|
||||||
///
|
// A convenient wrapper for an OS specific critical section. The only real
|
||||||
/// A convenient wrapper for an OS specific critical section. The only real
|
// intelligence in this class is in debug mode for the support for the
|
||||||
/// intelligence in this class is in debug mode for the support for the
|
// AssertAcquired() method.
|
||||||
/// AssertAcquired() method.
|
|
||||||
///
|
|
||||||
class Lock {
|
class Lock {
|
||||||
public:
|
public:
|
||||||
#if !DCHECK_IS_ON() // Optimized wrapper implementation
|
#if !DCHECK_IS_ON() // Optimized wrapper implementation
|
||||||
Lock() : lock_() {}
|
Lock() : lock_() {}
|
||||||
|
|
||||||
Lock(const Lock&) = delete;
|
|
||||||
Lock& operator=(const Lock&) = delete;
|
|
||||||
|
|
||||||
~Lock() {}
|
~Lock() {}
|
||||||
void Acquire() { lock_.Lock(); }
|
void Acquire() { lock_.Lock(); }
|
||||||
void Release() { lock_.Unlock(); }
|
void Release() { lock_.Unlock(); }
|
||||||
|
|
||||||
///
|
// If the lock is not held, take it and return true. If the lock is already
|
||||||
/// If the lock is not held, take it and return true. If the lock is already
|
// held by another thread, immediately return false. This must not be called
|
||||||
/// held by another thread, immediately return false. This must not be called
|
// by a thread already holding the lock (what happens is undefined and an
|
||||||
/// by a thread already holding the lock (what happens is undefined and an
|
// assertion may fail).
|
||||||
/// assertion may fail).
|
|
||||||
///
|
|
||||||
bool Try() { return lock_.Try(); }
|
bool Try() { return lock_.Try(); }
|
||||||
|
|
||||||
// Null implementation if not debug.
|
// Null implementation if not debug.
|
||||||
@@ -118,11 +111,11 @@ class Lock {
|
|||||||
|
|
||||||
// Platform specific underlying lock implementation.
|
// Platform specific underlying lock implementation.
|
||||||
LockImpl lock_;
|
LockImpl lock_;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(Lock);
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// A helper class that acquires the given Lock while the AutoLock is in scope.
|
||||||
/// A helper class that acquires the given Lock while the AutoLock is in scope.
|
|
||||||
///
|
|
||||||
class AutoLock {
|
class AutoLock {
|
||||||
public:
|
public:
|
||||||
struct AlreadyAcquired {};
|
struct AlreadyAcquired {};
|
||||||
@@ -133,9 +126,6 @@ class AutoLock {
|
|||||||
lock_.AssertAcquired();
|
lock_.AssertAcquired();
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoLock(const AutoLock&) = delete;
|
|
||||||
AutoLock& operator=(const AutoLock&) = delete;
|
|
||||||
|
|
||||||
~AutoLock() {
|
~AutoLock() {
|
||||||
lock_.AssertAcquired();
|
lock_.AssertAcquired();
|
||||||
lock_.Release();
|
lock_.Release();
|
||||||
@@ -143,12 +133,11 @@ class AutoLock {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Lock& lock_;
|
Lock& lock_;
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(AutoLock);
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// AutoUnlock is a helper that will Release() the |lock| argument in the
|
||||||
/// AutoUnlock is a helper that will Release() the |lock| argument in the
|
// constructor, and re-Acquire() it in the destructor.
|
||||||
/// constructor, and re-Acquire() it in the destructor.
|
|
||||||
///
|
|
||||||
class AutoUnlock {
|
class AutoUnlock {
|
||||||
public:
|
public:
|
||||||
explicit AutoUnlock(Lock& lock) : lock_(lock) {
|
explicit AutoUnlock(Lock& lock) : lock_(lock) {
|
||||||
@@ -157,13 +146,11 @@ class AutoUnlock {
|
|||||||
lock_.Release();
|
lock_.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoUnlock(const AutoUnlock&) = delete;
|
|
||||||
AutoUnlock& operator=(const AutoUnlock&) = delete;
|
|
||||||
|
|
||||||
~AutoUnlock() { lock_.Acquire(); }
|
~AutoUnlock() { lock_.Acquire(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Lock& lock_;
|
Lock& lock_;
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(AutoUnlock);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace cef_internal
|
||||||
@@ -171,9 +158,9 @@ class AutoUnlock {
|
|||||||
// Implement classes in the cef_internal namespace and then expose them to the
|
// Implement classes in the cef_internal namespace and then expose them to the
|
||||||
// base namespace. This avoids conflicts with the base.lib implementation when
|
// base namespace. This avoids conflicts with the base.lib implementation when
|
||||||
// linking sandbox support on Windows.
|
// linking sandbox support on Windows.
|
||||||
|
using cef_internal::Lock;
|
||||||
using cef_internal::AutoLock;
|
using cef_internal::AutoLock;
|
||||||
using cef_internal::AutoUnlock;
|
using cef_internal::AutoUnlock;
|
||||||
using cef_internal::Lock;
|
|
||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
|
|||||||
@@ -27,130 +27,110 @@
|
|||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
//
|
||||||
///
|
// ---------------------------------------------------------------------------
|
||||||
/// \file
|
//
|
||||||
/// A bunch of macros for logging.
|
// The contents of this file are only available to applications that link
|
||||||
///
|
// against the libcef_dll_wrapper target.
|
||||||
/// NOTE: The contents of this file are only available to applications that link
|
//
|
||||||
/// against the libcef_dll_wrapper target.
|
// WARNING: Logging macros should not be used in the main/browser process before
|
||||||
///
|
// calling CefInitialize or in sub-processes before calling CefExecuteProcess.
|
||||||
/// WARNING: Logging macros should not be used in the main/browser process
|
//
|
||||||
/// before calling CefInitialize or in sub-processes before calling
|
// Instructions
|
||||||
/// CefExecuteProcess.
|
// ------------
|
||||||
///
|
//
|
||||||
/// INSTRUCTIONS:
|
// Make a bunch of macros for logging. The way to log things is to stream
|
||||||
///
|
// things to LOG(<a particular severity level>). E.g.,
|
||||||
/// The way to log things is to stream things to LOG(<a particular severity
|
//
|
||||||
/// level>). E.g.,
|
// LOG(INFO) << "Found " << num_cookies << " cookies";
|
||||||
///
|
//
|
||||||
/// <pre>
|
// You can also do conditional logging:
|
||||||
/// LOG(INFO) << "Found " << num_cookies << " cookies";
|
//
|
||||||
/// </pre>
|
// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
||||||
///
|
//
|
||||||
/// You can also do conditional logging:
|
// The CHECK(condition) macro is active in both debug and release builds and
|
||||||
///
|
// effectively performs a LOG(FATAL) which terminates the process and
|
||||||
/// <pre>
|
// generates a crashdump unless a debugger is attached.
|
||||||
/// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
//
|
||||||
/// </pre>
|
// There are also "debug mode" logging macros like the ones above:
|
||||||
///
|
//
|
||||||
/// The CHECK(condition) macro is active in both debug and release builds and
|
// DLOG(INFO) << "Found cookies";
|
||||||
/// effectively performs a LOG(FATAL) which terminates the process and
|
//
|
||||||
/// generates a crashdump unless a debugger is attached.
|
// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
||||||
///
|
//
|
||||||
/// There are also "debug mode" logging macros like the ones above:
|
// All "debug mode" logging is compiled away to nothing for non-debug mode
|
||||||
///
|
// compiles. LOG_IF and development flags also work well together
|
||||||
/// <pre>
|
// because the code can be compiled away sometimes.
|
||||||
/// DLOG(INFO) << "Found cookies";
|
//
|
||||||
///
|
// We also have
|
||||||
/// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
//
|
||||||
/// </pre>
|
// LOG_ASSERT(assertion);
|
||||||
///
|
// DLOG_ASSERT(assertion);
|
||||||
/// All "debug mode" logging is compiled away to nothing for non-debug mode
|
//
|
||||||
/// compiles. LOG_IF and development flags also work well together
|
// which is syntactic sugar for {,D}LOG_IF(FATAL, assert fails) << assertion;
|
||||||
/// because the code can be compiled away sometimes.
|
//
|
||||||
///
|
// There are "verbose level" logging macros. They look like
|
||||||
/// We also have
|
//
|
||||||
///
|
// VLOG(1) << "I'm printed when you run the program with --v=1 or more";
|
||||||
/// <pre>
|
// VLOG(2) << "I'm printed when you run the program with --v=2 or more";
|
||||||
/// LOG_ASSERT(assertion);
|
//
|
||||||
/// DLOG_ASSERT(assertion);
|
// These always log at the INFO log level (when they log at all).
|
||||||
/// </pre>
|
// The verbose logging can also be turned on module-by-module. For instance,
|
||||||
///
|
// --vmodule=profile=2,icon_loader=1,browser_*=3,*/chromeos/*=4 --v=0
|
||||||
/// which is syntactic sugar for "{,D}LOG_IF(FATAL, assert fails) << assertion;"
|
// will cause:
|
||||||
///
|
// a. VLOG(2) and lower messages to be printed from profile.{h,cc}
|
||||||
/// There are "verbose level" logging macros. They look like
|
// b. VLOG(1) and lower messages to be printed from icon_loader.{h,cc}
|
||||||
///
|
// c. VLOG(3) and lower messages to be printed from files prefixed with
|
||||||
/// <pre>
|
// "browser"
|
||||||
/// VLOG(1) << "I'm printed when you run the program with --v=1 or more";
|
// d. VLOG(4) and lower messages to be printed from files under a
|
||||||
/// VLOG(2) << "I'm printed when you run the program with --v=2 or more";
|
// "chromeos" directory.
|
||||||
/// </pre>
|
// e. VLOG(0) and lower messages to be printed from elsewhere
|
||||||
///
|
//
|
||||||
/// These always log at the INFO log level (when they log at all).
|
// The wildcarding functionality shown by (c) supports both '*' (match
|
||||||
/// The verbose logging can also be turned on module-by-module. For instance,
|
// 0 or more characters) and '?' (match any single character)
|
||||||
/// <pre>
|
// wildcards. Any pattern containing a forward or backward slash will
|
||||||
/// --vmodule=profile=2,icon_loader=1,browser_*=3,*/chromeos/*=4 --v=0
|
// be tested against the whole pathname and not just the module.
|
||||||
/// </pre>
|
// E.g., "*/foo/bar/*=2" would change the logging level for all code
|
||||||
/// will cause:
|
// in source files under a "foo/bar" directory.
|
||||||
/// 1. VLOG(2) and lower messages to be printed from profile.{h,cc}
|
//
|
||||||
/// 2. VLOG(1) and lower messages to be printed from icon_loader.{h,cc}
|
// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as
|
||||||
/// 3. VLOG(3) and lower messages to be printed from files prefixed with
|
//
|
||||||
/// "browser"
|
// if (VLOG_IS_ON(2)) {
|
||||||
/// 4. VLOG(4) and lower messages to be printed from files under a
|
// // do some logging preparation and logging
|
||||||
/// "chromeos" directory.
|
// // that can't be accomplished with just VLOG(2) << ...;
|
||||||
/// 5. VLOG(0) and lower messages to be printed from elsewhere
|
// }
|
||||||
///
|
//
|
||||||
/// The wildcarding functionality shown by (c) supports both '*' (match
|
// There is also a VLOG_IF "verbose level" condition macro for sample
|
||||||
/// 0 or more characters) and '?' (match any single character)
|
// cases, when some extra computation and preparation for logs is not
|
||||||
/// wildcards. Any pattern containing a forward or backward slash will
|
// needed.
|
||||||
/// be tested against the whole pathname and not just the module.
|
//
|
||||||
/// E.g., "*/foo/bar/*=2" would change the logging level for all code
|
// VLOG_IF(1, (size > 1024))
|
||||||
/// in source files under a "foo/bar" directory.
|
// << "I'm printed when size is more than 1024 and when you run the "
|
||||||
///
|
// "program with --v=1 or more";
|
||||||
/// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as
|
//
|
||||||
///
|
// We also override the standard 'assert' to use 'DLOG_ASSERT'.
|
||||||
/// <pre>
|
//
|
||||||
/// if (VLOG_IS_ON(2)) {
|
// Lastly, there is:
|
||||||
/// // do some logging preparation and logging
|
//
|
||||||
/// // that can't be accomplished with just VLOG(2) << ...;
|
// PLOG(ERROR) << "Couldn't do foo";
|
||||||
/// }
|
// DPLOG(ERROR) << "Couldn't do foo";
|
||||||
/// </pre>
|
// PLOG_IF(ERROR, cond) << "Couldn't do foo";
|
||||||
///
|
// DPLOG_IF(ERROR, cond) << "Couldn't do foo";
|
||||||
/// There is also a VLOG_IF "verbose level" condition macro for sample
|
// PCHECK(condition) << "Couldn't do foo";
|
||||||
/// cases, when some extra computation and preparation for logs is not
|
// DPCHECK(condition) << "Couldn't do foo";
|
||||||
/// needed.
|
//
|
||||||
///
|
// which append the last system error to the message in string form (taken from
|
||||||
/// <pre>
|
// GetLastError() on Windows and errno on POSIX).
|
||||||
/// VLOG_IF(1, (size > 1024))
|
//
|
||||||
/// << "I'm printed when size is more than 1024 and when you run the "
|
// The supported severity levels for macros that allow you to specify one
|
||||||
/// "program with --v=1 or more";
|
// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL.
|
||||||
/// </pre>
|
//
|
||||||
///
|
// Very important: logging a message at the FATAL severity level causes
|
||||||
/// We also override the standard 'assert' to use 'DLOG_ASSERT'.
|
// the program to terminate (after the message is logged).
|
||||||
///
|
//
|
||||||
/// Lastly, there is:
|
// There is the special severity of DFATAL, which logs FATAL in debug mode,
|
||||||
///
|
// ERROR in normal mode.
|
||||||
/// <pre>
|
//
|
||||||
/// PLOG(ERROR) << "Couldn't do foo";
|
|
||||||
/// DPLOG(ERROR) << "Couldn't do foo";
|
|
||||||
/// PLOG_IF(ERROR, cond) << "Couldn't do foo";
|
|
||||||
/// DPLOG_IF(ERROR, cond) << "Couldn't do foo";
|
|
||||||
/// PCHECK(condition) << "Couldn't do foo";
|
|
||||||
/// DPCHECK(condition) << "Couldn't do foo";
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// which append the last system error to the message in string form (taken from
|
|
||||||
/// GetLastError() on Windows and errno on POSIX).
|
|
||||||
///
|
|
||||||
/// The supported severity levels for macros that allow you to specify one
|
|
||||||
/// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL.
|
|
||||||
///
|
|
||||||
/// Very important: logging a message at the FATAL severity level causes
|
|
||||||
/// the program to terminate (after the message is logged).
|
|
||||||
///
|
|
||||||
/// There is the special severity of DFATAL, which logs FATAL in debug mode,
|
|
||||||
/// ERROR in normal mode.
|
|
||||||
///
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_LOGGING_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_LOGGING_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_LOGGING_H_
|
#define CEF_INCLUDE_BASE_CEF_LOGGING_H_
|
||||||
@@ -184,6 +164,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
|
#include "include/base/cef_macros.h"
|
||||||
#include "include/internal/cef_logging_internal.h"
|
#include "include/internal/cef_logging_internal.h"
|
||||||
|
|
||||||
namespace cef {
|
namespace cef {
|
||||||
@@ -221,21 +202,21 @@ const LogSeverity LOG_DFATAL = LOG_FATAL;
|
|||||||
// A few definitions of macros that don't generate much code. These are used
|
// 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
|
// by LOG() and LOG_IF, etc. Since these are used all over our code, it's
|
||||||
// better to have compact code for these operations.
|
// better to have compact code for these operations.
|
||||||
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
|
||||||
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_INFO, \
|
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_INFO, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \
|
||||||
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_WARNING, \
|
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_WARNING, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \
|
||||||
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_ERROR, \
|
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_ERROR, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \
|
||||||
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_FATAL, \
|
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_FATAL, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \
|
||||||
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_DFATAL, \
|
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_DFATAL, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
|
|
||||||
#define COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(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_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
|
||||||
@@ -602,9 +583,6 @@ class LogMessage {
|
|||||||
LogSeverity severity,
|
LogSeverity severity,
|
||||||
std::string* result);
|
std::string* result);
|
||||||
|
|
||||||
LogMessage(const LogMessage&) = delete;
|
|
||||||
LogMessage& operator=(const LogMessage&) = delete;
|
|
||||||
|
|
||||||
~LogMessage();
|
~LogMessage();
|
||||||
|
|
||||||
std::ostream& stream() { return stream_; }
|
std::ostream& stream() { return stream_; }
|
||||||
@@ -636,6 +614,8 @@ class LogMessage {
|
|||||||
|
|
||||||
SaveLastError last_error_;
|
SaveLastError last_error_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(LogMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
// A non-macro interface to the log facility; (useful
|
// A non-macro interface to the log facility; (useful
|
||||||
@@ -675,9 +655,6 @@ class Win32ErrorLogMessage {
|
|||||||
LogSeverity severity,
|
LogSeverity severity,
|
||||||
SystemErrorCode err);
|
SystemErrorCode err);
|
||||||
|
|
||||||
Win32ErrorLogMessage(const Win32ErrorLogMessage&) = delete;
|
|
||||||
Win32ErrorLogMessage& operator=(const Win32ErrorLogMessage&) = delete;
|
|
||||||
|
|
||||||
// Appends the error message before destructing the encapsulated class.
|
// Appends the error message before destructing the encapsulated class.
|
||||||
~Win32ErrorLogMessage();
|
~Win32ErrorLogMessage();
|
||||||
|
|
||||||
@@ -686,6 +663,8 @@ class Win32ErrorLogMessage {
|
|||||||
private:
|
private:
|
||||||
SystemErrorCode err_;
|
SystemErrorCode err_;
|
||||||
LogMessage log_message_;
|
LogMessage log_message_;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(Win32ErrorLogMessage);
|
||||||
};
|
};
|
||||||
#elif defined(OS_POSIX)
|
#elif defined(OS_POSIX)
|
||||||
// Appends a formatted system message of the errno type
|
// Appends a formatted system message of the errno type
|
||||||
@@ -696,9 +675,6 @@ class ErrnoLogMessage {
|
|||||||
LogSeverity severity,
|
LogSeverity severity,
|
||||||
SystemErrorCode err);
|
SystemErrorCode err);
|
||||||
|
|
||||||
ErrnoLogMessage(const ErrnoLogMessage&) = delete;
|
|
||||||
ErrnoLogMessage& operator=(const ErrnoLogMessage&) = delete;
|
|
||||||
|
|
||||||
// Appends the error message before destructing the encapsulated class.
|
// Appends the error message before destructing the encapsulated class.
|
||||||
~ErrnoLogMessage();
|
~ErrnoLogMessage();
|
||||||
|
|
||||||
@@ -707,6 +683,8 @@ class ErrnoLogMessage {
|
|||||||
private:
|
private:
|
||||||
SystemErrorCode err_;
|
SystemErrorCode err_;
|
||||||
LogMessage log_message_;
|
LogMessage log_message_;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(ErrnoLogMessage);
|
||||||
};
|
};
|
||||||
#endif // OS_WIN
|
#endif // OS_WIN
|
||||||
|
|
||||||
@@ -723,13 +701,6 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
|
|||||||
inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
|
inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
|
||||||
return out << wstr.c_str();
|
return out << wstr.c_str();
|
||||||
}
|
}
|
||||||
#if defined(WCHAR_T_IS_32_BIT)
|
|
||||||
std::ostream& operator<<(std::ostream& out, const char16_t* wstr);
|
|
||||||
#elif defined(WCHAR_T_IS_16_BIT)
|
|
||||||
inline std::ostream& operator<<(std::ostream& out, const char16_t* wstr) {
|
|
||||||
return operator<<(out, reinterpret_cast<const wchar_t*>(wstr));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// The NOTIMPLEMENTED() macro annotates codepaths which have
|
// The NOTIMPLEMENTED() macro annotates codepaths which have
|
||||||
// not been implemented yet.
|
// not been implemented yet.
|
||||||
|
|||||||
@@ -32,14 +32,18 @@
|
|||||||
#define CEF_INCLUDE_BASE_CEF_MACROS_H_
|
#define CEF_INCLUDE_BASE_CEF_MACROS_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(USING_CHROMIUM_INCLUDES)
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
|
// When building CEF include the Chromium header directly.
|
||||||
|
#include "base/macros.h"
|
||||||
|
|
||||||
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
// The following is substantially similar to the Chromium implementation.
|
// The following is substantially similar to the Chromium implementation.
|
||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
// updated to match.
|
// updated to match.
|
||||||
|
|
||||||
// ALL DISALLOW_xxx MACROS ARE DEPRECATED; DO NOT USE IN NEW CODE.
|
// ALL DISALLOW_xxx MACROS ARE DEPRECATED; DO NOT USE IN NEW CODE.
|
||||||
// Use explicit deletions instead. For more information see
|
// Use explicit deletions instead. See the section on copyability/movability in
|
||||||
// https://chromium.googlesource.com/chromium/src/+/lkgr/styleguide/c++/c++-dos-and-donts.md#explicitly-declare-class-copyability_movability
|
// //styleguide/c++/c++-dos-and-donts.md for more information.
|
||||||
|
|
||||||
// DEPRECATED: See above. Makes a class uncopyable.
|
// DEPRECATED: See above. Makes a class uncopyable.
|
||||||
#define DISALLOW_COPY(TypeName) TypeName(const TypeName&) = delete
|
#define DISALLOW_COPY(TypeName) TypeName(const TypeName&) = delete
|
||||||
@@ -58,6 +62,17 @@
|
|||||||
TypeName() = delete; \
|
TypeName() = delete; \
|
||||||
DISALLOW_COPY_AND_ASSIGN(TypeName)
|
DISALLOW_COPY_AND_ASSIGN(TypeName)
|
||||||
|
|
||||||
|
// Used to explicitly mark the return value of a function as unused. If you are
|
||||||
|
// really sure you don't want to do anything with the return value of a function
|
||||||
|
// that has been marked WARN_UNUSED_RESULT, wrap it with this. Example:
|
||||||
|
//
|
||||||
|
// std::unique_ptr<MyType> my_var = ...;
|
||||||
|
// if (TakeOwnership(my_var.get()) == SUCCESS)
|
||||||
|
// ignore_result(my_var.release());
|
||||||
|
//
|
||||||
|
template <typename T>
|
||||||
|
inline void ignore_result(const T&) {}
|
||||||
|
|
||||||
#endif // !USING_CHROMIUM_INCLUDES
|
#endif // !USING_CHROMIUM_INCLUDES
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_BASE_CEF_MACROS_H_
|
#endif // CEF_INCLUDE_BASE_CEF_MACROS_H_
|
||||||
|
|||||||
@@ -43,26 +43,23 @@
|
|||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
// updated to match.
|
// updated to match.
|
||||||
|
|
||||||
|
#include "include/base/cef_basictypes.h"
|
||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
#include "include/internal/cef_thread_internal.h"
|
#include "include/internal/cef_thread_internal.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
|
|
||||||
///
|
// Used for logging. Always an integer value.
|
||||||
/// Used for logging. Always an integer value.
|
|
||||||
///
|
|
||||||
typedef cef_platform_thread_id_t PlatformThreadId;
|
typedef cef_platform_thread_id_t PlatformThreadId;
|
||||||
|
|
||||||
///
|
// Used for thread checking and debugging.
|
||||||
/// Used for thread checking and debugging.
|
// Meant to be as fast as possible.
|
||||||
/// Meant to be as fast as possible.
|
// These are produced by PlatformThread::CurrentRef(), and used to later
|
||||||
/// These are produced by PlatformThread::CurrentRef(), and used to later
|
// check if we are on the same thread or not by using ==. These are safe
|
||||||
/// check if we are on the same thread or not by using ==. These are safe
|
// to copy between threads, but can't be copied to another process as they
|
||||||
/// to copy between threads, but can't be copied to another process as they
|
// have no meaning there. Also, the internal identifier can be re-used
|
||||||
/// have no meaning there. Also, the internal identifier can be re-used
|
// after a thread dies, so a PlatformThreadRef cannot be reliably used
|
||||||
/// after a thread dies, so a PlatformThreadRef cannot be reliably used
|
// to distinguish a new thread from an old, dead thread.
|
||||||
/// to distinguish a new thread from an old, dead thread.
|
|
||||||
///
|
|
||||||
class PlatformThreadRef {
|
class PlatformThreadRef {
|
||||||
public:
|
public:
|
||||||
typedef cef_platform_thread_handle_t RefType;
|
typedef cef_platform_thread_handle_t RefType;
|
||||||
@@ -79,24 +76,18 @@ class PlatformThreadRef {
|
|||||||
RefType id_;
|
RefType id_;
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// A namespace for low-level thread functions.
|
||||||
/// A namespace for low-level thread functions.
|
// Chromium uses a class with static methods but CEF uses an actual namespace
|
||||||
/// Chromium uses a class with static methods but CEF uses an actual namespace
|
// to avoid linker problems with the sandbox libaries on Windows.
|
||||||
/// to avoid linker problems with the sandbox libaries on Windows.
|
|
||||||
///
|
|
||||||
namespace PlatformThread {
|
namespace PlatformThread {
|
||||||
|
|
||||||
///
|
// Gets the current thread id, which may be useful for logging purposes.
|
||||||
/// Gets the current thread id, which may be useful for logging purposes.
|
|
||||||
///
|
|
||||||
inline PlatformThreadId CurrentId() {
|
inline PlatformThreadId CurrentId() {
|
||||||
return cef_get_current_platform_thread_id();
|
return cef_get_current_platform_thread_id();
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Gets the current thread reference, which can be used to check if
|
||||||
/// Gets the current thread reference, which can be used to check if
|
// we're on the right thread quickly.
|
||||||
/// we're on the right thread quickly.
|
|
||||||
///
|
|
||||||
inline PlatformThreadRef CurrentRef() {
|
inline PlatformThreadRef CurrentRef() {
|
||||||
return PlatformThreadRef(cef_get_current_platform_thread_handle());
|
return PlatformThreadRef(cef_get_current_platform_thread_handle());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,11 +45,9 @@
|
|||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
|
|
||||||
///
|
// Helper to transfer ownership of a raw pointer to a std::unique_ptr<T>.
|
||||||
/// Helper to transfer ownership of a raw pointer to a std::unique_ptr<T>.
|
// Note that std::unique_ptr<T> has very different semantics from
|
||||||
/// Note that std::unique_ptr<T> has very different semantics from
|
// std::unique_ptr<T[]>: do not use this helper for array allocations.
|
||||||
/// std::unique_ptr<T[]>: do not use this helper for array allocations.
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::unique_ptr<T> WrapUnique(T* ptr) {
|
std::unique_ptr<T> WrapUnique(T* ptr) {
|
||||||
return std::unique_ptr<T>(ptr);
|
return std::unique_ptr<T>(ptr);
|
||||||
|
|||||||
@@ -49,7 +49,9 @@
|
|||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
#include "include/base/cef_compiler_specific.h"
|
#include "include/base/cef_compiler_specific.h"
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
|
#include "include/base/cef_macros.h"
|
||||||
#include "include/base/cef_scoped_refptr.h"
|
#include "include/base/cef_scoped_refptr.h"
|
||||||
|
#include "include/base/cef_template_util.h"
|
||||||
#include "include/base/cef_thread_checker.h"
|
#include "include/base/cef_thread_checker.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
@@ -74,9 +76,6 @@ class RefCountedBase {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
RefCountedBase(const RefCountedBase&) = delete;
|
|
||||||
RefCountedBase& operator=(const RefCountedBase&) = delete;
|
|
||||||
|
|
||||||
~RefCountedBase() {
|
~RefCountedBase() {
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()";
|
DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()";
|
||||||
@@ -104,16 +103,13 @@ class RefCountedBase {
|
|||||||
|
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
DCHECK(!in_dtor_);
|
DCHECK(!in_dtor_);
|
||||||
if (ref_count_ == 0) {
|
if (ref_count_ == 0)
|
||||||
in_dtor_ = true;
|
in_dtor_ = true;
|
||||||
}
|
|
||||||
|
|
||||||
if (ref_count_ >= 1) {
|
if (ref_count_ >= 1)
|
||||||
DCHECK(CalledOnValidThread());
|
DCHECK(CalledOnValidThread());
|
||||||
}
|
if (ref_count_ == 1)
|
||||||
if (ref_count_ == 1) {
|
|
||||||
thread_checker_.DetachFromThread();
|
thread_checker_.DetachFromThread();
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ref_count_ == 0;
|
return ref_count_ == 0;
|
||||||
@@ -172,6 +168,8 @@ class RefCountedBase {
|
|||||||
mutable bool in_dtor_ = false;
|
mutable bool in_dtor_ = false;
|
||||||
mutable ThreadChecker thread_checker_;
|
mutable ThreadChecker thread_checker_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
|
||||||
};
|
};
|
||||||
|
|
||||||
class RefCountedThreadSafeBase {
|
class RefCountedThreadSafeBase {
|
||||||
@@ -188,9 +186,6 @@ class RefCountedThreadSafeBase {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
RefCountedThreadSafeBase(const RefCountedThreadSafeBase&) = delete;
|
|
||||||
RefCountedThreadSafeBase& operator=(const RefCountedThreadSafeBase&) = delete;
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
~RefCountedThreadSafeBase();
|
~RefCountedThreadSafeBase();
|
||||||
#else
|
#else
|
||||||
@@ -264,6 +259,8 @@ class RefCountedThreadSafeBase {
|
|||||||
mutable bool needs_adopt_ref_ = false;
|
mutable bool needs_adopt_ref_ = false;
|
||||||
mutable bool in_dtor_ = false;
|
mutable bool in_dtor_ = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafeBase);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ScopedAllowCrossThreadRefCountAccess disables the check documented on
|
// ScopedAllowCrossThreadRefCountAccess disables the check documented on
|
||||||
@@ -292,26 +289,52 @@ class ScopedAllowCrossThreadRefCountAccess final {
|
|||||||
using ScopedAllowCrossThreadRefCountAccess =
|
using ScopedAllowCrossThreadRefCountAccess =
|
||||||
cef_subtle::ScopedAllowCrossThreadRefCountAccess;
|
cef_subtle::ScopedAllowCrossThreadRefCountAccess;
|
||||||
|
|
||||||
///
|
//
|
||||||
/// The reference count starts from zero by default, and we intended to migrate
|
// A base class for reference counted classes. Otherwise, known as a cheap
|
||||||
/// to start-from-one ref count. Put REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() to
|
// knock-off of WebKit's RefCounted<T> class. To use this, just extend your
|
||||||
/// the ref counted class to opt-in.
|
// class from it like so:
|
||||||
///
|
//
|
||||||
/// If an object has start-from-one ref count, the first scoped_refptr need to
|
// class MyFoo : public base::RefCounted<MyFoo> {
|
||||||
/// be created by base::AdoptRef() or base::MakeRefCounted(). We can use
|
// ...
|
||||||
/// base::MakeRefCounted() to create create both type of ref counted object.
|
// private:
|
||||||
///
|
// friend class base::RefCounted<MyFoo>;
|
||||||
/// The motivations to use start-from-one ref count are:
|
// ~MyFoo();
|
||||||
/// - Start-from-one ref count doesn't need the ref count increment for the
|
// };
|
||||||
/// first reference.
|
//
|
||||||
/// - It can detect an invalid object acquisition for a being-deleted object
|
// Usage Notes:
|
||||||
/// that has zero ref count. That tends to happen on custom deleter that
|
// 1. You should always make your destructor non-public, to avoid any code
|
||||||
/// delays the deletion.
|
// deleting the object accidentally while there are references to it.
|
||||||
/// TODO(tzik): Implement invalid acquisition detection.
|
// 2. You should always make the ref-counted base class a friend of your class,
|
||||||
/// - Behavior parity to Blink's WTF::RefCounted, whose count starts from one.
|
// so that it can access the destructor.
|
||||||
/// And start-from-one ref count is a step to merge WTF::RefCounted into
|
//
|
||||||
/// base::RefCounted.
|
// The ref count manipulation to RefCounted is NOT thread safe and has DCHECKs
|
||||||
///
|
// to trap unsafe cross thread usage. A subclass instance of RefCounted can be
|
||||||
|
// passed to another execution thread only when its ref count is 1. If the ref
|
||||||
|
// count is more than 1, the RefCounted class verifies the ref updates are made
|
||||||
|
// on the same execution thread as the previous ones. The subclass can also
|
||||||
|
// manually call IsOnValidThread to trap other non-thread-safe accesses; see
|
||||||
|
// the documentation for that method.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// The reference count starts from zero by default, and we intended to migrate
|
||||||
|
// to start-from-one ref count. Put REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() to
|
||||||
|
// the ref counted class to opt-in.
|
||||||
|
//
|
||||||
|
// If an object has start-from-one ref count, the first scoped_refptr need to be
|
||||||
|
// created by base::AdoptRef() or base::MakeRefCounted(). We can use
|
||||||
|
// base::MakeRefCounted() to create create both type of ref counted object.
|
||||||
|
//
|
||||||
|
// The motivations to use start-from-one ref count are:
|
||||||
|
// - Start-from-one ref count doesn't need the ref count increment for the
|
||||||
|
// first reference.
|
||||||
|
// - It can detect an invalid object acquisition for a being-deleted object
|
||||||
|
// that has zero ref count. That tends to happen on custom deleter that
|
||||||
|
// delays the deletion.
|
||||||
|
// TODO(tzik): Implement invalid acquisition detection.
|
||||||
|
// - Behavior parity to Blink's WTF::RefCounted, whose count starts from one.
|
||||||
|
// And start-from-one ref count is a step to merge WTF::RefCounted into
|
||||||
|
// base::RefCounted.
|
||||||
|
//
|
||||||
#define REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() \
|
#define REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() \
|
||||||
static constexpr ::base::cef_subtle::StartRefCountFromOneTag \
|
static constexpr ::base::cef_subtle::StartRefCountFromOneTag \
|
||||||
kRefCountPreference = ::base::cef_subtle::kStartRefCountFromOneTag
|
kRefCountPreference = ::base::cef_subtle::kStartRefCountFromOneTag
|
||||||
@@ -319,10 +342,6 @@ using ScopedAllowCrossThreadRefCountAccess =
|
|||||||
template <class T, typename Traits>
|
template <class T, typename Traits>
|
||||||
class RefCounted;
|
class RefCounted;
|
||||||
|
|
||||||
///
|
|
||||||
/// Default traits for RefCounted<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 DefaultRefCountedTraits {
|
struct DefaultRefCountedTraits {
|
||||||
static void Destruct(const T* x) {
|
static void Destruct(const T* x) {
|
||||||
@@ -330,34 +349,6 @@ struct DefaultRefCountedTraits {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
|
||||||
/// A base class for reference counted classes. Otherwise, known as a cheap
|
|
||||||
/// knock-off of WebKit's RefCounted<T> class. To use this, just extend your
|
|
||||||
/// class from it like so:
|
|
||||||
///
|
|
||||||
/// <pre>
|
|
||||||
/// class MyFoo : public base::RefCounted<MyFoo> {
|
|
||||||
/// ...
|
|
||||||
/// private:
|
|
||||||
/// friend class base::RefCounted<MyFoo>;
|
|
||||||
/// ~MyFoo();
|
|
||||||
/// };
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// Usage Notes:
|
|
||||||
/// 1. You should always make your destructor non-public, to avoid any code
|
|
||||||
/// deleting the object accidentally while there are references to it.
|
|
||||||
/// 2. You should always make the ref-counted base class a friend of your class,
|
|
||||||
/// so that it can access the destructor.
|
|
||||||
///
|
|
||||||
/// The ref count manipulation to RefCounted is NOT thread safe and has DCHECKs
|
|
||||||
/// to trap unsafe cross thread usage. A subclass instance of RefCounted can be
|
|
||||||
/// passed to another execution thread only when its ref count is 1. If the ref
|
|
||||||
/// count is more than 1, the RefCounted class verifies the ref updates are made
|
|
||||||
/// on the same execution thread as the previous ones. The subclass can also
|
|
||||||
/// manually call IsOnValidThread to trap other non-thread-safe accesses; see
|
|
||||||
/// the documentation for that method.
|
|
||||||
///
|
|
||||||
template <class T, typename Traits = DefaultRefCountedTraits<T>>
|
template <class T, typename Traits = DefaultRefCountedTraits<T>>
|
||||||
class RefCounted : public cef_subtle::RefCountedBase {
|
class RefCounted : public cef_subtle::RefCountedBase {
|
||||||
public:
|
public:
|
||||||
@@ -366,9 +357,6 @@ class RefCounted : public cef_subtle::RefCountedBase {
|
|||||||
|
|
||||||
RefCounted() : cef_subtle::RefCountedBase(T::kRefCountPreference) {}
|
RefCounted() : cef_subtle::RefCountedBase(T::kRefCountPreference) {}
|
||||||
|
|
||||||
RefCounted(const RefCounted&) = delete;
|
|
||||||
RefCounted& operator=(const RefCounted&) = delete;
|
|
||||||
|
|
||||||
void AddRef() const { cef_subtle::RefCountedBase::AddRef(); }
|
void AddRef() const { cef_subtle::RefCountedBase::AddRef(); }
|
||||||
|
|
||||||
void Release() const {
|
void Release() const {
|
||||||
@@ -391,16 +379,16 @@ class RefCounted : public cef_subtle::RefCountedBase {
|
|||||||
static void DeleteInternal(const U* x) {
|
static void DeleteInternal(const U* x) {
|
||||||
delete x;
|
delete x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(RefCounted);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Forward declaration.
|
// Forward declaration.
|
||||||
template <class T, typename Traits>
|
template <class T, typename Traits>
|
||||||
class RefCountedThreadSafe;
|
class RefCountedThreadSafe;
|
||||||
|
|
||||||
///
|
// Default traits for RefCountedThreadSafe<T>. Deletes the object when its ref
|
||||||
/// Default traits for RefCountedThreadSafe<T>. Deletes the object when its ref
|
// count reaches 0. Overload to delete it on a different thread etc.
|
||||||
/// count reaches 0. Overload to delete it on a different thread etc.
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct DefaultRefCountedThreadSafeTraits {
|
struct DefaultRefCountedThreadSafeTraits {
|
||||||
static void Destruct(const T* x) {
|
static void Destruct(const T* x) {
|
||||||
@@ -412,26 +400,21 @@ struct DefaultRefCountedThreadSafeTraits {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
//
|
||||||
/// A thread-safe variant of RefCounted<T>
|
// A thread-safe variant of RefCounted<T>
|
||||||
///
|
//
|
||||||
/// <pre>
|
// class MyFoo : public base::RefCountedThreadSafe<MyFoo> {
|
||||||
/// class MyFoo : public base::RefCountedThreadSafe<MyFoo> {
|
// ...
|
||||||
/// ...
|
// };
|
||||||
/// };
|
//
|
||||||
/// </pre>
|
// If you're using the default trait, then you should add compile time
|
||||||
///
|
// asserts that no one else is deleting your object. i.e.
|
||||||
/// If you're using the default trait, then you should add compile time
|
// private:
|
||||||
/// asserts that no one else is deleting your object. i.e.
|
// friend class base::RefCountedThreadSafe<MyFoo>;
|
||||||
/// <pre>
|
// ~MyFoo();
|
||||||
/// private:
|
//
|
||||||
/// friend class base::RefCountedThreadSafe<MyFoo>;
|
// We can use REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() with RefCountedThreadSafe
|
||||||
/// ~MyFoo();
|
// too. See the comment above the RefCounted definition for details.
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// We can use REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() with RefCountedThreadSafe
|
|
||||||
/// too. See the comment above the RefCounted definition for details.
|
|
||||||
///
|
|
||||||
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T>>
|
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T>>
|
||||||
class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
||||||
public:
|
public:
|
||||||
@@ -441,9 +424,6 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
|||||||
explicit RefCountedThreadSafe()
|
explicit RefCountedThreadSafe()
|
||||||
: cef_subtle::RefCountedThreadSafeBase(T::kRefCountPreference) {}
|
: cef_subtle::RefCountedThreadSafeBase(T::kRefCountPreference) {}
|
||||||
|
|
||||||
RefCountedThreadSafe(const RefCountedThreadSafe&) = delete;
|
|
||||||
RefCountedThreadSafe& operator=(const RefCountedThreadSafe&) = delete;
|
|
||||||
|
|
||||||
void AddRef() const { AddRefImpl(T::kRefCountPreference); }
|
void AddRef() const { AddRefImpl(T::kRefCountPreference); }
|
||||||
|
|
||||||
void Release() const {
|
void Release() const {
|
||||||
@@ -470,12 +450,14 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
|||||||
void AddRefImpl(cef_subtle::StartRefCountFromOneTag) const {
|
void AddRefImpl(cef_subtle::StartRefCountFromOneTag) const {
|
||||||
cef_subtle::RefCountedThreadSafeBase::AddRefWithCheck();
|
cef_subtle::RefCountedThreadSafeBase::AddRefWithCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafe);
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
//
|
||||||
/// A thread-safe wrapper for some piece of data so we can place other
|
// A thread-safe wrapper for some piece of data so we can place other
|
||||||
/// things in scoped_refptrs<>.
|
// things in scoped_refptrs<>.
|
||||||
///
|
//
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class RefCountedData
|
class RefCountedData
|
||||||
: public base::RefCountedThreadSafe<base::RefCountedData<T>> {
|
: public base::RefCountedThreadSafe<base::RefCountedData<T>> {
|
||||||
@@ -484,7 +466,7 @@ class RefCountedData
|
|||||||
RefCountedData(const T& in_value) : data(in_value) {}
|
RefCountedData(const T& in_value) : data(in_value) {}
|
||||||
RefCountedData(T&& in_value) : data(std::move(in_value)) {}
|
RefCountedData(T&& in_value) : data(std::move(in_value)) {}
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
explicit RefCountedData(std::in_place_t, Args&&... args)
|
explicit RefCountedData(in_place_t, Args&&... args)
|
||||||
: data(std::forward<Args>(args)...) {}
|
: data(std::forward<Args>(args)...) {}
|
||||||
|
|
||||||
T data;
|
T data;
|
||||||
|
|||||||
@@ -46,7 +46,9 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "include/base/cef_compiler_specific.h"
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
|
#include "include/base/cef_macros.h"
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class scoped_refptr;
|
class scoped_refptr;
|
||||||
@@ -142,76 +144,68 @@ scoped_refptr<T> WrapRefCounted(T* t) {
|
|||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
///
|
//
|
||||||
/// A smart pointer class for reference counted objects. Use this class instead
|
// A smart pointer class for reference counted objects. Use this class instead
|
||||||
/// of calling AddRef and Release manually on a reference counted object to
|
// of calling AddRef and Release manually on a reference counted object to
|
||||||
/// avoid common memory leaks caused by forgetting to Release an object
|
// avoid common memory leaks caused by forgetting to Release an object
|
||||||
/// reference. Sample usage:
|
// reference. Sample usage:
|
||||||
///
|
//
|
||||||
/// <pre>
|
// class MyFoo : public RefCounted<MyFoo> {
|
||||||
/// class MyFoo : public RefCounted<MyFoo> {
|
// ...
|
||||||
/// ...
|
// private:
|
||||||
/// private:
|
// friend class RefCounted<MyFoo>; // Allow destruction by RefCounted<>.
|
||||||
/// friend class RefCounted<MyFoo>; // Allow destruction by RefCounted<>.
|
// ~MyFoo(); // Destructor must be private/protected.
|
||||||
/// ~MyFoo(); // Destructor must be
|
// };
|
||||||
/// private/protected.
|
//
|
||||||
/// };
|
// void some_function() {
|
||||||
///
|
// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
|
||||||
/// void some_function() {
|
// foo->Method(param);
|
||||||
/// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
|
// // |foo| is released when this function returns
|
||||||
/// foo->Method(param);
|
// }
|
||||||
/// // |foo| is released when this function returns
|
//
|
||||||
/// }
|
// void some_other_function() {
|
||||||
///
|
// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
|
||||||
/// void some_other_function() {
|
// ...
|
||||||
/// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
|
// foo.reset(); // explicitly releases |foo|
|
||||||
/// ...
|
// ...
|
||||||
/// foo.reset(); // explicitly releases |foo|
|
// if (foo)
|
||||||
/// ...
|
// foo->Method(param);
|
||||||
/// if (foo)
|
// }
|
||||||
/// foo->Method(param);
|
//
|
||||||
/// }
|
// The above examples show how scoped_refptr<T> acts like a pointer to T.
|
||||||
/// </pre>
|
// Given two scoped_refptr<T> classes, it is also possible to exchange
|
||||||
///
|
// references between the two objects, like so:
|
||||||
/// The above examples show how scoped_refptr<T> acts like a pointer to T.
|
//
|
||||||
/// Given two scoped_refptr<T> classes, it is also possible to exchange
|
// {
|
||||||
/// references between the two objects, like so:
|
// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
|
||||||
///
|
// scoped_refptr<MyFoo> b;
|
||||||
/// <pre>
|
//
|
||||||
/// {
|
// b.swap(a);
|
||||||
/// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
|
// // now, |b| references the MyFoo object, and |a| references nullptr.
|
||||||
/// scoped_refptr<MyFoo> b;
|
// }
|
||||||
///
|
//
|
||||||
/// b.swap(a);
|
// To make both |a| and |b| in the above example reference the same MyFoo
|
||||||
/// // now, |b| references the MyFoo object, and |a| references nullptr.
|
// object, simply use the assignment operator:
|
||||||
/// }
|
//
|
||||||
/// </pre>
|
// {
|
||||||
///
|
// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
|
||||||
/// To make both |a| and |b| in the above example reference the same MyFoo
|
// scoped_refptr<MyFoo> b;
|
||||||
/// object, simply use the assignment operator:
|
//
|
||||||
///
|
// b = a;
|
||||||
/// <pre>
|
// // now, |a| and |b| each own a reference to the same MyFoo object.
|
||||||
/// {
|
// }
|
||||||
/// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
|
//
|
||||||
/// scoped_refptr<MyFoo> b;
|
// Also see Chromium's ownership and calling conventions:
|
||||||
///
|
// https://chromium.googlesource.com/chromium/src/+/lkgr/styleguide/c++/c++.md#object-ownership-and-calling-conventions
|
||||||
/// b = a;
|
// Specifically:
|
||||||
/// // now, |a| and |b| each own a reference to the same MyFoo object.
|
// If the function (at least sometimes) takes a ref on a refcounted object,
|
||||||
/// }
|
// declare the param as scoped_refptr<T>. The caller can decide whether it
|
||||||
/// </pre>
|
// wishes to transfer ownership (by calling std::move(t) when passing t) or
|
||||||
///
|
// retain its ref (by simply passing t directly).
|
||||||
/// Also see Chromium's ownership and calling conventions:
|
// In other words, use scoped_refptr like you would a std::unique_ptr except
|
||||||
/// https://chromium.googlesource.com/chromium/src/+/lkgr/styleguide/c++/c++.md#object-ownership-and-calling-conventions
|
// in the odd case where it's required to hold on to a ref while handing one
|
||||||
/// Specifically:
|
// to another component (if a component merely needs to use t on the stack
|
||||||
/// If the function (at least sometimes) takes a ref on a refcounted object,
|
// without keeping a ref: pass t as a raw T*).
|
||||||
/// declare the param as scoped_refptr<T>. The caller can decide whether it
|
|
||||||
/// wishes to transfer ownership (by calling std::move(t) when passing t) or
|
|
||||||
/// retain its ref (by simply passing t directly).
|
|
||||||
/// In other words, use scoped_refptr like you would a std::unique_ptr except
|
|
||||||
/// in the odd case where it's required to hold on to a ref while handing one
|
|
||||||
/// to another component (if a component merely needs to use t on the stack
|
|
||||||
/// without keeping a ref: pass t as a raw T*).
|
|
||||||
///
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class TRIVIAL_ABI scoped_refptr {
|
class TRIVIAL_ABI scoped_refptr {
|
||||||
public:
|
public:
|
||||||
@@ -229,9 +223,8 @@ class TRIVIAL_ABI scoped_refptr {
|
|||||||
// should move or copy construct from an existing scoped_refptr<T> to the
|
// should move or copy construct from an existing scoped_refptr<T> to the
|
||||||
// ref-counted object.
|
// ref-counted object.
|
||||||
scoped_refptr(T* p) : ptr_(p) {
|
scoped_refptr(T* p) : ptr_(p) {
|
||||||
if (ptr_) {
|
if (ptr_)
|
||||||
AddRef(ptr_);
|
AddRef(ptr_);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy constructor. This is required in addition to the copy conversion
|
// Copy constructor. This is required in addition to the copy conversion
|
||||||
@@ -262,9 +255,8 @@ class TRIVIAL_ABI scoped_refptr {
|
|||||||
"It's unsafe to override the ref count preference."
|
"It's unsafe to override the ref count preference."
|
||||||
" Please remove REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE"
|
" Please remove REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE"
|
||||||
" from subclasses.");
|
" from subclasses.");
|
||||||
if (ptr_) {
|
if (ptr_)
|
||||||
Release(ptr_);
|
Release(ptr_);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
T* get() const { return ptr_; }
|
T* get() const { return ptr_; }
|
||||||
@@ -298,7 +290,7 @@ class TRIVIAL_ABI scoped_refptr {
|
|||||||
|
|
||||||
// Returns the owned pointer (if any), releasing ownership to the caller. The
|
// Returns the owned pointer (if any), releasing ownership to the caller. The
|
||||||
// caller is responsible for managing the lifetime of the reference.
|
// caller is responsible for managing the lifetime of the reference.
|
||||||
[[nodiscard]] T* release();
|
T* release() WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
void swap(scoped_refptr& r) noexcept { std::swap(ptr_, r.ptr_); }
|
void swap(scoped_refptr& r) noexcept { std::swap(ptr_, r.ptr_); }
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,40 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
// ScopedTypeRef<> is patterned after std::unique_ptr<>, but maintains ownership
|
||||||
|
// of a reference to any type that is maintained by Retain and Release methods.
|
||||||
|
//
|
||||||
|
// The Traits structure must provide the Retain and Release methods for type T.
|
||||||
|
// A default ScopedTypeRefTraits is used but not defined, and should be defined
|
||||||
|
// for each type to use this interface. For example, an appropriate definition
|
||||||
|
// of ScopedTypeRefTraits for CGLContextObj would be:
|
||||||
|
//
|
||||||
|
// template<>
|
||||||
|
// struct ScopedTypeRefTraits<CGLContextObj> {
|
||||||
|
// static CGLContextObj InvalidValue() { return nullptr; }
|
||||||
|
// static CGLContextObj Retain(CGLContextObj object) {
|
||||||
|
// CGLContextRetain(object);
|
||||||
|
// return object;
|
||||||
|
// }
|
||||||
|
// static void Release(CGLContextObj object) { CGLContextRelease(object); }
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// For the many types that have pass-by-pointer create functions, the function
|
||||||
|
// InitializeInto() is provided to allow direct initialization and assumption
|
||||||
|
// of ownership of the object. For example, continuing to use the above
|
||||||
|
// CGLContextObj specialization:
|
||||||
|
//
|
||||||
|
// base::ScopedTypeRef<CGLContextObj> context;
|
||||||
|
// CGLCreateContext(pixel_format, share_group, context.InitializeInto());
|
||||||
|
//
|
||||||
|
// For initialization with an existing object, the caller may specify whether
|
||||||
|
// the ScopedTypeRef<> being initialized is assuming the caller's existing
|
||||||
|
// ownership of the object (and should not call Retain in initialization) or if
|
||||||
|
// it should not assume this ownership and must create its own (by calling
|
||||||
|
// Retain in initialization). This behavior is based on the |policy| parameter,
|
||||||
|
// with |ASSUME| for the former and |RETAIN| for the latter. The default policy
|
||||||
|
// is to |ASSUME|.
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_SCOPED_TYPEREF_MAC_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_SCOPED_TYPEREF_MAC_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_SCOPED_TYPEREF_MAC_H_
|
#define CEF_INCLUDE_BASE_CEF_SCOPED_TYPEREF_MAC_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
@@ -40,55 +74,16 @@
|
|||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
// updated to match.
|
// updated to match.
|
||||||
|
|
||||||
|
#include "include/base/cef_compiler_specific.h"
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
#include "include/base/internal/cef_scoped_policy.h"
|
#include "include/base/internal/cef_scoped_policy.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
|
|
||||||
template <typename T>
|
template<typename T>
|
||||||
struct ScopedTypeRefTraits;
|
struct ScopedTypeRefTraits;
|
||||||
|
|
||||||
///
|
template<typename T, typename Traits = ScopedTypeRefTraits<T>>
|
||||||
/// ScopedTypeRef<> is patterned after std::unique_ptr<>, but maintains
|
|
||||||
/// ownership of a reference to any type that is maintained by Retain and
|
|
||||||
/// Release methods.
|
|
||||||
///
|
|
||||||
/// The Traits structure must provide the Retain and Release methods for type T.
|
|
||||||
/// A default ScopedTypeRefTraits is used but not defined, and should be defined
|
|
||||||
/// for each type to use this interface. For example, an appropriate definition
|
|
||||||
/// of ScopedTypeRefTraits for CGLContextObj would be:
|
|
||||||
///
|
|
||||||
/// <pre>
|
|
||||||
/// template<>
|
|
||||||
/// struct ScopedTypeRefTraits<CGLContextObj> {
|
|
||||||
/// static CGLContextObj InvalidValue() { return nullptr; }
|
|
||||||
/// static CGLContextObj Retain(CGLContextObj object) {
|
|
||||||
/// CGLContextRetain(object);
|
|
||||||
/// return object;
|
|
||||||
/// }
|
|
||||||
/// static void Release(CGLContextObj object) { CGLContextRelease(object); }
|
|
||||||
/// };
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// For the many types that have pass-by-pointer create functions, the function
|
|
||||||
/// InitializeInto() is provided to allow direct initialization and assumption
|
|
||||||
/// of ownership of the object. For example, continuing to use the above
|
|
||||||
/// CGLContextObj specialization:
|
|
||||||
///
|
|
||||||
/// <pre>
|
|
||||||
/// base::ScopedTypeRef<CGLContextObj> context;
|
|
||||||
/// CGLCreateContext(pixel_format, share_group, context.InitializeInto());
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// For initialization with an existing object, the caller may specify whether
|
|
||||||
/// the ScopedTypeRef<> being initialized is assuming the caller's existing
|
|
||||||
/// ownership of the object (and should not call Retain in initialization) or if
|
|
||||||
/// it should not assume this ownership and must create its own (by calling
|
|
||||||
/// Retain in initialization). This behavior is based on the |policy| parameter,
|
|
||||||
/// with |ASSUME| for the former and |RETAIN| for the latter. The default policy
|
|
||||||
/// is to |ASSUME|.
|
|
||||||
///
|
|
||||||
template <typename T, typename Traits = ScopedTypeRefTraits<T>>
|
|
||||||
class ScopedTypeRef {
|
class ScopedTypeRef {
|
||||||
public:
|
public:
|
||||||
using element_type = T;
|
using element_type = T;
|
||||||
@@ -97,24 +92,22 @@ class ScopedTypeRef {
|
|||||||
element_type object = Traits::InvalidValue(),
|
element_type object = Traits::InvalidValue(),
|
||||||
base::scoped_policy::OwnershipPolicy policy = base::scoped_policy::ASSUME)
|
base::scoped_policy::OwnershipPolicy policy = base::scoped_policy::ASSUME)
|
||||||
: object_(object) {
|
: object_(object) {
|
||||||
if (object_ && policy == base::scoped_policy::RETAIN) {
|
if (object_ && policy == base::scoped_policy::RETAIN)
|
||||||
object_ = Traits::Retain(object_);
|
object_ = Traits::Retain(object_);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopedTypeRef(const ScopedTypeRef<T, Traits>& that) : object_(that.object_) {
|
ScopedTypeRef(const ScopedTypeRef<T, Traits>& that)
|
||||||
if (object_) {
|
: object_(that.object_) {
|
||||||
|
if (object_)
|
||||||
object_ = Traits::Retain(object_);
|
object_ = Traits::Retain(object_);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This allows passing an object to a function that takes its superclass.
|
// This allows passing an object to a function that takes its superclass.
|
||||||
template <typename R, typename RTraits>
|
template <typename R, typename RTraits>
|
||||||
explicit ScopedTypeRef(const ScopedTypeRef<R, RTraits>& that_as_subclass)
|
explicit ScopedTypeRef(const ScopedTypeRef<R, RTraits>& that_as_subclass)
|
||||||
: object_(that_as_subclass.get()) {
|
: object_(that_as_subclass.get()) {
|
||||||
if (object_) {
|
if (object_)
|
||||||
object_ = Traits::Retain(object_);
|
object_ = Traits::Retain(object_);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopedTypeRef(ScopedTypeRef<T, Traits>&& that) : object_(that.object_) {
|
ScopedTypeRef(ScopedTypeRef<T, Traits>&& that) : object_(that.object_) {
|
||||||
@@ -122,9 +115,8 @@ class ScopedTypeRef {
|
|||||||
}
|
}
|
||||||
|
|
||||||
~ScopedTypeRef() {
|
~ScopedTypeRef() {
|
||||||
if (object_) {
|
if (object_)
|
||||||
Traits::Release(object_);
|
Traits::Release(object_);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopedTypeRef& operator=(const ScopedTypeRef<T, Traits>& that) {
|
ScopedTypeRef& operator=(const ScopedTypeRef<T, Traits>& that) {
|
||||||
@@ -135,7 +127,7 @@ class ScopedTypeRef {
|
|||||||
// This is to be used only to take ownership of objects that are created
|
// This is to be used only to take ownership of objects that are created
|
||||||
// by pass-by-pointer create functions. To enforce this, require that the
|
// by pass-by-pointer create functions. To enforce this, require that the
|
||||||
// object be reset to NULL before this may be used.
|
// object be reset to NULL before this may be used.
|
||||||
[[nodiscard]] element_type* InitializeInto() {
|
element_type* InitializeInto() WARN_UNUSED_RESULT {
|
||||||
DCHECK(!object_);
|
DCHECK(!object_);
|
||||||
return &object_;
|
return &object_;
|
||||||
}
|
}
|
||||||
@@ -147,12 +139,10 @@ class ScopedTypeRef {
|
|||||||
void reset(element_type object = Traits::InvalidValue(),
|
void reset(element_type object = Traits::InvalidValue(),
|
||||||
base::scoped_policy::OwnershipPolicy policy =
|
base::scoped_policy::OwnershipPolicy policy =
|
||||||
base::scoped_policy::ASSUME) {
|
base::scoped_policy::ASSUME) {
|
||||||
if (object && policy == base::scoped_policy::RETAIN) {
|
if (object && policy == base::scoped_policy::RETAIN)
|
||||||
object = Traits::Retain(object);
|
object = Traits::Retain(object);
|
||||||
}
|
if (object_)
|
||||||
if (object_) {
|
|
||||||
Traits::Release(object_);
|
Traits::Release(object_);
|
||||||
}
|
|
||||||
object_ = object;
|
object_ = object;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,7 +163,7 @@ class ScopedTypeRef {
|
|||||||
// ScopedTypeRef<>::release() is like std::unique_ptr<>::release. It is NOT
|
// ScopedTypeRef<>::release() is like std::unique_ptr<>::release. It is NOT
|
||||||
// a wrapper for Release(). To force a ScopedTypeRef<> object to call
|
// a wrapper for Release(). To force a ScopedTypeRef<> object to call
|
||||||
// Release(), use ScopedTypeRef<>::reset().
|
// Release(), use ScopedTypeRef<>::reset().
|
||||||
[[nodiscard]] element_type release() {
|
element_type release() WARN_UNUSED_RESULT {
|
||||||
element_type temp = object_;
|
element_type temp = object_;
|
||||||
object_ = Traits::InvalidValue();
|
object_ = Traits::InvalidValue();
|
||||||
return temp;
|
return temp;
|
||||||
|
|||||||
409
include/base/cef_template_util.h
Normal file
409
include/base/cef_template_util.h
Normal file
@@ -0,0 +1,409 @@
|
|||||||
|
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
|
||||||
|
// 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_TEMPLATE_UTIL_H_
|
||||||
|
#define CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
|
// When building CEF include the Chromium header directly.
|
||||||
|
#include "base/template_util.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 <stddef.h>
|
||||||
|
#include <iosfwd>
|
||||||
|
#include <iterator>
|
||||||
|
#include <type_traits>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "include/base/cef_build.h"
|
||||||
|
|
||||||
|
// Some versions of libstdc++ have partial support for type_traits, but misses
|
||||||
|
// a smaller subset while removing some of the older non-standard stuff. Assume
|
||||||
|
// that all versions below 5.0 fall in this category, along with one 5.0
|
||||||
|
// experimental release. Test for this by consulting compiler major version,
|
||||||
|
// the only reliable option available, so theoretically this could fail should
|
||||||
|
// you attempt to mix an earlier version of libstdc++ with >= GCC5. But
|
||||||
|
// that's unlikely to work out, especially as GCC5 changed ABI.
|
||||||
|
#define CR_GLIBCXX_5_0_0 20150123
|
||||||
|
#if (defined(__GNUC__) && __GNUC__ < 5) || \
|
||||||
|
(defined(__GLIBCXX__) && __GLIBCXX__ == CR_GLIBCXX_5_0_0)
|
||||||
|
#define CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// This hacks around using gcc with libc++ which has some incompatibilies.
|
||||||
|
// - is_trivially_* doesn't work: https://llvm.org/bugs/show_bug.cgi?id=27538
|
||||||
|
// TODO(danakj): Remove this when android builders are all using a newer version
|
||||||
|
// of gcc, or the android ndk is updated to a newer libc++ that works with older
|
||||||
|
// gcc versions.
|
||||||
|
#if !defined(__clang__) && defined(_LIBCPP_VERSION)
|
||||||
|
#define CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
|
||||||
|
template <class T> struct is_non_const_reference : std::false_type {};
|
||||||
|
template <class T> struct is_non_const_reference<T&> : std::true_type {};
|
||||||
|
template <class T> struct is_non_const_reference<const T&> : std::false_type {};
|
||||||
|
|
||||||
|
namespace internal {
|
||||||
|
|
||||||
|
// Implementation detail of base::void_t below.
|
||||||
|
template <typename...>
|
||||||
|
struct make_void {
|
||||||
|
using type = void;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace internal
|
||||||
|
|
||||||
|
// base::void_t is an implementation of std::void_t from C++17.
|
||||||
|
//
|
||||||
|
// We use |base::internal::make_void| as a helper struct to avoid a C++14
|
||||||
|
// defect:
|
||||||
|
// http://en.cppreference.com/w/cpp/types/void_t
|
||||||
|
// http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1558
|
||||||
|
template <typename... Ts>
|
||||||
|
using void_t = typename ::base::internal::make_void<Ts...>::type;
|
||||||
|
|
||||||
|
namespace internal {
|
||||||
|
|
||||||
|
// Uses expression SFINAE to detect whether using operator<< would work.
|
||||||
|
template <typename T, typename = void>
|
||||||
|
struct SupportsOstreamOperator : std::false_type {};
|
||||||
|
template <typename T>
|
||||||
|
struct SupportsOstreamOperator<T,
|
||||||
|
decltype(void(std::declval<std::ostream&>()
|
||||||
|
<< std::declval<T>()))>
|
||||||
|
: std::true_type {};
|
||||||
|
|
||||||
|
template <typename T, typename = void>
|
||||||
|
struct SupportsToString : std::false_type {};
|
||||||
|
template <typename T>
|
||||||
|
struct SupportsToString<T, decltype(void(std::declval<T>().ToString()))>
|
||||||
|
: std::true_type {};
|
||||||
|
|
||||||
|
// Used to detech whether the given type is an iterator. This is normally used
|
||||||
|
// with std::enable_if to provide disambiguation for functions that take
|
||||||
|
// templatzed iterators as input.
|
||||||
|
template <typename T, typename = void>
|
||||||
|
struct is_iterator : std::false_type {};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct is_iterator<T,
|
||||||
|
void_t<typename std::iterator_traits<T>::iterator_category>>
|
||||||
|
: std::true_type {};
|
||||||
|
|
||||||
|
// Helper to express preferences in an overload set. If more than one overload
|
||||||
|
// are available for a given set of parameters the overload with the higher
|
||||||
|
// priority will be chosen.
|
||||||
|
template <size_t I>
|
||||||
|
struct priority_tag : priority_tag<I - 1> {};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct priority_tag<0> {};
|
||||||
|
|
||||||
|
} // namespace internal
|
||||||
|
|
||||||
|
// is_trivially_copyable is especially hard to get right.
|
||||||
|
// - Older versions of libstdc++ will fail to have it like they do for other
|
||||||
|
// type traits. This has become a subset of the second point, but used to be
|
||||||
|
// handled independently.
|
||||||
|
// - An experimental release of gcc includes most of type_traits but misses
|
||||||
|
// is_trivially_copyable, so we still have to avoid using libstdc++ in this
|
||||||
|
// case, which is covered by CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX.
|
||||||
|
// - When compiling libc++ from before r239653, with a gcc compiler, the
|
||||||
|
// std::is_trivially_copyable can fail. So we need to work around that by not
|
||||||
|
// using the one in libc++ in this case. This is covered by the
|
||||||
|
// CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX define, and is discussed in
|
||||||
|
// https://llvm.org/bugs/show_bug.cgi?id=27538#c1 where they point out that
|
||||||
|
// in libc++'s commit r239653 this is fixed by libc++ checking for gcc 5.1.
|
||||||
|
// - In both of the above cases we are using the gcc compiler. When defining
|
||||||
|
// this ourselves on compiler intrinsics, the __is_trivially_copyable()
|
||||||
|
// intrinsic is not available on gcc before version 5.1 (see the discussion in
|
||||||
|
// https://llvm.org/bugs/show_bug.cgi?id=27538#c1 again), so we must check for
|
||||||
|
// that version.
|
||||||
|
// - When __is_trivially_copyable() is not available because we are on gcc older
|
||||||
|
// than 5.1, we need to fall back to something, so we use __has_trivial_copy()
|
||||||
|
// instead based on what was done one-off in bit_cast() previously.
|
||||||
|
|
||||||
|
// TODO(crbug.com/554293): Remove this when all platforms have this in the std
|
||||||
|
// namespace and it works with gcc as needed.
|
||||||
|
#if defined(CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX) || \
|
||||||
|
defined(CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX)
|
||||||
|
template <typename T>
|
||||||
|
struct is_trivially_copyable {
|
||||||
|
// TODO(danakj): Remove this when android builders are all using a newer version
|
||||||
|
// of gcc, or the android ndk is updated to a newer libc++ that does this for
|
||||||
|
// us.
|
||||||
|
#if _GNUC_VER >= 501
|
||||||
|
static constexpr bool value = __is_trivially_copyable(T);
|
||||||
|
#else
|
||||||
|
static constexpr bool value =
|
||||||
|
__has_trivial_copy(T) && __has_trivial_destructor(T);
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
template <class T>
|
||||||
|
using is_trivially_copyable = std::is_trivially_copyable<T>;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 7
|
||||||
|
// Workaround for g++7 and earlier family.
|
||||||
|
// Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80654, without this
|
||||||
|
// Optional<std::vector<T>> where T is non-copyable causes a compile error.
|
||||||
|
// As we know it is not trivially copy constructible, explicitly declare so.
|
||||||
|
template <typename T>
|
||||||
|
struct is_trivially_copy_constructible
|
||||||
|
: std::is_trivially_copy_constructible<T> {};
|
||||||
|
|
||||||
|
template <typename... T>
|
||||||
|
struct is_trivially_copy_constructible<std::vector<T...>> : std::false_type {};
|
||||||
|
#else
|
||||||
|
// Otherwise use std::is_trivially_copy_constructible as is.
|
||||||
|
template <typename T>
|
||||||
|
using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// base::in_place_t is an implementation of std::in_place_t from
|
||||||
|
// C++17. A tag type used to request in-place construction in template vararg
|
||||||
|
// constructors.
|
||||||
|
|
||||||
|
// Specification:
|
||||||
|
// https://en.cppreference.com/w/cpp/utility/in_place
|
||||||
|
struct in_place_t {};
|
||||||
|
constexpr in_place_t in_place = {};
|
||||||
|
|
||||||
|
// base::in_place_type_t is an implementation of std::in_place_type_t from
|
||||||
|
// C++17. A tag type used for in-place construction when the type to construct
|
||||||
|
// needs to be specified, such as with base::unique_any, designed to be a
|
||||||
|
// drop-in replacement.
|
||||||
|
|
||||||
|
// Specification:
|
||||||
|
// http://en.cppreference.com/w/cpp/utility/in_place
|
||||||
|
template <typename T>
|
||||||
|
struct in_place_type_t {};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct is_in_place_type_t {
|
||||||
|
static constexpr bool value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename... Ts>
|
||||||
|
struct is_in_place_type_t<in_place_type_t<Ts...>> {
|
||||||
|
static constexpr bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// C++14 implementation of C++17's std::bool_constant.
|
||||||
|
//
|
||||||
|
// Reference: https://en.cppreference.com/w/cpp/types/integral_constant
|
||||||
|
// Specification: https://wg21.link/meta.type.synop
|
||||||
|
template <bool B>
|
||||||
|
using bool_constant = std::integral_constant<bool, B>;
|
||||||
|
|
||||||
|
// C++14 implementation of C++17's std::conjunction.
|
||||||
|
//
|
||||||
|
// Reference: https://en.cppreference.com/w/cpp/types/conjunction
|
||||||
|
// Specification: https://wg21.link/meta.logical#1.itemdecl:1
|
||||||
|
template <typename...>
|
||||||
|
struct conjunction : std::true_type {};
|
||||||
|
|
||||||
|
template <typename B1>
|
||||||
|
struct conjunction<B1> : B1 {};
|
||||||
|
|
||||||
|
template <typename B1, typename... Bn>
|
||||||
|
struct conjunction<B1, Bn...>
|
||||||
|
: std::conditional_t<static_cast<bool>(B1::value), conjunction<Bn...>, B1> {
|
||||||
|
};
|
||||||
|
|
||||||
|
// C++14 implementation of C++17's std::disjunction.
|
||||||
|
//
|
||||||
|
// Reference: https://en.cppreference.com/w/cpp/types/disjunction
|
||||||
|
// Specification: https://wg21.link/meta.logical#itemdecl:2
|
||||||
|
template <typename...>
|
||||||
|
struct disjunction : std::false_type {};
|
||||||
|
|
||||||
|
template <typename B1>
|
||||||
|
struct disjunction<B1> : B1 {};
|
||||||
|
|
||||||
|
template <typename B1, typename... Bn>
|
||||||
|
struct disjunction<B1, Bn...>
|
||||||
|
: std::conditional_t<static_cast<bool>(B1::value), B1, disjunction<Bn...>> {
|
||||||
|
};
|
||||||
|
|
||||||
|
// C++14 implementation of C++17's std::negation.
|
||||||
|
//
|
||||||
|
// Reference: https://en.cppreference.com/w/cpp/types/negation
|
||||||
|
// Specification: https://wg21.link/meta.logical#itemdecl:3
|
||||||
|
template <typename B>
|
||||||
|
struct negation : bool_constant<!static_cast<bool>(B::value)> {};
|
||||||
|
|
||||||
|
// Implementation of C++17's invoke_result.
|
||||||
|
//
|
||||||
|
// This implementation adds references to `Functor` and `Args` to work around
|
||||||
|
// some quirks of std::result_of. See the #Notes section of [1] for details.
|
||||||
|
//
|
||||||
|
// References:
|
||||||
|
// [1] https://en.cppreference.com/w/cpp/types/result_of
|
||||||
|
// [2] https://wg21.link/meta.trans.other#lib:invoke_result
|
||||||
|
template <typename Functor, typename... Args>
|
||||||
|
using invoke_result = std::result_of<Functor && (Args && ...)>;
|
||||||
|
|
||||||
|
// Implementation of C++17's std::invoke_result_t.
|
||||||
|
//
|
||||||
|
// Reference: https://wg21.link/meta.type.synop#lib:invoke_result_t
|
||||||
|
template <typename Functor, typename... Args>
|
||||||
|
using invoke_result_t = typename invoke_result<Functor, Args...>::type;
|
||||||
|
|
||||||
|
namespace internal {
|
||||||
|
|
||||||
|
// Base case, `InvokeResult` does not have a nested type member. This means `F`
|
||||||
|
// could not be invoked with `Args...` and thus is not invocable.
|
||||||
|
template <typename InvokeResult, typename R, typename = void>
|
||||||
|
struct IsInvocableImpl : std::false_type {};
|
||||||
|
|
||||||
|
// Happy case, `InvokeResult` does have a nested type member. Now check whether
|
||||||
|
// `InvokeResult::type` is convertible to `R`. Short circuit in case
|
||||||
|
// `std::is_void<R>`.
|
||||||
|
template <typename InvokeResult, typename R>
|
||||||
|
struct IsInvocableImpl<InvokeResult, R, void_t<typename InvokeResult::type>>
|
||||||
|
: disjunction<std::is_void<R>,
|
||||||
|
std::is_convertible<typename InvokeResult::type, R>> {};
|
||||||
|
|
||||||
|
} // namespace internal
|
||||||
|
|
||||||
|
// Implementation of C++17's std::is_invocable_r.
|
||||||
|
//
|
||||||
|
// Returns whether `F` can be invoked with `Args...` and the result is
|
||||||
|
// convertible to `R`.
|
||||||
|
//
|
||||||
|
// Reference: https://wg21.link/meta.rel#lib:is_invocable_r
|
||||||
|
template <typename R, typename F, typename... Args>
|
||||||
|
struct is_invocable_r
|
||||||
|
: internal::IsInvocableImpl<invoke_result<F, Args...>, R> {};
|
||||||
|
|
||||||
|
// Implementation of C++17's std::is_invocable.
|
||||||
|
//
|
||||||
|
// Returns whether `F` can be invoked with `Args...`.
|
||||||
|
//
|
||||||
|
// Reference: https://wg21.link/meta.rel#lib:is_invocable
|
||||||
|
template <typename F, typename... Args>
|
||||||
|
struct is_invocable : is_invocable_r<void, F, Args...> {};
|
||||||
|
|
||||||
|
namespace internal {
|
||||||
|
|
||||||
|
// The indirection with std::is_enum<T> is required, because instantiating
|
||||||
|
// std::underlying_type_t<T> when T is not an enum is UB prior to C++20.
|
||||||
|
template <typename T, bool = std::is_enum<T>::value>
|
||||||
|
struct IsScopedEnumImpl : std::false_type {};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct IsScopedEnumImpl<T, /*std::is_enum<T>::value=*/true>
|
||||||
|
: negation<std::is_convertible<T, std::underlying_type_t<T>>> {};
|
||||||
|
|
||||||
|
} // namespace internal
|
||||||
|
|
||||||
|
// Implementation of C++23's std::is_scoped_enum
|
||||||
|
//
|
||||||
|
// Reference: https://en.cppreference.com/w/cpp/types/is_scoped_enum
|
||||||
|
template <typename T>
|
||||||
|
struct is_scoped_enum : internal::IsScopedEnumImpl<T> {};
|
||||||
|
|
||||||
|
// Implementation of C++20's std::remove_cvref.
|
||||||
|
//
|
||||||
|
// References:
|
||||||
|
// - https://en.cppreference.com/w/cpp/types/remove_cvref
|
||||||
|
// - https://wg21.link/meta.trans.other#lib:remove_cvref
|
||||||
|
template <typename T>
|
||||||
|
struct remove_cvref {
|
||||||
|
using type = std::remove_cv_t<std::remove_reference_t<T>>;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Implementation of C++20's std::remove_cvref_t.
|
||||||
|
//
|
||||||
|
// References:
|
||||||
|
// - https://en.cppreference.com/w/cpp/types/remove_cvref
|
||||||
|
// - https://wg21.link/meta.type.synop#lib:remove_cvref_t
|
||||||
|
template <typename T>
|
||||||
|
using remove_cvref_t = typename remove_cvref<T>::type;
|
||||||
|
|
||||||
|
// Simplified implementation of C++20's std::iter_value_t.
|
||||||
|
// As opposed to std::iter_value_t, this implementation does not restrict
|
||||||
|
// the type of `Iter` and does not consider specializations of
|
||||||
|
// `indirectly_readable_traits`.
|
||||||
|
//
|
||||||
|
// Reference: https://wg21.link/readable.traits#2
|
||||||
|
template <typename Iter>
|
||||||
|
using iter_value_t =
|
||||||
|
typename std::iterator_traits<remove_cvref_t<Iter>>::value_type;
|
||||||
|
|
||||||
|
// Simplified implementation of C++20's std::iter_reference_t.
|
||||||
|
// As opposed to std::iter_reference_t, this implementation does not restrict
|
||||||
|
// the type of `Iter`.
|
||||||
|
//
|
||||||
|
// Reference: https://wg21.link/iterator.synopsis#:~:text=iter_reference_t
|
||||||
|
template <typename Iter>
|
||||||
|
using iter_reference_t = decltype(*std::declval<Iter&>());
|
||||||
|
|
||||||
|
// Simplified implementation of C++20's std::indirect_result_t. As opposed to
|
||||||
|
// std::indirect_result_t, this implementation does not restrict the type of
|
||||||
|
// `Func` and `Iters`.
|
||||||
|
//
|
||||||
|
// Reference: https://wg21.link/iterator.synopsis#:~:text=indirect_result_t
|
||||||
|
template <typename Func, typename... Iters>
|
||||||
|
using indirect_result_t = invoke_result_t<Func, iter_reference_t<Iters>...>;
|
||||||
|
|
||||||
|
// Simplified implementation of C++20's std::projected. As opposed to
|
||||||
|
// std::projected, this implementation does not explicitly restrict the type of
|
||||||
|
// `Iter` and `Proj`, but rather does so implicitly by requiring
|
||||||
|
// `indirect_result_t<Proj, Iter>` is a valid type. This is required for SFINAE
|
||||||
|
// friendliness.
|
||||||
|
//
|
||||||
|
// Reference: https://wg21.link/projected
|
||||||
|
template <typename Iter,
|
||||||
|
typename Proj,
|
||||||
|
typename IndirectResultT = indirect_result_t<Proj, Iter>>
|
||||||
|
struct projected {
|
||||||
|
using value_type = remove_cvref_t<IndirectResultT>;
|
||||||
|
|
||||||
|
IndirectResultT operator*() const; // not defined
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace base
|
||||||
|
|
||||||
|
#undef CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX
|
||||||
|
#undef CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX
|
||||||
|
|
||||||
|
#endif // !USING_CHROMIUM_INCLUDES
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_
|
||||||
@@ -43,12 +43,10 @@
|
|||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
#include "include/base/internal/cef_thread_checker_impl.h"
|
#include "include/base/internal/cef_thread_checker_impl.h"
|
||||||
|
|
||||||
///
|
// Apart from debug builds, we also enable the thread checker in
|
||||||
/// Apart from debug builds, we also enable the thread checker in
|
// builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots
|
||||||
/// builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots
|
// with this define will get the same level of thread checking as
|
||||||
/// with this define will get the same level of thread checking as
|
// debug bots.
|
||||||
/// debug bots.
|
|
||||||
///
|
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
#define ENABLE_THREAD_CHECKER 1
|
#define ENABLE_THREAD_CHECKER 1
|
||||||
#else
|
#else
|
||||||
@@ -59,12 +57,10 @@ namespace base {
|
|||||||
|
|
||||||
namespace cef_internal {
|
namespace cef_internal {
|
||||||
|
|
||||||
///
|
// Do nothing implementation, for use in release mode.
|
||||||
/// Do nothing implementation, for use in release mode.
|
//
|
||||||
///
|
// Note: You should almost always use the ThreadChecker class to get the
|
||||||
/// Note: You should almost always use the ThreadChecker class to get the
|
// right version for your build configuration.
|
||||||
/// right version for your build configuration.
|
|
||||||
///
|
|
||||||
class ThreadCheckerDoNothing {
|
class ThreadCheckerDoNothing {
|
||||||
public:
|
public:
|
||||||
bool CalledOnValidThread() const { return true; }
|
bool CalledOnValidThread() const { return true; }
|
||||||
@@ -74,42 +70,37 @@ class ThreadCheckerDoNothing {
|
|||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace cef_internal
|
||||||
|
|
||||||
///
|
// ThreadChecker is a helper class used to help verify that some methods of a
|
||||||
/// ThreadChecker is a helper class used to help verify that some methods of a
|
// class are called from the same thread. It provides identical functionality to
|
||||||
/// class are called from the same thread. It provides identical functionality
|
// base::NonThreadSafe, but it is meant to be held as a member variable, rather
|
||||||
/// to base::NonThreadSafe, but it is meant to be held as a member variable,
|
// than inherited from base::NonThreadSafe.
|
||||||
/// rather than inherited from base::NonThreadSafe.
|
//
|
||||||
///
|
// While inheriting from base::NonThreadSafe may give a clear indication about
|
||||||
/// While inheriting from base::NonThreadSafe may give a clear indication about
|
// the thread-safety of a class, it may also lead to violations of the style
|
||||||
/// the thread-safety of a class, it may also lead to violations of the style
|
// guide with regard to multiple inheritance. The choice between having a
|
||||||
/// guide with regard to multiple inheritance. The choice between having a
|
// ThreadChecker member and inheriting from base::NonThreadSafe should be based
|
||||||
/// ThreadChecker member and inheriting from base::NonThreadSafe should be based
|
// on whether:
|
||||||
/// on whether:
|
// - Derived classes need to know the thread they belong to, as opposed to
|
||||||
/// - Derived classes need to know the thread they belong to, as opposed to
|
// having that functionality fully encapsulated in the base class.
|
||||||
/// having that functionality fully encapsulated in the base class.
|
// - Derived classes should be able to reassign the base class to another
|
||||||
/// - Derived classes should be able to reassign the base class to another
|
// thread, via DetachFromThread.
|
||||||
/// thread, via DetachFromThread.
|
//
|
||||||
///
|
// If neither of these are true, then having a ThreadChecker member and calling
|
||||||
/// If neither of these are true, then having a ThreadChecker member and calling
|
// CalledOnValidThread is the preferable solution.
|
||||||
/// CalledOnValidThread is the preferable solution.
|
//
|
||||||
///
|
// Example:
|
||||||
/// Example:
|
// class MyClass {
|
||||||
///
|
// public:
|
||||||
/// <pre>
|
// void Foo() {
|
||||||
/// class MyClass {
|
// DCHECK(thread_checker_.CalledOnValidThread());
|
||||||
/// public:
|
// ... (do stuff) ...
|
||||||
/// void Foo() {
|
// }
|
||||||
/// DCHECK(thread_checker_.CalledOnValidThread());
|
//
|
||||||
/// ... (do stuff) ...
|
// private:
|
||||||
/// }
|
// ThreadChecker thread_checker_;
|
||||||
///
|
// }
|
||||||
/// private:
|
//
|
||||||
/// ThreadChecker thread_checker_;
|
// In Release mode, CalledOnValidThread will always return true.
|
||||||
/// }
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// In Release mode, CalledOnValidThread will always return true.
|
|
||||||
///
|
|
||||||
#if ENABLE_THREAD_CHECKER
|
#if ENABLE_THREAD_CHECKER
|
||||||
class ThreadChecker : public cef_internal::ThreadCheckerImpl {};
|
class ThreadChecker : public cef_internal::ThreadCheckerImpl {};
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -29,125 +29,111 @@
|
|||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
///
|
///
|
||||||
/// \file
|
// Trace events are for tracking application performance and resource usage.
|
||||||
/// Trace events are for tracking application performance and resource usage.
|
// Macros are provided to track:
|
||||||
/// Macros are provided to track:
|
// Begin and end of function calls
|
||||||
/// Begin and end of function calls
|
// Counters
|
||||||
/// Counters
|
//
|
||||||
///
|
// Events are issued against categories. Whereas LOG's categories are statically
|
||||||
/// Events are issued against categories. Whereas LOG's categories are
|
// defined, TRACE categories are created implicitly with a string. For example:
|
||||||
/// statically defined, TRACE categories are created implicitly with a string.
|
// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent")
|
||||||
/// For example: <pre>
|
//
|
||||||
/// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent")
|
// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope:
|
||||||
/// </pre>
|
// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly")
|
||||||
///
|
// doSomethingCostly()
|
||||||
/// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope:
|
// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly")
|
||||||
/// <pre>
|
// Note: Our tools can't always determine the correct BEGIN/END pairs unless
|
||||||
/// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly")
|
// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you
|
||||||
/// doSomethingCostly()
|
// need them to be in separate scopes.
|
||||||
/// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly")
|
//
|
||||||
/// </pre>
|
// A common use case is to trace entire function scopes. This issues a trace
|
||||||
/// Note: Our tools can't always determine the correct BEGIN/END pairs unless
|
// BEGIN and END automatically:
|
||||||
/// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you
|
// void doSomethingCostly() {
|
||||||
/// need them to be in separate scopes.
|
// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly");
|
||||||
///
|
// ...
|
||||||
/// A common use case is to trace entire function scopes. This issues a trace
|
// }
|
||||||
/// BEGIN and END automatically:
|
//
|
||||||
/// <pre>
|
// Additional parameters can be associated with an event:
|
||||||
/// void doSomethingCostly() {
|
// void doSomethingCostly2(int howMuch) {
|
||||||
/// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly");
|
// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly",
|
||||||
/// ...
|
// "howMuch", howMuch);
|
||||||
/// }
|
// ...
|
||||||
/// </pre>
|
// }
|
||||||
///
|
//
|
||||||
/// Additional parameters can be associated with an event:
|
// The trace system will automatically add to this information the current
|
||||||
/// <pre>
|
// process id, thread id, and a timestamp in microseconds.
|
||||||
/// void doSomethingCostly2(int howMuch) {
|
//
|
||||||
/// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly",
|
// To trace an asynchronous procedure such as an IPC send/receive, use
|
||||||
/// "howMuch", howMuch);
|
// ASYNC_BEGIN and ASYNC_END:
|
||||||
/// ...
|
// [single threaded sender code]
|
||||||
/// }
|
// static int send_count = 0;
|
||||||
/// </pre>
|
// ++send_count;
|
||||||
///
|
// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count);
|
||||||
/// The trace system will automatically add to this information the current
|
// Send(new MyMessage(send_count));
|
||||||
/// process id, thread id, and a timestamp in microseconds.
|
// [receive code]
|
||||||
///
|
// void OnMyMessage(send_count) {
|
||||||
/// To trace an asynchronous procedure such as an IPC send/receive, use
|
// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count);
|
||||||
/// ASYNC_BEGIN and ASYNC_END:
|
// }
|
||||||
/// <pre>
|
// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs.
|
||||||
/// [single threaded sender code]
|
// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process.
|
||||||
/// static int send_count = 0;
|
// Pointers can be used for the ID parameter, and they will be mangled
|
||||||
/// ++send_count;
|
// internally so that the same pointer on two different processes will not
|
||||||
/// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count);
|
// match. For example:
|
||||||
/// Send(new MyMessage(send_count));
|
// class MyTracedClass {
|
||||||
/// [receive code]
|
// public:
|
||||||
/// void OnMyMessage(send_count) {
|
// MyTracedClass() {
|
||||||
/// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count);
|
// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this);
|
||||||
/// }
|
// }
|
||||||
/// </pre>
|
// ~MyTracedClass() {
|
||||||
/// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs.
|
// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this);
|
||||||
/// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process.
|
// }
|
||||||
/// Pointers can be used for the ID parameter, and they will be mangled
|
// }
|
||||||
/// internally so that the same pointer on two different processes will not
|
//
|
||||||
/// match. For example:
|
// The trace event also supports counters, which is a way to track a quantity
|
||||||
/// <pre>
|
// as it varies over time. Counters are created with the following macro:
|
||||||
/// class MyTracedClass {
|
// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue);
|
||||||
/// public:
|
//
|
||||||
/// MyTracedClass() {
|
// Counters are process-specific. The macro itself can be issued from any
|
||||||
/// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this);
|
// thread, however.
|
||||||
/// }
|
//
|
||||||
/// ~MyTracedClass() {
|
// Sometimes, you want to track two counters at once. You can do this with two
|
||||||
/// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this);
|
// counter macros:
|
||||||
/// }
|
// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]);
|
||||||
/// }
|
// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]);
|
||||||
/// </pre>
|
// Or you can do it with a combined macro:
|
||||||
///
|
// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter",
|
||||||
/// The trace event also supports counters, which is a way to track a quantity
|
// "bytesPinned", g_myCounterValue[0],
|
||||||
/// as it varies over time. Counters are created with the following macro:
|
// "bytesAllocated", g_myCounterValue[1]);
|
||||||
/// <pre>
|
// This indicates to the tracing UI that these counters should be displayed
|
||||||
/// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue);
|
// in a single graph, as a summed area chart.
|
||||||
/// </pre>
|
//
|
||||||
///
|
// Since counters are in a global namespace, you may want to disembiguate with a
|
||||||
/// Counters are process-specific. The macro itself can be issued from any
|
// unique ID, by using the TRACE_COUNTER_ID* variations.
|
||||||
/// thread, however.
|
//
|
||||||
///
|
// By default, trace collection is compiled in, but turned off at runtime.
|
||||||
/// Sometimes, you want to track two counters at once. You can do this with two
|
// Collecting trace data is the responsibility of the embedding application. In
|
||||||
/// counter macros:
|
// CEF's case, calling BeginTracing will turn on tracing on all active
|
||||||
/// <pre>
|
// processes.
|
||||||
/// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]);
|
//
|
||||||
/// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]);
|
//
|
||||||
/// </pre>
|
// Memory scoping note:
|
||||||
/// Or you can do it with a combined macro:
|
// Tracing copies the pointers, not the string content, of the strings passed
|
||||||
/// <pre>
|
// in for category, name, and arg_names. Thus, the following code will cause
|
||||||
/// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter",
|
// problems:
|
||||||
/// "bytesPinned", g_myCounterValue[0],
|
// char* str = strdup("impprtantName");
|
||||||
/// "bytesAllocated", g_myCounterValue[1]);
|
// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD!
|
||||||
/// </pre>
|
// free(str); // Trace system now has dangling pointer
|
||||||
/// This indicates to the tracing UI that these counters should be displayed
|
//
|
||||||
/// in a single graph, as a summed area chart.
|
// To avoid this issue with the |name| and |arg_name| parameters, use the
|
||||||
///
|
// TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime
|
||||||
/// Since counters are in a global namespace, you may want to disembiguate with
|
// overhead.
|
||||||
/// a unique ID, by using the TRACE_COUNTER_ID* variations.
|
// Notes: The category must always be in a long-lived char* (i.e. static const).
|
||||||
///
|
// The |arg_values|, when used, are always deep copied with the _COPY
|
||||||
/// By default, trace collection is compiled in, but turned off at runtime.
|
// macros.
|
||||||
/// Collecting trace data is the responsibility of the embedding application. In
|
//
|
||||||
/// CEF's case, calling BeginTracing will turn on tracing on all active
|
//
|
||||||
/// processes.
|
// Thread Safety:
|
||||||
///
|
// All macros are thread safe and can be used from any process.
|
||||||
///
|
|
||||||
/// Memory scoping note:
|
|
||||||
/// Tracing copies the pointers, not the string content, of the strings passed
|
|
||||||
/// in for category, name, and arg_names. Thus, the following code will cause
|
|
||||||
/// problems:
|
|
||||||
/// <pre>
|
|
||||||
/// char* str = strdup("impprtantName");
|
|
||||||
/// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD!
|
|
||||||
/// free(str); // Trace system now has dangling pointer
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
///
|
|
||||||
/// Thread Safety:
|
|
||||||
/// All macros are thread safe and can be used from any process.
|
|
||||||
///
|
///
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_
|
||||||
@@ -155,7 +141,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(USING_CHROMIUM_INCLUDES)
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
/// When building CEF include the Chromium header directly.
|
// When building CEF include the Chromium header directly.
|
||||||
#include "base/trace_event/trace_event.h"
|
#include "base/trace_event/trace_event.h"
|
||||||
#else // !USING_CHROMIUM_INCLUDES
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
// The following is substantially similar to the Chromium implementation.
|
// The following is substantially similar to the Chromium implementation.
|
||||||
@@ -164,22 +150,20 @@
|
|||||||
|
|
||||||
#include "include/internal/cef_trace_event_internal.h"
|
#include "include/internal/cef_trace_event_internal.h"
|
||||||
|
|
||||||
///
|
// Records a pair of begin and end events called "name" for the current
|
||||||
/// Records a pair of begin and end events called "name" for the current
|
// scope, with 0, 1 or 2 associated arguments. If the category is not
|
||||||
/// scope, with 0, 1 or 2 associated arguments. If the category is not
|
// enabled, then this does nothing.
|
||||||
/// enabled, then this does nothing.
|
// - category and name strings must have application lifetime (statics or
|
||||||
/// - category and name strings must have application lifetime (statics or
|
// literals). They may not include " chars.
|
||||||
/// literals). They may not include " chars.
|
#define TRACE_EVENT0(category, name) \
|
||||||
///
|
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false); \
|
||||||
#define TRACE_EVENT0(category, name) \
|
|
||||||
cef_trace_event_begin(category, name, NULL, 0, NULL, 0); \
|
|
||||||
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
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); \
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false); \
|
||||||
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
||||||
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \
|
#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, \
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val); \
|
arg2_val, false); \
|
||||||
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
||||||
|
|
||||||
// Implementation detail: trace event macros create temporary variable names.
|
// Implementation detail: trace event macros create temporary variable names.
|
||||||
@@ -195,181 +179,228 @@
|
|||||||
cef_trace_event::CefTraceEndOnScopeClose CEF_INTERNAL_TRACE_EVENT_UID( \
|
cef_trace_event::CefTraceEndOnScopeClose CEF_INTERNAL_TRACE_EVENT_UID( \
|
||||||
profileScope)(category, name)
|
profileScope)(category, name)
|
||||||
|
|
||||||
///
|
// Records a single event called "name" immediately, with 0, 1 or 2
|
||||||
/// Records a single event called "name" immediately, with 0, 1 or 2
|
// associated arguments. If the category is not enabled, then this
|
||||||
/// associated arguments. If the category is not enabled, then this
|
// does nothing.
|
||||||
/// does nothing.
|
// - category and name strings must have application lifetime (statics or
|
||||||
/// - category and name strings must have application lifetime (statics or
|
// literals). They may not include " chars.
|
||||||
/// literals). They may not include " chars.
|
|
||||||
///
|
|
||||||
#define TRACE_EVENT_INSTANT0(category, name) \
|
#define TRACE_EVENT_INSTANT0(category, name) \
|
||||||
cef_trace_event_instant(category, name, NULL, 0, NULL, 0)
|
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false)
|
||||||
#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0)
|
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, \
|
#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val) \
|
arg2_val) \
|
||||||
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
|
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val)
|
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) \
|
||||||
|
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
|
arg2_val, true)
|
||||||
|
|
||||||
///
|
// Records a single BEGIN event called "name" immediately, with 0, 1 or 2
|
||||||
/// Records a single BEGIN event called "name" immediately, with 0, 1 or 2
|
// associated arguments. If the category is not enabled, then this
|
||||||
/// associated arguments. If the category is not enabled, then this
|
// does nothing.
|
||||||
/// does nothing.
|
// - category and name strings must have application lifetime (statics or
|
||||||
/// - category and name strings must have application lifetime (statics or
|
// literals). They may not include " chars.
|
||||||
/// literals). They may not include " chars.
|
|
||||||
///
|
|
||||||
#define TRACE_EVENT_BEGIN0(category, name) \
|
#define TRACE_EVENT_BEGIN0(category, name) \
|
||||||
cef_trace_event_begin(category, name, NULL, 0, NULL, 0)
|
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false)
|
||||||
#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0)
|
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, \
|
#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val) \
|
arg2_val) \
|
||||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val)
|
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) \
|
||||||
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
|
arg2_val, true)
|
||||||
|
|
||||||
///
|
// Records a single END event for "name" immediately. If the category
|
||||||
/// Records a single END event for "name" immediately. If the category
|
// is not enabled, then this does nothing.
|
||||||
/// is not enabled, then this does nothing.
|
// - category and name strings must have application lifetime (statics or
|
||||||
/// - category and name strings must have application lifetime (statics or
|
// literals). They may not include " chars.
|
||||||
/// literals). They may not include " chars.
|
|
||||||
///
|
|
||||||
#define TRACE_EVENT_END0(category, name) \
|
#define TRACE_EVENT_END0(category, name) \
|
||||||
cef_trace_event_end(category, name, NULL, 0, NULL, 0)
|
cef_trace_event_end(category, name, NULL, 0, NULL, 0, false)
|
||||||
#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0)
|
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, \
|
#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val) \
|
arg2_val) \
|
||||||
cef_trace_event_end(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)
|
||||||
|
|
||||||
///
|
// Records the value of a counter called "name" immediately. Value
|
||||||
/// Records the value of a counter called "name" immediately. Value
|
// must be representable as a 32 bit integer.
|
||||||
/// must be representable as a 32 bit integer.
|
// - category and name strings must have application lifetime (statics or
|
||||||
/// - category and name strings must have application lifetime (statics or
|
// literals). They may not include " chars.
|
||||||
/// literals). They may not include " chars.
|
|
||||||
///
|
|
||||||
#define TRACE_COUNTER1(category, name, value) \
|
#define TRACE_COUNTER1(category, name, value) \
|
||||||
cef_trace_counter(category, name, NULL, value, NULL, 0)
|
cef_trace_counter(category, name, NULL, value, NULL, 0, false)
|
||||||
|
#define TRACE_COPY_COUNTER1(category, name, value) \
|
||||||
|
cef_trace_counter(category, name, NULL, value, NULL, 0, true)
|
||||||
|
|
||||||
///
|
// Records the values of a multi-parted counter called "name" immediately.
|
||||||
/// Records the values of a multi-parted counter called "name" immediately.
|
// The UI will treat value1 and value2 as parts of a whole, displaying their
|
||||||
/// The UI will treat value1 and value2 as parts of a whole, displaying their
|
// values as a stacked-bar chart.
|
||||||
/// values as a stacked-bar chart.
|
// - category and name strings must have application lifetime (statics or
|
||||||
/// - category and name strings must have application lifetime (statics or
|
// literals). They may not include " chars.
|
||||||
/// literals). They may not include " chars.
|
|
||||||
///
|
|
||||||
#define TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, \
|
#define TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, \
|
||||||
value2_val) \
|
value2_val) \
|
||||||
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
|
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
|
||||||
value2_val)
|
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
|
||||||
/// Records the value of a counter called "name" immediately. Value
|
// must be representable as a 32 bit integer.
|
||||||
/// must be representable as a 32 bit integer.
|
// - category and name strings must have application lifetime (statics or
|
||||||
/// - category and name strings must have application lifetime (statics or
|
// literals). They may not include " chars.
|
||||||
/// literals). They may not include " chars.
|
// - |id| is used to disambiguate counters with the same name. It must either
|
||||||
/// - |id| is used to disambiguate counters with the same name. It must either
|
// be a pointer or an integer value up to 64 bits. If it's a pointer, the
|
||||||
/// be a pointer or an integer value up to 64 bits. If it's a pointer, the
|
// bits will be xored with a hash of the process ID so that the same pointer
|
||||||
/// bits will be xored with a hash of the process ID so that the same pointer
|
// on two different processes will not collide.
|
||||||
/// on two different processes will not collide.
|
|
||||||
///
|
|
||||||
#define TRACE_COUNTER_ID1(category, name, id, value) \
|
#define TRACE_COUNTER_ID1(category, name, id, value) \
|
||||||
cef_trace_counter_id(category, name, id, NULL, value, NULL, 0)
|
cef_trace_counter_id(category, name, id, NULL, value, NULL, 0, false)
|
||||||
|
#define TRACE_COPY_COUNTER_ID1(category, name, id, value) \
|
||||||
|
cef_trace_counter_id(category, name, id, NULL, value, NULL, 0, true)
|
||||||
|
|
||||||
///
|
// Records the values of a multi-parted counter called "name" immediately.
|
||||||
/// Records the values of a multi-parted counter called "name" immediately.
|
// The UI will treat value1 and value2 as parts of a whole, displaying their
|
||||||
/// The UI will treat value1 and value2 as parts of a whole, displaying their
|
// values as a stacked-bar chart.
|
||||||
/// values as a stacked-bar chart.
|
// - category and name strings must have application lifetime (statics or
|
||||||
/// - category and name strings must have application lifetime (statics or
|
// literals). They may not include " chars.
|
||||||
/// literals). They may not include " chars.
|
// - |id| is used to disambiguate counters with the same name. It must either
|
||||||
/// - |id| is used to disambiguate counters with the same name. It must either
|
// be a pointer or an integer value up to 64 bits. If it's a pointer, the
|
||||||
/// be a pointer or an integer value up to 64 bits. If it's a pointer, the
|
// bits will be xored with a hash of the process ID so that the same pointer
|
||||||
/// bits will be xored with a hash of the process ID so that the same pointer
|
// on two different processes will not collide.
|
||||||
/// on two different processes will not collide.
|
|
||||||
///
|
|
||||||
#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \
|
#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \
|
||||||
value2_name, value2_val) \
|
value2_name, value2_val) \
|
||||||
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
||||||
value2_name, value2_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
|
||||||
/// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
|
// associated arguments. If the category is not enabled, then this
|
||||||
/// associated arguments. If the category is not enabled, then this
|
// does nothing.
|
||||||
/// does nothing.
|
// - category and name strings must have application lifetime (statics or
|
||||||
/// - category and name strings must have application lifetime (statics or
|
// literals). They may not include " chars.
|
||||||
/// literals). They may not include " chars.
|
// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event.
|
||||||
/// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event.
|
// ASYNC events are considered to match if their category, name and id values
|
||||||
/// ASYNC events are considered to match if their category, name and id values
|
// all match. |id| must either be a pointer or an integer value up to 64
|
||||||
/// all match. |id| must either be a pointer or an integer value up to 64
|
// bits. If it's a pointer, the bits will be xored with a hash of the process
|
||||||
/// bits. If it's a pointer, the bits will be xored with a hash of the process
|
// ID sothat the same pointer on two different processes will not collide.
|
||||||
/// ID sothat the same pointer on two different processes will not collide.
|
// An asynchronous operation can consist of multiple phases. The first phase is
|
||||||
/// An asynchronous operation can consist of multiple phases. The first phase is
|
// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the
|
||||||
/// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the
|
// ASYNC_STEP_BEGIN macros. When the operation completes, call ASYNC_END.
|
||||||
/// ASYNC_STEP_BEGIN macros. When the operation completes, call ASYNC_END.
|
// An async operation can span threads and processes, but all events in that
|
||||||
/// An async operation can span threads and processes, but all events in that
|
// operation must use the same |name| and |id|. Each event can have its own
|
||||||
/// operation must use the same |name| and |id|. Each event can have its own
|
// args.
|
||||||
/// args.
|
|
||||||
///
|
|
||||||
#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
|
#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
|
||||||
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0)
|
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)
|
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
|
||||||
|
0, false)
|
||||||
#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
|
#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_val) \
|
arg2_name, arg2_val) \
|
||||||
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
|
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_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)
|
||||||
|
|
||||||
///
|
// Records a single ASYNC_STEP_INTO event for |step| immediately. If the
|
||||||
/// 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
|
||||||
/// category is not enabled, then this does nothing. The |name| and |id| must
|
// match the ASYNC_BEGIN event above. The |step| param identifies this step
|
||||||
/// match the ASYNC_BEGIN event above. The |step| param identifies this step
|
// within the async event. This should be called at the beginning of the next
|
||||||
/// within the async event. This should be called at the beginning of the next
|
// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
|
||||||
/// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
|
// ASYNC_STEP_PAST events.
|
||||||
/// ASYNC_STEP_PAST events.
|
|
||||||
///
|
|
||||||
#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \
|
#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \
|
||||||
cef_trace_event_async_step_into(category, name, id, step, NULL, 0)
|
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, \
|
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
|
||||||
arg1_val) \
|
arg1_val) \
|
||||||
cef_trace_event_async_step_into(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)
|
||||||
|
|
||||||
///
|
// Records a single ASYNC_STEP_PAST event for |step| immediately. If the
|
||||||
/// 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
|
||||||
/// category is not enabled, then this does nothing. The |name| and |id| must
|
// match the ASYNC_BEGIN event above. The |step| param identifies this step
|
||||||
/// match the ASYNC_BEGIN event above. The |step| param identifies this step
|
// within the async event. This should be called at the beginning of the next
|
||||||
/// within the async event. This should be called at the beginning of the next
|
// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
|
||||||
/// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
|
// ASYNC_STEP_INTO events.
|
||||||
/// ASYNC_STEP_INTO events.
|
|
||||||
///
|
|
||||||
#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \
|
#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \
|
||||||
cef_trace_event_async_step_past(category, name, id, step, NULL, 0)
|
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, \
|
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
|
||||||
arg1_val) \
|
arg1_val) \
|
||||||
cef_trace_event_async_step_past(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)
|
||||||
|
|
||||||
///
|
// Records a single ASYNC_END event for "name" immediately. If the category
|
||||||
/// Records a single ASYNC_END event for "name" immediately. If the category
|
// is not enabled, then this does nothing.
|
||||||
/// is not enabled, then this does nothing.
|
|
||||||
///
|
|
||||||
#define TRACE_EVENT_ASYNC_END0(category, name, id) \
|
#define TRACE_EVENT_ASYNC_END0(category, name, id) \
|
||||||
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0)
|
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)
|
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
|
||||||
|
false)
|
||||||
#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
|
#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_val) \
|
arg2_name, arg2_val) \
|
||||||
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
|
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_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) \
|
||||||
|
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)
|
||||||
|
|
||||||
namespace cef_trace_event {
|
namespace cef_trace_event {
|
||||||
|
|
||||||
///
|
// Used by TRACE_EVENTx macro. Do not use directly.
|
||||||
/// Used by TRACE_EVENTx macro. Do not use directly.
|
|
||||||
///
|
|
||||||
class CefTraceEndOnScopeClose {
|
class CefTraceEndOnScopeClose {
|
||||||
public:
|
public:
|
||||||
CefTraceEndOnScopeClose(const char* category, const char* name)
|
CefTraceEndOnScopeClose(const char* category, const char* name)
|
||||||
: category_(category), name_(name) {}
|
: category_(category), name_(name) {}
|
||||||
~CefTraceEndOnScopeClose() {
|
~CefTraceEndOnScopeClose() {
|
||||||
cef_trace_event_end(category_, name_, NULL, 0, NULL, 0);
|
cef_trace_event_end(category_, name_, NULL, 0, NULL, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -377,7 +408,7 @@ class CefTraceEndOnScopeClose {
|
|||||||
const char* name_;
|
const char* name_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cef_trace_event
|
} // cef_trace_event
|
||||||
|
|
||||||
#endif // !USING_CHROMIUM_INCLUDES
|
#endif // !USING_CHROMIUM_INCLUDES
|
||||||
|
|
||||||
|
|||||||
@@ -28,30 +28,25 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
///
|
// Use std::tuple as tuple type. This file contains helper functions for
|
||||||
/// \file
|
// working with std::tuples.
|
||||||
/// Use std::tuple as tuple type. This file contains helper functions for
|
// The functions DispatchToMethod and DispatchToFunction take a function pointer
|
||||||
/// working with std::tuples.
|
// or instance and method pointer, and unpack a tuple into arguments to the
|
||||||
/// The functions DispatchToMethod and DispatchToFunction take a function
|
// call.
|
||||||
/// pointer or instance and method pointer, and unpack a tuple into arguments to
|
//
|
||||||
/// the call.
|
// Example usage:
|
||||||
///
|
// // These two methods of creating a Tuple are identical.
|
||||||
/// Example usage:
|
// std::tuple<int, const char*> tuple_a(1, "wee");
|
||||||
/// <pre>
|
// std::tuple<int, const char*> tuple_b = std::make_tuple(1, "wee");
|
||||||
/// // These two methods of creating a Tuple are identical.
|
//
|
||||||
/// std::tuple<int, const char*> tuple_a(1, "wee");
|
// void SomeFunc(int a, const char* b) { }
|
||||||
/// std::tuple<int, const char*> tuple_b = std::make_tuple(1, "wee");
|
// DispatchToFunction(&SomeFunc, tuple_a); // SomeFunc(1, "wee")
|
||||||
///
|
// DispatchToFunction(
|
||||||
/// void SomeFunc(int a, const char* b) { }
|
// &SomeFunc, std::make_tuple(10, "foo")); // SomeFunc(10, "foo")
|
||||||
/// DispatchToFunction(&SomeFunc, tuple_a); // SomeFunc(1, "wee")
|
//
|
||||||
/// DispatchToFunction(
|
// struct { void SomeMeth(int a, int b, int c) { } } foo;
|
||||||
/// &SomeFunc, std::make_tuple(10, "foo")); // SomeFunc(10, "foo")
|
// DispatchToMethod(&foo, &Foo::SomeMeth, std::make_tuple(1, 2, 3));
|
||||||
///
|
// // foo->SomeMeth(1, 2, 3);
|
||||||
/// struct { void SomeMeth(int a, int b, int c) { } } foo;
|
|
||||||
/// DispatchToMethod(&foo, &Foo::SomeMeth, std::make_tuple(1, 2, 3));
|
|
||||||
/// // foo->SomeMeth(1, 2, 3);
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_TUPLE_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_TUPLE_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_TUPLE_H_
|
#define CEF_INCLUDE_BASE_CEF_TUPLE_H_
|
||||||
@@ -93,7 +88,9 @@ inline void DispatchToMethodImpl(const ObjT& obj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename ObjT, typename Method, typename Tuple>
|
template <typename ObjT, typename Method, typename Tuple>
|
||||||
inline void DispatchToMethod(const ObjT& obj, Method method, Tuple&& args) {
|
inline void DispatchToMethod(const ObjT& obj,
|
||||||
|
Method method,
|
||||||
|
Tuple&& args) {
|
||||||
constexpr size_t size = std::tuple_size<std::decay_t<Tuple>>::value;
|
constexpr size_t size = std::tuple_size<std::decay_t<Tuple>>::value;
|
||||||
DispatchToMethodImpl(obj, method, std::forward<Tuple>(args),
|
DispatchToMethodImpl(obj, method, std::forward<Tuple>(args),
|
||||||
std::make_index_sequence<size>());
|
std::make_index_sequence<size>());
|
||||||
|
|||||||
@@ -28,73 +28,69 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
///
|
// Weak pointers are pointers to an object that do not affect its lifetime,
|
||||||
/// \file
|
// and which may be invalidated (i.e. reset to nullptr) by the object, or its
|
||||||
/// Weak pointers are pointers to an object that do not affect its lifetime.
|
// owner, at any time, most commonly when the object is about to be deleted.
|
||||||
/// They may be invalidated (i.e. reset to nullptr) by the object, or its
|
|
||||||
/// owner, at any time, most commonly when the object is about to be deleted.
|
// Weak pointers are useful when an object needs to be accessed safely by one
|
||||||
///
|
// or more objects other than its owner, and those callers can cope with the
|
||||||
/// Weak pointers are useful when an object needs to be accessed safely by one
|
// object vanishing and e.g. tasks posted to it being silently dropped.
|
||||||
/// or more objects other than its owner, and those callers can cope with the
|
// Reference-counting such an object would complicate the ownership graph and
|
||||||
/// object vanishing and e.g. tasks posted to it being silently dropped.
|
// make it harder to reason about the object's lifetime.
|
||||||
/// Reference-counting such an object would complicate the ownership graph and
|
|
||||||
/// make it harder to reason about the object's lifetime.
|
// EXAMPLE:
|
||||||
///
|
//
|
||||||
/// EXAMPLE:
|
// class Controller {
|
||||||
///
|
// public:
|
||||||
/// <pre>
|
// void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); }
|
||||||
/// class Controller {
|
// void WorkComplete(const Result& result) { ... }
|
||||||
/// public:
|
// private:
|
||||||
/// void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); }
|
// // Member variables should appear before the WeakPtrFactory, to ensure
|
||||||
/// void WorkComplete(const Result& result) { ... }
|
// // that any WeakPtrs to Controller are invalidated before its members
|
||||||
/// private:
|
// // variable's destructors are executed, rendering them invalid.
|
||||||
/// // Member variables should appear before the WeakPtrFactory, to ensure
|
// WeakPtrFactory<Controller> weak_factory_{this};
|
||||||
/// // that any WeakPtrs to Controller are invalidated before its members
|
// };
|
||||||
/// // variable's destructors are executed, rendering them invalid.
|
//
|
||||||
/// WeakPtrFactory<Controller> weak_factory_{this};
|
// class Worker {
|
||||||
/// };
|
// public:
|
||||||
///
|
// static void StartNew(WeakPtr<Controller> controller) {
|
||||||
/// class Worker {
|
// Worker* worker = new Worker(std::move(controller));
|
||||||
/// public:
|
// // Kick off asynchronous processing...
|
||||||
/// static void StartNew(WeakPtr<Controller> controller) {
|
// }
|
||||||
/// Worker* worker = new Worker(std::move(controller));
|
// private:
|
||||||
/// // Kick off asynchronous processing...
|
// Worker(WeakPtr<Controller> controller)
|
||||||
/// }
|
// : controller_(std::move(controller)) {}
|
||||||
/// private:
|
// void DidCompleteAsynchronousProcessing(const Result& result) {
|
||||||
/// Worker(WeakPtr<Controller> controller)
|
// if (controller_)
|
||||||
/// : controller_(std::move(controller)) {}
|
// controller_->WorkComplete(result);
|
||||||
/// void DidCompleteAsynchronousProcessing(const Result& result) {
|
// }
|
||||||
/// if (controller_)
|
// WeakPtr<Controller> controller_;
|
||||||
/// controller_->WorkComplete(result);
|
// };
|
||||||
/// }
|
//
|
||||||
/// WeakPtr<Controller> controller_;
|
// With this implementation a caller may use SpawnWorker() to dispatch multiple
|
||||||
/// };
|
// Workers and subsequently delete the Controller, without waiting for all
|
||||||
/// </pre>
|
// Workers to have completed.
|
||||||
///
|
|
||||||
/// With this implementation a caller may use SpawnWorker() to dispatch multiple
|
// ------------------------- IMPORTANT: Thread-safety -------------------------
|
||||||
/// Workers and subsequently delete the Controller, without waiting for all
|
|
||||||
/// Workers to have completed.
|
// Weak pointers may be passed safely between threads, but must always be
|
||||||
///
|
// dereferenced and invalidated on the same ThreaddTaskRunner otherwise
|
||||||
/// <b>IMPORTANT: Thread-safety</b>
|
// checking the pointer would be racey.
|
||||||
///
|
//
|
||||||
/// Weak pointers may be passed safely between threads, but must always be
|
// To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory
|
||||||
/// dereferenced and invalidated on the same ThreaddTaskRunner otherwise
|
// is dereferenced, the factory and its WeakPtrs become bound to the calling
|
||||||
/// checking the pointer would be racey.
|
// thread or current ThreaddWorkerPool token, and cannot be dereferenced or
|
||||||
///
|
// invalidated on any other task runner. Bound WeakPtrs can still be handed
|
||||||
/// To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory
|
// off to other task runners, e.g. to use to post tasks back to object on the
|
||||||
/// is dereferenced, the factory and its WeakPtrs become bound to the calling
|
// bound thread.
|
||||||
/// thread or current ThreaddWorkerPool token, and cannot be dereferenced or
|
//
|
||||||
/// invalidated on any other task runner. Bound WeakPtrs can still be handed
|
// If all WeakPtr objects are destroyed or invalidated then the factory is
|
||||||
/// off to other task runners, e.g. to use to post tasks back to object on the
|
// unbound from the ThreaddTaskRunner/Thread. The WeakPtrFactory may then be
|
||||||
/// bound thread.
|
// destroyed, or new WeakPtr objects may be used, from a different thread.
|
||||||
///
|
//
|
||||||
/// If all WeakPtr objects are destroyed or invalidated then the factory is
|
// Thus, at least one WeakPtr object must exist and have been dereferenced on
|
||||||
/// unbound from the ThreadedTaskRunner/Thread. The WeakPtrFactory may then be
|
// the correct thread to enforce that other WeakPtr objects will enforce they
|
||||||
/// destroyed, or new WeakPtr objects may be used, from a different thread.
|
// are used on the desired thread.
|
||||||
///
|
|
||||||
/// Thus, at least one WeakPtr object must exist and have been dereferenced on
|
|
||||||
/// the correct thread to enforce that other WeakPtr objects will enforce they
|
|
||||||
/// are used on the desired thread.
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
|
#define CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
|
||||||
@@ -113,6 +109,7 @@
|
|||||||
|
|
||||||
#include "include/base/cef_atomic_flag.h"
|
#include "include/base/cef_atomic_flag.h"
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
|
#include "include/base/cef_macros.h"
|
||||||
#include "include/base/cef_ref_counted.h"
|
#include "include/base/cef_ref_counted.h"
|
||||||
#include "include/base/cef_thread_checker.h"
|
#include "include/base/cef_thread_checker.h"
|
||||||
|
|
||||||
@@ -123,7 +120,7 @@ class SupportsWeakPtr;
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
class WeakPtr;
|
class WeakPtr;
|
||||||
|
|
||||||
namespace cef_internal {
|
namespace internal {
|
||||||
// These classes are part of the WeakPtr implementation.
|
// These classes are part of the WeakPtr implementation.
|
||||||
// DO NOT USE THESE CLASSES DIRECTLY YOURSELF.
|
// DO NOT USE THESE CLASSES DIRECTLY YOURSELF.
|
||||||
|
|
||||||
@@ -197,7 +194,7 @@ class WeakPtrBase {
|
|||||||
WeakPtrBase& operator=(WeakPtrBase&& other) noexcept = default;
|
WeakPtrBase& operator=(WeakPtrBase&& other) noexcept = default;
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
ref_ = cef_internal::WeakReference();
|
ref_ = internal::WeakReference();
|
||||||
ptr_ = 0;
|
ptr_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +222,7 @@ class SupportsWeakPtrBase {
|
|||||||
template <typename Derived>
|
template <typename Derived>
|
||||||
static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
|
static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
|
||||||
static_assert(
|
static_assert(
|
||||||
std::is_base_of<cef_internal::SupportsWeakPtrBase, Derived>::value,
|
std::is_base_of<internal::SupportsWeakPtrBase, Derived>::value,
|
||||||
"AsWeakPtr argument must inherit from SupportsWeakPtr");
|
"AsWeakPtr argument must inherit from SupportsWeakPtr");
|
||||||
return AsWeakPtrImpl<Derived>(t);
|
return AsWeakPtrImpl<Derived>(t);
|
||||||
}
|
}
|
||||||
@@ -242,37 +239,32 @@ class SupportsWeakPtrBase {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace internal
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class WeakPtrFactory;
|
class WeakPtrFactory;
|
||||||
|
|
||||||
///
|
// The WeakPtr class holds a weak reference to |T*|.
|
||||||
/// The WeakPtr class holds a weak reference to |T*|.
|
//
|
||||||
///
|
// This class is designed to be used like a normal pointer. You should always
|
||||||
/// This class is designed to be used like a normal pointer. You should always
|
// null-test an object of this class before using it or invoking a method that
|
||||||
/// null-test an object of this class before using it or invoking a method that
|
// may result in the underlying object being destroyed.
|
||||||
/// may result in the underlying object being destroyed.
|
//
|
||||||
///
|
// EXAMPLE:
|
||||||
/// EXAMPLE:
|
//
|
||||||
///
|
// class Foo { ... };
|
||||||
/// <pre>
|
// WeakPtr<Foo> foo;
|
||||||
/// class Foo { ... };
|
// if (foo)
|
||||||
/// WeakPtr<Foo> foo;
|
// foo->method();
|
||||||
/// if (foo)
|
//
|
||||||
/// foo->method();
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class WeakPtr : public cef_internal::WeakPtrBase {
|
class WeakPtr : public internal::WeakPtrBase {
|
||||||
public:
|
public:
|
||||||
WeakPtr() = default;
|
WeakPtr() = default;
|
||||||
WeakPtr(std::nullptr_t) {}
|
WeakPtr(std::nullptr_t) {}
|
||||||
|
|
||||||
///
|
// Allow conversion from U to T provided U "is a" T. Note that this
|
||||||
/// Allow conversion from U to T provided U "is a" T. Note that this
|
// is separate from the (implicit) copy and move constructors.
|
||||||
/// is separate from the (implicit) copy and move constructors.
|
|
||||||
///
|
|
||||||
template <typename U>
|
template <typename U>
|
||||||
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other) {
|
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other) {
|
||||||
// Need to cast from U* to T* to do pointer adjustment in case of multiple
|
// Need to cast from U* to T* to do pointer adjustment in case of multiple
|
||||||
@@ -301,43 +293,35 @@ class WeakPtr : public cef_internal::WeakPtrBase {
|
|||||||
return get();
|
return get();
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Allow conditionals to test validity, e.g. if (weak_ptr) {...};
|
||||||
/// Allow conditionals to test validity, e.g. `if (weak_ptr) {...}`;
|
|
||||||
///
|
|
||||||
explicit operator bool() const { return get() != nullptr; }
|
explicit operator bool() const { return get() != nullptr; }
|
||||||
|
|
||||||
///
|
// Returns false if the WeakPtr is confirmed to be invalid. This call is safe
|
||||||
/// Returns false if the WeakPtr is confirmed to be invalid. This call is safe
|
// to make from any thread, e.g. to optimize away unnecessary work, but
|
||||||
/// to make from any thread, e.g. to optimize away unnecessary work, but
|
// operator bool() must always be called, on the correct thread, before
|
||||||
/// operator bool() must always be called, on the correct thread, before
|
// actually using the pointer.
|
||||||
/// actually using the pointer.
|
//
|
||||||
///
|
// Warning: as with any object, this call is only thread-safe if the WeakPtr
|
||||||
/// Warning: as with any object, this call is only thread-safe if the WeakPtr
|
// instance isn't being re-assigned or reset() racily with this call.
|
||||||
/// instance isn't being re-assigned or reset() racily with this call.
|
|
||||||
///
|
|
||||||
bool MaybeValid() const { return ref_.MaybeValid(); }
|
bool MaybeValid() const { return ref_.MaybeValid(); }
|
||||||
|
|
||||||
///
|
// Returns whether the object |this| points to has been invalidated. This can
|
||||||
/// Returns whether the object |this| points to has been invalidated. This can
|
// be used to distinguish a WeakPtr to a destroyed object from one that has
|
||||||
/// be used to distinguish a WeakPtr to a destroyed object from one that has
|
// been explicitly set to null.
|
||||||
/// been explicitly set to null.
|
|
||||||
///
|
|
||||||
bool WasInvalidated() const { return ptr_ && !ref_.IsValid(); }
|
bool WasInvalidated() const { return ptr_ && !ref_.IsValid(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class cef_internal::SupportsWeakPtrBase;
|
friend class internal::SupportsWeakPtrBase;
|
||||||
template <typename U>
|
template <typename U>
|
||||||
friend class WeakPtr;
|
friend class WeakPtr;
|
||||||
friend class SupportsWeakPtr<T>;
|
friend class SupportsWeakPtr<T>;
|
||||||
friend class WeakPtrFactory<T>;
|
friend class WeakPtrFactory<T>;
|
||||||
|
|
||||||
WeakPtr(const cef_internal::WeakReference& ref, T* ptr)
|
WeakPtr(const internal::WeakReference& ref, T* ptr)
|
||||||
: WeakPtrBase(ref, reinterpret_cast<uintptr_t>(ptr)) {}
|
: WeakPtrBase(ref, reinterpret_cast<uintptr_t>(ptr)) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// Allow callers to compare WeakPtrs against nullptr to test validity.
|
||||||
/// Allow callers to compare WeakPtrs against nullptr to test validity.
|
|
||||||
///
|
|
||||||
template <class T>
|
template <class T>
|
||||||
bool operator!=(const WeakPtr<T>& weak_ptr, std::nullptr_t) {
|
bool operator!=(const WeakPtr<T>& weak_ptr, std::nullptr_t) {
|
||||||
return !(weak_ptr == nullptr);
|
return !(weak_ptr == nullptr);
|
||||||
@@ -355,35 +339,27 @@ bool operator==(std::nullptr_t, const WeakPtr<T>& weak_ptr) {
|
|||||||
return weak_ptr == nullptr;
|
return weak_ptr == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace cef_internal {
|
namespace internal {
|
||||||
class WeakPtrFactoryBase {
|
class WeakPtrFactoryBase {
|
||||||
protected:
|
protected:
|
||||||
WeakPtrFactoryBase(uintptr_t ptr);
|
WeakPtrFactoryBase(uintptr_t ptr);
|
||||||
~WeakPtrFactoryBase();
|
~WeakPtrFactoryBase();
|
||||||
cef_internal::WeakReferenceOwner weak_reference_owner_;
|
internal::WeakReferenceOwner weak_reference_owner_;
|
||||||
uintptr_t ptr_;
|
uintptr_t ptr_;
|
||||||
};
|
};
|
||||||
} // namespace cef_internal
|
} // namespace internal
|
||||||
|
|
||||||
///
|
// A class may be composed of a WeakPtrFactory and thereby
|
||||||
/// A class may be composed of a WeakPtrFactory and thereby control how it
|
// control how it exposes weak pointers to itself. This is helpful if you only
|
||||||
/// exposes weak pointers to itself. This is helpful if you only need weak
|
// need weak pointers within the implementation of a class. This class is also
|
||||||
/// pointers within the implementation of a class. This class is also useful
|
// useful when working with primitive types. For example, you could have a
|
||||||
/// when working with primitive types. For example, you could have a
|
// WeakPtrFactory<bool> that is used to pass around a weak reference to a bool.
|
||||||
/// WeakPtrFactory<bool> that is used to pass around a weak reference to a
|
|
||||||
/// bool.
|
|
||||||
///
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class WeakPtrFactory : public cef_internal::WeakPtrFactoryBase {
|
class WeakPtrFactory : public internal::WeakPtrFactoryBase {
|
||||||
public:
|
public:
|
||||||
WeakPtrFactory() = delete;
|
|
||||||
|
|
||||||
explicit WeakPtrFactory(T* ptr)
|
explicit WeakPtrFactory(T* ptr)
|
||||||
: WeakPtrFactoryBase(reinterpret_cast<uintptr_t>(ptr)) {}
|
: WeakPtrFactoryBase(reinterpret_cast<uintptr_t>(ptr)) {}
|
||||||
|
|
||||||
WeakPtrFactory(const WeakPtrFactory&) = delete;
|
|
||||||
WeakPtrFactory& operator=(const WeakPtrFactory&) = delete;
|
|
||||||
|
|
||||||
~WeakPtrFactory() = default;
|
~WeakPtrFactory() = default;
|
||||||
|
|
||||||
WeakPtr<T> GetWeakPtr() const {
|
WeakPtr<T> GetWeakPtr() const {
|
||||||
@@ -391,38 +367,32 @@ class WeakPtrFactory : public cef_internal::WeakPtrFactoryBase {
|
|||||||
reinterpret_cast<T*>(ptr_));
|
reinterpret_cast<T*>(ptr_));
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Call this method to invalidate all existing weak pointers.
|
||||||
/// Call this method to invalidate all existing weak pointers.
|
|
||||||
///
|
|
||||||
void InvalidateWeakPtrs() {
|
void InvalidateWeakPtrs() {
|
||||||
DCHECK(ptr_);
|
DCHECK(ptr_);
|
||||||
weak_reference_owner_.Invalidate();
|
weak_reference_owner_.Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
// Call this method to determine if any weak pointers exist.
|
||||||
/// Call this method to determine if any weak pointers exist.
|
|
||||||
///
|
|
||||||
bool HasWeakPtrs() const {
|
bool HasWeakPtrs() const {
|
||||||
DCHECK(ptr_);
|
DCHECK(ptr_);
|
||||||
return weak_reference_owner_.HasRefs();
|
return weak_reference_owner_.HasRefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
DISALLOW_IMPLICIT_CONSTRUCTORS(WeakPtrFactory);
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// A class may extend from SupportsWeakPtr to let others take weak pointers to
|
||||||
/// A class may extend from SupportsWeakPtr to let others take weak pointers to
|
// it. This avoids the class itself implementing boilerplate to dispense weak
|
||||||
/// it. This avoids the class itself implementing boilerplate to dispense weak
|
// pointers. However, since SupportsWeakPtr's destructor won't invalidate
|
||||||
/// pointers. However, since SupportsWeakPtr's destructor won't invalidate
|
// weak pointers to the class until after the derived class' members have been
|
||||||
/// weak pointers to the class until after the derived class' members have been
|
// destroyed, its use can lead to subtle use-after-destroy issues.
|
||||||
/// destroyed, its use can lead to subtle use-after-destroy issues.
|
|
||||||
///
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class SupportsWeakPtr : public cef_internal::SupportsWeakPtrBase {
|
class SupportsWeakPtr : public internal::SupportsWeakPtrBase {
|
||||||
public:
|
public:
|
||||||
SupportsWeakPtr() = default;
|
SupportsWeakPtr() = default;
|
||||||
|
|
||||||
SupportsWeakPtr(const SupportsWeakPtr&) = delete;
|
|
||||||
SupportsWeakPtr& operator=(const SupportsWeakPtr&) = delete;
|
|
||||||
|
|
||||||
WeakPtr<T> AsWeakPtr() {
|
WeakPtr<T> AsWeakPtr() {
|
||||||
return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(this));
|
return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(this));
|
||||||
}
|
}
|
||||||
@@ -431,35 +401,31 @@ class SupportsWeakPtr : public cef_internal::SupportsWeakPtrBase {
|
|||||||
~SupportsWeakPtr() = default;
|
~SupportsWeakPtr() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cef_internal::WeakReferenceOwner weak_reference_owner_;
|
internal::WeakReferenceOwner weak_reference_owner_;
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(SupportsWeakPtr);
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
// Helper function that uses type deduction to safely return a WeakPtr<Derived>
|
||||||
/// Helper function that uses type deduction to safely return a WeakPtr<Derived>
|
// when Derived doesn't directly extend SupportsWeakPtr<Derived>, instead it
|
||||||
/// when Derived doesn't directly extend SupportsWeakPtr<Derived>, instead it
|
// extends a Base that extends SupportsWeakPtr<Base>.
|
||||||
/// extends a Base that extends SupportsWeakPtr<Base>.
|
//
|
||||||
///
|
// EXAMPLE:
|
||||||
/// EXAMPLE:
|
// class Base : public base::SupportsWeakPtr<Producer> {};
|
||||||
/// <pre>
|
// class Derived : public Base {};
|
||||||
/// class Base : public base::SupportsWeakPtr<Producer> {};
|
//
|
||||||
/// class Derived : public Base {};
|
// Derived derived;
|
||||||
///
|
// base::WeakPtr<Derived> ptr = base::AsWeakPtr(&derived);
|
||||||
/// Derived derived;
|
//
|
||||||
/// base::WeakPtr<Derived> ptr = base::AsWeakPtr(&derived);
|
// Note that the following doesn't work (invalid type conversion) since
|
||||||
/// </pre>
|
// Derived::AsWeakPtr() is WeakPtr<Base> SupportsWeakPtr<Base>::AsWeakPtr(),
|
||||||
///
|
// and there's no way to safely cast WeakPtr<Base> to WeakPtr<Derived> at
|
||||||
/// Note that the following doesn't work (invalid type conversion) since
|
// the caller.
|
||||||
/// Derived::AsWeakPtr() is WeakPtr<Base> SupportsWeakPtr<Base>::AsWeakPtr(),
|
//
|
||||||
/// and there's no way to safely cast WeakPtr<Base> to WeakPtr<Derived> at
|
// base::WeakPtr<Derived> ptr = derived.AsWeakPtr(); // Fails.
|
||||||
/// the caller.
|
|
||||||
///
|
|
||||||
/// <pre>
|
|
||||||
/// base::WeakPtr<Derived> ptr = derived.AsWeakPtr(); // Fails.
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
template <typename Derived>
|
template <typename Derived>
|
||||||
WeakPtr<Derived> AsWeakPtr(Derived* t) {
|
WeakPtr<Derived> AsWeakPtr(Derived* t) {
|
||||||
return cef_internal::SupportsWeakPtrBase::StaticAsWeakPtr<Derived>(t);
|
return internal::SupportsWeakPtrBase::StaticAsWeakPtr<Derived>(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|||||||
@@ -68,6 +68,7 @@
|
|||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
#include "include/base/cef_compiler_specific.h"
|
#include "include/base/cef_compiler_specific.h"
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
|
#include "include/base/cef_template_util.h"
|
||||||
#include "include/base/cef_weak_ptr.h"
|
#include "include/base/cef_weak_ptr.h"
|
||||||
#include "include/base/internal/cef_callback_internal.h"
|
#include "include/base/internal/cef_callback_internal.h"
|
||||||
#include "include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h"
|
#include "include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h"
|
||||||
@@ -96,7 +97,7 @@ struct BindUnwrapTraits;
|
|||||||
template <typename Functor, typename BoundArgsTuple, typename SFINAE = void>
|
template <typename Functor, typename BoundArgsTuple, typename SFINAE = void>
|
||||||
struct CallbackCancellationTraits;
|
struct CallbackCancellationTraits;
|
||||||
|
|
||||||
namespace cef_internal {
|
namespace internal {
|
||||||
|
|
||||||
template <typename Functor, typename SFINAE = void>
|
template <typename Functor, typename SFINAE = void>
|
||||||
struct FunctorTraits;
|
struct FunctorTraits;
|
||||||
@@ -355,14 +356,14 @@ template <typename Functor, typename SFINAE = void>
|
|||||||
struct IsCallableObject : std::false_type {};
|
struct IsCallableObject : std::false_type {};
|
||||||
|
|
||||||
template <typename Callable>
|
template <typename Callable>
|
||||||
struct IsCallableObject<Callable, std::void_t<decltype(&Callable::operator())>>
|
struct IsCallableObject<Callable, void_t<decltype(&Callable::operator())>>
|
||||||
: std::true_type {};
|
: std::true_type {};
|
||||||
|
|
||||||
// HasRefCountedTypeAsRawPtr inherits from true_type when any of the |Args| is a
|
// HasRefCountedTypeAsRawPtr inherits from true_type when any of the |Args| is a
|
||||||
// raw pointer to a RefCounted type.
|
// raw pointer to a RefCounted type.
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
struct HasRefCountedTypeAsRawPtr
|
struct HasRefCountedTypeAsRawPtr
|
||||||
: std::disjunction<NeedsScopedRefptrButGetsRawPtr<Ts>...> {};
|
: disjunction<NeedsScopedRefptrButGetsRawPtr<Ts>...> {};
|
||||||
|
|
||||||
// ForceVoidReturn<>
|
// ForceVoidReturn<>
|
||||||
//
|
//
|
||||||
@@ -686,9 +687,8 @@ struct InvokeHelper<true, ReturnType> {
|
|||||||
static inline void MakeItSo(Functor&& functor,
|
static inline void MakeItSo(Functor&& functor,
|
||||||
BoundWeakPtr&& weak_ptr,
|
BoundWeakPtr&& weak_ptr,
|
||||||
RunArgs&&... args) {
|
RunArgs&&... args) {
|
||||||
if (!weak_ptr) {
|
if (!weak_ptr)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
using Traits = MakeFunctorTraits<Functor>;
|
using Traits = MakeFunctorTraits<Functor>;
|
||||||
Traits::Invoke(std::forward<Functor>(functor),
|
Traits::Invoke(std::forward<Functor>(functor),
|
||||||
std::forward<BoundWeakPtr>(weak_ptr),
|
std::forward<BoundWeakPtr>(weak_ptr),
|
||||||
@@ -877,7 +877,7 @@ BanUnconstructedRefCountedReceiver(const Receiver& receiver, Unused&&...) {
|
|||||||
// This stores all the state passed into Bind().
|
// This stores all the state passed into Bind().
|
||||||
template <typename Functor, typename... BoundArgs>
|
template <typename Functor, typename... BoundArgs>
|
||||||
struct BindState final : BindStateBase {
|
struct BindState final : BindStateBase {
|
||||||
using IsCancellable = std::bool_constant<
|
using IsCancellable = bool_constant<
|
||||||
CallbackCancellationTraits<Functor,
|
CallbackCancellationTraits<Functor,
|
||||||
std::tuple<BoundArgs...>>::is_cancellable>;
|
std::tuple<BoundArgs...>>::is_cancellable>;
|
||||||
template <typename ForwardFunctor, typename... ForwardBoundArgs>
|
template <typename ForwardFunctor, typename... ForwardBoundArgs>
|
||||||
@@ -1189,11 +1189,7 @@ struct AssertBindArgsValidity<std::index_sequence<Ns...>,
|
|||||||
TypeList<Args...>,
|
TypeList<Args...>,
|
||||||
TypeList<Unwrapped...>,
|
TypeList<Unwrapped...>,
|
||||||
TypeList<Params...>>
|
TypeList<Params...>>
|
||||||
: AssertConstructible<static_cast<int>(Ns),
|
: AssertConstructible<Ns, Args, std::decay_t<Args>, Unwrapped, Params>... {
|
||||||
Args,
|
|
||||||
std::decay_t<Args>,
|
|
||||||
Unwrapped,
|
|
||||||
Params>... {
|
|
||||||
static constexpr bool ok = true;
|
static constexpr bool ok = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1251,7 +1247,7 @@ decltype(auto) BindImpl(Functor&& functor, Args&&... args) {
|
|||||||
// PolymorphicInvoke, to which CallbackType will cast back.
|
// PolymorphicInvoke, to which CallbackType will cast back.
|
||||||
using PolymorphicInvoke = typename CallbackType::PolymorphicInvoke;
|
using PolymorphicInvoke = typename CallbackType::PolymorphicInvoke;
|
||||||
PolymorphicInvoke invoke_func =
|
PolymorphicInvoke invoke_func =
|
||||||
GetInvokeFunc<Invoker>(std::bool_constant<kIsOnce>());
|
GetInvokeFunc<Invoker>(bool_constant<kIsOnce>());
|
||||||
|
|
||||||
using InvokeFuncStorage = BindStateBase::InvokeFuncStorage;
|
using InvokeFuncStorage = BindStateBase::InvokeFuncStorage;
|
||||||
return CallbackType(BindState::Create(
|
return CallbackType(BindState::Create(
|
||||||
@@ -1259,7 +1255,7 @@ decltype(auto) BindImpl(Functor&& functor, Args&&... args) {
|
|||||||
std::forward<Functor>(functor), std::forward<Args>(args)...));
|
std::forward<Functor>(functor), std::forward<Args>(args)...));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace internal
|
||||||
|
|
||||||
// An injection point to control |this| pointer behavior on a method invocation.
|
// An injection point to control |this| pointer behavior on a method invocation.
|
||||||
// If IsWeakReceiver<> is true_type for |T| and |T| is used for a receiver of a
|
// If IsWeakReceiver<> is true_type for |T| and |T| is used for a receiver of a
|
||||||
@@ -1303,36 +1299,30 @@ struct BindUnwrapTraits {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct BindUnwrapTraits<cef_internal::UnretainedWrapper<T>> {
|
struct BindUnwrapTraits<internal::UnretainedWrapper<T>> {
|
||||||
static T* Unwrap(const cef_internal::UnretainedWrapper<T>& o) {
|
static T* Unwrap(const internal::UnretainedWrapper<T>& o) { return o.get(); }
|
||||||
return o.get();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct BindUnwrapTraits<cef_internal::RetainedRefWrapper<T>> {
|
struct BindUnwrapTraits<internal::RetainedRefWrapper<T>> {
|
||||||
static T* Unwrap(const cef_internal::RetainedRefWrapper<T>& o) {
|
static T* Unwrap(const internal::RetainedRefWrapper<T>& o) { return o.get(); }
|
||||||
return o.get();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, typename Deleter>
|
template <typename T, typename Deleter>
|
||||||
struct BindUnwrapTraits<cef_internal::OwnedWrapper<T, Deleter>> {
|
struct BindUnwrapTraits<internal::OwnedWrapper<T, Deleter>> {
|
||||||
static T* Unwrap(const cef_internal::OwnedWrapper<T, Deleter>& o) {
|
static T* Unwrap(const internal::OwnedWrapper<T, Deleter>& o) {
|
||||||
return o.get();
|
return o.get();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct BindUnwrapTraits<cef_internal::OwnedRefWrapper<T>> {
|
struct BindUnwrapTraits<internal::OwnedRefWrapper<T>> {
|
||||||
static T& Unwrap(const cef_internal::OwnedRefWrapper<T>& o) {
|
static T& Unwrap(const internal::OwnedRefWrapper<T>& o) { return o.get(); }
|
||||||
return o.get();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct BindUnwrapTraits<cef_internal::PassedWrapper<T>> {
|
struct BindUnwrapTraits<internal::PassedWrapper<T>> {
|
||||||
static T Unwrap(const cef_internal::PassedWrapper<T>& o) { return o.Take(); }
|
static T Unwrap(const internal::PassedWrapper<T>& o) { return o.Take(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
@@ -1356,9 +1346,9 @@ template <typename Functor, typename... BoundArgs>
|
|||||||
struct CallbackCancellationTraits<
|
struct CallbackCancellationTraits<
|
||||||
Functor,
|
Functor,
|
||||||
std::tuple<BoundArgs...>,
|
std::tuple<BoundArgs...>,
|
||||||
std::enable_if_t<cef_internal::IsWeakMethod<
|
std::enable_if_t<
|
||||||
cef_internal::FunctorTraits<Functor>::is_method,
|
internal::IsWeakMethod<internal::FunctorTraits<Functor>::is_method,
|
||||||
BoundArgs...>::value>> {
|
BoundArgs...>::value>> {
|
||||||
static constexpr bool is_cancellable = true;
|
static constexpr bool is_cancellable = true;
|
||||||
|
|
||||||
template <typename Receiver, typename... Args>
|
template <typename Receiver, typename... Args>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace base {
|
|||||||
|
|
||||||
struct FakeBindState;
|
struct FakeBindState;
|
||||||
|
|
||||||
namespace cef_internal {
|
namespace internal {
|
||||||
|
|
||||||
class BindStateBase;
|
class BindStateBase;
|
||||||
class FinallyExecutorCommon;
|
class FinallyExecutorCommon;
|
||||||
@@ -269,7 +269,7 @@ struct ThenHelper<OriginalCallback<OriginalR(OriginalArgs...)>,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace internal
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_
|
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
// Copyright 2019 The Chromium Authors
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
// The following macros are used to declare both the color id enumerations and
|
|
||||||
// the stringized names of the enumeration elements for use in dump_colors. To
|
|
||||||
// stringize the element names, define STRINGIZE_COLOR_IDS prior to including
|
|
||||||
// this file. This file is intended to be included just before and just after
|
|
||||||
// the enumeration or string array declarations.
|
|
||||||
|
|
||||||
#if !defined(COLOR_ID_MACROS_DEFINED)
|
|
||||||
#define COLOR_ID_MACROS_DEFINED
|
|
||||||
#if defined(STRINGIZE_COLOR_IDS)
|
|
||||||
// Convert first token to string, throw away the rest.
|
|
||||||
#define D1(enum_name) #enum_name
|
|
||||||
#define D2(enum_name, enum_value) #enum_name
|
|
||||||
#else // defined(STRINGIZE_COLOR_IDS)
|
|
||||||
// Declare enum with optional assigned value.
|
|
||||||
#define D1(enum_name) enum_name
|
|
||||||
#define D2(enum_name, enum_value) enum_name = enum_value
|
|
||||||
#endif // defined(STRINGIZE_COLOR_IDS)
|
|
||||||
// Select which token in the declaration is the assigned value.
|
|
||||||
// Use first and optional third token, ignore optional second.
|
|
||||||
#define E1(enum_name) D1(enum_name)
|
|
||||||
#define E2(enum_name, old_enum_name) D1(enum_name)
|
|
||||||
#define E3(enum_name, old_enum_name, enum_value) D2(enum_name, enum_value)
|
|
||||||
#define GET_E(_1, _2, _3, macro_name, ...) macro_name
|
|
||||||
#if defined(COMPILER_MSVC)
|
|
||||||
// Workaround for MSVC not properly expanding __VA_ARGS__.
|
|
||||||
#define EXPAND(x) x
|
|
||||||
#define E_CPONLY(...) EXPAND(E(__VA_ARGS__))
|
|
||||||
#define E(...) EXPAND(GET_E(__VA_ARGS__, E3, E2, E1)(__VA_ARGS__)),
|
|
||||||
#else // !defined(COMPILER_MSVC)
|
|
||||||
#define E_CPONLY(...) E(__VA_ARGS__)
|
|
||||||
#define E(...) GET_E(__VA_ARGS__, E3, E2, E1)(__VA_ARGS__),
|
|
||||||
#endif // !defined(COMPILER_MSVC)
|
|
||||||
#else // !defined(COLOR_ID_MACROS_DEFINED)
|
|
||||||
#undef D1
|
|
||||||
#undef D2
|
|
||||||
#undef E1
|
|
||||||
#undef E2
|
|
||||||
#undef E3
|
|
||||||
#if defined(COMPILER_MSVC)
|
|
||||||
#undef EXPAND
|
|
||||||
#endif
|
|
||||||
#undef E_CPONLY
|
|
||||||
#undef GET_E
|
|
||||||
#undef E
|
|
||||||
#undef COLOR_ID_MACROS_DEFINED
|
|
||||||
#endif // !defined(COLOR_ID_MACROS_DEFINED)
|
|
||||||
@@ -40,6 +40,8 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "include/base/cef_macros.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
namespace cef_internal {
|
namespace cef_internal {
|
||||||
|
|
||||||
@@ -55,10 +57,6 @@ class LockImpl {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
LockImpl();
|
LockImpl();
|
||||||
|
|
||||||
LockImpl(const LockImpl&) = delete;
|
|
||||||
LockImpl& operator=(const LockImpl&) = delete;
|
|
||||||
|
|
||||||
~LockImpl();
|
~LockImpl();
|
||||||
|
|
||||||
// If the lock is not held, take it and return true. If the lock is already
|
// If the lock is not held, take it and return true. If the lock is already
|
||||||
@@ -79,6 +77,8 @@ class LockImpl {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
NativeHandle native_handle_;
|
NativeHandle native_handle_;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(LockImpl);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace cef_internal
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include "include/base/cef_template_util.h"
|
||||||
|
|
||||||
// It is dangerous to post a task with a T* argument where T is a subtype of
|
// It is dangerous to post a task with a T* argument where T is a subtype of
|
||||||
// RefCounted(Base|ThreadSafeBase), since by the time the parameter is used, the
|
// RefCounted(Base|ThreadSafeBase), since by the time the parameter is used, the
|
||||||
// object may already have been deleted since it was not held with a
|
// object may already have been deleted since it was not held with a
|
||||||
@@ -45,28 +47,28 @@ namespace base {
|
|||||||
|
|
||||||
// This is a base internal implementation file used by task.h and callback.h.
|
// This is a base internal implementation file used by task.h and callback.h.
|
||||||
// Not for public consumption, so we wrap it in namespace internal.
|
// Not for public consumption, so we wrap it in namespace internal.
|
||||||
namespace cef_internal {
|
namespace internal {
|
||||||
|
|
||||||
template <typename T, typename = void>
|
template <typename T, typename = void>
|
||||||
struct IsRefCountedType : std::false_type {};
|
struct IsRefCountedType : std::false_type {};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct IsRefCountedType<T,
|
struct IsRefCountedType<T,
|
||||||
std::void_t<decltype(std::declval<T*>()->AddRef()),
|
void_t<decltype(std::declval<T*>()->AddRef()),
|
||||||
decltype(std::declval<T*>()->Release())>>
|
decltype(std::declval<T*>()->Release())>>
|
||||||
: std::true_type {};
|
: std::true_type {};
|
||||||
|
|
||||||
// Human readable translation: you needed to be a scoped_refptr if you are a raw
|
// Human readable translation: you needed to be a scoped_refptr if you are a raw
|
||||||
// pointer type and are convertible to a RefCounted(Base|ThreadSafeBase) type.
|
// pointer type and are convertible to a RefCounted(Base|ThreadSafeBase) type.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct NeedsScopedRefptrButGetsRawPtr
|
struct NeedsScopedRefptrButGetsRawPtr
|
||||||
: std::conjunction<std::is_pointer<T>,
|
: conjunction<std::is_pointer<T>,
|
||||||
IsRefCountedType<std::remove_pointer_t<T>>> {
|
IsRefCountedType<std::remove_pointer_t<T>>> {
|
||||||
static_assert(!std::is_reference<T>::value,
|
static_assert(!std::is_reference<T>::value,
|
||||||
"NeedsScopedRefptrButGetsRawPtr requires non-reference type.");
|
"NeedsScopedRefptrButGetsRawPtr requires non-reference type.");
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace internal
|
||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
|
|||||||
@@ -38,14 +38,13 @@
|
|||||||
#include "include/base/cef_scoped_typeref_mac.h"
|
#include "include/base/cef_scoped_typeref_mac.h"
|
||||||
|
|
||||||
#if defined(__has_feature) && __has_feature(objc_arc)
|
#if defined(__has_feature) && __has_feature(objc_arc)
|
||||||
#error \
|
#error "Cannot include include/base/internal/cef_scoped_block_mac.h in file built with ARC."
|
||||||
"Cannot include include/base/internal/cef_scoped_block_mac.h in file built with ARC."
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
namespace mac {
|
namespace mac {
|
||||||
|
|
||||||
namespace cef_internal {
|
namespace internal {
|
||||||
|
|
||||||
template <typename B>
|
template <typename B>
|
||||||
struct ScopedBlockTraits {
|
struct ScopedBlockTraits {
|
||||||
@@ -54,12 +53,12 @@ struct ScopedBlockTraits {
|
|||||||
static void Release(B block) { Block_release(block); }
|
static void Release(B block) { Block_release(block); }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace internal
|
||||||
|
|
||||||
// ScopedBlock<> is patterned after ScopedCFTypeRef<>, but uses Block_copy() and
|
// ScopedBlock<> is patterned after ScopedCFTypeRef<>, but uses Block_copy() and
|
||||||
// Block_release() instead of CFRetain() and CFRelease().
|
// Block_release() instead of CFRetain() and CFRelease().
|
||||||
template <typename B>
|
template <typename B>
|
||||||
using ScopedBlock = ScopedTypeRef<B, cef_internal::ScopedBlockTraits<B>>;
|
using ScopedBlock = ScopedTypeRef<B, internal::ScopedBlockTraits<B>>;
|
||||||
|
|
||||||
} // namespace mac
|
} // namespace mac
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=6ea5d772fb4961ae4a658b4b730aa608fa93309f$
|
// $hash=c487e5fd787b1be8224a8981839e0cfdd0ed74f3$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
|
||||||
@@ -47,27 +47,27 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to receive accessibility notification when
|
// Implement this structure to receive accessibility notification when
|
||||||
/// accessibility events have been registered. The functions of this structure
|
// accessibility events have been registered. The functions of this structure
|
||||||
/// will be called on the UI thread.
|
// will be called on the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_accessibility_handler_t {
|
typedef struct _cef_accessibility_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called after renderer process sends accessibility tree changes to the
|
// Called after renderer process sends accessibility tree changes to the
|
||||||
/// browser process.
|
// browser process.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_accessibility_tree_change)(
|
void(CEF_CALLBACK* on_accessibility_tree_change)(
|
||||||
struct _cef_accessibility_handler_t* self,
|
struct _cef_accessibility_handler_t* self,
|
||||||
struct _cef_value_t* value);
|
struct _cef_value_t* value);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called after renderer process sends accessibility location changes to the
|
// Called after renderer process sends accessibility location changes to the
|
||||||
/// browser process.
|
// browser process.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_accessibility_location_change)(
|
void(CEF_CALLBACK* on_accessibility_location_change)(
|
||||||
struct _cef_accessibility_handler_t* self,
|
struct _cef_accessibility_handler_t* self,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=dfa0d4d2da319b2fd5e92324fd14301b500ceb5c$
|
// $hash=a4b63e6e7942e3a3961b4f7141a963980178ae6f$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
||||||
@@ -54,26 +54,25 @@ extern "C" {
|
|||||||
struct _cef_app_t;
|
struct _cef_app_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to provide handler implementations. Methods will be
|
// Implement this structure to provide handler implementations. Methods will be
|
||||||
/// called by the process and/or thread indicated.
|
// called by the process and/or thread indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_app_t {
|
typedef struct _cef_app_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Provides an opportunity to view and/or modify command-line arguments
|
// Provides an opportunity to view and/or modify command-line arguments before
|
||||||
/// before processing by CEF and Chromium. The |process_type| value will be
|
// processing by CEF and Chromium. The |process_type| value will be NULL for
|
||||||
/// NULL for the browser process. Do not keep a reference to the
|
// the browser process. Do not keep a reference to the cef_command_line_t
|
||||||
/// cef_command_line_t object passed to this function. The
|
// object passed to this function. The CefSettings.command_line_args_disabled
|
||||||
/// cef_settings_t.command_line_args_disabled value can be used to start with
|
// value can be used to start with an NULL command-line object. Any values
|
||||||
/// an NULL command-line object. Any values specified in CefSettings that
|
// specified in CefSettings that equate to command-line arguments will be set
|
||||||
/// equate to command-line arguments will be set before this function is
|
// before this function is called. Be cautious when using this function to
|
||||||
/// called. Be cautious when using this function to modify command-line
|
// modify command-line arguments for non-browser processes as this may result
|
||||||
/// arguments for non-browser processes as this may result in undefined
|
// in undefined behavior including crashes.
|
||||||
/// behavior including crashes.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_before_command_line_processing)(
|
void(CEF_CALLBACK* on_before_command_line_processing)(
|
||||||
struct _cef_app_t* self,
|
struct _cef_app_t* self,
|
||||||
@@ -81,122 +80,119 @@ typedef struct _cef_app_t {
|
|||||||
struct _cef_command_line_t* command_line);
|
struct _cef_command_line_t* command_line);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Provides an opportunity to register custom schemes. Do not keep a
|
// Provides an opportunity to register custom schemes. Do not keep a reference
|
||||||
/// reference to the |registrar| object. This function is called on the main
|
// to the |registrar| object. This function is called on the main thread for
|
||||||
/// thread for each process and the registered schemes should be the same
|
// each process and the registered schemes should be the same across all
|
||||||
/// across all processes.
|
// processes.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_register_custom_schemes)(
|
void(CEF_CALLBACK* on_register_custom_schemes)(
|
||||||
struct _cef_app_t* self,
|
struct _cef_app_t* self,
|
||||||
struct _cef_scheme_registrar_t* registrar);
|
struct _cef_scheme_registrar_t* registrar);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for resource bundle events. If
|
// Return the handler for resource bundle events. If
|
||||||
/// cef_settings_t.pack_loading_disabled is true (1) a handler must be
|
// CefSettings.pack_loading_disabled is true (1) a handler must be returned.
|
||||||
/// returned. If no handler is returned resources will be loaded from pack
|
// If no handler is returned resources will be loaded from pack files. This
|
||||||
/// files. This function is called by the browser and render processes on
|
// function is called by the browser and render processes on multiple threads.
|
||||||
/// multiple threads.
|
|
||||||
///
|
///
|
||||||
struct _cef_resource_bundle_handler_t*(
|
struct _cef_resource_bundle_handler_t*(
|
||||||
CEF_CALLBACK* get_resource_bundle_handler)(struct _cef_app_t* self);
|
CEF_CALLBACK* get_resource_bundle_handler)(struct _cef_app_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for functionality specific to the browser process. This
|
// Return the handler for functionality specific to the browser process. This
|
||||||
/// function is called on multiple threads in the browser process.
|
// function is called on multiple threads in the browser process.
|
||||||
///
|
///
|
||||||
struct _cef_browser_process_handler_t*(
|
struct _cef_browser_process_handler_t*(
|
||||||
CEF_CALLBACK* get_browser_process_handler)(struct _cef_app_t* self);
|
CEF_CALLBACK* get_browser_process_handler)(struct _cef_app_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for functionality specific to the render process. This
|
// Return the handler for functionality specific to the render process. This
|
||||||
/// function is called on the render process main thread.
|
// function is called on the render process main thread.
|
||||||
///
|
///
|
||||||
struct _cef_render_process_handler_t*(
|
struct _cef_render_process_handler_t*(
|
||||||
CEF_CALLBACK* get_render_process_handler)(struct _cef_app_t* self);
|
CEF_CALLBACK* get_render_process_handler)(struct _cef_app_t* self);
|
||||||
} cef_app_t;
|
} cef_app_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// This function should be called from the application entry point function to
|
// 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
|
// execute a secondary process. It can be used to run secondary processes from
|
||||||
/// the browser client executable (default behavior) or from a separate
|
// the browser client executable (default behavior) or from a separate
|
||||||
/// executable specified by the cef_settings_t.browser_subprocess_path value. If
|
// executable specified by the CefSettings.browser_subprocess_path value. If
|
||||||
/// called for the browser process (identified by no "type" command-line value)
|
// called for the browser process (identified by no "type" command-line value)
|
||||||
/// it will return immediately with a value of -1. If called for a recognized
|
// it will return immediately with a value of -1. If called for a recognized
|
||||||
/// secondary process it will block until the process should exit and then
|
// secondary process it will block until the process should exit and then return
|
||||||
/// return the process exit code. The |application| parameter may be NULL. The
|
// the process exit code. The |application| parameter may be NULL. The
|
||||||
/// |windows_sandbox_info| parameter is only used on Windows and may be NULL
|
// |windows_sandbox_info| parameter is only used on Windows and may be NULL (see
|
||||||
/// (see cef_sandbox_win.h for details).
|
// cef_sandbox_win.h for details).
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_execute_process(const cef_main_args_t* args,
|
CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
|
||||||
cef_app_t* application,
|
cef_app_t* application,
|
||||||
void* windows_sandbox_info);
|
void* windows_sandbox_info);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// This function should be called on the main application thread to initialize
|
// This function should be called on the main application thread to initialize
|
||||||
/// the CEF browser process. The |application| parameter may be NULL. Returns
|
// the CEF browser process. The |application| parameter may be NULL. A return
|
||||||
/// true (1) if initialization succeeds. Returns false (0) if initialization
|
// value of true (1) indicates that it succeeded and false (0) indicates that it
|
||||||
/// fails or if early exit is desired (for example, due to process singleton
|
// failed. The |windows_sandbox_info| parameter is only used on Windows and may
|
||||||
/// relaunch behavior). If this function returns false (0) then the application
|
// be NULL (see cef_sandbox_win.h for details).
|
||||||
/// should exit immediately without calling any other CEF functions except,
|
|
||||||
/// optionally, CefGetErrorCode. The |windows_sandbox_info| parameter is only
|
|
||||||
/// used on Windows and may be NULL (see cef_sandbox_win.h for details).
|
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_initialize(const cef_main_args_t* args,
|
CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
|
||||||
const struct _cef_settings_t* settings,
|
const struct _cef_settings_t* settings,
|
||||||
cef_app_t* application,
|
cef_app_t* application,
|
||||||
void* windows_sandbox_info);
|
void* windows_sandbox_info);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// This function can optionally be called on the main application thread after
|
// This function should be called on the main application thread to shut down
|
||||||
/// CefInitialize to retrieve the initialization exit code. When CefInitialize
|
// the CEF browser process before the application exits.
|
||||||
/// returns true (1) the exit code will be 0 (CEF_RESULT_CODE_NORMAL_EXIT).
|
|
||||||
/// Otherwise, see cef_resultcode_t for possible exit code values including
|
|
||||||
/// browser process initialization errors and normal early exit conditions (such
|
|
||||||
/// as CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED for process singleton
|
|
||||||
/// relaunch behavior).
|
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_get_exit_code(void);
|
CEF_EXPORT void cef_shutdown();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// This function should be called on the main application thread to shut down
|
// Perform a single iteration of CEF message loop processing. This function is
|
||||||
/// the CEF browser process before the application exits. Do not call any other
|
// provided for cases where the CEF message loop must be integrated into an
|
||||||
/// CEF functions after calling this function.
|
// existing application message loop. Use of this function is not recommended
|
||||||
|
// for most users; use either the cef_run_message_loop() function or
|
||||||
|
// CefSettings.multi_threaded_message_loop if possible. When using this function
|
||||||
|
// care must be taken to balance performance against excessive CPU usage. It is
|
||||||
|
// recommended to enable the CefSettings.external_message_pump option when using
|
||||||
|
// this function so that
|
||||||
|
// cef_browser_process_handler_t::on_schedule_message_pump_work() callbacks can
|
||||||
|
// facilitate the scheduling process. This function should only be called on the
|
||||||
|
// main application thread and only if cef_initialize() is called with a
|
||||||
|
// CefSettings.multi_threaded_message_loop value of false (0). This function
|
||||||
|
// will not block.
|
||||||
///
|
///
|
||||||
CEF_EXPORT void cef_shutdown(void);
|
CEF_EXPORT void cef_do_message_loop_work();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Perform a single iteration of CEF message loop processing. This function is
|
// Run the CEF message loop. Use this function instead of an application-
|
||||||
/// provided for cases where the CEF message loop must be integrated into an
|
// provided message loop to get the best balance between performance and CPU
|
||||||
/// existing application message loop. Use of this function is not recommended
|
// usage. This function should only be called on the main application thread and
|
||||||
/// for most users; use either the cef_run_message_loop() function or
|
// only if cef_initialize() is called with a
|
||||||
/// cef_settings_t.multi_threaded_message_loop if possible. When using this
|
// CefSettings.multi_threaded_message_loop value of false (0). This function
|
||||||
/// function care must be taken to balance performance against excessive CPU
|
// will block until a quit message is received by the system.
|
||||||
/// usage. It is recommended to enable the cef_settings_t.external_message_pump
|
|
||||||
/// option when using this function so that
|
|
||||||
/// cef_browser_process_handler_t::on_schedule_message_pump_work() callbacks can
|
|
||||||
/// facilitate the scheduling process. This function should only be called on
|
|
||||||
/// the main application thread and only if cef_initialize() is called with a
|
|
||||||
/// cef_settings_t.multi_threaded_message_loop value of false (0). This function
|
|
||||||
/// will not block.
|
|
||||||
///
|
///
|
||||||
CEF_EXPORT void cef_do_message_loop_work(void);
|
CEF_EXPORT void cef_run_message_loop();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Run the CEF message loop. Use this function instead of an application-
|
// Quit the CEF message loop that was started by calling cef_run_message_loop().
|
||||||
/// provided message loop to get the best balance between performance and CPU
|
// This function should only be called on the main application thread and only
|
||||||
/// usage. This function should only be called on the main application thread
|
// if cef_run_message_loop() was used.
|
||||||
/// and only if cef_initialize() is called with a
|
|
||||||
/// cef_settings_t.multi_threaded_message_loop value of false (0). This function
|
|
||||||
/// will block until a quit message is received by the system.
|
|
||||||
///
|
///
|
||||||
CEF_EXPORT void cef_run_message_loop(void);
|
CEF_EXPORT void cef_quit_message_loop();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Quit the CEF message loop that was started by calling
|
// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a
|
||||||
/// cef_run_message_loop(). This function should only be called on the main
|
// modal message loop. Set to false (0) after exiting the modal message loop.
|
||||||
/// application thread and only if cef_run_message_loop() was used.
|
|
||||||
///
|
///
|
||||||
CEF_EXPORT void cef_quit_message_loop(void);
|
CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Call during process startup to enable High-DPI support on Windows 7 or newer.
|
||||||
|
// Older versions of Windows should be left DPI-unaware because they do not
|
||||||
|
// support DirectWrite and GDI fonts are kerned very badly.
|
||||||
|
///
|
||||||
|
CEF_EXPORT void cef_enable_highdpi_support();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=d98482eba93dcd8b6a6f69b2732162733c73203d$
|
// $hash=7a483ed552ecca4f1aaa03800d366beca1ea2dee$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
|
||||||
@@ -48,30 +48,30 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle audio events.
|
// Implement this structure to handle audio events.
|
||||||
///
|
///
|
||||||
typedef struct _cef_audio_handler_t {
|
typedef struct _cef_audio_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on the UI thread to allow configuration of audio stream parameters.
|
// 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
|
// 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
|
// cancel it. All members of |params| can optionally be configured here, but
|
||||||
/// they are also pre-filled with some sensible defaults.
|
// they are also pre-filled with some sensible defaults.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_audio_parameters)(struct _cef_audio_handler_t* self,
|
int(CEF_CALLBACK* get_audio_parameters)(struct _cef_audio_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
cef_audio_parameters_t* params);
|
cef_audio_parameters_t* params);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on a browser audio capture thread when the browser starts streaming
|
// Called on a browser audio capture thread when the browser starts streaming
|
||||||
/// audio. OnAudioStreamStopped will always be called after
|
// audio. OnAudioSteamStopped will always be called after
|
||||||
/// OnAudioStreamStarted; both functions may be called multiple times for the
|
// OnAudioStreamStarted; both functions may be called multiple times for the
|
||||||
/// same browser. |params| contains the audio parameters like sample rate and
|
// same browser. |params| contains the audio parameters like sample rate and
|
||||||
/// channel layout. |channels| is the number of channels.
|
// channel layout. |channels| is the number of channels.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_audio_stream_started)(
|
void(CEF_CALLBACK* on_audio_stream_started)(
|
||||||
struct _cef_audio_handler_t* self,
|
struct _cef_audio_handler_t* self,
|
||||||
@@ -80,34 +80,34 @@ typedef struct _cef_audio_handler_t {
|
|||||||
int channels);
|
int channels);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on the audio stream thread when a PCM packet is received for the
|
// 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
|
// 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
|
// 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
|
// PCM packet. |pts| is the presentation timestamp (in milliseconds since the
|
||||||
/// Unix Epoch) and represents the time at which the decompressed packet
|
// Unix Epoch) and represents the time at which the decompressed packet should
|
||||||
/// should be presented to the user. Based on |frames| and the
|
// be presented to the user. Based on |frames| and the |channel_layout| value
|
||||||
/// |channel_layout| value passed to OnAudioStreamStarted you can calculate
|
// passed to OnAudioStreamStarted you can calculate the size of the |data|
|
||||||
/// the size of the |data| array in bytes.
|
// array in bytes.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_audio_stream_packet)(struct _cef_audio_handler_t* self,
|
void(CEF_CALLBACK* on_audio_stream_packet)(struct _cef_audio_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
const float** data,
|
const float** data,
|
||||||
int frames,
|
int frames,
|
||||||
int64_t pts);
|
int64 pts);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on the UI thread when the stream has stopped. OnAudioSteamStopped
|
// Called on the UI thread when the stream has stopped. OnAudioSteamStopped
|
||||||
/// will always be called after OnAudioStreamStarted; both functions may be
|
// will always be called after OnAudioStreamStarted; both functions may be
|
||||||
/// called multiple times for the same stream.
|
// called multiple times for the same stream.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_audio_stream_stopped)(struct _cef_audio_handler_t* self,
|
void(CEF_CALLBACK* on_audio_stream_stopped)(struct _cef_audio_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on the UI or audio stream thread when an error occurred. During the
|
// 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
|
// 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
|
// in the capturing phase it will be called on the audio stream thread. The
|
||||||
/// stream will be stopped immediately.
|
// stream will be stopped immediately.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_audio_stream_error)(struct _cef_audio_handler_t* self,
|
void(CEF_CALLBACK* on_audio_stream_error)(struct _cef_audio_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=b63947918eca8c31790cae16b2e8a0be7e9464dd$
|
// $hash=2b9508a328ed0218e2c576af455f8d76e5978545$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
|
||||||
@@ -47,24 +47,24 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure used for asynchronous continuation of authentication
|
// Callback structure used for asynchronous continuation of authentication
|
||||||
/// requests.
|
// requests.
|
||||||
///
|
///
|
||||||
typedef struct _cef_auth_callback_t {
|
typedef struct _cef_auth_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Continue the authentication request.
|
// Continue the authentication request.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_auth_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_auth_callback_t* self,
|
||||||
const cef_string_t* username,
|
const cef_string_t* username,
|
||||||
const cef_string_t* password);
|
const cef_string_t* password);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Cancel the authentication request.
|
// 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;
|
} cef_auth_callback_t;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=d958d5bed7f909f6313facef3440fb8ba07a5c01$
|
// $hash=ade537f836add7fe0b5fd94ceba26d678abb3e43$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
|
||||||
@@ -43,8 +43,6 @@
|
|||||||
#include "include/capi/cef_base_capi.h"
|
#include "include/capi/cef_base_capi.h"
|
||||||
#include "include/capi/cef_client_capi.h"
|
#include "include/capi/cef_client_capi.h"
|
||||||
#include "include/capi/cef_command_line_capi.h"
|
#include "include/capi/cef_command_line_capi.h"
|
||||||
#include "include/capi/cef_preference_capi.h"
|
|
||||||
#include "include/capi/cef_request_context_handler_capi.h"
|
|
||||||
#include "include/capi/cef_values_capi.h"
|
#include "include/capi/cef_values_capi.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -52,122 +50,60 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to implement browser process callbacks. The functions of this
|
// Structure used to implement browser process callbacks. The functions of this
|
||||||
/// structure will be called on the browser process main thread unless otherwise
|
// structure will be called on the browser process main thread unless otherwise
|
||||||
/// indicated.
|
// indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_browser_process_handler_t {
|
typedef struct _cef_browser_process_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Provides an opportunity to register custom preferences prior to global and
|
// Called on the browser process UI thread immediately after the CEF context
|
||||||
/// request context initialization.
|
// has been initialized.
|
||||||
///
|
|
||||||
/// If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be
|
|
||||||
/// accessed via cef_preference_manager_t::GetGlobalPreferences after
|
|
||||||
/// OnContextInitialized is called. Global preferences are registered a single
|
|
||||||
/// time at application startup. See related cef_settings_t.cache_path and
|
|
||||||
/// cef_settings_t.persist_user_preferences configuration.
|
|
||||||
///
|
|
||||||
/// If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be
|
|
||||||
/// accessed via the cef_request_context_t after
|
|
||||||
/// cef_request_context_handler_t::OnRequestContextInitialized is called.
|
|
||||||
/// Request context preferences are registered each time a new
|
|
||||||
/// cef_request_context_t is created. It is intended but not required that all
|
|
||||||
/// request contexts have the same registered preferences. See related
|
|
||||||
/// cef_request_context_settings_t.cache_path and
|
|
||||||
/// cef_request_context_settings_t.persist_user_preferences configuration.
|
|
||||||
///
|
|
||||||
/// Do not keep a reference to the |registrar| object. This function is called
|
|
||||||
/// on the browser process UI thread.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* on_register_custom_preferences)(
|
|
||||||
struct _cef_browser_process_handler_t* self,
|
|
||||||
cef_preferences_type_t type,
|
|
||||||
struct _cef_preference_registrar_t* registrar);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// 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);
|
struct _cef_browser_process_handler_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called before a child process is launched. Will be called on the browser
|
// Called before a child process is launched. Will be called on the browser
|
||||||
/// process UI thread when launching a render process and on the browser
|
// process UI thread when launching a render process and on the browser
|
||||||
/// process IO thread when launching a GPU process. Provides an opportunity to
|
// process IO thread when launching a GPU or plugin process. Provides an
|
||||||
/// modify the child process command line. Do not keep a reference to
|
// opportunity to modify the child process command line. Do not keep a
|
||||||
/// |command_line| outside of this function.
|
// 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_browser_process_handler_t* self,
|
||||||
struct _cef_command_line_t* command_line);
|
struct _cef_command_line_t* command_line);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this function to provide app-specific behavior when an already
|
// Called from any thread when work has been scheduled for the browser process
|
||||||
/// running app is relaunched with the same CefSettings.root_cache_path value.
|
// main (UI) thread. This callback is used in combination with CefSettings.
|
||||||
/// For example, activate an existing app window or create a new app window.
|
// external_message_pump and cef_do_message_loop_work() in cases where the CEF
|
||||||
/// |command_line| will be read-only. Do not keep a reference to
|
// message loop must be integrated into an existing application message loop
|
||||||
/// |command_line| outside of this function. Return true (1) if the relaunch
|
// (see additional comments and warnings on CefDoMessageLoopWork). This
|
||||||
/// is handled or false (0) for default relaunch behavior. Default behavior
|
// callback should schedule a cef_do_message_loop_work() call to happen on the
|
||||||
/// will create a new default styled Chrome window.
|
// main (UI) thread. |delay_ms| is the requested delay in milliseconds. If
|
||||||
///
|
// |delay_ms| is <= 0 then the call should happen reasonably soon. If
|
||||||
/// To avoid cache corruption only a single app instance is allowed to run for
|
// |delay_ms| is > 0 then the call should be scheduled to happen after the
|
||||||
/// a given CefSettings.root_cache_path value. On relaunch the app checks a
|
// specified delay and any currently pending scheduled call should be
|
||||||
/// process singleton lock and then forwards the new launch arguments to the
|
// cancelled.
|
||||||
/// already running app process before exiting early. Client apps should
|
|
||||||
/// therefore check the cef_initialize() return value for early exit before
|
|
||||||
/// proceeding.
|
|
||||||
///
|
|
||||||
/// This function will be called on the browser process UI thread.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* on_already_running_app_relaunch)(
|
|
||||||
struct _cef_browser_process_handler_t* self,
|
|
||||||
struct _cef_command_line_t* command_line,
|
|
||||||
const cef_string_t* current_directory);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called from any thread when work has been scheduled for the browser
|
|
||||||
/// process main (UI) thread. This callback is used in combination with
|
|
||||||
/// cef_settings_t.external_message_pump and cef_do_message_loop_work() in
|
|
||||||
/// cases where the CEF message loop must be integrated into an existing
|
|
||||||
/// application message loop (see additional comments and warnings on
|
|
||||||
/// CefDoMessageLoopWork). This callback should schedule a
|
|
||||||
/// cef_do_message_loop_work() call to happen on the main (UI) thread.
|
|
||||||
/// |delay_ms| is the requested delay in milliseconds. If |delay_ms| is <= 0
|
|
||||||
/// then the call should happen reasonably soon. If |delay_ms| is > 0 then the
|
|
||||||
/// call should be scheduled to happen after the specified delay and any
|
|
||||||
/// currently pending scheduled call should be cancelled.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_schedule_message_pump_work)(
|
void(CEF_CALLBACK* on_schedule_message_pump_work)(
|
||||||
struct _cef_browser_process_handler_t* self,
|
struct _cef_browser_process_handler_t* self,
|
||||||
int64_t delay_ms);
|
int64 delay_ms);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the default client for use with a newly created browser window
|
// Return the default client for use with a newly created browser window. If
|
||||||
/// (cef_browser_t object). If null is returned the cef_browser_t will be
|
// null is returned the browser will be unmanaged (no callbacks will be
|
||||||
/// unmanaged (no callbacks will be executed for that cef_browser_t) and
|
// executed for that browser) and application shutdown will be blocked until
|
||||||
/// application shutdown will be blocked until the browser window is closed
|
// the browser window is closed manually. This function is currently only used
|
||||||
/// manually. This function is currently only used with the Chrome runtime
|
// with the chrome runtime.
|
||||||
/// when creating new browser windows via Chrome UI.
|
|
||||||
///
|
///
|
||||||
struct _cef_client_t*(CEF_CALLBACK* get_default_client)(
|
struct _cef_client_t*(CEF_CALLBACK* get_default_client)(
|
||||||
struct _cef_browser_process_handler_t* self);
|
struct _cef_browser_process_handler_t* self);
|
||||||
|
|
||||||
///
|
|
||||||
/// Return the default handler for use with a new user or incognito profile
|
|
||||||
/// (cef_request_context_t object). If null is returned the
|
|
||||||
/// cef_request_context_t will be unmanaged (no callbacks will be executed for
|
|
||||||
/// that cef_request_context_t). This function is currently only used with the
|
|
||||||
/// Chrome runtime when creating new browser windows via Chrome UI.
|
|
||||||
///
|
|
||||||
struct _cef_request_context_handler_t*(
|
|
||||||
CEF_CALLBACK* get_default_request_context_handler)(
|
|
||||||
struct _cef_browser_process_handler_t* self);
|
|
||||||
} cef_browser_process_handler_t;
|
} cef_browser_process_handler_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=46bc048bec64590735298a95633167d66e445844$
|
// $hash=cd8c183355a6808abd763ecc0396b5da6c15b3f9$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
||||||
@@ -47,36 +47,36 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Generic callback structure used for asynchronous continuation.
|
// Generic callback structure used for asynchronous continuation.
|
||||||
///
|
///
|
||||||
typedef struct _cef_callback_t {
|
typedef struct _cef_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Continue processing.
|
// Continue processing.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_callback_t* self);
|
void(CEF_CALLBACK* cont)(struct _cef_callback_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Cancel processing.
|
// Cancel processing.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* cancel)(struct _cef_callback_t* self);
|
void(CEF_CALLBACK* cancel)(struct _cef_callback_t* self);
|
||||||
} cef_callback_t;
|
} cef_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Generic callback structure used for asynchronous completion.
|
// Generic callback structure used for asynchronous completion.
|
||||||
///
|
///
|
||||||
typedef struct _cef_completion_callback_t {
|
typedef struct _cef_completion_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be called once the task is complete.
|
// 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;
|
} cef_completion_callback_t;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=09bd4140605645c9dfbd81e7e22d029d0bb50129$
|
// $hash=845a1d1dda63a06f4ae33ed39acfd2599b46a885$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||||
@@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
#include "include/capi/cef_audio_handler_capi.h"
|
#include "include/capi/cef_audio_handler_capi.h"
|
||||||
#include "include/capi/cef_base_capi.h"
|
#include "include/capi/cef_base_capi.h"
|
||||||
#include "include/capi/cef_command_handler_capi.h"
|
|
||||||
#include "include/capi/cef_context_menu_handler_capi.h"
|
#include "include/capi/cef_context_menu_handler_capi.h"
|
||||||
#include "include/capi/cef_dialog_handler_capi.h"
|
#include "include/capi/cef_dialog_handler_capi.h"
|
||||||
#include "include/capi/cef_display_handler_capi.h"
|
#include "include/capi/cef_display_handler_capi.h"
|
||||||
@@ -55,7 +54,6 @@
|
|||||||
#include "include/capi/cef_keyboard_handler_capi.h"
|
#include "include/capi/cef_keyboard_handler_capi.h"
|
||||||
#include "include/capi/cef_life_span_handler_capi.h"
|
#include "include/capi/cef_life_span_handler_capi.h"
|
||||||
#include "include/capi/cef_load_handler_capi.h"
|
#include "include/capi/cef_load_handler_capi.h"
|
||||||
#include "include/capi/cef_permission_handler_capi.h"
|
|
||||||
#include "include/capi/cef_print_handler_capi.h"
|
#include "include/capi/cef_print_handler_capi.h"
|
||||||
#include "include/capi/cef_process_message_capi.h"
|
#include "include/capi/cef_process_message_capi.h"
|
||||||
#include "include/capi/cef_render_handler_capi.h"
|
#include "include/capi/cef_render_handler_capi.h"
|
||||||
@@ -66,134 +64,121 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to provide handler implementations.
|
// Implement this structure to provide handler implementations.
|
||||||
///
|
///
|
||||||
typedef struct _cef_client_t {
|
typedef struct _cef_client_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for audio rendering events.
|
// Return the handler for audio rendering events.
|
||||||
///
|
///
|
||||||
struct _cef_audio_handler_t*(CEF_CALLBACK* get_audio_handler)(
|
struct _cef_audio_handler_t*(CEF_CALLBACK* get_audio_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for commands. If no handler is provided the default
|
// Return the handler for context menus. If no handler is provided the default
|
||||||
/// implementation will be used.
|
// implementation will be used.
|
||||||
///
|
|
||||||
struct _cef_command_handler_t*(CEF_CALLBACK* get_command_handler)(
|
|
||||||
struct _cef_client_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for dialogs. If no handler is provided the default
|
// Return the handler for dialogs. If no handler is provided the default
|
||||||
/// implementation will be used.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for browser display state events.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for download events. If no handler is returned
|
// Return the handler for download events. If no handler is returned downloads
|
||||||
/// downloads will not be allowed.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for drag events.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for find result events.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for focus events.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for events related to cef_frame_t lifespan. This
|
// Return the handler for events related to cef_frame_t lifespan. This
|
||||||
/// function will be called once during cef_browser_t creation and the result
|
// function will be called once during cef_browser_t creation and the result
|
||||||
/// will be cached for performance reasons.
|
// will be cached for performance reasons.
|
||||||
///
|
///
|
||||||
struct _cef_frame_handler_t*(CEF_CALLBACK* get_frame_handler)(
|
struct _cef_frame_handler_t*(CEF_CALLBACK* get_frame_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for permission requests.
|
// Return the handler for JavaScript dialogs. If no handler is provided the
|
||||||
///
|
// default implementation will be used.
|
||||||
struct _cef_permission_handler_t*(CEF_CALLBACK* get_permission_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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for keyboard events.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for browser life span events.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for browser load status events.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for printing on Linux. If a print handler is not
|
// Return the handler for printing on Linux. If a print handler is not
|
||||||
/// provided then printing will not be supported on the Linux platform.
|
// 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_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for off-screen rendering events.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for browser request events.
|
// 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);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a new message is received from a different process. Return
|
// Called when a new message is received from a different process. Return true
|
||||||
/// true (1) if the message was handled or false (0) otherwise. It is safe to
|
// (1) if the message was handled or false (0) otherwise. It is safe to keep
|
||||||
/// keep a reference to |message| outside of this callback.
|
// a reference to |message| outside of this callback.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_process_message_received)(
|
int(CEF_CALLBACK* on_process_message_received)(
|
||||||
struct _cef_client_t* self,
|
struct _cef_client_t* self,
|
||||||
|
|||||||
@@ -1,120 +0,0 @@
|
|||||||
// Copyright (c) 2024 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=dd183a473b1e8c5ee8bdcf99949fc5274c4cc892$
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
|
|
||||||
#define CEF_INCLUDE_CAPI_CEF_COMMAND_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 events related to commands. The functions
|
|
||||||
/// of this structure will be called on the UI thread.
|
|
||||||
///
|
|
||||||
typedef struct _cef_command_handler_t {
|
|
||||||
///
|
|
||||||
/// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called to execute a Chrome command triggered via menu selection or
|
|
||||||
/// keyboard shortcut. Values for |command_id| can be found in the
|
|
||||||
/// cef_command_ids.h file. |disposition| provides information about the
|
|
||||||
/// intended command target. Return true (1) if the command was handled or
|
|
||||||
/// false (0) for the default implementation. For context menu commands this
|
|
||||||
/// will be called after cef_context_menu_handler_t::OnContextMenuCommand.
|
|
||||||
/// Only used with the Chrome runtime.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* on_chrome_command)(
|
|
||||||
struct _cef_command_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
int command_id,
|
|
||||||
cef_window_open_disposition_t disposition);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called to check if a Chrome app menu item should be visible. Values for
|
|
||||||
/// |command_id| can be found in the cef_command_ids.h file. Only called for
|
|
||||||
/// menu items that would be visible by default. Only used with the Chrome
|
|
||||||
/// runtime.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* is_chrome_app_menu_item_visible)(
|
|
||||||
struct _cef_command_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
int command_id);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called to check if a Chrome app menu item should be enabled. Values for
|
|
||||||
/// |command_id| can be found in the cef_command_ids.h file. Only called for
|
|
||||||
/// menu items that would be enabled by default. Only used with the Chrome
|
|
||||||
/// runtime.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* is_chrome_app_menu_item_enabled)(
|
|
||||||
struct _cef_command_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
int command_id);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called during browser creation to check if a Chrome page action icon
|
|
||||||
/// should be visible. Only called for icons that would be visible by default.
|
|
||||||
/// Only used with the Chrome runtime.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* is_chrome_page_action_icon_visible)(
|
|
||||||
struct _cef_command_handler_t* self,
|
|
||||||
cef_chrome_page_action_icon_type_t icon_type);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called during browser creation to check if a Chrome toolbar button should
|
|
||||||
/// be visible. Only called for buttons that would be visible by default. Only
|
|
||||||
/// used with the Chrome runtime.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* is_chrome_toolbar_button_visible)(
|
|
||||||
struct _cef_command_handler_t* self,
|
|
||||||
cef_chrome_toolbar_button_type_t button_type);
|
|
||||||
} cef_command_handler_t;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=fce786b3f054d6581438e2906b77e573c797372a$
|
// $hash=5af5bf1e877dd53f21f751d332a9e2166817324c$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
||||||
@@ -47,104 +47,103 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to create and/or parse command line arguments. Arguments with
|
// Structure used to create and/or parse command line arguments. Arguments with
|
||||||
/// "--", "-" and, on Windows, "/" prefixes are considered switches. Switches
|
// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
|
||||||
/// will always precede any arguments without switch prefixes. Switches can
|
// will always precede any arguments without switch prefixes. Switches can
|
||||||
/// optionally have a value specified using the "=" delimiter (e.g.
|
// optionally have a value specified using the '=' delimiter (e.g.
|
||||||
/// "-switch=value"). An argument of "--" will terminate switch parsing with all
|
// "-switch=value"). An argument of "--" will terminate switch parsing with all
|
||||||
/// subsequent tokens, regardless of prefix, being interpreted as non-switch
|
// subsequent tokens, regardless of prefix, being interpreted as non-switch
|
||||||
/// arguments. Switch names should be lowercase ASCII and will be converted to
|
// arguments. Switch names are considered case-insensitive. This structure can
|
||||||
/// such if necessary. Switch values will retain the original case and UTF8
|
// be used before cef_initialize() is called.
|
||||||
/// encoding. This structure can be used before cef_initialize() is called.
|
|
||||||
///
|
///
|
||||||
typedef struct _cef_command_line_t {
|
typedef struct _cef_command_line_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
/// if this function returns false (0).
|
// 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
|
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||||
/// expose read-only objects.
|
// 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.
|
// 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);
|
struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Initialize the command line with the specified |argc| and |argv| values.
|
// Initialize the command line with the specified |argc| and |argv| values.
|
||||||
/// The first argument must be the name of the program. This function is only
|
// The first argument must be the name of the program. This function is only
|
||||||
/// supported on non-Windows platforms.
|
// supported on non-Windows platforms.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* init_from_argv)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* init_from_argv)(struct _cef_command_line_t* self,
|
||||||
int argc,
|
int argc,
|
||||||
const char* const* argv);
|
const char* const* argv);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Initialize the command line with the string returned by calling
|
// Initialize the command line with the string returned by calling
|
||||||
/// GetCommandLineW(). This function is only supported on Windows.
|
// GetCommandLineW(). This function is only supported on Windows.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* init_from_string)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* init_from_string)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* command_line);
|
const cef_string_t* command_line);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Reset the command-line switches and arguments but leave the program
|
// Reset the command-line switches and arguments but leave the program
|
||||||
/// component unchanged.
|
// 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
|
// Retrieve the original command line string as a vector of strings. The argv
|
||||||
/// array: `{ program, [(--|-|/)switch[=value]]*, [--], [argument]* }`
|
// array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* }
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_argv)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* get_argv)(struct _cef_command_line_t* self,
|
||||||
cef_string_list_t argv);
|
cef_string_list_t argv);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructs and returns the represented command line string. Use this
|
// Constructs and returns the represented command line string. Use this
|
||||||
/// function cautiously because quoting behavior is unclear.
|
// function cautiously because quoting behavior is unclear.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the program part of the command line string (the first item).
|
// Get the program part of the command line string (the first item).
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the program part of the command line string (the first item).
|
// Set the program part of the command line string (the first item).
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_program)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* set_program)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* program);
|
const cef_string_t* program);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the command line has switches.
|
// 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.
|
// Returns true (1) if the command line contains the given switch.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* has_switch)(struct _cef_command_line_t* self,
|
int(CEF_CALLBACK* has_switch)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the value associated with the given switch. If the switch has no
|
// Returns the value associated with the given switch. If the switch has no
|
||||||
/// value or isn't present this function returns the NULL string.
|
// value or isn't present this function returns the NULL string.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t(CEF_CALLBACK* get_switch_value)(
|
cef_string_userfree_t(CEF_CALLBACK* get_switch_value)(
|
||||||
@@ -152,61 +151,61 @@ typedef struct _cef_command_line_t {
|
|||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the map of switch names and values. If a switch has no value an
|
// Returns the map of switch names and values. If a switch has no value an
|
||||||
/// NULL string is returned.
|
// NULL string is returned.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_switches)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* get_switches)(struct _cef_command_line_t* self,
|
||||||
cef_string_map_t switches);
|
cef_string_map_t switches);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add a switch to the end of the command line.
|
// 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,
|
void(CEF_CALLBACK* append_switch)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add a switch with the specified value to the end of the command line. If
|
// Add a switch with the specified value to the end of the command line.
|
||||||
/// the switch has no value pass an NULL value string.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* append_switch_with_value)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* append_switch_with_value)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* name,
|
const cef_string_t* name,
|
||||||
const cef_string_t* value);
|
const cef_string_t* value);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// True if there are remaining command line arguments.
|
// 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.
|
// Get the remaining command line arguments.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_arguments)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* get_arguments)(struct _cef_command_line_t* self,
|
||||||
cef_string_list_t arguments);
|
cef_string_list_t arguments);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add an argument to the end of the command line.
|
// Add an argument to the end of the command line.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* append_argument)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* append_argument)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* argument);
|
const cef_string_t* argument);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Insert a command before the current command. Common for debuggers, like
|
// Insert a command before the current command. Common for debuggers, like
|
||||||
/// "valgrind" or "gdb --args".
|
// "valgrind" or "gdb --args".
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* prepend_wrapper)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* prepend_wrapper)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* wrapper);
|
const cef_string_t* wrapper);
|
||||||
} cef_command_line_t;
|
} cef_command_line_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new cef_command_line_t instance.
|
// Create a new cef_command_line_t instance.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_command_line_t* cef_command_line_create(void);
|
CEF_EXPORT cef_command_line_t* cef_command_line_create();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the singleton global cef_command_line_t object. The returned object
|
// Returns the singleton global cef_command_line_t object. The returned object
|
||||||
/// will be read-only.
|
// will be read-only.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_command_line_t* cef_command_line_get_global(void);
|
CEF_EXPORT cef_command_line_t* cef_command_line_get_global();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=3ae7dbb24ec7a95a2f4d4e390c9b6622221c2f42$
|
// $hash=175779df75a1405fcc5c337a09e6322c556698ba$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
|
||||||
@@ -52,67 +52,44 @@ extern "C" {
|
|||||||
struct _cef_context_menu_params_t;
|
struct _cef_context_menu_params_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure used for continuation of custom context menu display.
|
// Callback structure used for continuation of custom context menu display.
|
||||||
///
|
///
|
||||||
typedef struct _cef_run_context_menu_callback_t {
|
typedef struct _cef_run_context_menu_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Complete context menu display by selecting the specified |command_id| and
|
// Complete context menu display by selecting the specified |command_id| and
|
||||||
/// |event_flags|.
|
// |event_flags|.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_run_context_menu_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_run_context_menu_callback_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
cef_event_flags_t event_flags);
|
cef_event_flags_t event_flags);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Cancel context menu display.
|
// 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;
|
} cef_run_context_menu_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure used for continuation of custom quick menu display.
|
// Implement this structure to handle context menu events. The functions of this
|
||||||
///
|
// structure will be called on the UI thread.
|
||||||
typedef struct _cef_run_quick_menu_callback_t {
|
|
||||||
///
|
|
||||||
/// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Complete quick menu display by selecting the specified |command_id| and
|
|
||||||
/// |event_flags|.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_run_quick_menu_callback_t* self,
|
|
||||||
int command_id,
|
|
||||||
cef_event_flags_t event_flags);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Cancel quick menu display.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* cancel)(struct _cef_run_quick_menu_callback_t* self);
|
|
||||||
} cef_run_quick_menu_callback_t;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Implement this structure to handle context menu events. The functions of
|
|
||||||
/// this structure will be called on the UI thread.
|
|
||||||
///
|
///
|
||||||
typedef struct _cef_context_menu_handler_t {
|
typedef struct _cef_context_menu_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called before a context menu is displayed. |params| provides information
|
// Called before a context menu is displayed. |params| provides information
|
||||||
/// about the context menu state. |model| initially contains the default
|
// about the context menu state. |model| initially contains the default
|
||||||
/// context menu. The |model| can be cleared to show no context menu or
|
// context menu. The |model| can be cleared to show no context menu or
|
||||||
/// modified to show a custom menu. Do not keep references to |params| or
|
// modified to show a custom menu. Do not keep references to |params| or
|
||||||
/// |model| outside of this callback.
|
// |model| outside of this callback.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_before_context_menu)(
|
void(CEF_CALLBACK* on_before_context_menu)(
|
||||||
struct _cef_context_menu_handler_t* self,
|
struct _cef_context_menu_handler_t* self,
|
||||||
@@ -122,12 +99,12 @@ typedef struct _cef_context_menu_handler_t {
|
|||||||
struct _cef_menu_model_t* model);
|
struct _cef_menu_model_t* model);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to allow custom display of the context menu. |params| provides
|
// Called to allow custom display of the context menu. |params| provides
|
||||||
/// information about the context menu state. |model| contains the context
|
// information about the context menu state. |model| contains the context menu
|
||||||
/// menu model resulting from OnBeforeContextMenu. For custom display return
|
// model resulting from OnBeforeContextMenu. For custom display return true
|
||||||
/// true (1) and execute |callback| either synchronously or asynchronously
|
// (1) and execute |callback| either synchronously or asynchronously with the
|
||||||
/// with the selected command ID. For default display return false (0). Do not
|
// selected command ID. For default display return false (0). Do not keep
|
||||||
/// keep references to |params| or |model| outside of this callback.
|
// references to |params| or |model| outside of this callback.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* run_context_menu)(
|
int(CEF_CALLBACK* run_context_menu)(
|
||||||
struct _cef_context_menu_handler_t* self,
|
struct _cef_context_menu_handler_t* self,
|
||||||
@@ -138,13 +115,13 @@ typedef struct _cef_context_menu_handler_t {
|
|||||||
struct _cef_run_context_menu_callback_t* callback);
|
struct _cef_run_context_menu_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to execute a command selected from the context menu. Return true
|
// Called to execute a command selected from the context menu. Return true (1)
|
||||||
/// (1) if the command was handled or false (0) for the default
|
// if the command was handled or false (0) for the default implementation. See
|
||||||
/// implementation. See cef_menu_id_t for the command ids that have default
|
// cef_menu_id_t for the command ids that have default implementations. All
|
||||||
/// implementations. All user-defined command ids should be between
|
// user-defined command ids should be between MENU_ID_USER_FIRST and
|
||||||
/// MENU_ID_USER_FIRST and MENU_ID_USER_LAST. |params| will have the same
|
// MENU_ID_USER_LAST. |params| will have the same values as what was passed to
|
||||||
/// values as what was passed to on_before_context_menu(). Do not keep a
|
// on_before_context_menu(). Do not keep a reference to |params| outside of
|
||||||
/// reference to |params| outside of this callback.
|
// this callback.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_context_menu_command)(
|
int(CEF_CALLBACK* on_context_menu_command)(
|
||||||
struct _cef_context_menu_handler_t* self,
|
struct _cef_context_menu_handler_t* self,
|
||||||
@@ -155,207 +132,166 @@ typedef struct _cef_context_menu_handler_t {
|
|||||||
cef_event_flags_t event_flags);
|
cef_event_flags_t event_flags);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the context menu is dismissed irregardless of whether the menu
|
// Called when the context menu is dismissed irregardless of whether the menu
|
||||||
/// was canceled or a command was selected.
|
// was NULL or a command was selected.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_context_menu_dismissed)(
|
void(CEF_CALLBACK* on_context_menu_dismissed)(
|
||||||
struct _cef_context_menu_handler_t* self,
|
struct _cef_context_menu_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_frame_t* frame);
|
struct _cef_frame_t* frame);
|
||||||
|
|
||||||
///
|
|
||||||
/// Called to allow custom display of the quick menu for a windowless browser.
|
|
||||||
/// |location| is the top left corner of the selected region. |size| is the
|
|
||||||
/// size of the selected region. |edit_state_flags| is a combination of flags
|
|
||||||
/// that represent the state of the quick menu. Return true (1) if the menu
|
|
||||||
/// will be handled and execute |callback| either synchronously or
|
|
||||||
/// asynchronously with the selected command ID. Return false (0) to cancel
|
|
||||||
/// the menu.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* run_quick_menu)(
|
|
||||||
struct _cef_context_menu_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
struct _cef_frame_t* frame,
|
|
||||||
const cef_point_t* location,
|
|
||||||
const cef_size_t* size,
|
|
||||||
cef_quick_menu_edit_state_flags_t edit_state_flags,
|
|
||||||
struct _cef_run_quick_menu_callback_t* callback);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called to execute a command selected from the quick menu for a windowless
|
|
||||||
/// browser. Return true (1) if the command was handled or false (0) for the
|
|
||||||
/// default implementation. See cef_menu_id_t for command IDs that have
|
|
||||||
/// default implementations.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* on_quick_menu_command)(
|
|
||||||
struct _cef_context_menu_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
struct _cef_frame_t* frame,
|
|
||||||
int command_id,
|
|
||||||
cef_event_flags_t event_flags);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called when the quick menu for a windowless browser is dismissed
|
|
||||||
/// irregardless of whether the menu was canceled or a command was selected.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* on_quick_menu_dismissed)(
|
|
||||||
struct _cef_context_menu_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
struct _cef_frame_t* frame);
|
|
||||||
} cef_context_menu_handler_t;
|
} cef_context_menu_handler_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Provides information about the context menu state. The functions of this
|
// Provides information about the context menu state. The ethods of this
|
||||||
/// structure can only be accessed on browser process the UI thread.
|
// structure can only be accessed on browser process the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_context_menu_params_t {
|
typedef struct _cef_context_menu_params_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the X coordinate of the mouse where the context menu was invoked.
|
// Returns the X coordinate of the mouse where the context menu was invoked.
|
||||||
/// Coords are relative to the associated RenderView's origin.
|
// 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.
|
// Returns the Y coordinate of the mouse where the context menu was invoked.
|
||||||
/// Coords are relative to the associated RenderView's origin.
|
// 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
|
// Returns flags representing the type of node that the context menu was
|
||||||
/// invoked on.
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the URL of the link, if any, that encloses the node that the
|
// Returns the URL of the link, if any, that encloses the node that the
|
||||||
/// context menu was invoked on.
|
// context menu was invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the link URL, if any, to be used ONLY for "copy link address". We
|
// Returns the link URL, if any, to be used ONLY for "copy link address". We
|
||||||
/// don't validate this field in the frontend process.
|
// don't validate this field in the frontend process.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the source URL, if any, for the element that the context menu was
|
// Returns the source URL, if any, for the element that the context menu was
|
||||||
/// invoked on. Example of elements with source URLs are img, audio, and
|
// invoked on. Example of elements with source URLs are img, audio, and video.
|
||||||
/// video.
|
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the context menu was invoked on an image which has
|
// Returns true (1) if the context menu was invoked on an image which has non-
|
||||||
/// non-NULL contents.
|
// NULL contents.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* has_image_contents)(
|
int(CEF_CALLBACK* has_image_contents)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the title text or the alt text if the context menu was invoked on
|
// Returns the title text or the alt text if the context menu was invoked on
|
||||||
/// an image.
|
// an image.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the URL of the top level page that the context menu was invoked
|
// Returns the URL of the top level page that the context menu was invoked on.
|
||||||
/// on.
|
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the URL of the subframe that the context menu was invoked on.
|
// 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().
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the character encoding of the subframe that the context menu was
|
// Returns the character encoding of the subframe that the context menu was
|
||||||
/// invoked on.
|
// invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the type of context node that the context menu was invoked on.
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns flags representing the actions supported by the media element, if
|
// Returns flags representing the actions supported by the media element, if
|
||||||
/// any, that the context menu was invoked on.
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the text of the selection, if any, that the context menu was
|
// Returns the text of the selection, if any, that the context menu was
|
||||||
/// invoked on.
|
// invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the text of the misspelled word, if any, that the context menu was
|
// Returns the text of the misspelled word, if any, that the context menu was
|
||||||
/// invoked on.
|
// invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if suggestions exist, false (0) otherwise. Fills in
|
// Returns true (1) if suggestions exist, false (0) otherwise. Fills in
|
||||||
/// |suggestions| from the spell check service for the misspelled word if
|
// |suggestions| from the spell check service for the misspelled word if there
|
||||||
/// there is one.
|
// is one.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_dictionary_suggestions)(
|
int(CEF_CALLBACK* get_dictionary_suggestions)(
|
||||||
struct _cef_context_menu_params_t* self,
|
struct _cef_context_menu_params_t* self,
|
||||||
cef_string_list_t suggestions);
|
cef_string_list_t suggestions);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the context menu was invoked on an editable node.
|
// 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
|
// Returns true (1) if the context menu was invoked on an editable node where
|
||||||
/// spell-check is enabled.
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns flags representing the actions supported by the editable node, if
|
// Returns flags representing the actions supported by the editable node, if
|
||||||
/// any, that the context menu was invoked on.
|
// 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);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the context menu contains items specified by the
|
// Returns true (1) if the context menu contains items specified by the
|
||||||
/// renderer process.
|
// 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);
|
||||||
} cef_context_menu_params_t;
|
} cef_context_menu_params_t;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=76ba2e59636aa71c8c6286093198a1e64d012c62$
|
// $hash=b19ef1c8a781f8d59276357609fe64370bb8a107$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||||
@@ -52,29 +52,29 @@ struct _cef_delete_cookies_callback_t;
|
|||||||
struct _cef_set_cookie_callback_t;
|
struct _cef_set_cookie_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used for managing cookies. The functions of this structure may be
|
// Structure used for managing cookies. The functions of this structure may be
|
||||||
/// called on any thread unless otherwise indicated.
|
// called on any thread unless otherwise indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_cookie_manager_t {
|
typedef struct _cef_cookie_manager_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Visit all cookies on the UI thread. The returned cookies are ordered by
|
// Visit all cookies on the UI thread. The returned cookies are ordered by
|
||||||
/// longest path, then by earliest creation date. Returns false (0) if cookies
|
// longest path, then by earliest creation date. Returns false (0) if cookies
|
||||||
/// cannot be accessed.
|
// cannot be accessed.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* visit_all_cookies)(struct _cef_cookie_manager_t* self,
|
int(CEF_CALLBACK* visit_all_cookies)(struct _cef_cookie_manager_t* self,
|
||||||
struct _cef_cookie_visitor_t* visitor);
|
struct _cef_cookie_visitor_t* visitor);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Visit a subset of cookies on the UI thread. The results are filtered by
|
// Visit a subset of cookies on the UI thread. The results are filtered by the
|
||||||
/// the given url scheme, host, domain and path. If |includeHttpOnly| is true
|
// given url scheme, host, domain and path. If |includeHttpOnly| is true (1)
|
||||||
/// (1) HTTP-only cookies will also be included in the results. The returned
|
// HTTP-only cookies will also be included in the results. The returned
|
||||||
/// cookies are ordered by longest path, then by earliest creation date.
|
// cookies are ordered by longest path, then by earliest creation date.
|
||||||
/// Returns false (0) if cookies cannot be accessed.
|
// Returns false (0) if cookies cannot be accessed.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* visit_url_cookies)(struct _cef_cookie_manager_t* self,
|
int(CEF_CALLBACK* visit_url_cookies)(struct _cef_cookie_manager_t* self,
|
||||||
const cef_string_t* url,
|
const cef_string_t* url,
|
||||||
@@ -82,13 +82,13 @@ typedef struct _cef_cookie_manager_t {
|
|||||||
struct _cef_cookie_visitor_t* visitor);
|
struct _cef_cookie_visitor_t* visitor);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Sets a cookie given a valid URL and explicit user-provided cookie
|
// Sets a cookie given a valid URL and explicit user-provided cookie
|
||||||
/// attributes. This function expects each attribute to be well-formed. It
|
// attributes. This function expects each attribute to be well-formed. It will
|
||||||
/// will check for disallowed characters (e.g. the ';' character is disallowed
|
// check for disallowed characters (e.g. the ';' character is disallowed
|
||||||
/// within the cookie value attribute) and fail without setting the cookie if
|
// 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
|
// 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 UI thread after the cookie has been set. Returns
|
||||||
/// false (0) if an invalid URL is specified or if cookies cannot be accessed.
|
// 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,
|
int(CEF_CALLBACK* set_cookie)(struct _cef_cookie_manager_t* self,
|
||||||
const cef_string_t* url,
|
const cef_string_t* url,
|
||||||
@@ -96,15 +96,15 @@ typedef struct _cef_cookie_manager_t {
|
|||||||
struct _cef_set_cookie_callback_t* callback);
|
struct _cef_set_cookie_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Delete all cookies that match the specified parameters. If both |url| and
|
// Delete all cookies that match the specified parameters. If both |url| and
|
||||||
/// |cookie_name| values are specified all host and domain cookies matching
|
// |cookie_name| values are specified all host and domain cookies matching
|
||||||
/// both will be deleted. If only |url| is specified all host cookies (but not
|
// 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
|
// 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-
|
// 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 UI thread after the cookies
|
||||||
/// have been deleted. Returns false (0) if a non-NULL invalid URL is
|
// have been deleted. Returns false (0) if a non-NULL invalid URL is specified
|
||||||
/// specified or if cookies cannot be accessed. Cookies can alternately be
|
// or if cookies cannot be accessed. Cookies can alternately be deleted using
|
||||||
/// deleted using the Visit*Cookies() functions.
|
// the Visit*Cookies() functions.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* delete_cookies)(
|
int(CEF_CALLBACK* delete_cookies)(
|
||||||
struct _cef_cookie_manager_t* self,
|
struct _cef_cookie_manager_t* self,
|
||||||
@@ -113,41 +113,41 @@ typedef struct _cef_cookie_manager_t {
|
|||||||
struct _cef_delete_cookies_callback_t* callback);
|
struct _cef_delete_cookies_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Flush the backing store (if any) to disk. If |callback| is non-NULL it
|
// Flush the backing store (if any) to disk. If |callback| is non-NULL it will
|
||||||
/// will be executed asnychronously on the UI thread after the flush is
|
// be executed asnychronously on the UI thread after the flush is complete.
|
||||||
/// complete. Returns false (0) if cookies cannot be accessed.
|
// Returns false (0) if cookies cannot be accessed.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* flush_store)(struct _cef_cookie_manager_t* self,
|
int(CEF_CALLBACK* flush_store)(struct _cef_cookie_manager_t* self,
|
||||||
struct _cef_completion_callback_t* callback);
|
struct _cef_completion_callback_t* callback);
|
||||||
} cef_cookie_manager_t;
|
} cef_cookie_manager_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the global cookie manager. By default data will be stored at
|
// Returns the global cookie manager. By default data will be stored at
|
||||||
/// cef_settings_t.cache_path if specified or in memory otherwise. If |callback|
|
// CefSettings.cache_path if specified or in memory otherwise. If |callback| is
|
||||||
/// is non-NULL it will be executed asnychronously on the UI thread after the
|
// non-NULL it will be executed asnychronously on the UI thread after the
|
||||||
/// manager's storage has been initialized. Using this function is equivalent to
|
// manager's storage has been initialized. Using this function is equivalent to
|
||||||
/// calling cef_request_context_t::cef_request_context_get_global_context()-
|
// calling cef_request_context_t::cef_request_context_get_global_context()->GetD
|
||||||
/// >GetDefaultCookieManager().
|
// efaultCookieManager().
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
||||||
struct _cef_completion_callback_t* callback);
|
struct _cef_completion_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure to implement for visiting cookie values. The functions of this
|
// 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 UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_cookie_visitor_t {
|
typedef struct _cef_cookie_visitor_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be called once for each cookie. |count| is the 0-based
|
// Method that will be called once for each cookie. |count| is the 0-based
|
||||||
/// index for the current cookie. |total| is the total number of cookies. Set
|
// index for the current cookie. |total| is the total number of cookies. Set
|
||||||
/// |deleteCookie| to true (1) to delete the cookie currently being visited.
|
// |deleteCookie| to true (1) to delete the cookie currently being visited.
|
||||||
/// Return false (0) to stop visiting cookies. This function may never be
|
// Return false (0) to stop visiting cookies. This function may never be
|
||||||
/// called if no cookies are found.
|
// called if no cookies are found.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* visit)(struct _cef_cookie_visitor_t* self,
|
int(CEF_CALLBACK* visit)(struct _cef_cookie_visitor_t* self,
|
||||||
const struct _cef_cookie_t* cookie,
|
const struct _cef_cookie_t* cookie,
|
||||||
@@ -157,36 +157,36 @@ typedef struct _cef_cookie_visitor_t {
|
|||||||
} cef_cookie_visitor_t;
|
} cef_cookie_visitor_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure to implement to be notified of asynchronous completion via
|
// Structure to implement to be notified of asynchronous completion via
|
||||||
/// cef_cookie_manager_t::set_cookie().
|
// cef_cookie_manager_t::set_cookie().
|
||||||
///
|
///
|
||||||
typedef struct _cef_set_cookie_callback_t {
|
typedef struct _cef_set_cookie_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be called upon completion. |success| will be true (1) if
|
// Method that will be called upon completion. |success| will be true (1) if
|
||||||
/// the cookie was set successfully.
|
// the cookie was set successfully.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_complete)(struct _cef_set_cookie_callback_t* self,
|
void(CEF_CALLBACK* on_complete)(struct _cef_set_cookie_callback_t* self,
|
||||||
int success);
|
int success);
|
||||||
} cef_set_cookie_callback_t;
|
} cef_set_cookie_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure to implement to be notified of asynchronous completion via
|
// Structure to implement to be notified of asynchronous completion via
|
||||||
/// cef_cookie_manager_t::delete_cookies().
|
// cef_cookie_manager_t::delete_cookies().
|
||||||
///
|
///
|
||||||
typedef struct _cef_delete_cookies_callback_t {
|
typedef struct _cef_delete_cookies_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be called upon completion. |num_deleted| will be the
|
// Method that will be called upon completion. |num_deleted| will be the
|
||||||
/// number of cookies that were deleted.
|
// number of cookies that were deleted.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_complete)(struct _cef_delete_cookies_callback_t* self,
|
void(CEF_CALLBACK* on_complete)(struct _cef_delete_cookies_callback_t* self,
|
||||||
int num_deleted);
|
int num_deleted);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=46a6432f66cce88d8597c3d070681b09a712dc54$
|
// $hash=5e19231e3476eef376c2742e8d375bee7bd4ea2d$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
|
||||||
@@ -47,102 +47,99 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Crash reporting is configured using an INI-style config file named
|
// 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
|
// "crash_reporter.cfg". On Windows and Linux this file must be placed next to
|
||||||
/// the main application executable. On macOS this file must be placed in the
|
// the main application executable. On macOS this file must be placed in the
|
||||||
/// top-level app bundle Resources directory (e.g.
|
// top-level app bundle Resources directory (e.g.
|
||||||
/// "<appname>.app/Contents/Resources"). File contents are as follows:
|
// "<appname>.app/Contents/Resources"). File contents are as follows:
|
||||||
|
//
|
||||||
|
// # Comments start with a hash character and must be on their own line.
|
||||||
|
//
|
||||||
|
// [Config]
|
||||||
|
// ProductName=<Value of the "prod" crash key; defaults to "cef">
|
||||||
|
// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
|
||||||
|
// AppName=<Windows only; App-specific folder name component for storing crash
|
||||||
|
// 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;
|
||||||
|
// default to 5>
|
||||||
|
// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value
|
||||||
|
// will cause older reports to be deleted; default to 20>
|
||||||
|
// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted;
|
||||||
|
// default to 5>
|
||||||
|
//
|
||||||
|
// [CrashKeys]
|
||||||
|
// my_key1=<small|medium|large>
|
||||||
|
// my_key2=<small|medium|large>
|
||||||
|
//
|
||||||
|
// Config section:
|
||||||
|
//
|
||||||
|
// If "ProductName" and/or "ProductVersion" are set then the specified values
|
||||||
|
// will be included in the crash dump metadata. On macOS if these values are set
|
||||||
|
// to NULL then they will be retrieved from the Info.plist file using the
|
||||||
|
// "CFBundleName" and "CFBundleShortVersionString" keys respectively.
|
||||||
|
//
|
||||||
|
// If "AppName" is set on Windows then crash report information (metrics,
|
||||||
|
// database and dumps) will be stored locally on disk under the
|
||||||
|
// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other
|
||||||
|
// platforms the CefSettings.user_data_path value will be used.
|
||||||
|
//
|
||||||
|
// If "ExternalHandler" is set on Windows then the specified exe will be
|
||||||
|
// launched as the crashpad-handler instead of re-launching the main process
|
||||||
|
// exe. The value can be an absolute path or a path relative to the main exe
|
||||||
|
// 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.
|
||||||
|
//
|
||||||
|
// If "RateLimitEnabled" is set to true (1) then crash report uploads will be
|
||||||
|
// rate limited as follows:
|
||||||
|
// 1. If "MaxUploadsPerDay" is set to a positive value then at most the
|
||||||
|
// specified number of crashes will be uploaded in each 24 hour period.
|
||||||
|
// 2. If crash upload fails due to a network or server error then an
|
||||||
|
// incremental backoff delay up to a maximum of 24 hours will be applied for
|
||||||
|
// retries.
|
||||||
|
// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the
|
||||||
|
// "MaxUploadsPerDay" value will be reduced to 1 until the client is
|
||||||
|
// restarted. This helps to avoid an upload flood when the network or
|
||||||
|
// server error is resolved.
|
||||||
|
// Rate limiting is not supported on Linux.
|
||||||
|
//
|
||||||
|
// If "MaxDatabaseSizeInMb" is set to a positive value then crash report storage
|
||||||
|
// on disk will be limited to that size in megabytes. For example, on Windows
|
||||||
|
// each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 equates to
|
||||||
|
// about 34 crash reports stored on disk. Not supported on Linux.
|
||||||
|
//
|
||||||
|
// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports older
|
||||||
|
// than the specified age in days will be deleted. Not supported on Linux.
|
||||||
|
//
|
||||||
|
// 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.
|
||||||
///
|
///
|
||||||
/// <pre>
|
CEF_EXPORT int cef_crash_reporting_enabled();
|
||||||
/// # Comments start with a hash character and must be on their own line.
|
|
||||||
///
|
|
||||||
/// [Config]
|
|
||||||
/// ProductName=<Value of the "prod" crash key; defaults to "cef">
|
|
||||||
/// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
|
|
||||||
/// AppName=<Windows only; App-specific folder name component for storing crash
|
|
||||||
/// 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;
|
|
||||||
/// default to 5>
|
|
||||||
/// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value
|
|
||||||
/// will cause older reports to be deleted; default to 20>
|
|
||||||
/// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted;
|
|
||||||
/// default to 5>
|
|
||||||
///
|
|
||||||
/// [CrashKeys]
|
|
||||||
/// my_key1=<small|medium|large>
|
|
||||||
/// my_key2=<small|medium|large>
|
|
||||||
/// </pre>
|
|
||||||
///
|
|
||||||
/// <b>Config section:</b>
|
|
||||||
///
|
|
||||||
/// If "ProductName" and/or "ProductVersion" are set then the specified values
|
|
||||||
/// will be included in the crash dump metadata. On macOS if these values are
|
|
||||||
/// set to NULL then they will be retrieved from the Info.plist file using the
|
|
||||||
/// "CFBundleName" and "CFBundleShortVersionString" keys respectively.
|
|
||||||
///
|
|
||||||
/// If "AppName" is set on Windows then crash report information (metrics,
|
|
||||||
/// database and dumps) will be stored locally on disk under the
|
|
||||||
/// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other
|
|
||||||
/// platforms the cef_settings_t.root_cache_path value will be used.
|
|
||||||
///
|
|
||||||
/// If "ExternalHandler" is set on Windows then the specified exe will be
|
|
||||||
/// launched as the crashpad-handler instead of re-launching the main process
|
|
||||||
/// exe. The value can be an absolute path or a path relative to the main exe
|
|
||||||
/// directory. On Linux the cef_settings_t.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.
|
|
||||||
///
|
|
||||||
/// If "RateLimitEnabled" is set to true (1) then crash report uploads will be
|
|
||||||
/// rate limited as follows:
|
|
||||||
/// 1. If "MaxUploadsPerDay" is set to a positive value then at most the
|
|
||||||
/// specified number of crashes will be uploaded in each 24 hour period.
|
|
||||||
/// 2. If crash upload fails due to a network or server error then an
|
|
||||||
/// incremental backoff delay up to a maximum of 24 hours will be applied
|
|
||||||
/// for retries.
|
|
||||||
/// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the
|
|
||||||
/// "MaxUploadsPerDay" value will be reduced to 1 until the client is
|
|
||||||
/// restarted. This helps to avoid an upload flood when the network or
|
|
||||||
/// server error is resolved.
|
|
||||||
/// Rate limiting is not supported on Linux.
|
|
||||||
///
|
|
||||||
/// If "MaxDatabaseSizeInMb" is set to a positive value then crash report
|
|
||||||
/// storage on disk will be limited to that size in megabytes. For example, on
|
|
||||||
/// Windows each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20
|
|
||||||
/// equates to about 34 crash reports stored on disk. Not supported on Linux.
|
|
||||||
///
|
|
||||||
/// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports
|
|
||||||
/// older than the specified age in days will be deleted. Not supported on
|
|
||||||
/// Linux.
|
|
||||||
///
|
|
||||||
/// <b>CrashKeys section:</b>
|
|
||||||
///
|
|
||||||
/// 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.
|
|
||||||
///
|
|
||||||
CEF_EXPORT int cef_crash_reporting_enabled(void);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Sets or clears a specific key-value pair from the crash metadata.
|
// 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,
|
CEF_EXPORT void cef_set_crash_key_value(const cef_string_t* key,
|
||||||
const cef_string_t* value);
|
const cef_string_t* value);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=dd94c50619e92bf5bed4fe61479813ee559f779d$
|
// $hash=1a256c04042ebd4867f39e1c31def558871b2bab$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_
|
||||||
@@ -49,36 +49,35 @@ extern "C" {
|
|||||||
struct _cef_browser_t;
|
struct _cef_browser_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The
|
// Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The
|
||||||
/// functions of this structure will be called on the browser process UI thread.
|
// functions of this structure will be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_dev_tools_message_observer_t {
|
typedef struct _cef_dev_tools_message_observer_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be called on receipt of a DevTools protocol message.
|
// Method that will be called on receipt of a DevTools protocol message.
|
||||||
/// |browser| is the originating browser instance. |message| is a UTF8-encoded
|
// |browser| is the originating browser instance. |message| is a UTF8-encoded
|
||||||
/// JSON dictionary representing either a function result or an event.
|
// JSON dictionary representing either a function result or an event.
|
||||||
/// |message| is only valid for the scope of this callback and should be
|
// |message| is only valid for the scope of this callback and should be copied
|
||||||
/// copied if necessary. Return true (1) if the message was handled or false
|
// if necessary. Return true (1) if the message was handled or false (0) if
|
||||||
/// (0) if the message should be further processed and passed to the
|
// the message should be further processed and passed to the
|
||||||
/// OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate.
|
// OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate.
|
||||||
///
|
//
|
||||||
/// Method result dictionaries include an "id" (int) value that identifies the
|
// Method result dictionaries include an "id" (int) value that identifies the
|
||||||
/// orginating function call sent from
|
// orginating function call sent from cef_browser_host_t::SendDevToolsMessage,
|
||||||
/// cef_browser_host_t::SendDevToolsMessage, and optionally either a "result"
|
// and optionally either a "result" (dictionary) or "error" (dictionary)
|
||||||
/// (dictionary) or "error" (dictionary) value. The "error" dictionary will
|
// value. The "error" dictionary will contain "code" (int) and "message"
|
||||||
/// contain "code" (int) and "message" (string) values. Event dictionaries
|
// (string) values. Event dictionaries include a "function" (string) value and
|
||||||
/// include a "function" (string) value and optionally a "params" (dictionary)
|
// optionally a "params" (dictionary) value. See the DevTools protocol
|
||||||
/// value. See the DevTools protocol documentation at
|
// documentation at https://chromedevtools.github.io/devtools-protocol/ for
|
||||||
/// https://chromedevtools.github.io/devtools-protocol/ for details of
|
// details of supported function calls and the expected "result" or "params"
|
||||||
/// supported function calls and the expected "result" or "params" dictionary
|
// dictionary contents. JSON dictionaries can be parsed using the CefParseJSON
|
||||||
/// contents. JSON dictionaries can be parsed using the CefParseJSON function
|
// function if desired, however be aware of performance considerations when
|
||||||
/// if desired, however be aware of performance considerations when parsing
|
// parsing large messages (some of which may exceed 1MB in size).
|
||||||
/// large messages (some of which may exceed 1MB in size).
|
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_dev_tools_message)(
|
int(CEF_CALLBACK* on_dev_tools_message)(
|
||||||
struct _cef_dev_tools_message_observer_t* self,
|
struct _cef_dev_tools_message_observer_t* self,
|
||||||
@@ -87,16 +86,16 @@ typedef struct _cef_dev_tools_message_observer_t {
|
|||||||
size_t message_size);
|
size_t message_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be called after attempted execution of a DevTools
|
// Method that will be called after attempted execution of a DevTools protocol
|
||||||
/// protocol function. |browser| is the originating browser instance.
|
// function. |browser| is the originating browser instance. |message_id| is
|
||||||
/// |message_id| is the "id" value that identifies the originating function
|
// the "id" value that identifies the originating function call message. If
|
||||||
/// call message. If the function succeeded |success| will be true (1) and
|
// the function succeeded |success| will be true (1) and |result| will be the
|
||||||
/// |result| will be the UTF8-encoded JSON "result" dictionary value (which
|
// UTF8-encoded JSON "result" dictionary value (which may be NULL). If the
|
||||||
/// may be NULL). If the function failed |success| will be false (0) and
|
// function failed |success| will be false (0) and |result| will be the
|
||||||
/// |result| will be the UTF8-encoded JSON "error" dictionary value. |result|
|
// UTF8-encoded JSON "error" dictionary value. |result| is only valid for the
|
||||||
/// is only valid for the scope of this callback and should be copied if
|
// scope of this callback and should be copied if necessary. See the
|
||||||
/// necessary. See the OnDevToolsMessage documentation for additional details
|
// OnDevToolsMessage documentation for additional details on |result|
|
||||||
/// on |result| contents.
|
// contents.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_dev_tools_method_result)(
|
void(CEF_CALLBACK* on_dev_tools_method_result)(
|
||||||
struct _cef_dev_tools_message_observer_t* self,
|
struct _cef_dev_tools_message_observer_t* self,
|
||||||
@@ -107,12 +106,12 @@ typedef struct _cef_dev_tools_message_observer_t {
|
|||||||
size_t result_size);
|
size_t result_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be called on receipt of a DevTools protocol event.
|
// Method that will be called on receipt of a DevTools protocol event.
|
||||||
/// |browser| is the originating browser instance. |function| is the
|
// |browser| is the originating browser instance. |function| is the "function"
|
||||||
/// "function" value. |params| is the UTF8-encoded JSON "params" dictionary
|
// value. |params| is the UTF8-encoded JSON "params" dictionary value (which
|
||||||
/// value (which may be NULL). |params| is only valid for the scope of this
|
// may be NULL). |params| is only valid for the scope of this callback and
|
||||||
/// callback and should be copied if necessary. See the OnDevToolsMessage
|
// should be copied if necessary. See the OnDevToolsMessage documentation for
|
||||||
/// documentation for additional details on |params| contents.
|
// additional details on |params| contents.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_dev_tools_event)(
|
void(CEF_CALLBACK* on_dev_tools_event)(
|
||||||
struct _cef_dev_tools_message_observer_t* self,
|
struct _cef_dev_tools_message_observer_t* self,
|
||||||
@@ -122,19 +121,19 @@ typedef struct _cef_dev_tools_message_observer_t {
|
|||||||
size_t params_size);
|
size_t params_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be called when the DevTools agent has attached. |browser|
|
// Method that will be called when the DevTools agent has attached. |browser|
|
||||||
/// is the originating browser instance. This will generally occur in response
|
// is the originating browser instance. This will generally occur in response
|
||||||
/// to the first message sent while the agent is detached.
|
// to the first message sent while the agent is detached.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_dev_tools_agent_attached)(
|
void(CEF_CALLBACK* on_dev_tools_agent_attached)(
|
||||||
struct _cef_dev_tools_message_observer_t* self,
|
struct _cef_dev_tools_message_observer_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be called when the DevTools agent has detached. |browser|
|
// Method that will be called when the DevTools agent has detached. |browser|
|
||||||
/// is the originating browser instance. Any function results that were
|
// is the originating browser instance. Any function results that were pending
|
||||||
/// pending before the agent became detached will not be delivered, and any
|
// before the agent became detached will not be delivered, and any active
|
||||||
/// active event subscriptions will be canceled.
|
// event subscriptions will be canceled.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_dev_tools_agent_detached)(
|
void(CEF_CALLBACK* on_dev_tools_agent_detached)(
|
||||||
struct _cef_dev_tools_message_observer_t* self,
|
struct _cef_dev_tools_message_observer_t* self,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=5644fdc2453dd083079bf9e3616b687eeb49f250$
|
// $hash=5ae5556e4085faf8cf17ee757f5eeac9197f75c0$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
|
||||||
@@ -48,51 +48,55 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure for asynchronous continuation of file dialog requests.
|
// Callback structure for asynchronous continuation of file dialog requests.
|
||||||
///
|
///
|
||||||
typedef struct _cef_file_dialog_callback_t {
|
typedef struct _cef_file_dialog_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Continue the file selection. |file_paths| should be a single value or a
|
// Continue the file selection. |selected_accept_filter| should be the 0-based
|
||||||
/// list of values depending on the dialog mode. An NULL |file_paths| value is
|
// index of the value selected from the accept filters array passed to
|
||||||
/// treated the same as calling cancel().
|
// cef_dialog_handler_t::OnFileDialog. |file_paths| should be a single value
|
||||||
|
// 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,
|
void(CEF_CALLBACK* cont)(struct _cef_file_dialog_callback_t* self,
|
||||||
|
int selected_accept_filter,
|
||||||
cef_string_list_t file_paths);
|
cef_string_list_t file_paths);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Cancel the file selection.
|
// 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;
|
} cef_file_dialog_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle dialog events. The functions of this
|
// Implement this structure to handle dialog events. The functions of this
|
||||||
/// structure will be called on the browser process UI thread.
|
// structure will be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_dialog_handler_t {
|
typedef struct _cef_dialog_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to run a file chooser dialog. |mode| represents the type of dialog
|
// Called to run a file chooser dialog. |mode| represents the type of dialog
|
||||||
/// to display. |title| to the title to be used for the dialog and may be NULL
|
// to display. |title| to the title to be used for the dialog and may be NULL
|
||||||
/// to show the default title ("Open" or "Save" depending on the mode).
|
// to show the default title ("Open" or "Save" depending on the mode).
|
||||||
/// |default_file_path| is the path with optional directory and/or file name
|
// |default_file_path| is the path with optional directory and/or file name
|
||||||
/// component that should be initially selected in the dialog.
|
// component that should be initially selected in the dialog. |accept_filters|
|
||||||
/// |accept_filters| are used to restrict the selectable file types and may
|
// are used to restrict the selectable file types and may any combination of
|
||||||
/// any combination of (a) valid lower-cased MIME types (e.g. "text/*" or
|
// (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b)
|
||||||
/// "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c)
|
// individual file extensions (e.g. ".txt" or ".png"), or (c) combined
|
||||||
/// combined description and file extension delimited using "|" and ";" (e.g.
|
// description and file extension delimited using "|" and ";" (e.g. "Image
|
||||||
/// "Image Types|.png;.gif;.jpg"). To display a custom dialog return true (1)
|
// Types|.png;.gif;.jpg"). |selected_accept_filter| is the 0-based index of
|
||||||
/// and execute |callback| either inline or at a later time. To display the
|
// the filter that should be selected by default. To display a custom dialog
|
||||||
/// default dialog return false (0).
|
// 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)(
|
int(CEF_CALLBACK* on_file_dialog)(
|
||||||
struct _cef_dialog_handler_t* self,
|
struct _cef_dialog_handler_t* self,
|
||||||
@@ -101,6 +105,7 @@ typedef struct _cef_dialog_handler_t {
|
|||||||
const cef_string_t* title,
|
const cef_string_t* title,
|
||||||
const cef_string_t* default_file_path,
|
const cef_string_t* default_file_path,
|
||||||
cef_string_list_t accept_filters,
|
cef_string_list_t accept_filters,
|
||||||
|
int selected_accept_filter,
|
||||||
struct _cef_file_dialog_callback_t* callback);
|
struct _cef_file_dialog_callback_t* callback);
|
||||||
} cef_dialog_handler_t;
|
} cef_dialog_handler_t;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=5a99c5e88ea0e123087234b2795fa625fed183f2$
|
// $hash=067fd169a30bec1ad8eeacc5ab1ac750cf59640e$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||||
@@ -49,17 +49,17 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to browser display state.
|
// Implement this structure to handle events related to browser display state.
|
||||||
/// The functions of this structure will be called on the UI thread.
|
// The functions of this structure will be called on the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_display_handler_t {
|
typedef struct _cef_display_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a frame's address has changed.
|
// Called when a frame's address has changed.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_address_change)(struct _cef_display_handler_t* self,
|
void(CEF_CALLBACK* on_address_change)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -67,30 +67,25 @@ typedef struct _cef_display_handler_t {
|
|||||||
const cef_string_t* url);
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the page title changes.
|
// Called when the page title changes.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_title_change)(struct _cef_display_handler_t* self,
|
void(CEF_CALLBACK* on_title_change)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
const cef_string_t* title);
|
const cef_string_t* title);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the page icon changes.
|
// Called when the page icon changes.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_favicon_urlchange)(struct _cef_display_handler_t* self,
|
void(CEF_CALLBACK* on_favicon_urlchange)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
cef_string_list_t icon_urls);
|
cef_string_list_t icon_urls);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when web content in the page has toggled fullscreen mode. If
|
// Called when web content in the page has toggled fullscreen mode. If
|
||||||
/// |fullscreen| is true (1) the content will automatically be sized to fill
|
// |fullscreen| is true (1) the content will automatically be sized to fill
|
||||||
/// the browser content area. If |fullscreen| is false (0) the content will
|
// the browser content area. If |fullscreen| is false (0) the content will
|
||||||
/// automatically return to its original size and position. With the Alloy
|
// automatically return to its original size and position. The client is
|
||||||
/// runtime the client is responsible for triggering the fullscreen transition
|
// responsible for resizing the browser if desired.
|
||||||
/// (for example, by calling cef_window_t::SetFullscreen when using Views).
|
|
||||||
/// With the Chrome runtime the fullscreen transition will be triggered
|
|
||||||
/// automatically. The cef_window_delegate_t::OnWindowFullscreenTransition
|
|
||||||
/// function will be called during the fullscreen transition for notification
|
|
||||||
/// purposes.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_fullscreen_mode_change)(
|
void(CEF_CALLBACK* on_fullscreen_mode_change)(
|
||||||
struct _cef_display_handler_t* self,
|
struct _cef_display_handler_t* self,
|
||||||
@@ -98,28 +93,28 @@ typedef struct _cef_display_handler_t {
|
|||||||
int fullscreen);
|
int fullscreen);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the browser is about to display a tooltip. |text| contains the
|
// Called when the browser is about to display a tooltip. |text| contains the
|
||||||
/// text that will be displayed in the tooltip. To handle the display of the
|
// text that will be displayed in the tooltip. To handle the display of the
|
||||||
/// tooltip yourself return true (1). Otherwise, you can optionally modify
|
// tooltip yourself return true (1). Otherwise, you can optionally modify
|
||||||
/// |text| and then return false (0) to allow the browser to display the
|
// |text| and then return false (0) to allow the browser to display the
|
||||||
/// tooltip. When window rendering is disabled the application is responsible
|
// tooltip. When window rendering is disabled the application is responsible
|
||||||
/// for drawing tooltips and the return value is ignored.
|
// for drawing tooltips and the return value is ignored.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_tooltip)(struct _cef_display_handler_t* self,
|
int(CEF_CALLBACK* on_tooltip)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
cef_string_t* text);
|
cef_string_t* text);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the browser receives a status message. |value| contains the
|
// Called when the browser receives a status message. |value| contains the
|
||||||
/// text that will be displayed in the status message.
|
// text that will be displayed in the status message.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_status_message)(struct _cef_display_handler_t* self,
|
void(CEF_CALLBACK* on_status_message)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
const cef_string_t* value);
|
const cef_string_t* value);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to display a console message. Return true (1) to stop the message
|
// Called to display a console message. Return true (1) to stop the message
|
||||||
/// from being output to the console.
|
// from being output to the console.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_console_message)(struct _cef_display_handler_t* self,
|
int(CEF_CALLBACK* on_console_message)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -129,18 +124,18 @@ typedef struct _cef_display_handler_t {
|
|||||||
int line);
|
int line);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when auto-resize is enabled via
|
// Called when auto-resize is enabled via
|
||||||
/// cef_browser_host_t::SetAutoResizeEnabled and the contents have auto-
|
// cef_browser_host_t::SetAutoResizeEnabled and the contents have auto-
|
||||||
/// resized. |new_size| will be the desired size in view coordinates. Return
|
// 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.
|
// 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,
|
int(CEF_CALLBACK* on_auto_resize)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
const cef_size_t* new_size);
|
const cef_size_t* new_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the overall page loading progress has changed. |progress|
|
// Called when the overall page loading progress has changed. |progress|
|
||||||
/// ranges from 0.0 to 1.0.
|
// ranges from 0.0 to 1.0.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_loading_progress_change)(
|
void(CEF_CALLBACK* on_loading_progress_change)(
|
||||||
struct _cef_display_handler_t* self,
|
struct _cef_display_handler_t* self,
|
||||||
@@ -148,27 +143,17 @@ typedef struct _cef_display_handler_t {
|
|||||||
double progress);
|
double progress);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
|
// 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.
|
// |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
|
// Return true (1) if the cursor change was handled or false (0) for default
|
||||||
/// handling.
|
// handling.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_cursor_change)(
|
int(CEF_CALLBACK* on_cursor_change)(
|
||||||
struct _cef_display_handler_t* self,
|
struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
cef_cursor_handle_t cursor,
|
cef_cursor_handle_t cursor,
|
||||||
cef_cursor_type_t type,
|
cef_cursor_type_t type,
|
||||||
const cef_cursor_info_t* custom_cursor_info);
|
const struct _cef_cursor_info_t* custom_cursor_info);
|
||||||
|
|
||||||
///
|
|
||||||
/// Called when the browser's access to an audio and/or video source has
|
|
||||||
/// changed.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* on_media_access_change)(
|
|
||||||
struct _cef_display_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
int has_video_access,
|
|
||||||
int has_audio_access);
|
|
||||||
} cef_display_handler_t;
|
} cef_display_handler_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=a4d2f79163205ed4367916546240a6aedc2165f9$
|
// $hash=0517dc6c42fdde9fecfc4549fab1ea12b614e143$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
|
||||||
@@ -50,120 +50,120 @@ struct _cef_domdocument_t;
|
|||||||
struct _cef_domnode_t;
|
struct _cef_domnode_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure to implement for visiting the DOM. The functions of this structure
|
// Structure to implement for visiting the DOM. The functions of this structure
|
||||||
/// will be called on the render process main thread.
|
// will be called on the render process main thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_domvisitor_t {
|
typedef struct _cef_domvisitor_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method executed for visiting the DOM. The document object passed to this
|
// Method executed for visiting the DOM. The document object passed to this
|
||||||
/// function represents a snapshot of the DOM at the time this function is
|
// function represents a snapshot of the DOM at the time this function is
|
||||||
/// executed. DOM objects are only valid for the scope of this function. Do
|
// executed. DOM objects are only valid for the scope of this function. Do not
|
||||||
/// not keep references to or attempt to access any DOM objects outside the
|
// keep references to or attempt to access any DOM objects outside the scope
|
||||||
/// scope of this function.
|
// of this function.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* visit)(struct _cef_domvisitor_t* self,
|
void(CEF_CALLBACK* visit)(struct _cef_domvisitor_t* self,
|
||||||
struct _cef_domdocument_t* document);
|
struct _cef_domdocument_t* document);
|
||||||
} cef_domvisitor_t;
|
} cef_domvisitor_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to represent a DOM document. The functions of this structure
|
// Structure used to represent a DOM document. The functions of this structure
|
||||||
/// should only be called on the render process main thread thread.
|
// should only be called on the render process main thread thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_domdocument_t {
|
typedef struct _cef_domdocument_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the document type.
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the root document node.
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the BODY node of an HTML document.
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the HEAD node of an HTML document.
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the title of an HTML document.
|
// Returns the title of an HTML document.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the document element with the specified ID value.
|
// Returns the document element with the specified ID value.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t*(CEF_CALLBACK* get_element_by_id)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_element_by_id)(
|
||||||
struct _cef_domdocument_t* self,
|
struct _cef_domdocument_t* self,
|
||||||
const cef_string_t* id);
|
const cef_string_t* id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the node that currently has keyboard focus.
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if a portion of the document is selected.
|
// 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.
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the selection offset within the end node.
|
// 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.
|
// Returns the contents of this selection as markup.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the contents of this selection as text.
|
// Returns the contents of this selection as text.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the base URL for the document.
|
// Returns the base URL for the document.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns a complete URL based on the document base URL and the specified
|
// Returns a complete URL based on the document base URL and the specified
|
||||||
/// partial URL.
|
// partial URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t(CEF_CALLBACK* get_complete_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_complete_url)(
|
||||||
@@ -172,138 +172,141 @@ typedef struct _cef_domdocument_t {
|
|||||||
} cef_domdocument_t;
|
} cef_domdocument_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to represent a DOM node. The functions of this structure
|
// Structure used to represent a DOM node. The functions of this structure
|
||||||
/// should only be called on the render process main thread.
|
// should only be called on the render process main thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_domnode_t {
|
typedef struct _cef_domnode_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the type for this node.
|
// 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.
|
// 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.
|
// 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.
|
// 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.
|
// 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.
|
// Returns the type of this form control element node.
|
||||||
///
|
///
|
||||||
cef_dom_form_control_type_t(CEF_CALLBACK* get_form_control_element_type)(
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
|
cef_string_userfree_t(CEF_CALLBACK* get_form_control_element_type)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is pointing to the same handle as |that|
|
// Returns true (1) if this object is pointing to the same handle as |that|
|
||||||
/// object.
|
// object.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_same)(struct _cef_domnode_t* self,
|
int(CEF_CALLBACK* is_same)(struct _cef_domnode_t* self,
|
||||||
struct _cef_domnode_t* that);
|
struct _cef_domnode_t* that);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the name of this node.
|
// Returns the name of this node.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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.
|
// Returns the value of this node.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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.
|
// Set the value of this node. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_value)(struct _cef_domnode_t* self,
|
int(CEF_CALLBACK* set_value)(struct _cef_domnode_t* self,
|
||||||
const cef_string_t* value);
|
const cef_string_t* value);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the contents of this node as markup.
|
// Returns the contents of this node as markup.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the document associated with this node.
|
// 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);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the parent node.
|
// 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.
|
// 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);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the next sibling node.
|
// 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);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this node has child nodes.
|
// 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.
|
// 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);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the last child node.
|
// 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);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
|
// The following functions are valid only for element nodes.
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the tag name of this element.
|
// Returns the tag name of this element.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this element has attributes.
|
// 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|.
|
// Returns true (1) if this element has an attribute named |attrName|.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* has_element_attribute)(struct _cef_domnode_t* self,
|
int(CEF_CALLBACK* has_element_attribute)(struct _cef_domnode_t* self,
|
||||||
const cef_string_t* attrName);
|
const cef_string_t* attrName);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the element attribute named |attrName|.
|
// Returns the element attribute named |attrName|.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t(CEF_CALLBACK* get_element_attribute)(
|
cef_string_userfree_t(CEF_CALLBACK* get_element_attribute)(
|
||||||
@@ -311,29 +314,28 @@ typedef struct _cef_domnode_t {
|
|||||||
const cef_string_t* attrName);
|
const cef_string_t* attrName);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns a map of all element attributes.
|
// Returns a map of all element attributes.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_element_attributes)(struct _cef_domnode_t* self,
|
void(CEF_CALLBACK* get_element_attributes)(struct _cef_domnode_t* self,
|
||||||
cef_string_map_t attrMap);
|
cef_string_map_t attrMap);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the value for the element attribute named |attrName|. Returns true (1)
|
// Set the value for the element attribute named |attrName|. Returns true (1)
|
||||||
/// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_element_attribute)(struct _cef_domnode_t* self,
|
int(CEF_CALLBACK* set_element_attribute)(struct _cef_domnode_t* self,
|
||||||
const cef_string_t* attrName,
|
const cef_string_t* attrName,
|
||||||
const cef_string_t* value);
|
const cef_string_t* value);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the inner text of the element.
|
// Returns the inner text of the element.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the bounds of the element in device pixels. Use
|
// Returns the bounds of the element.
|
||||||
/// "window.devicePixelRatio" to convert to/from CSS pixels.
|
|
||||||
///
|
///
|
||||||
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;
|
} cef_domnode_t;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=60a08a60be70e8fe5df17f18f8e5758e1830d5e1$
|
// $hash=f0ceb73b289072a01c45c6e7abf339a4ec924d29$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
|
||||||
@@ -49,19 +49,19 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure used to asynchronously continue a download.
|
// Callback structure used to asynchronously continue a download.
|
||||||
///
|
///
|
||||||
typedef struct _cef_before_download_callback_t {
|
typedef struct _cef_before_download_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Call to continue the download. Set |download_path| to the full file path
|
// Call to continue the download. Set |download_path| to the full file path
|
||||||
/// for the download including the file name or leave blank to use the
|
// for the download including the file name or leave blank to use the
|
||||||
/// suggested name and the default temp directory. Set |show_dialog| to true
|
// suggested name and the default temp directory. Set |show_dialog| to true
|
||||||
/// (1) if you do wish to show the default "Save As" dialog.
|
// (1) if you do wish to show the default "Save As" dialog.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_before_download_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_before_download_callback_t* self,
|
||||||
const cef_string_t* download_path,
|
const cef_string_t* download_path,
|
||||||
@@ -69,58 +69,46 @@ typedef struct _cef_before_download_callback_t {
|
|||||||
} cef_before_download_callback_t;
|
} cef_before_download_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure used to asynchronously cancel a download.
|
// Callback structure used to asynchronously cancel a download.
|
||||||
///
|
///
|
||||||
typedef struct _cef_download_item_callback_t {
|
typedef struct _cef_download_item_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Call to cancel the download.
|
// 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.
|
// 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.
|
// 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;
|
} cef_download_item_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to handle file downloads. The functions of this structure
|
// Structure used to handle file downloads. The functions of this structure will
|
||||||
/// will called on the browser process UI thread.
|
// called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_download_handler_t {
|
typedef struct _cef_download_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called before a download begins in response to a user-initiated action
|
// Called before a download begins. |suggested_name| is the suggested name for
|
||||||
/// (e.g. alt + link click or link click that returns a `Content-Disposition:
|
// the download file. By default the download will be canceled. Execute
|
||||||
/// attachment` response from the server). |url| is the target download URL
|
// |callback| either asynchronously or in this function to continue the
|
||||||
/// and |request_function| is the target function (GET, POST, etc). Return
|
// download if desired. Do not keep a reference to |download_item| outside of
|
||||||
/// true (1) to proceed with the download or false (0) to cancel the download.
|
// this function.
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* can_download)(struct _cef_download_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
const cef_string_t* url,
|
|
||||||
const cef_string_t* request_method);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called before a download begins. |suggested_name| is the suggested name
|
|
||||||
/// for the download file. By default the download will be canceled. Execute
|
|
||||||
/// |callback| either asynchronously or in this function to continue the
|
|
||||||
/// download if desired. Do not keep a reference to |download_item| outside of
|
|
||||||
/// this function.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_before_download)(
|
void(CEF_CALLBACK* on_before_download)(
|
||||||
struct _cef_download_handler_t* self,
|
struct _cef_download_handler_t* self,
|
||||||
@@ -130,11 +118,11 @@ typedef struct _cef_download_handler_t {
|
|||||||
struct _cef_before_download_callback_t* callback);
|
struct _cef_before_download_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a download's status or progress information has been updated.
|
// Called when a download's status or progress information has been updated.
|
||||||
/// This may be called multiple times before and after on_before_download().
|
// This may be called multiple times before and after on_before_download().
|
||||||
/// Execute |callback| either asynchronously or in this function to cancel the
|
// Execute |callback| either asynchronously or in this function to cancel the
|
||||||
/// download if desired. Do not keep a reference to |download_item| outside of
|
// download if desired. Do not keep a reference to |download_item| outside of
|
||||||
/// this function.
|
// this function.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_download_updated)(
|
void(CEF_CALLBACK* on_download_updated)(
|
||||||
struct _cef_download_handler_t* self,
|
struct _cef_download_handler_t* self,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=9af8ade3addfd112db41792c4e80682a8143e8c4$
|
// $hash=d84044bb582b029af5fa46c75f35b3da948dffd2$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
|
||||||
@@ -47,120 +47,108 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to represent a download item.
|
// Structure used to represent a download item.
|
||||||
///
|
///
|
||||||
typedef struct _cef_download_item_t {
|
typedef struct _cef_download_item_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
/// if this function returns false (0).
|
// 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.
|
// 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.
|
// 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.
|
// 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 true (1) if the download has been interrupted.
|
// Returns a simple speed estimate in bytes/s.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_interrupted)(struct _cef_download_item_t* self);
|
int64(CEF_CALLBACK* get_current_speed)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the most recent interrupt reason.
|
// Returns the rough percent complete or -1 if the receive total size is
|
||||||
///
|
// unknown.
|
||||||
cef_download_interrupt_reason_t(CEF_CALLBACK* get_interrupt_reason)(
|
|
||||||
struct _cef_download_item_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns a simple speed estimate in bytes/s.
|
|
||||||
///
|
|
||||||
int64_t(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.
|
// Returns the total number of bytes.
|
||||||
///
|
///
|
||||||
int64_t(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.
|
// Returns the number of received bytes.
|
||||||
///
|
///
|
||||||
int64_t(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.
|
// Returns the time that the download started.
|
||||||
///
|
///
|
||||||
cef_basetime_t(CEF_CALLBACK* get_start_time)(
|
cef_time_t(CEF_CALLBACK* get_start_time)(struct _cef_download_item_t* self);
|
||||||
struct _cef_download_item_t* self);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the time that the download ended.
|
// Returns the time that the download ended.
|
||||||
///
|
///
|
||||||
cef_basetime_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.
|
// Returns the full path to the downloaded or downloading file.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the unique identifier for this download.
|
// Returns the unique identifier for this download.
|
||||||
///
|
///
|
||||||
uint32_t(CEF_CALLBACK* get_id)(struct _cef_download_item_t* self);
|
uint32(CEF_CALLBACK* get_id)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the URL.
|
// Returns the URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the original URL before any redirections.
|
// Returns the original URL before any redirections.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the suggested file name.
|
// Returns the suggested file name.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the content disposition.
|
// Returns the content disposition.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the mime type.
|
// Returns the mime type.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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)(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=a096775255ddc4d7616095e48e7370bd87bf4bb5$
|
// $hash=9663321e2be1d000ac54e195c81f210ae40773d1$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
|
||||||
@@ -49,189 +49,177 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to represent drag data. The functions of this structure may
|
// Structure used to represent drag data. The functions of this structure may be
|
||||||
/// be called on any thread.
|
// called on any thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_drag_data_t {
|
typedef struct _cef_drag_data_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns a copy of the current object.
|
// 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.
|
// 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.
|
// 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.
|
// 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.
|
// 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.
|
// Return the link URL that is being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the title associated with the link being dragged.
|
// Return the title associated with the link being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the metadata, if any, associated with the link being dragged.
|
// Return the metadata, if any, associated with the link being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the plain text fragment that is being dragged.
|
// Return the plain text fragment that is being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the text/html fragment that is being dragged.
|
// Return the text/html fragment that is being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the base URL that the fragment came from. This value is used for
|
// Return the base URL that the fragment came from. This value is used for
|
||||||
/// resolving relative URLs and may be NULL.
|
// resolving relative URLs and may be NULL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the name of the file being dragged out of the browser window.
|
// 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().
|
// 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);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Write the contents of the file being dragged out of the web view into
|
// Write the contents of the file being dragged out of the web view into
|
||||||
/// |writer|. Returns the number of bytes sent to |writer|. If |writer| is
|
// |writer|. Returns the number of bytes sent to |writer|. If |writer| is NULL
|
||||||
/// NULL this function will return the size of the file contents in bytes.
|
// this function will return the size of the file contents in bytes. Call
|
||||||
/// Call get_file_name() to get a suggested name for the file.
|
// get_file_name() to get a suggested name for the file.
|
||||||
///
|
///
|
||||||
size_t(CEF_CALLBACK* get_file_contents)(struct _cef_drag_data_t* self,
|
size_t(CEF_CALLBACK* get_file_contents)(struct _cef_drag_data_t* self,
|
||||||
struct _cef_stream_writer_t* writer);
|
struct _cef_stream_writer_t* writer);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Retrieve the list of file names that are being dragged into the browser
|
// Retrieve the list of file names that are being dragged into the browser
|
||||||
/// window.
|
// window.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_file_names)(struct _cef_drag_data_t* self,
|
int(CEF_CALLBACK* get_file_names)(struct _cef_drag_data_t* self,
|
||||||
cef_string_list_t names);
|
cef_string_list_t names);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Retrieve the list of file paths that are being dragged into the browser
|
// Set the link URL that is being dragged.
|
||||||
/// window.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* get_file_paths)(struct _cef_drag_data_t* self,
|
|
||||||
cef_string_list_t paths);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Set the link URL that is being dragged.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_link_url)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_link_url)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* url);
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the title associated with the link being dragged.
|
// Set the title associated with the link being dragged.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_link_title)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_link_title)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* title);
|
const cef_string_t* title);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the metadata associated with the link being dragged.
|
// Set the metadata associated with the link being dragged.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_link_metadata)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_link_metadata)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* data);
|
const cef_string_t* data);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the plain text fragment that is being dragged.
|
// Set the plain text fragment that is being dragged.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_fragment_text)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_fragment_text)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* text);
|
const cef_string_t* text);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the text/html fragment that is being dragged.
|
// Set the text/html fragment that is being dragged.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_fragment_html)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_fragment_html)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* html);
|
const cef_string_t* html);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the base URL that the fragment came from.
|
// Set the base URL that the fragment came from.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_fragment_base_url)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_fragment_base_url)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* base_url);
|
const cef_string_t* base_url);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Reset the file contents. You should do this before calling
|
// Reset the file contents. You should do this before calling
|
||||||
/// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
|
// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
|
||||||
/// to drag in this kind of data.
|
// 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.
|
// Add a file that is being dragged into the webview.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* add_file)(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* path,
|
||||||
const cef_string_t* display_name);
|
const cef_string_t* display_name);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Clear list of filenames.
|
// Get the image representation of drag data. May return NULL if no image
|
||||||
///
|
// representation is available.
|
||||||
void(CEF_CALLBACK* clear_filenames)(struct _cef_drag_data_t* self);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// 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);
|
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).
|
// 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);
|
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.
|
// Returns true (1) if an image representation of drag data is available.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* has_image)(struct _cef_drag_data_t* self);
|
int(CEF_CALLBACK* has_image)(struct _cef_drag_data_t* self);
|
||||||
} cef_drag_data_t;
|
} cef_drag_data_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new cef_drag_data_t object.
|
// Create a new cef_drag_data_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_drag_data_t* cef_drag_data_create(void);
|
CEF_EXPORT cef_drag_data_t* cef_drag_data_create();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=0723a2a59d46e465ac94f198351dc871f0b35b96$
|
// $hash=1cc1f134e68406ae3b05f7e181e12f27262772f0$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
|
||||||
@@ -50,20 +50,20 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to dragging. The functions
|
// Implement this structure to handle events related to dragging. The functions
|
||||||
/// of this structure will be called on the UI thread.
|
// of this structure will be called on the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_drag_handler_t {
|
typedef struct _cef_drag_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when an external drag event enters the browser window. |dragData|
|
// Called when an external drag event enters the browser window. |dragData|
|
||||||
/// contains the drag event data and |mask| represents the type of drag
|
// contains the drag event data and |mask| represents the type of drag
|
||||||
/// operation. Return false (0) for default drag handling behavior or true (1)
|
// operation. Return false (0) for default drag handling behavior or true (1)
|
||||||
/// to cancel the drag event.
|
// to cancel the drag event.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_drag_enter)(struct _cef_drag_handler_t* self,
|
int(CEF_CALLBACK* on_drag_enter)(struct _cef_drag_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -71,11 +71,11 @@ typedef struct _cef_drag_handler_t {
|
|||||||
cef_drag_operations_mask_t mask);
|
cef_drag_operations_mask_t mask);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called whenever draggable regions for the browser window change. These can
|
// Called whenever draggable regions for the browser window change. These can
|
||||||
/// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
|
// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
|
||||||
/// draggable regions are never defined in a document this function will also
|
// draggable regions are never defined in a document this function will also
|
||||||
/// never be called. If the last draggable region is removed from a document
|
// never be called. If the last draggable region is removed from a document
|
||||||
/// this function will be called with an NULL vector.
|
// this function will be called with an NULL vector.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_draggable_regions_changed)(
|
void(CEF_CALLBACK* on_draggable_regions_changed)(
|
||||||
struct _cef_drag_handler_t* self,
|
struct _cef_drag_handler_t* self,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=0ca2b788f70f8c9f5b2706d691d8e063be00ed19$
|
// $hash=5d5251098be1477705de2a21502dec2d8338ce00$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
|
||||||
@@ -51,74 +51,74 @@ struct _cef_extension_handler_t;
|
|||||||
struct _cef_request_context_t;
|
struct _cef_request_context_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Object representing an extension. Methods may be called on any thread unless
|
// Object representing an extension. Methods may be called on any thread unless
|
||||||
/// otherwise indicated.
|
// otherwise indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_extension_t {
|
typedef struct _cef_extension_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the unique extension identifier. This is calculated based on the
|
// Returns the unique extension identifier. This is calculated based on the
|
||||||
/// extension public key, if available, or on the extension path. See
|
// extension public key, if available, or on the extension path. See
|
||||||
/// https://developer.chrome.com/extensions/manifest/key for details.
|
// https://developer.chrome.com/extensions/manifest/key for details.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
|
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
|
||||||
struct _cef_extension_t* self);
|
struct _cef_extension_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the absolute path to the extension directory on disk. This value
|
// 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
|
// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to
|
||||||
/// cef_request_context_t::LoadExtension.
|
// cef_request_context_t::LoadExtension.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
cef_string_userfree_t(CEF_CALLBACK* get_path)(struct _cef_extension_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the extension manifest contents as a cef_dictionary_value_t
|
// Returns the extension manifest contents as a cef_dictionary_value_t object.
|
||||||
/// object. See https://developer.chrome.com/extensions/manifest for details.
|
// See https://developer.chrome.com/extensions/manifest for details.
|
||||||
///
|
///
|
||||||
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_manifest)(
|
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_manifest)(
|
||||||
struct _cef_extension_t* self);
|
struct _cef_extension_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is the same extension as |that| object.
|
// Returns true (1) if this object is the same extension as |that| object.
|
||||||
/// Extensions are considered the same if identifier, path and loader context
|
// Extensions are considered the same if identifier, path and loader context
|
||||||
/// match.
|
// match.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_same)(struct _cef_extension_t* self,
|
int(CEF_CALLBACK* is_same)(struct _cef_extension_t* self,
|
||||||
struct _cef_extension_t* that);
|
struct _cef_extension_t* that);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the handler for this extension. Will return NULL for internal
|
// Returns the handler for this extension. Will return NULL for internal
|
||||||
/// extensions or if no handler was passed to
|
// extensions or if no handler was passed to
|
||||||
/// cef_request_context_t::LoadExtension.
|
// cef_request_context_t::LoadExtension.
|
||||||
///
|
///
|
||||||
struct _cef_extension_handler_t*(CEF_CALLBACK* get_handler)(
|
struct _cef_extension_handler_t*(CEF_CALLBACK* get_handler)(
|
||||||
struct _cef_extension_t* self);
|
struct _cef_extension_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the request context that loaded this extension. Will return NULL
|
// Returns the request context that loaded this extension. Will return NULL
|
||||||
/// for internal extensions or if the extension has been unloaded. See the
|
// for internal extensions or if the extension has been unloaded. See the
|
||||||
/// cef_request_context_t::LoadExtension documentation for more information
|
// cef_request_context_t::LoadExtension documentation for more information
|
||||||
/// about loader contexts. Must be called on the browser process UI thread.
|
// about loader contexts. Must be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
struct _cef_request_context_t*(CEF_CALLBACK* get_loader_context)(
|
struct _cef_request_context_t*(CEF_CALLBACK* get_loader_context)(
|
||||||
struct _cef_extension_t* self);
|
struct _cef_extension_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this extension is currently loaded. Must be called on
|
// Returns true (1) if this extension is currently loaded. Must be called on
|
||||||
/// the browser process UI thread.
|
// the browser process UI thread.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_loaded)(struct _cef_extension_t* self);
|
int(CEF_CALLBACK* is_loaded)(struct _cef_extension_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Unload this extension if it is not an internal extension and is currently
|
// Unload this extension if it is not an internal extension and is currently
|
||||||
/// loaded. Will result in a call to
|
// loaded. Will result in a call to
|
||||||
/// cef_extension_handler_t::OnExtensionUnloaded on success.
|
// cef_extension_handler_t::OnExtensionUnloaded on success.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* unload)(struct _cef_extension_t* self);
|
void(CEF_CALLBACK* unload)(struct _cef_extension_t* self);
|
||||||
} cef_extension_t;
|
} cef_extension_t;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=5cfff4465a586d2b2ea7b54a9549096faec415f6$
|
// $hash=c952241dabb9d99109ebb64acba0124e43150628$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
|
||||||
@@ -52,76 +52,75 @@ extern "C" {
|
|||||||
struct _cef_client_t;
|
struct _cef_client_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure used for asynchronous continuation of
|
// Callback structure used for asynchronous continuation of
|
||||||
/// cef_extension_handler_t::GetExtensionResource.
|
// cef_extension_handler_t::GetExtensionResource.
|
||||||
///
|
///
|
||||||
typedef struct _cef_get_extension_resource_callback_t {
|
typedef struct _cef_get_extension_resource_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Continue the request. Read the resource contents from |stream|.
|
// Continue the request. Read the resource contents from |stream|.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_get_extension_resource_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_get_extension_resource_callback_t* self,
|
||||||
struct _cef_stream_reader_t* stream);
|
struct _cef_stream_reader_t* stream);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Cancel the request.
|
// Cancel the request.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* cancel)(
|
void(CEF_CALLBACK* cancel)(
|
||||||
struct _cef_get_extension_resource_callback_t* self);
|
struct _cef_get_extension_resource_callback_t* self);
|
||||||
} cef_get_extension_resource_callback_t;
|
} cef_get_extension_resource_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to browser extensions. The
|
// Implement this structure to handle events related to browser extensions. The
|
||||||
/// functions of this structure will be called on the UI thread. See
|
// functions of this structure will be called on the UI thread. See
|
||||||
/// cef_request_context_t::LoadExtension for information about extension
|
// cef_request_context_t::LoadExtension for information about extension loading.
|
||||||
/// loading.
|
|
||||||
///
|
///
|
||||||
typedef struct _cef_extension_handler_t {
|
typedef struct _cef_extension_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called if the cef_request_context_t::LoadExtension request fails. |result|
|
// Called if the cef_request_context_t::LoadExtension request fails. |result|
|
||||||
/// will be the error code.
|
// will be the error code.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_extension_load_failed)(
|
void(CEF_CALLBACK* on_extension_load_failed)(
|
||||||
struct _cef_extension_handler_t* self,
|
struct _cef_extension_handler_t* self,
|
||||||
cef_errorcode_t result);
|
cef_errorcode_t result);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called if the cef_request_context_t::LoadExtension request succeeds.
|
// Called if the cef_request_context_t::LoadExtension request succeeds.
|
||||||
/// |extension| is the loaded extension.
|
// |extension| is the loaded extension.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_extension_loaded)(struct _cef_extension_handler_t* self,
|
void(CEF_CALLBACK* on_extension_loaded)(struct _cef_extension_handler_t* self,
|
||||||
struct _cef_extension_t* extension);
|
struct _cef_extension_t* extension);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called after the cef_extension_t::Unload request has completed.
|
// Called after the cef_extension_t::Unload request has completed.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_extension_unloaded)(
|
void(CEF_CALLBACK* on_extension_unloaded)(
|
||||||
struct _cef_extension_handler_t* self,
|
struct _cef_extension_handler_t* self,
|
||||||
struct _cef_extension_t* extension);
|
struct _cef_extension_t* extension);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when an extension needs a browser to host a background script
|
// Called when an extension needs a browser to host a background script
|
||||||
/// specified via the "background" manifest key. The browser will have no
|
// specified via the "background" manifest key. The browser will have no
|
||||||
/// visible window and cannot be displayed. |extension| is the extension that
|
// visible window and cannot be displayed. |extension| is the extension that
|
||||||
/// is loading the background script. |url| is an internally generated
|
// is loading the background script. |url| is an internally generated
|
||||||
/// reference to an HTML page that will be used to load the background script
|
// 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
|
// via a <script> src attribute. To allow creation of the browser optionally
|
||||||
/// optionally modify |client| and |settings| and return false (0). To cancel
|
// modify |client| and |settings| and return false (0). To cancel creation of
|
||||||
/// creation of the browser (and consequently cancel load of the background
|
// the browser (and consequently cancel load of the background script) return
|
||||||
/// script) return true (1). Successful creation will be indicated by a call
|
// true (1). Successful creation will be indicated by a call to
|
||||||
/// to cef_life_span_handler_t::OnAfterCreated, and
|
// cef_life_span_handler_t::OnAfterCreated, and
|
||||||
/// cef_browser_host_t::IsBackgroundHost will return true (1) for the
|
// cef_browser_host_t::IsBackgroundHost will return true (1) for the resulting
|
||||||
/// resulting browser. See https://developer.chrome.com/extensions/event_pages
|
// browser. See https://developer.chrome.com/extensions/event_pages for more
|
||||||
/// for more information about extension background script usage.
|
// information about extension background script usage.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_before_background_browser)(
|
int(CEF_CALLBACK* on_before_background_browser)(
|
||||||
struct _cef_extension_handler_t* self,
|
struct _cef_extension_handler_t* self,
|
||||||
@@ -131,19 +130,19 @@ typedef struct _cef_extension_handler_t {
|
|||||||
struct _cef_browser_settings_t* settings);
|
struct _cef_browser_settings_t* settings);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when an extension API (e.g. chrome.tabs.create) requests creation
|
// Called when an extension API (e.g. chrome.tabs.create) requests creation of
|
||||||
/// of a new browser. |extension| and |browser| are the source of the API
|
// a new browser. |extension| and |browser| are the source of the API call.
|
||||||
/// call. |active_browser| may optionally be specified via the windowId
|
// |active_browser| may optionally be specified via the windowId property or
|
||||||
/// property or returned via the get_active_browser() callback and provides
|
// returned via the get_active_browser() callback and provides the default
|
||||||
/// the default |client| and |settings| values for the new browser. |index| is
|
// |client| and |settings| values for the new browser. |index| is the position
|
||||||
/// the position value optionally specified via the index property. |url| is
|
// value optionally specified via the index property. |url| is the URL that
|
||||||
/// the URL that will be loaded in the browser. |active| is true (1) if the
|
// will be loaded in the browser. |active| is true (1) if the new browser
|
||||||
/// new browser should be active when opened. To allow creation of the
|
// should be active when opened. To allow creation of the browser optionally
|
||||||
/// browser optionally modify |windowInfo|, |client| and |settings| and return
|
// modify |windowInfo|, |client| and |settings| and return false (0). To
|
||||||
/// false (0). To cancel creation of the browser return true (1). Successful
|
// cancel creation of the browser return true (1). Successful creation will be
|
||||||
/// creation will be indicated by a call to
|
// indicated by a call to cef_life_span_handler_t::OnAfterCreated. Any
|
||||||
/// cef_life_span_handler_t::OnAfterCreated. Any modifications to |windowInfo|
|
// modifications to |windowInfo| will be ignored if |active_browser| is
|
||||||
/// will be ignored if |active_browser| is wrapped in a cef_browser_view_t.
|
// wrapped in a cef_browser_view_t.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_before_browser)(
|
int(CEF_CALLBACK* on_before_browser)(
|
||||||
struct _cef_extension_handler_t* self,
|
struct _cef_extension_handler_t* self,
|
||||||
@@ -158,13 +157,13 @@ typedef struct _cef_extension_handler_t {
|
|||||||
struct _cef_browser_settings_t* settings);
|
struct _cef_browser_settings_t* settings);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when no tabId is specified to an extension API call that accepts a
|
// 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
|
// 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
|
// source of the API call. Return the browser that will be acted on by the API
|
||||||
/// API call or return NULL to act on |browser|. The returned browser must
|
// call or return NULL to act on |browser|. The returned browser must share
|
||||||
/// share the same cef_request_context_t as |browser|. Incognito browsers
|
// the same cef_request_context_t as |browser|. Incognito browsers should not
|
||||||
/// should not be considered unless the source extension has incognito access
|
// be considered unless the source extension has incognito access enabled, in
|
||||||
/// enabled, in which case |include_incognito| will be true (1).
|
// which case |include_incognito| will be true (1).
|
||||||
///
|
///
|
||||||
struct _cef_browser_t*(CEF_CALLBACK* get_active_browser)(
|
struct _cef_browser_t*(CEF_CALLBACK* get_active_browser)(
|
||||||
struct _cef_extension_handler_t* self,
|
struct _cef_extension_handler_t* self,
|
||||||
@@ -173,12 +172,12 @@ typedef struct _cef_extension_handler_t {
|
|||||||
int include_incognito);
|
int include_incognito);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the tabId associated with |target_browser| is specified to an
|
// 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 API call that accepts a tabId parameter (e.g. chrome.tabs.*).
|
||||||
/// |extension| and |browser| are the source of the API call. Return true (1)
|
// |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
|
// to allow access of false (0) to deny access. Access to incognito browsers
|
||||||
/// should not be allowed unless the source extension has incognito access
|
// should not be allowed unless the source extension has incognito access
|
||||||
/// enabled, in which case |include_incognito| will be true (1).
|
// enabled, in which case |include_incognito| will be true (1).
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* can_access_browser)(struct _cef_extension_handler_t* self,
|
int(CEF_CALLBACK* can_access_browser)(struct _cef_extension_handler_t* self,
|
||||||
struct _cef_extension_t* extension,
|
struct _cef_extension_t* extension,
|
||||||
@@ -187,15 +186,14 @@ typedef struct _cef_extension_handler_t {
|
|||||||
struct _cef_browser_t* target_browser);
|
struct _cef_browser_t* target_browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to retrieve an extension resource that would normally be loaded
|
// Called to retrieve an extension resource that would normally be loaded from
|
||||||
/// from disk (e.g. if a file parameter is specified to
|
// disk (e.g. if a file parameter is specified to chrome.tabs.executeScript).
|
||||||
/// chrome.tabs.executeScript). |extension| and |browser| are the source of
|
// |extension| and |browser| are the source of the resource request. |file| is
|
||||||
/// the resource request. |file| is the requested relative file path. To
|
// the requested relative file path. To handle the resource request return
|
||||||
/// handle the resource request return true (1) and execute |callback| either
|
// true (1) and execute |callback| either synchronously or asynchronously. For
|
||||||
/// synchronously or asynchronously. For the default behavior which reads the
|
// the default behavior which reads the resource from the extension directory
|
||||||
/// resource from the extension directory on disk return false (0).
|
// on disk return false (0). Localization substitutions will not be applied to
|
||||||
/// Localization substitutions will not be applied to resources handled via
|
// resources handled via this function.
|
||||||
/// this function.
|
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_extension_resource)(
|
int(CEF_CALLBACK* get_extension_resource)(
|
||||||
struct _cef_extension_handler_t* self,
|
struct _cef_extension_handler_t* self,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=e10581d1f6aeb104646ae106aaa5fb36016643dd$
|
// $hash=00d75d4f1968686cec7db84a59df89d98d8fe146$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
|
||||||
@@ -47,40 +47,40 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Creates a directory and all parent directories if they don't already exist.
|
// 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.
|
// Returns true (1) on successful creation or if the directory already exists.
|
||||||
/// The directory is only readable by the current user. Calling this function on
|
// The directory is only readable by the current user. Calling this function on
|
||||||
/// the browser process UI or IO threads is not allowed.
|
// the browser process UI or IO threads is not allowed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_create_directory(const cef_string_t* full_path);
|
CEF_EXPORT int cef_create_directory(const cef_string_t* full_path);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the temporary directory provided by the system.
|
// Get the temporary directory provided by the system.
|
||||||
///
|
//
|
||||||
/// WARNING: In general, you should use the temp directory variants below
|
// WARNING: In general, you should use the temp directory variants below instead
|
||||||
/// instead of this function. Those variants will ensure that the proper
|
// of this function. Those variants will ensure that the proper permissions are
|
||||||
/// permissions are set so that other users on the system can't edit them while
|
// set so that other users on the system can't edit them while they're open
|
||||||
/// they're open (which could lead to security issues).
|
// (which could lead to security issues).
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_get_temp_directory(cef_string_t* temp_dir);
|
CEF_EXPORT int cef_get_temp_directory(cef_string_t* temp_dir);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Creates a new directory. On Windows if |prefix| is provided the new
|
// Creates a new directory. On Windows if |prefix| is provided the new directory
|
||||||
/// directory name is in the format of "prefixyyyy". Returns true (1) on success
|
// name is in the format of "prefixyyyy". Returns true (1) on success and sets
|
||||||
/// and sets |new_temp_path| to the full path of the directory that was created.
|
// |new_temp_path| to the full path of the directory that was created. The
|
||||||
/// The directory is only readable by the current user. Calling this function on
|
// directory is only readable by the current user. Calling this function on the
|
||||||
/// the browser process UI or IO threads is not allowed.
|
// browser process UI or IO threads is not allowed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix,
|
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
|
// Creates a directory within another directory. Extra characters will be
|
||||||
/// appended to |prefix| to ensure that the new directory does not have the same
|
// appended to |prefix| to ensure that the new directory does not have the same
|
||||||
/// name as an existing directory. Returns true (1) on success and sets
|
// name as an existing directory. Returns true (1) on success and sets |new_dir|
|
||||||
/// |new_dir| to the full path of the directory that was created. The directory
|
// to the full path of the directory that was created. The directory is only
|
||||||
/// is only readable by the current user. Calling this function on the browser
|
// readable by the current user. Calling this function on the browser process UI
|
||||||
/// process UI or IO threads is not allowed.
|
// or IO threads is not allowed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_create_temp_directory_in_directory(
|
CEF_EXPORT int cef_create_temp_directory_in_directory(
|
||||||
const cef_string_t* base_dir,
|
const cef_string_t* base_dir,
|
||||||
@@ -88,40 +88,39 @@ CEF_EXPORT int cef_create_temp_directory_in_directory(
|
|||||||
cef_string_t* new_dir);
|
cef_string_t* new_dir);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the given path exists and is a directory. Calling this
|
// Returns true (1) if the given path exists and is a directory. Calling this
|
||||||
/// function on the browser process UI or IO threads is not allowed.
|
// function on the browser process UI or IO threads is not allowed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_directory_exists(const cef_string_t* path);
|
CEF_EXPORT int cef_directory_exists(const cef_string_t* path);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Deletes the given path whether it's a file or a directory. If |path| is a
|
// Deletes the given path whether it's a file or a directory. If |path| is a
|
||||||
/// directory all contents will be deleted. If |recursive| is true (1) any sub-
|
// directory all contents will be deleted. If |recursive| is true (1) any sub-
|
||||||
/// directories and their contents will also be deleted (equivalent to executing
|
// directories and their contents will also be deleted (equivalent to executing
|
||||||
/// "rm -rf", so use with caution). On POSIX environments if |path| is a
|
// "rm -rf", so use with caution). On POSIX environments if |path| is a symbolic
|
||||||
/// symbolic link then only the symlink will be deleted. Returns true (1) on
|
// link then only the symlink will be deleted. Returns true (1) on successful
|
||||||
/// successful deletion or if |path| does not exist. Calling this function on
|
// deletion or if |path| does not exist. Calling this function on the browser
|
||||||
/// the browser process UI or IO threads is not allowed.
|
// process UI or IO threads is not allowed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_delete_file(const cef_string_t* path, int recursive);
|
CEF_EXPORT int cef_delete_file(const cef_string_t* path, int recursive);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Writes the contents of |src_dir| into a zip archive at |dest_file|. If
|
// Writes the contents of |src_dir| into a zip archive at |dest_file|. If
|
||||||
/// |include_hidden_files| is true (1) files starting with "." will be included.
|
// |include_hidden_files| is true (1) files starting with "." will be included.
|
||||||
/// Returns true (1) on success. Calling this function on the browser process
|
// Returns true (1) on success. Calling this function on the browser process UI
|
||||||
/// UI or IO threads is not allowed.
|
// or IO threads is not allowed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_zip_directory(const cef_string_t* src_dir,
|
CEF_EXPORT int cef_zip_directory(const cef_string_t* src_dir,
|
||||||
const cef_string_t* dest_file,
|
const cef_string_t* dest_file,
|
||||||
int include_hidden_files);
|
int include_hidden_files);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Loads the existing "Certificate Revocation Lists" file that is managed by
|
// Loads the existing "Certificate Revocation Lists" file that is managed by
|
||||||
/// Google Chrome. This file can generally be found in Chrome's User Data
|
// 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
|
// directory (e.g. "C:\Users\[User]\AppData\Local\Google\Chrome\User Data\" on
|
||||||
/// Windows) and is updated periodically by Chrome's component updater service.
|
// Windows) and is updated periodically by Chrome's component updater service.
|
||||||
/// Must be called in the browser process after the context has been
|
// Must be called in the browser process after the context has been initialized.
|
||||||
/// initialized. See https://dev.chromium.org/Home/chromium-security/crlsets for
|
// See https://dev.chromium.org/Home/chromium-security/crlsets for background.
|
||||||
/// background.
|
|
||||||
///
|
///
|
||||||
CEF_EXPORT void cef_load_crlsets_file(const cef_string_t* path);
|
CEF_EXPORT void cef_load_crlsets_file(const cef_string_t* path);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=da0a9242b309fbd70d19949fb1c5b4ec4475ef94$
|
// $hash=03bb69a14868a95abf3bf7b1608dc351480e307f$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
||||||
@@ -48,23 +48,22 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to find results. The
|
// Implement this structure to handle events related to find results. The
|
||||||
/// functions of this structure will be called on the UI thread.
|
// functions of this structure will be called on the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_find_handler_t {
|
typedef struct _cef_find_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to report find results returned by cef_browser_host_t::find().
|
// Called to report find results returned by cef_browser_host_t::find().
|
||||||
/// |identifer| is a unique incremental identifier for the currently active
|
// |identifer| is the identifier passed to find(), |count| is the number of
|
||||||
/// search, |count| is the number of matches currently identified,
|
// matches currently identified, |selectionRect| is the location of where the
|
||||||
/// |selectionRect| is the location of where the match was found (in window
|
// match was found (in window coordinates), |activeMatchOrdinal| is the
|
||||||
/// coordinates), |activeMatchOrdinal| is the current position in the search
|
// current position in the search results, and |finalUpdate| is true (1) if
|
||||||
/// results, and |finalUpdate| is true (1) if this is the last find
|
// this is the last find notification.
|
||||||
/// notification.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self,
|
void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=6eefc2c650908461fb7536dd3314c77a3f89dceb$
|
// $hash=0fccb41381e922e9d9545ae45ba3e6cf1916c4b0$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
|
||||||
@@ -50,37 +50,36 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to focus. The functions of
|
// Implement this structure to handle events related to focus. The functions of
|
||||||
/// this structure will be called on the UI thread.
|
// this structure will be called on the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_focus_handler_t {
|
typedef struct _cef_focus_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the browser component is about to loose focus. For instance,
|
// Called when the browser component is about to loose focus. For instance, if
|
||||||
/// if focus was on the last HTML element and the user pressed the TAB key.
|
// focus was on the last HTML element and the user pressed the TAB key. |next|
|
||||||
/// |next| will be true (1) if the browser is giving focus to the next
|
// will be true (1) if the browser is giving focus to the next component and
|
||||||
/// component and false (0) if the browser is giving focus to the previous
|
// false (0) if the browser is giving focus to the previous component.
|
||||||
/// component.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_take_focus)(struct _cef_focus_handler_t* self,
|
void(CEF_CALLBACK* on_take_focus)(struct _cef_focus_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
int next);
|
int next);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the browser component is requesting focus. |source| indicates
|
// Called when the browser component is requesting focus. |source| indicates
|
||||||
/// where the focus request is originating from. Return false (0) to allow the
|
// 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.
|
// focus to be set or true (1) to cancel setting the focus.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_set_focus)(struct _cef_focus_handler_t* self,
|
int(CEF_CALLBACK* on_set_focus)(struct _cef_focus_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
cef_focus_source_t source);
|
cef_focus_source_t source);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the browser component has received focus.
|
// Called when the browser component has received focus.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_got_focus)(struct _cef_focus_handler_t* self,
|
void(CEF_CALLBACK* on_got_focus)(struct _cef_focus_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=8f347a95168778ec0e686cdef93be3bc517e2f68$
|
// $hash=872fd1e811d41f56f03da0da75a8f2e89cad40cd$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
||||||
@@ -57,100 +57,100 @@ struct _cef_urlrequest_t;
|
|||||||
struct _cef_v8context_t;
|
struct _cef_v8context_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to represent a frame in the browser window. When used in the
|
// Structure used to represent a frame in the browser window. When used in the
|
||||||
/// browser process the functions of this structure may be called on any thread
|
// browser process the functions of this structure may be called on any thread
|
||||||
/// unless otherwise indicated in the comments. When used in the render process
|
// unless otherwise indicated in the comments. When used in the render process
|
||||||
/// the functions of this structure may only be called on the main thread.
|
// the functions of this structure may only be called on the main thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_frame_t {
|
typedef struct _cef_frame_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// True if this object is currently attached to a valid frame.
|
// 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.
|
// 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.
|
// 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.
|
// 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.
|
// 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.
|
// 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.
|
// 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.
|
// 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
|
// 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
|
// default text viewing application. This function can only be called from the
|
||||||
/// the browser process.
|
// 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
|
// Retrieve this frame's HTML source as a string sent to the specified
|
||||||
/// visitor.
|
// visitor.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_source)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* get_source)(struct _cef_frame_t* self,
|
||||||
struct _cef_string_visitor_t* visitor);
|
struct _cef_string_visitor_t* visitor);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Retrieve this frame's display text as a string sent to the specified
|
// Retrieve this frame's display text as a string sent to the specified
|
||||||
/// visitor.
|
// visitor.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_text)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* get_text)(struct _cef_frame_t* self,
|
||||||
struct _cef_string_visitor_t* visitor);
|
struct _cef_string_visitor_t* visitor);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Load the request represented by the |request| object.
|
// Load the request represented by the |request| object.
|
||||||
///
|
//
|
||||||
/// WARNING: This function will fail with "bad IPC message" reason
|
// WARNING: This function will fail with "bad IPC message" reason
|
||||||
/// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
|
// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
|
||||||
/// origin using some other mechanism (LoadURL, link click, etc).
|
// origin using some other mechanism (LoadURL, link click, etc).
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* load_request)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* load_request)(struct _cef_frame_t* self,
|
||||||
struct _cef_request_t* request);
|
struct _cef_request_t* request);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Load the specified |url|.
|
// Load the specified |url|.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* load_url)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* load_url)(struct _cef_frame_t* self,
|
||||||
const cef_string_t* url);
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Execute a string of JavaScript code in this frame. The |script_url|
|
// Execute a string of JavaScript code in this frame. The |script_url|
|
||||||
/// parameter is the URL where the script in question can be found, if any.
|
// parameter is the URL where the script in question can be found, if any. The
|
||||||
/// The renderer may request this URL to show the developer the source of the
|
// renderer may request this URL to show the developer the source of the
|
||||||
/// error. The |start_line| parameter is the base line number to use for
|
// error. The |start_line| parameter is the base line number to use for error
|
||||||
/// error reporting.
|
// reporting.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* execute_java_script)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* execute_java_script)(struct _cef_frame_t* self,
|
||||||
const cef_string_t* code,
|
const cef_string_t* code,
|
||||||
@@ -158,78 +158,83 @@ typedef struct _cef_frame_t {
|
|||||||
int start_line);
|
int start_line);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this is the main (top-level) frame.
|
// 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.
|
// 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
|
// Returns the name for this frame. If the frame has an assigned name (for
|
||||||
/// example, set via the iframe "name" attribute) then that value will be
|
// example, set via the iframe "name" attribute) then that value will be
|
||||||
/// returned. Otherwise a unique name will be constructed based on the frame
|
// returned. Otherwise a unique name will be constructed based on the frame
|
||||||
/// parent hierarchy. The main (top-level) frame will always have an NULL name
|
// parent hierarchy. The main (top-level) frame will always have an NULL name
|
||||||
/// value.
|
// value.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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 NULL if the
|
// Returns the globally unique identifier for this frame or < 0 if the
|
||||||
/// underlying frame does not yet exist.
|
// underlying frame does not yet exist.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
int64(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self);
|
||||||
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
|
|
||||||
struct _cef_frame_t* self);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the parent of this frame or NULL if this is the main (top-level)
|
// Returns the parent of this frame or NULL if this is the main (top-level)
|
||||||
/// frame.
|
// 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.
|
// Returns the URL currently loaded in this frame.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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.
|
// 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
|
// Get the V8 context associated with the frame. This function can only be
|
||||||
/// called from the render process.
|
// 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);
|
struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Visit the DOM document. This function can only be called from the render
|
// Visit the DOM document. This function can only be called from the render
|
||||||
/// process.
|
// process.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* visit_dom)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* visit_dom)(struct _cef_frame_t* self,
|
||||||
struct _cef_domvisitor_t* visitor);
|
struct _cef_domvisitor_t* visitor);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new URL request that will be treated as originating from this
|
// Create a new URL request that will be treated as originating from this
|
||||||
/// frame and the associated browser. Use cef_urlrequest_t::Create instead if
|
// frame and the associated browser. This request may be intercepted by the
|
||||||
/// you do not want the request to have this association, in which case it may
|
// client via cef_resource_request_handler_t or cef_scheme_handler_factory_t.
|
||||||
/// be handled differently (see documentation on that function). A request
|
// Use cef_urlrequest_t::Create instead if you do not want the request to have
|
||||||
/// created with this function may only originate from the browser process,
|
// this association, in which case it may be handled differently (see
|
||||||
/// and will behave as follows:
|
// documentation on that function). Requests may originate from both the
|
||||||
/// - It may be intercepted by the client via CefResourceRequestHandler or
|
// browser process and the render process.
|
||||||
/// CefSchemeHandlerFactory.
|
//
|
||||||
/// - POST data may only contain a single element of type PDE_TYPE_FILE or
|
// For requests originating from the browser process:
|
||||||
/// PDE_TYPE_BYTES.
|
// - POST data may only contain a single element of type PDE_TYPE_FILE or
|
||||||
///
|
// PDE_TYPE_BYTES.
|
||||||
/// The |request| object will be marked as read-only after calling this
|
// For requests originating from the render process:
|
||||||
/// function.
|
// - 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_urlrequest_t*(CEF_CALLBACK* create_urlrequest)(
|
||||||
struct _cef_frame_t* self,
|
struct _cef_frame_t* self,
|
||||||
@@ -237,12 +242,12 @@ typedef struct _cef_frame_t {
|
|||||||
struct _cef_urlrequest_client_t* client);
|
struct _cef_urlrequest_client_t* client);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Send a message to the specified |target_process|. Ownership of the message
|
// Send a message to the specified |target_process|. Ownership of the message
|
||||||
/// contents will be transferred and the |message| reference will be
|
// contents will be transferred and the |message| reference will be
|
||||||
/// invalidated. Message delivery is not guaranteed in all cases (for example,
|
// invalidated. Message delivery is not guaranteed in all cases (for example,
|
||||||
/// if the browser is closing, navigating, or if the target process crashes).
|
// if the browser is closing, navigating, or if the target process crashes).
|
||||||
/// Send an ACK message back from the target process if confirmation is
|
// Send an ACK message back from the target process if confirmation is
|
||||||
/// required.
|
// required.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* send_process_message)(
|
void(CEF_CALLBACK* send_process_message)(
|
||||||
struct _cef_frame_t* self,
|
struct _cef_frame_t* self,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=fc6fbee765ce2b649f5293c8c4b076d36014e4aa$
|
// $hash=f6be5f7509ee3ccfe16f226470897223cc131014$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_
|
||||||
@@ -49,106 +49,107 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to cef_frame_t life span.
|
// Implement this structure to handle events related to cef_frame_t life span.
|
||||||
/// The order of callbacks is:
|
// The order of callbacks is:
|
||||||
///
|
//
|
||||||
/// (1) During initial cef_browser_host_t creation and navigation of the main
|
// (1) During initial cef_browser_host_t creation and navigation of the main
|
||||||
/// frame:
|
// frame: - cef_frame_handler_t::OnFrameCreated => The initial main frame object
|
||||||
/// - cef_frame_handler_t::OnFrameCreated => The initial main frame object has
|
// has been
|
||||||
/// been created. Any commands will be queued until the frame is attached.
|
// created. Any commands will be queued until the frame is attached.
|
||||||
/// - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object
|
// - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object
|
||||||
/// has been assigned to the browser.
|
// has
|
||||||
/// - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and
|
// been assigned to the browser.
|
||||||
/// can be used.
|
// - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and can
|
||||||
/// - cef_frame_handler_t::OnFrameAttached => The initial main frame object is
|
// be
|
||||||
/// now connected to its peer in the renderer process. Commands can be routed.
|
// used.
|
||||||
///
|
// - cef_frame_handler_t::OnFrameAttached => The initial main frame object is
|
||||||
/// (2) During further cef_browser_host_t navigation/loading of the main frame
|
// now
|
||||||
/// and/or sub-frames:
|
// connected to its peer in the renderer process. Commands can be routed.
|
||||||
/// - cef_frame_handler_t::OnFrameCreated => A new main frame or sub-frame
|
//
|
||||||
/// object has been created. Any commands will be queued until the frame is
|
// (2) During further cef_browser_host_t navigation/loading of the main frame
|
||||||
/// attached.
|
// and/or sub-frames: - cef_frame_handler_t::OnFrameCreated => A new main frame
|
||||||
/// - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame
|
// or sub-frame object has
|
||||||
/// object is now connected to its peer in the renderer process. Commands can
|
// been created. Any commands will be queued until the frame is attached.
|
||||||
/// be routed.
|
// - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame
|
||||||
/// - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub-
|
// object is
|
||||||
/// frame object has lost its connection to the renderer process. If multiple
|
// now connected to its peer in the renderer process. Commands can be routed.
|
||||||
/// objects are detached at the same time then notifications will be sent for
|
// - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub-frame
|
||||||
/// any sub-frame objects before the main frame object. Commands can no longer
|
// object has lost its connection to the renderer process. If multiple objects
|
||||||
/// be routed and will be discarded.
|
// are detached at the same time then notifications will be sent for any
|
||||||
/// - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has
|
// sub-frame objects before the main frame object. Commands can no longer be
|
||||||
/// been assigned to the browser. This will only occur with cross-origin
|
// routed and will be discarded.
|
||||||
/// navigation or re-navigation after renderer process termination (due to
|
// - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has been
|
||||||
/// crashes, etc).
|
// assigned to the browser. This will only occur with cross-origin navigation
|
||||||
///
|
// or re-navigation after renderer process termination (due to crashes, etc).
|
||||||
/// (3) During final cef_browser_host_t destruction of the main frame:
|
//
|
||||||
/// - cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost
|
// (3) During final cef_browser_host_t destruction of the main frame: -
|
||||||
/// their connection to the renderer process. Commands can no longer be routed
|
// cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost their
|
||||||
/// and will be discarded.
|
// connection to the renderer process. Commands can no longer be routed and
|
||||||
/// - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed.
|
// will be discarded.
|
||||||
/// - cef_frame_handler_t::OnFrameDetached => The main frame object have lost
|
// - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed. -
|
||||||
/// its connection to the renderer process. Notifications will be sent for any
|
// cef_frame_handler_t::OnFrameDetached => The main frame object have lost its
|
||||||
/// sub-frame objects before the main frame object. Commands can no longer be
|
// connection to the renderer process. Notifications will be sent for any
|
||||||
/// routed and will be discarded.
|
// sub-frame objects before the main frame object. Commands can no longer be
|
||||||
/// - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has
|
// routed and will be discarded.
|
||||||
/// been removed from the browser.
|
// - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has
|
||||||
///
|
// been
|
||||||
/// Cross-origin navigation and/or loading receives special handling.
|
// removed from the browser.
|
||||||
///
|
//
|
||||||
/// When the main frame navigates to a different origin the OnMainFrameChanged
|
// Cross-origin navigation and/or loading receives special handling.
|
||||||
/// callback (2) will be executed with the old and new main frame objects.
|
//
|
||||||
///
|
// When the main frame navigates to a different origin the OnMainFrameChanged
|
||||||
/// When a new sub-frame is loaded in, or an existing sub-frame is navigated to,
|
// callback (2) will be executed with the old and new main frame objects.
|
||||||
/// a different origin from the parent frame, a temporary sub-frame object will
|
//
|
||||||
/// first be created in the parent's renderer process. That temporary sub-frame
|
// When a new sub-frame is loaded in, or an existing sub-frame is navigated to,
|
||||||
/// will then be discarded after the real cross-origin sub-frame is created in
|
// a different origin from the parent frame, a temporary sub-frame object will
|
||||||
/// the new/target renderer process. The client will receive cross-origin
|
// first be created in the parent's renderer process. That temporary sub-frame
|
||||||
/// navigation callbacks (2) for the transition from the temporary sub-frame to
|
// will then be discarded after the real cross-origin sub-frame is created in
|
||||||
/// the real sub-frame. The temporary sub-frame will not receive or execute
|
// the new/target renderer process. The client will receive cross-origin
|
||||||
/// commands during this transitional period (any sent commands will be
|
// navigation callbacks (2) for the transition from the temporary sub-frame to
|
||||||
/// discarded).
|
// the real sub-frame. The temporary sub-frame will not recieve or execute
|
||||||
///
|
// commands during this transitional period (any sent commands will be
|
||||||
/// When a new popup browser is created in a different origin from the parent
|
// discarded).
|
||||||
/// browser, a temporary main frame object for the popup will first be created
|
//
|
||||||
/// in the parent's renderer process. That temporary main frame will then be
|
// When a new popup browser is created in a different origin from the parent
|
||||||
/// discarded after the real cross-origin main frame is created in the
|
// browser, a temporary main frame object for the popup will first be created in
|
||||||
/// new/target renderer process. The client will receive creation and initial
|
// the parent's renderer process. That temporary main frame will then be
|
||||||
/// navigation callbacks (1) for the temporary main frame, followed by cross-
|
// discarded after the real cross-origin main frame is created in the new/target
|
||||||
/// origin navigation callbacks (2) for the transition from the temporary main
|
// renderer process. The client will recieve creation and initial navigation
|
||||||
/// frame to the real main frame. The temporary main frame may receive and
|
// callbacks (1) for the temporary main frame, followed by cross-origin
|
||||||
/// execute commands during this transitional period (any sent commands may be
|
// navigation callbacks (2) for the transition from the temporary main frame to
|
||||||
/// executed, but the behavior is potentially undesirable since they execute in
|
// the real main frame. The temporary main frame may receive and execute
|
||||||
/// the parent browser's renderer process and not the new/target renderer
|
// commands during this transitional period (any sent commands may be executed,
|
||||||
/// process).
|
// but the behavior is potentially undesirable since they execute in the parent
|
||||||
///
|
// browser's renderer process and not the new/target renderer process).
|
||||||
/// Callbacks will not be executed for placeholders that may be created during
|
//
|
||||||
/// pre-commit navigation for sub-frames that do not yet exist in the renderer
|
// Callbacks will not be executed for placeholders that may be created during
|
||||||
/// process. Placeholders will have cef_frame_t::get_identifier() == -4.
|
// pre-commit navigation for sub-frames that do not yet exist in the renderer
|
||||||
///
|
// process. Placeholders will have cef_frame_t::get_identifier() == -4.
|
||||||
/// The functions of this structure will be called on the UI thread unless
|
//
|
||||||
/// otherwise indicated.
|
// The functions of this structure will be called on the UI thread unless
|
||||||
|
// otherwise indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_frame_handler_t {
|
typedef struct _cef_frame_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a new frame is created. This will be the first notification
|
// Called when a new frame is created. This will be the first notification
|
||||||
/// that references |frame|. Any commands that require transport to the
|
// that references |frame|. Any commands that require transport to the
|
||||||
/// associated renderer process (LoadRequest, SendProcessMessage, GetSource,
|
// associated renderer process (LoadRequest, SendProcessMessage, GetSource,
|
||||||
/// etc.) will be queued until OnFrameAttached is called for |frame|.
|
// etc.) will be queued until OnFrameAttached is called for |frame|.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_frame_created)(struct _cef_frame_handler_t* self,
|
void(CEF_CALLBACK* on_frame_created)(struct _cef_frame_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_frame_t* frame);
|
struct _cef_frame_t* frame);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a frame can begin routing commands to/from the associated
|
// Called when a frame can begin routing commands to/from the associated
|
||||||
/// renderer process. |reattached| will be true (1) if the frame was re-
|
// renderer process. |reattached| will be true (1) if the frame was re-
|
||||||
/// attached after exiting the BackForwardCache. Any commands that were queued
|
// attached after exiting the BackForwardCache. Any commands that were queued
|
||||||
/// have now been dispatched.
|
// have now been dispatched.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_frame_attached)(struct _cef_frame_handler_t* self,
|
void(CEF_CALLBACK* on_frame_attached)(struct _cef_frame_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -156,31 +157,29 @@ typedef struct _cef_frame_handler_t {
|
|||||||
int reattached);
|
int reattached);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a frame loses its connection to the renderer process and will
|
// Called when a frame loses its connection to the renderer process and will
|
||||||
/// be destroyed. Any pending or future commands will be discarded and
|
// be destroyed. Any pending or future commands will be discarded and
|
||||||
/// cef_frame_t::is_valid() will now return false (0) for |frame|. If called
|
// cef_frame_t::is_valid() will now return false (0) for |frame|. If called
|
||||||
/// after cef_life_span_handler_t::on_before_close() during browser
|
// after cef_life_span_handler_t::on_before_close() during browser destruction
|
||||||
/// destruction then cef_browser_t::is_valid() will return false (0) for
|
// then cef_browser_t::is_valid() will return false (0) for |browser|.
|
||||||
/// |browser|.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_frame_detached)(struct _cef_frame_handler_t* self,
|
void(CEF_CALLBACK* on_frame_detached)(struct _cef_frame_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_frame_t* frame);
|
struct _cef_frame_t* frame);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the main frame changes due to (a) initial browser creation,
|
// Called when the main frame changes due to (a) initial browser creation, (b)
|
||||||
/// (b) final browser destruction, (c) cross-origin navigation or (d) re-
|
// final browser destruction, (c) cross-origin navigation or (d) re-navigation
|
||||||
/// navigation after renderer process termination (due to crashes, etc).
|
// after renderer process termination (due to crashes, etc). |old_frame| will
|
||||||
/// |old_frame| will be NULL and |new_frame| will be non-NULL when a main
|
// be NULL and |new_frame| will be non-NULL when a main frame is assigned to
|
||||||
/// frame is assigned to |browser| for the first time. |old_frame| will be
|
// |browser| for the first time. |old_frame| will be non-NULL and |new_frame|
|
||||||
/// non-NULL and |new_frame| will be NULL and when a main frame is removed
|
// will be NULL and when a main frame is removed from |browser| for the last
|
||||||
/// from |browser| for the last time. Both |old_frame| and |new_frame| will be
|
// time. Both |old_frame| and |new_frame| will be non-NULL for cross-origin
|
||||||
/// non-NULL for cross-origin navigations or re-navigation after renderer
|
// navigations or re-navigation after renderer process termination. This
|
||||||
/// process termination. This function will be called after on_frame_created()
|
// function will be called after on_frame_created() for |new_frame| and/or
|
||||||
/// for |new_frame| and/or after on_frame_detached() for |old_frame|. If
|
// after on_frame_detached() for |old_frame|. If called after
|
||||||
/// called after cef_life_span_handler_t::on_before_close() during browser
|
// cef_life_span_handler_t::on_before_close() during browser destruction then
|
||||||
/// destruction then cef_browser_t::is_valid() will return false (0) for
|
// cef_browser_t::is_valid() will return false (0) for |browser|.
|
||||||
/// |browser|.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_main_frame_changed)(struct _cef_frame_handler_t* self,
|
void(CEF_CALLBACK* on_main_frame_changed)(struct _cef_frame_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=990e80ab5ae04298e6b70cbc0a67115825563251$
|
// $hash=bf890f7b8e8edd423d71ad5a4d5bd43d81f1eb01$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_
|
||||||
@@ -47,9 +47,9 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the application text direction is right-to-left.
|
// Returns true (1) if the application text direction is right-to-left.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_is_rtl(void);
|
CEF_EXPORT int cef_is_rtl();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=7512ccf755017d5b1866b753890b498e8163006d$
|
// $hash=d9da8862142742e780086714bbd4fb44ac95cf2c$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
||||||
@@ -48,37 +48,37 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Container for a single image represented at different scale factors. All
|
// Container for a single image represented at different scale factors. All
|
||||||
/// image representations should be the same size in density independent pixel
|
// 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
|
// (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
|
// 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
|
// will display with a DIP size of 100x100 units. The functions of this
|
||||||
/// structure can be called on any browser process thread.
|
// structure can be called on any browser process thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_image_t {
|
typedef struct _cef_image_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this Image is NULL.
|
// 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
|
// Returns true (1) if this Image and |that| Image share the same underlying
|
||||||
/// storage. Will also return true (1) if both images are NULL.
|
// storage. Will also return true (1) if both images are NULL.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_same)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* is_same)(struct _cef_image_t* self,
|
||||||
struct _cef_image_t* that);
|
struct _cef_image_t* that);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add a bitmap image representation for |scale_factor|. Only 32-bit
|
// Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA
|
||||||
/// RGBA/BGRA formats are supported. |pixel_width| and |pixel_height| are the
|
// formats are supported. |pixel_width| and |pixel_height| are the bitmap
|
||||||
/// bitmap representation size in pixel coordinates. |pixel_data| is the array
|
// representation size in pixel coordinates. |pixel_data| is the array of
|
||||||
/// of pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in
|
// pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in size.
|
||||||
/// size. |color_type| and |alpha_type| values specify the pixel format.
|
// |color_type| and |alpha_type| values specify the pixel format.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* add_bitmap)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* add_bitmap)(struct _cef_image_t* self,
|
||||||
float scale_factor,
|
float scale_factor,
|
||||||
@@ -90,9 +90,9 @@ typedef struct _cef_image_t {
|
|||||||
size_t pixel_data_size);
|
size_t pixel_data_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add a PNG image representation for |scale_factor|. |png_data| is the image
|
// 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
|
// data of size |png_data_size|. Any alpha transparency in the PNG data will
|
||||||
/// be maintained.
|
// be maintained.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* add_png)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* add_png)(struct _cef_image_t* self,
|
||||||
float scale_factor,
|
float scale_factor,
|
||||||
@@ -100,9 +100,9 @@ typedef struct _cef_image_t {
|
|||||||
size_t png_data_size);
|
size_t png_data_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
|
// 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
|
// 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.
|
// transparency so the alpha byte will be set to 0xFF for all pixels.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* add_jpeg)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* add_jpeg)(struct _cef_image_t* self,
|
||||||
float scale_factor,
|
float scale_factor,
|
||||||
@@ -110,34 +110,33 @@ typedef struct _cef_image_t {
|
|||||||
size_t jpeg_data_size);
|
size_t jpeg_data_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the image width in density independent pixel (DIP) units.
|
// 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.
|
// 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
|
// Returns true (1) if this image contains a representation for
|
||||||
/// |scale_factor|.
|
// |scale_factor|.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* has_representation)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* has_representation)(struct _cef_image_t* self,
|
||||||
float scale_factor);
|
float scale_factor);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Removes the representation for |scale_factor|. Returns true (1) on
|
// Removes the representation for |scale_factor|. Returns true (1) on success.
|
||||||
/// success.
|
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* remove_representation)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* remove_representation)(struct _cef_image_t* self,
|
||||||
float scale_factor);
|
float scale_factor);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns information for the representation that most closely matches
|
// Returns information for the representation that most closely matches
|
||||||
/// |scale_factor|. |actual_scale_factor| is the actual scale factor for the
|
// |scale_factor|. |actual_scale_factor| is the actual scale factor for the
|
||||||
/// representation. |pixel_width| and |pixel_height| are the representation
|
// representation. |pixel_width| and |pixel_height| are the representation
|
||||||
/// size in pixel coordinates. Returns true (1) on success.
|
// size in pixel coordinates. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_representation_info)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* get_representation_info)(struct _cef_image_t* self,
|
||||||
float scale_factor,
|
float scale_factor,
|
||||||
@@ -146,12 +145,12 @@ typedef struct _cef_image_t {
|
|||||||
int* pixel_height);
|
int* pixel_height);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the bitmap representation that most closely matches
|
// Returns the bitmap representation that most closely matches |scale_factor|.
|
||||||
/// |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |color_type|
|
// Only 32-bit RGBA/BGRA formats are supported. |color_type| and |alpha_type|
|
||||||
/// and |alpha_type| values specify the desired output pixel format.
|
// values specify the desired output pixel format. |pixel_width| and
|
||||||
/// |pixel_width| and |pixel_height| are the output representation size in
|
// |pixel_height| are the output representation size in pixel coordinates.
|
||||||
/// pixel coordinates. Returns a cef_binary_value_t containing the pixel data
|
// Returns a cef_binary_value_t containing the pixel data on success or NULL
|
||||||
/// on success or NULL on failure.
|
// on failure.
|
||||||
///
|
///
|
||||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_bitmap)(
|
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_bitmap)(
|
||||||
struct _cef_image_t* self,
|
struct _cef_image_t* self,
|
||||||
@@ -162,12 +161,12 @@ typedef struct _cef_image_t {
|
|||||||
int* pixel_height);
|
int* pixel_height);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the PNG representation that most closely matches |scale_factor|.
|
// Returns the PNG representation that most closely matches |scale_factor|. If
|
||||||
/// If |with_transparency| is true (1) any alpha transparency in the image
|
// |with_transparency| is true (1) any alpha transparency in the image will be
|
||||||
/// will be represented in the resulting PNG data. |pixel_width| and
|
// represented in the resulting PNG data. |pixel_width| and |pixel_height| are
|
||||||
/// |pixel_height| are the output representation size in pixel coordinates.
|
// the output representation size in pixel coordinates. Returns a
|
||||||
/// Returns a cef_binary_value_t containing the PNG image data on success or
|
// cef_binary_value_t containing the PNG image data on success or NULL on
|
||||||
/// NULL on failure.
|
// failure.
|
||||||
///
|
///
|
||||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_png)(
|
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_png)(
|
||||||
struct _cef_image_t* self,
|
struct _cef_image_t* self,
|
||||||
@@ -177,13 +176,13 @@ typedef struct _cef_image_t {
|
|||||||
int* pixel_height);
|
int* pixel_height);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the JPEG representation that most closely matches |scale_factor|.
|
// Returns the JPEG representation that most closely matches |scale_factor|.
|
||||||
/// |quality| determines the compression level with 0 == lowest and 100 ==
|
// |quality| determines the compression level with 0 == lowest and 100 ==
|
||||||
/// highest. The JPEG format does not support alpha transparency and the alpha
|
// highest. The JPEG format does not support alpha transparency and the alpha
|
||||||
/// channel, if any, will be discarded. |pixel_width| and |pixel_height| are
|
// channel, if any, will be discarded. |pixel_width| and |pixel_height| are
|
||||||
/// the output representation size in pixel coordinates. Returns a
|
// the output representation size in pixel coordinates. Returns a
|
||||||
/// cef_binary_value_t containing the JPEG image data on success or NULL on
|
// cef_binary_value_t containing the JPEG image data on success or NULL on
|
||||||
/// failure.
|
// failure.
|
||||||
///
|
///
|
||||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_jpeg)(
|
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_jpeg)(
|
||||||
struct _cef_image_t* self,
|
struct _cef_image_t* self,
|
||||||
@@ -194,10 +193,10 @@ typedef struct _cef_image_t {
|
|||||||
} cef_image_t;
|
} cef_image_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new cef_image_t. It will initially be NULL. Use the Add*()
|
// Create a new cef_image_t. It will initially be NULL. Use the Add*() functions
|
||||||
/// functions to add representations at different scale factors.
|
// to add representations at different scale factors.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_image_t* cef_image_create(void);
|
CEF_EXPORT cef_image_t* cef_image_create();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=c6810367ba3a17824247dcb17f87040cd021c295$
|
// $hash=d991e2a7d1a58a013e4d3a963361fed6918f4ec3$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
|
||||||
@@ -48,19 +48,18 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure used for asynchronous continuation of JavaScript dialog
|
// Callback structure used for asynchronous continuation of JavaScript dialog
|
||||||
/// requests.
|
// requests.
|
||||||
///
|
///
|
||||||
typedef struct _cef_jsdialog_callback_t {
|
typedef struct _cef_jsdialog_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Continue the JS dialog request. Set |success| to true (1) if the OK button
|
// 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
|
// was pressed. The |user_input| value should be specified for prompt dialogs.
|
||||||
/// dialogs.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_jsdialog_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_jsdialog_callback_t* self,
|
||||||
int success,
|
int success,
|
||||||
@@ -68,31 +67,31 @@ typedef struct _cef_jsdialog_callback_t {
|
|||||||
} cef_jsdialog_callback_t;
|
} cef_jsdialog_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to JavaScript dialogs. The
|
// Implement this structure to handle events related to JavaScript dialogs. The
|
||||||
/// functions of this structure will be called on the UI thread.
|
// functions of this structure will be called on the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_jsdialog_handler_t {
|
typedef struct _cef_jsdialog_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
|
// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
|
||||||
/// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
|
// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
|
||||||
/// and user-friendly display string. The |default_prompt_text| value will be
|
// and user-friendly display string. The |default_prompt_text| value will be
|
||||||
/// specified for prompt dialogs only. Set |suppress_message| to true (1) and
|
// specified for prompt dialogs only. Set |suppress_message| to true (1) and
|
||||||
/// return false (0) to suppress the message (suppressing messages is
|
// return false (0) to suppress the message (suppressing messages is
|
||||||
/// preferable to immediately executing the callback as this is used to detect
|
// preferable to immediately executing the callback as this is used to detect
|
||||||
/// presumably malicious behavior like spamming alert messages in
|
// presumably malicious behavior like spamming alert messages in
|
||||||
/// onbeforeunload). Set |suppress_message| to false (0) and return false (0)
|
// onbeforeunload). Set |suppress_message| to false (0) and return false (0)
|
||||||
/// to use the default implementation (the default implementation will show
|
// to use the default implementation (the default implementation will show one
|
||||||
/// one modal dialog at a time and suppress any additional dialog requests
|
// modal dialog at a time and suppress any additional dialog requests until
|
||||||
/// until the displayed dialog is dismissed). Return true (1) if the
|
// the displayed dialog is dismissed). Return true (1) if the application will
|
||||||
/// application will use a custom dialog or if the callback has been executed
|
// use a custom dialog or if the callback has been executed immediately.
|
||||||
/// immediately. Custom dialogs may be either modal or modeless. If a custom
|
// Custom dialogs may be either modal or modeless. If a custom dialog is used
|
||||||
/// dialog is used the application must execute |callback| once the custom
|
// the application must execute |callback| once the custom dialog is
|
||||||
/// dialog is dismissed.
|
// dismissed.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_jsdialog)(struct _cef_jsdialog_handler_t* self,
|
int(CEF_CALLBACK* on_jsdialog)(struct _cef_jsdialog_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -104,12 +103,12 @@ typedef struct _cef_jsdialog_handler_t {
|
|||||||
int* suppress_message);
|
int* suppress_message);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to run a dialog asking the user if they want to leave a page.
|
// Called to run a dialog asking the user if they want to leave a page. Return
|
||||||
/// Return false (0) to use the default dialog implementation. Return true (1)
|
// false (0) to use the default dialog implementation. Return true (1) if the
|
||||||
/// if the application will use a custom dialog or if the callback has been
|
// application will use a custom dialog or if the callback has been executed
|
||||||
/// executed immediately. Custom dialogs may be either modal or modeless. If a
|
// immediately. Custom dialogs may be either modal or modeless. If a custom
|
||||||
/// custom dialog is used the application must execute |callback| once the
|
// dialog is used the application must execute |callback| once the custom
|
||||||
/// custom dialog is dismissed.
|
// dialog is dismissed.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_before_unload_dialog)(
|
int(CEF_CALLBACK* on_before_unload_dialog)(
|
||||||
struct _cef_jsdialog_handler_t* self,
|
struct _cef_jsdialog_handler_t* self,
|
||||||
@@ -119,16 +118,16 @@ typedef struct _cef_jsdialog_handler_t {
|
|||||||
struct _cef_jsdialog_callback_t* callback);
|
struct _cef_jsdialog_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to cancel any pending dialogs and reset any saved dialog state.
|
// Called to cancel any pending dialogs and reset any saved dialog state. Will
|
||||||
/// Will be called due to events like page navigation irregardless of whether
|
// be called due to events like page navigation irregardless of whether any
|
||||||
/// any dialogs are currently pending.
|
// dialogs are currently pending.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_reset_dialog_state)(
|
void(CEF_CALLBACK* on_reset_dialog_state)(
|
||||||
struct _cef_jsdialog_handler_t* self,
|
struct _cef_jsdialog_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the dialog is closed.
|
// Called when the default implementation dialog is closed.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_dialog_closed)(struct _cef_jsdialog_handler_t* self,
|
void(CEF_CALLBACK* on_dialog_closed)(struct _cef_jsdialog_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=0bfe161c51cc6378b2e8e2e2b2c017b750b46864$
|
// $hash=d804a2db0f9ac13afd249407c85cb8d5852508ac$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
|
||||||
@@ -48,38 +48,37 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to keyboard input. The
|
// Implement this structure to handle events related to keyboard input. The
|
||||||
/// functions of this structure will be called on the UI thread.
|
// functions of this structure will be called on the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_keyboard_handler_t {
|
typedef struct _cef_keyboard_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called before a keyboard event is sent to the renderer. |event| contains
|
// Called before a keyboard event is sent to the renderer. |event| contains
|
||||||
/// information about the keyboard event. |os_event| is the operating system
|
// information about the keyboard event. |os_event| is the operating system
|
||||||
/// event message, if any. Return true (1) if the event was handled or false
|
// event message, if any. Return true (1) if the event was handled or false
|
||||||
/// (0) otherwise. If the event will be handled in on_key_event() as a
|
// (0) otherwise. If the event will be handled in on_key_event() as a keyboard
|
||||||
/// keyboard shortcut set |is_keyboard_shortcut| to true (1) and return false
|
// shortcut set |is_keyboard_shortcut| to true (1) and return false (0).
|
||||||
/// (0).
|
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_pre_key_event)(struct _cef_keyboard_handler_t* self,
|
int(CEF_CALLBACK* on_pre_key_event)(struct _cef_keyboard_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
const cef_key_event_t* event,
|
const struct _cef_key_event_t* event,
|
||||||
cef_event_handle_t os_event,
|
cef_event_handle_t os_event,
|
||||||
int* is_keyboard_shortcut);
|
int* is_keyboard_shortcut);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called after the renderer and JavaScript in the page has had a chance to
|
// Called after the renderer and JavaScript in the page has had a chance to
|
||||||
/// handle the event. |event| contains information about the keyboard event.
|
// handle the event. |event| contains information about the keyboard event.
|
||||||
/// |os_event| is the operating system event message, if any. Return true (1)
|
// |os_event| is the operating system event message, if any. Return true (1)
|
||||||
/// if the keyboard event was handled or false (0) otherwise.
|
// if the keyboard event was handled or false (0) otherwise.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_key_event)(struct _cef_keyboard_handler_t* self,
|
int(CEF_CALLBACK* on_key_event)(struct _cef_keyboard_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
const cef_key_event_t* event,
|
const struct _cef_key_event_t* event,
|
||||||
cef_event_handle_t os_event);
|
cef_event_handle_t os_event);
|
||||||
} cef_keyboard_handler_t;
|
} cef_keyboard_handler_t;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=54edf9e9c2a12acdc4cab55079a4a5cb8e2a1e43$
|
// $hash=e44bb89a337942c82bfa246275b4b033821b2782$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||||
@@ -50,40 +50,40 @@ extern "C" {
|
|||||||
struct _cef_client_t;
|
struct _cef_client_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to browser life span. The
|
// Implement this structure to handle events related to browser life span. The
|
||||||
/// functions of this structure will be called on the UI thread unless otherwise
|
// functions of this structure will be called on the UI thread unless otherwise
|
||||||
/// indicated.
|
// indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_life_span_handler_t {
|
typedef struct _cef_life_span_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on the UI thread before a new popup browser is created. The
|
// Called on the UI thread before a new popup browser is created. The
|
||||||
/// |browser| and |frame| values represent the source of the popup request.
|
// |browser| and |frame| values represent the source of the popup request. The
|
||||||
/// The |target_url| and |target_frame_name| values indicate where the popup
|
// |target_url| and |target_frame_name| values indicate where the popup
|
||||||
/// browser should navigate and may be NULL if not specified with the request.
|
// browser should navigate and may be NULL if not specified with the request.
|
||||||
/// The |target_disposition| value indicates where the user intended to open
|
// The |target_disposition| value indicates where the user intended to open
|
||||||
/// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
|
// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
|
||||||
/// be true (1) if the popup was opened via explicit user gesture (e.g.
|
// be true (1) if the popup was opened via explicit user gesture (e.g.
|
||||||
/// clicking a link) or false (0) if the popup opened automatically (e.g. via
|
// clicking a link) or false (0) if the popup opened automatically (e.g. via
|
||||||
/// the DomContentLoaded event). The |popupFeatures| structure contains
|
// the DomContentLoaded event). The |popupFeatures| structure contains
|
||||||
/// additional information about the requested popup window. To allow creation
|
// additional information about the requested popup window. To allow creation
|
||||||
/// of the popup browser optionally modify |windowInfo|, |client|, |settings|
|
// of the popup browser optionally modify |windowInfo|, |client|, |settings|
|
||||||
/// and |no_javascript_access| and return false (0). To cancel creation of the
|
// and |no_javascript_access| and return false (0). To cancel creation of the
|
||||||
/// popup browser return true (1). The |client| and |settings| values will
|
// popup browser return true (1). The |client| and |settings| values will
|
||||||
/// default to the source browser's values. If the |no_javascript_access|
|
// default to the source browser's values. If the |no_javascript_access| value
|
||||||
/// value is set to false (0) the new browser will not be scriptable and may
|
// is set to false (0) the new browser will not be scriptable and may not be
|
||||||
/// not be hosted in the same renderer process as the source browser. Any
|
// hosted in the same renderer process as the source browser. Any
|
||||||
/// modifications to |windowInfo| will be ignored if the parent browser is
|
// modifications to |windowInfo| will be ignored if the parent browser is
|
||||||
/// wrapped in a cef_browser_view_t. Popup browser creation will be canceled
|
// wrapped in a cef_browser_view_t. Popup browser creation will be canceled if
|
||||||
/// if the parent browser is destroyed before the popup browser creation
|
// the parent browser is destroyed before the popup browser creation completes
|
||||||
/// completes (indicated by a call to OnAfterCreated for the popup browser).
|
// (indicated by a call to OnAfterCreated for the popup browser). The
|
||||||
/// The |extra_info| parameter provides an opportunity to specify extra
|
// |extra_info| parameter provides an opportunity to specify extra information
|
||||||
/// information specific to the created popup browser that will be passed to
|
// specific to the created popup browser that will be passed to
|
||||||
/// cef_render_process_handler_t::on_browser_created() in the render process.
|
// cef_render_process_handler_t::on_browser_created() in the render process.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_before_popup)(
|
int(CEF_CALLBACK* on_before_popup)(
|
||||||
struct _cef_life_span_handler_t* self,
|
struct _cef_life_span_handler_t* self,
|
||||||
@@ -93,7 +93,7 @@ typedef struct _cef_life_span_handler_t {
|
|||||||
const cef_string_t* target_frame_name,
|
const cef_string_t* target_frame_name,
|
||||||
cef_window_open_disposition_t target_disposition,
|
cef_window_open_disposition_t target_disposition,
|
||||||
int user_gesture,
|
int user_gesture,
|
||||||
const cef_popup_features_t* popupFeatures,
|
const struct _cef_popup_features_t* popupFeatures,
|
||||||
struct _cef_window_info_t* windowInfo,
|
struct _cef_window_info_t* windowInfo,
|
||||||
struct _cef_client_t** client,
|
struct _cef_client_t** client,
|
||||||
struct _cef_browser_settings_t* settings,
|
struct _cef_browser_settings_t* settings,
|
||||||
@@ -101,146 +101,117 @@ typedef struct _cef_life_span_handler_t {
|
|||||||
int* no_javascript_access);
|
int* no_javascript_access);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on the UI thread before a new DevTools popup browser is created.
|
// Called after a new browser is created. It is now safe to begin performing
|
||||||
/// The |browser| value represents the source of the popup request. Optionally
|
// actions with |browser|. cef_frame_handler_t callbacks related to initial
|
||||||
/// modify |windowInfo|, |client|, |settings| and |extra_info| values. The
|
// main frame creation will arrive before this callback. See
|
||||||
/// |client|, |settings| and |extra_info| values will default to the source
|
// cef_frame_handler_t documentation for additional usage information.
|
||||||
/// browser's values. Any modifications to |windowInfo| will be ignored if the
|
|
||||||
/// parent browser is Views-hosted (wrapped in a cef_browser_view_t).
|
|
||||||
///
|
|
||||||
/// 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.
|
|
||||||
/// The existing |extra_info| object, if any, will be read-only but may be
|
|
||||||
/// replaced with a new object.
|
|
||||||
///
|
|
||||||
/// Views-hosted source browsers will create Views-hosted DevTools popups
|
|
||||||
/// unless |use_default_window| is set to to true (1). DevTools popups can be
|
|
||||||
/// blocked by returning true (1) from cef_command_handler_t::OnChromeCommand
|
|
||||||
/// for IDC_DEV_TOOLS. Only used with the Chrome runtime.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* on_before_dev_tools_popup)(
|
|
||||||
struct _cef_life_span_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
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* use_default_window);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called after a new browser is created. It is now safe to begin performing
|
|
||||||
/// actions with |browser|. cef_frame_handler_t callbacks related to initial
|
|
||||||
/// main frame creation will arrive before this callback. See
|
|
||||||
/// cef_frame_handler_t documentation for additional usage information.
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_after_created)(struct _cef_life_span_handler_t* self,
|
void(CEF_CALLBACK* on_after_created)(struct _cef_life_span_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a browser has received a request to close. This may result
|
// Called when a browser has recieved a request to close. This may result
|
||||||
/// directly from a call to cef_browser_host_t::*close_browser() or indirectly
|
// directly from a call to cef_browser_host_t::*close_browser() or indirectly
|
||||||
/// if the browser is parented to a top-level window created by CEF and the
|
// if the browser is parented to a top-level window created by CEF and the
|
||||||
/// user attempts to close that window (by clicking the 'X', for example). The
|
// user attempts to close that window (by clicking the 'X', for example). The
|
||||||
/// do_close() function will be called after the JavaScript 'onunload' event
|
// do_close() function will be called after the JavaScript 'onunload' event
|
||||||
/// has been fired.
|
// has been fired.
|
||||||
///
|
//
|
||||||
/// An application should handle top-level owner window close notifications by
|
// An application should handle top-level owner window close notifications by
|
||||||
/// calling cef_browser_host_t::try_close_browser() or
|
// calling cef_browser_host_t::try_close_browser() or
|
||||||
/// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
|
// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
|
||||||
/// to close immediately (see the examples below). This gives CEF an
|
// to close immediately (see the examples below). This gives CEF an
|
||||||
/// opportunity to process the 'onbeforeunload' event and optionally cancel
|
// opportunity to process the 'onbeforeunload' event and optionally cancel the
|
||||||
/// the close before do_close() is called.
|
// close before do_close() is called.
|
||||||
///
|
//
|
||||||
/// When windowed rendering is enabled CEF will internally create a window or
|
// When windowed rendering is enabled CEF will internally create a window or
|
||||||
/// view to host the browser. In that case returning false (0) from do_close()
|
// view to host the browser. In that case returning false (0) from do_close()
|
||||||
/// will send the standard close notification to the browser's top-level owner
|
// will send the standard close notification to the browser's top-level owner
|
||||||
/// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
|
// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
|
||||||
/// Linux or cef_window_delegate_t::can_close() callback from Views). If the
|
// Linux or cef_window_delegate_t::can_close() callback from Views). If the
|
||||||
/// browser's host window/view has already been destroyed (via view hierarchy
|
// browser's host window/view has already been destroyed (via view hierarchy
|
||||||
/// tear-down, for example) then do_close() will not be called for that
|
// tear-down, for example) then do_close() will not be called for that browser
|
||||||
/// browser since is no longer possible to cancel the close.
|
// since is no longer possible to cancel the close.
|
||||||
///
|
//
|
||||||
/// When windowed rendering is disabled returning false (0) from do_close()
|
// When windowed rendering is disabled returning false (0) from do_close()
|
||||||
/// will cause the browser object to be destroyed immediately.
|
// will cause the browser object to be destroyed immediately.
|
||||||
///
|
//
|
||||||
/// If the browser's top-level owner window requires a non-standard close
|
// If the browser's top-level owner window requires a non-standard close
|
||||||
/// notification then send that notification from do_close() and return true
|
// notification then send that notification from do_close() and return true
|
||||||
/// (1).
|
// (1).
|
||||||
///
|
//
|
||||||
/// The cef_life_span_handler_t::on_before_close() function will be called
|
// The cef_life_span_handler_t::on_before_close() function will be called
|
||||||
/// after do_close() (if do_close() is called) and immediately before the
|
// after do_close() (if do_close() is called) and immediately before the
|
||||||
/// browser object is destroyed. The application should only exit after
|
// browser object is destroyed. The application should only exit after
|
||||||
/// on_before_close() has been called for all existing browsers.
|
// on_before_close() has been called for all existing browsers.
|
||||||
///
|
//
|
||||||
/// The below examples describe what should happen during window close when
|
// The below examples describe what should happen during window close when the
|
||||||
/// the browser is parented to an application-provided top-level window.
|
// browser is parented to an application-provided top-level window.
|
||||||
///
|
//
|
||||||
/// Example 1: Using cef_browser_host_t::try_close_browser(). This is
|
// Example 1: Using cef_browser_host_t::try_close_browser(). This is
|
||||||
/// recommended for clients using standard close handling and windows created
|
// recommended for clients using standard close handling and windows created
|
||||||
/// on the browser process UI thread. 1. User clicks the window close button
|
// on the browser process UI thread. 1. User clicks the window close button
|
||||||
/// which sends a close notification
|
// which sends a close notification to
|
||||||
/// to the application's top-level window.
|
// the application's top-level window.
|
||||||
/// 2. Application's top-level window receives the close notification and
|
// 2. Application's top-level window receives the close notification and
|
||||||
/// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
|
// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
|
||||||
/// TryCloseBrowser() returns false so the client cancels the window
|
// TryCloseBrowser() returns false so the client cancels the window close.
|
||||||
/// close.
|
// 3. JavaScript 'onbeforeunload' handler executes and shows the close
|
||||||
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
|
// confirmation dialog (which can be overridden via
|
||||||
/// confirmation dialog (which can be overridden via
|
// CefJSDialogHandler::OnBeforeUnloadDialog()).
|
||||||
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
|
// 4. User approves the close. 5. JavaScript 'onunload' handler executes. 6.
|
||||||
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
|
// CEF sends a close notification to the application's top-level window
|
||||||
/// 6. CEF sends a close notification to the application's top-level window
|
// (because DoClose() returned false by default).
|
||||||
/// (because DoClose() returned false by default).
|
// 7. Application's top-level window receives the close notification and
|
||||||
/// 7. Application's top-level window receives the close notification and
|
// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
|
||||||
/// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
|
// allows the window close.
|
||||||
/// allows the window close.
|
// 8. Application's top-level window is destroyed. 9. Application's
|
||||||
/// 8. Application's top-level window is destroyed. 9. Application's
|
// on_before_close() handler is called and the browser object
|
||||||
/// on_before_close() handler is called and the browser object
|
// is destroyed.
|
||||||
/// is destroyed.
|
// 10. Application exits by calling cef_quit_message_loop() if no other
|
||||||
/// 10. Application exits by calling cef_quit_message_loop() if no other
|
// browsers
|
||||||
/// browsers
|
// exist.
|
||||||
/// exist.
|
//
|
||||||
///
|
// Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and
|
||||||
/// Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and
|
// implementing the do_close() callback. This is recommended for clients using
|
||||||
/// implementing the do_close() callback. This is recommended for clients
|
// non-standard close handling or windows that were not created on the browser
|
||||||
/// using non-standard close handling or windows that were not created on the
|
// process UI thread. 1. User clicks the window close button which sends a
|
||||||
/// browser process UI thread. 1. User clicks the window close button which
|
// close notification to
|
||||||
/// sends a close notification
|
// the application's top-level window.
|
||||||
/// to the application's top-level window.
|
// 2. Application's top-level window receives the close notification and:
|
||||||
/// 2. Application's top-level window receives the close notification and:
|
// A. Calls CefBrowserHost::CloseBrowser(false).
|
||||||
/// A. Calls CefBrowserHost::CloseBrowser(false).
|
// B. Cancels the window close.
|
||||||
/// B. Cancels the window close.
|
// 3. JavaScript 'onbeforeunload' handler executes and shows the close
|
||||||
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
|
// confirmation dialog (which can be overridden via
|
||||||
/// confirmation dialog (which can be overridden via
|
// CefJSDialogHandler::OnBeforeUnloadDialog()).
|
||||||
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
|
// 4. User approves the close. 5. JavaScript 'onunload' handler executes. 6.
|
||||||
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
|
// Application's do_close() handler is called. Application will:
|
||||||
/// 6. Application's do_close() handler is called. Application will:
|
// A. Set a flag to indicate that the next close attempt will be allowed.
|
||||||
/// A. Set a flag to indicate that the next close attempt will be allowed.
|
// B. Return false.
|
||||||
/// B. Return false.
|
// 7. CEF sends an close notification to the application's top-level window.
|
||||||
/// 7. CEF sends an close notification to the application's top-level window.
|
// 8. Application's top-level window receives the close notification and
|
||||||
/// 8. Application's top-level window receives the close notification and
|
// allows the window to close based on the flag from #6B.
|
||||||
/// allows the window to close based on the flag from #6B.
|
// 9. Application's top-level window is destroyed. 10. Application's
|
||||||
/// 9. Application's top-level window is destroyed. 10. Application's
|
// on_before_close() handler is called and the browser object
|
||||||
/// on_before_close() handler is called and the browser object
|
// is destroyed.
|
||||||
/// is destroyed.
|
// 11. Application exits by calling cef_quit_message_loop() if no other
|
||||||
/// 11. Application exits by calling cef_quit_message_loop() if no other
|
// browsers
|
||||||
/// browsers
|
// exist.
|
||||||
/// exist.
|
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* do_close)(struct _cef_life_span_handler_t* self,
|
int(CEF_CALLBACK* do_close)(struct _cef_life_span_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called just before a browser is destroyed. Release all references to the
|
// 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
|
// browser object and do not attempt to execute any functions on the browser
|
||||||
/// object (other than IsValid, GetIdentifier or IsSame) after this callback
|
// object (other than IsValid, GetIdentifier or IsSame) after this callback
|
||||||
/// returns. cef_frame_handler_t callbacks related to final main frame
|
// returns. cef_frame_handler_t callbacks related to final main frame
|
||||||
/// destruction will arrive after this callback and cef_browser_t::IsValid
|
// destruction will arrive after this callback and cef_browser_t::IsValid will
|
||||||
/// will return false (0) at that time. Any in-progress network requests
|
// return false (0) at that time. Any in-progress network requests associated
|
||||||
/// associated with |browser| will be aborted when the browser is destroyed,
|
// with |browser| will be aborted when the browser is destroyed, and
|
||||||
/// and cef_resource_request_handler_t callbacks related to those requests may
|
// cef_resource_request_handler_t callbacks related to those requests may
|
||||||
/// still arrive on the IO thread after this callback. See cef_frame_handler_t
|
// still arrive on the IO thread after this callback. See cef_frame_handler_t
|
||||||
/// and do_close() documentation for additional usage information.
|
// and do_close() documentation for additional usage information.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_before_close)(struct _cef_life_span_handler_t* self,
|
void(CEF_CALLBACK* on_before_close)(struct _cef_life_span_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=eb842e65cd2e7c4a8a6baa2813b57ac0d3977261$
|
// $hash=6c6a719d7cbbc01adfdc9bbe0dff6da10e06e3f3$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
||||||
@@ -49,22 +49,22 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events related to browser load status.
|
// Implement this structure to handle events related to browser load status. The
|
||||||
/// The functions of this structure will be called on the browser process UI
|
// functions of this structure will be called on the browser process UI thread
|
||||||
/// thread or render process main thread (TID_RENDERER).
|
// or render process main thread (TID_RENDERER).
|
||||||
///
|
///
|
||||||
typedef struct _cef_load_handler_t {
|
typedef struct _cef_load_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the loading state has changed. This callback will be executed
|
// Called when the loading state has changed. This callback will be executed
|
||||||
/// twice -- once when loading is initiated either programmatically or by user
|
// twice -- once when loading is initiated either programmatically or by user
|
||||||
/// action, and once when loading is terminated due to completion,
|
// action, and once when loading is terminated due to completion, cancellation
|
||||||
/// cancellation of failure. It will be called before any calls to OnLoadStart
|
// of failure. It will be called before any calls to OnLoadStart and after all
|
||||||
/// and after all calls to OnLoadError and/or OnLoadEnd.
|
// calls to OnLoadError and/or OnLoadEnd.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self,
|
void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -73,16 +73,16 @@ typedef struct _cef_load_handler_t {
|
|||||||
int canGoForward);
|
int canGoForward);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called after a navigation has been committed and before the browser begins
|
// Called after a navigation has been committed and before the browser begins
|
||||||
/// loading contents in the frame. The |frame| value will never be NULL --
|
// loading contents in the frame. The |frame| value will never be NULL -- call
|
||||||
/// call the is_main() function to check if this frame is the main frame.
|
// the is_main() function to check if this frame is the main frame.
|
||||||
/// |transition_type| provides information about the source of the navigation
|
// |transition_type| provides information about the source of the navigation
|
||||||
/// and an accurate value is only available in the browser process. Multiple
|
// 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
|
// 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
|
// loading after the main frame load has ended. This function will not be
|
||||||
/// called for same page navigations (fragments, history state, etc.) or for
|
// called for same page navigations (fragments, history state, etc.) or for
|
||||||
/// navigations that fail or are canceled before commit. For notification of
|
// navigations that fail or are canceled before commit. For notification of
|
||||||
/// overall browser load status use OnLoadingStateChange instead.
|
// overall browser load status use OnLoadingStateChange instead.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_load_start)(struct _cef_load_handler_t* self,
|
void(CEF_CALLBACK* on_load_start)(struct _cef_load_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -90,14 +90,14 @@ typedef struct _cef_load_handler_t {
|
|||||||
cef_transition_type_t transition_type);
|
cef_transition_type_t transition_type);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the browser is done loading a frame. The |frame| value will
|
// 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
|
// 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
|
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
||||||
/// may start or continue loading after the main frame load has ended. This
|
// start or continue loading after the main frame load has ended. This
|
||||||
/// function will not be called for same page navigations (fragments, history
|
// function will not be called for same page navigations (fragments, history
|
||||||
/// state, etc.) or for navigations that fail or are canceled before commit.
|
// state, etc.) or for navigations that fail or are canceled before commit.
|
||||||
/// For notification of overall browser load status use OnLoadingStateChange
|
// For notification of overall browser load status use OnLoadingStateChange
|
||||||
/// instead.
|
// instead.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self,
|
void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -105,11 +105,11 @@ typedef struct _cef_load_handler_t {
|
|||||||
int httpStatusCode);
|
int httpStatusCode);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a navigation fails or is canceled. This function may be called
|
// 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
|
// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
|
||||||
/// after commit. |errorCode| is the error code number, |errorText| is the
|
// after commit. |errorCode| is the error code number, |errorText| is the
|
||||||
/// error text and |failedUrl| is the URL that failed to load. See
|
// 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.
|
// 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,
|
void(CEF_CALLBACK* on_load_error)(struct _cef_load_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
// Copyright (c) 2022 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=91101808168ec0faf1f39b1924579e31478a6616$
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ACCESS_HANDLER_CAPI_H_
|
|
||||||
#define CEF_INCLUDE_CAPI_CEF_MEDIA_ACCESS_HANDLER_CAPI_H_
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "include/capi/cef_base_capi.h"
|
|
||||||
#include "include/capi/cef_browser_capi.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
///
|
|
||||||
// Callback structure used for asynchronous continuation of media access
|
|
||||||
// permission requests.
|
|
||||||
///
|
|
||||||
typedef struct _cef_media_access_callback_t {
|
|
||||||
///
|
|
||||||
// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Call to allow or deny media access. If this callback was initiated in
|
|
||||||
// response to a getUserMedia (indicated by
|
|
||||||
// CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE and/or
|
|
||||||
// CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE being set) the
|
|
||||||
// |allowed_permissions| are required to match those given in
|
|
||||||
// |required_permissions| in the OnRequestMediaAccessPermission.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_media_access_callback_t* self,
|
|
||||||
int allowed_permissions);
|
|
||||||
|
|
||||||
///
|
|
||||||
// Cancel the media access request.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* cancel)(struct _cef_media_access_callback_t* self);
|
|
||||||
} cef_media_access_callback_t;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Implement this structure to handle events related to media access permission
|
|
||||||
// requests. The functions of this structure will be called on the browser
|
|
||||||
// process UI thread.
|
|
||||||
///
|
|
||||||
typedef struct _cef_media_access_handler_t {
|
|
||||||
///
|
|
||||||
// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
// Called when a page requests permission to access media. |requesting_url| is
|
|
||||||
// the URL requesting permission. Return true (1) and call
|
|
||||||
// cef_media_access_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_media_access_permission)(
|
|
||||||
struct _cef_media_access_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
struct _cef_frame_t* frame,
|
|
||||||
const cef_string_t* requesting_url,
|
|
||||||
int32_t requested_permissions,
|
|
||||||
struct _cef_media_access_callback_t* callback);
|
|
||||||
} cef_media_access_handler_t;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CAPI_CEF_MEDIA_ACCESS_HANDLER_CAPI_H_
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=8eec1100e8470cbe3ebc54d5962416d2fa4d57fb$
|
// $hash=79e4e38c732c0cfeef495c8a9726e105054012bb$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
|
||||||
@@ -56,46 +56,46 @@ struct _cef_media_sink_t;
|
|||||||
struct _cef_media_source_t;
|
struct _cef_media_source_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Supports discovery of and communication with media devices on the local
|
// Supports discovery of and communication with media devices on the local
|
||||||
/// network via the Cast and DIAL protocols. The functions of this structure may
|
// network via the Cast and DIAL protocols. The functions of this structure may
|
||||||
/// be called on any browser process thread unless otherwise indicated.
|
// be called on any browser process thread unless otherwise indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_media_router_t {
|
typedef struct _cef_media_router_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add an observer for MediaRouter events. The observer will remain
|
// Add an observer for MediaRouter events. The observer will remain registered
|
||||||
/// registered until the returned Registration object is destroyed.
|
// until the returned Registration object is destroyed.
|
||||||
///
|
///
|
||||||
struct _cef_registration_t*(CEF_CALLBACK* add_observer)(
|
struct _cef_registration_t*(CEF_CALLBACK* add_observer)(
|
||||||
struct _cef_media_router_t* self,
|
struct _cef_media_router_t* self,
|
||||||
struct _cef_media_observer_t* observer);
|
struct _cef_media_observer_t* observer);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns a MediaSource object for the specified media source URN. Supported
|
// Returns a MediaSource object for the specified media source URN. Supported
|
||||||
/// URN schemes include "cast:" and "dial:", and will be already known by the
|
// URN schemes include "cast:" and "dial:", and will be already known by the
|
||||||
/// client application (e.g. "cast:<appId>?clientId=<clientId>").
|
// client application (e.g. "cast:<appId>?clientId=<clientId>").
|
||||||
///
|
///
|
||||||
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
|
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
|
||||||
struct _cef_media_router_t* self,
|
struct _cef_media_router_t* self,
|
||||||
const cef_string_t* urn);
|
const cef_string_t* urn);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Trigger an asynchronous call to cef_media_observer_t::OnSinks on all
|
// Trigger an asynchronous call to cef_media_observer_t::OnSinks on all
|
||||||
/// registered observers.
|
// registered observers.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* notify_current_sinks)(struct _cef_media_router_t* self);
|
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
|
// Create a new route between |source| and |sink|. Source and sink must be
|
||||||
/// valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and
|
// valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and
|
||||||
/// a route between them must not already exist. |callback| will be executed
|
// a route between them must not already exist. |callback| will be executed on
|
||||||
/// on success or failure. If route creation succeeds it will also trigger an
|
// success or failure. If route creation succeeds it will also trigger an
|
||||||
/// asynchronous call to cef_media_observer_t::OnRoutes on all registered
|
// asynchronous call to cef_media_observer_t::OnRoutes on all registered
|
||||||
/// observers.
|
// observers.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* create_route)(
|
void(CEF_CALLBACK* create_route)(
|
||||||
struct _cef_media_router_t* self,
|
struct _cef_media_router_t* self,
|
||||||
@@ -104,51 +104,51 @@ typedef struct _cef_media_router_t {
|
|||||||
struct _cef_media_route_create_callback_t* callback);
|
struct _cef_media_route_create_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Trigger an asynchronous call to cef_media_observer_t::OnRoutes on all
|
// Trigger an asynchronous call to cef_media_observer_t::OnRoutes on all
|
||||||
/// registered observers.
|
// registered observers.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* notify_current_routes)(struct _cef_media_router_t* self);
|
void(CEF_CALLBACK* notify_current_routes)(struct _cef_media_router_t* self);
|
||||||
} cef_media_router_t;
|
} cef_media_router_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the MediaRouter object associated with the global request context.
|
// Returns the MediaRouter object associated with the global request context. If
|
||||||
/// If |callback| is non-NULL it will be executed asnychronously on the UI
|
// |callback| is non-NULL it will be executed asnychronously on the UI thread
|
||||||
/// thread after the manager's storage has been initialized. Equivalent to
|
// after the manager's storage has been initialized. Equivalent to calling cef_r
|
||||||
/// calling cef_request_context_t::cef_request_context_get_global_context()-
|
// equest_context_t::cef_request_context_get_global_context()->get_media_router(
|
||||||
/// >get_media_router().
|
// ).
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_media_router_t* cef_media_router_get_global(
|
CEF_EXPORT cef_media_router_t* cef_media_router_get_global(
|
||||||
struct _cef_completion_callback_t* callback);
|
struct _cef_completion_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implemented by the client to observe MediaRouter events and registered via
|
// Implemented by the client to observe MediaRouter events and registered via
|
||||||
/// cef_media_router_t::AddObserver. The functions of this structure will be
|
// cef_media_router_t::AddObserver. The functions of this structure will be
|
||||||
/// called on the browser process UI thread.
|
// called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_media_observer_t {
|
typedef struct _cef_media_observer_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The list of available media sinks has changed or
|
// The list of available media sinks has changed or
|
||||||
/// cef_media_router_t::NotifyCurrentSinks was called.
|
// cef_media_router_t::NotifyCurrentSinks was called.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_sinks)(struct _cef_media_observer_t* self,
|
void(CEF_CALLBACK* on_sinks)(struct _cef_media_observer_t* self,
|
||||||
size_t sinksCount,
|
size_t sinksCount,
|
||||||
struct _cef_media_sink_t* const* sinks);
|
struct _cef_media_sink_t* const* sinks);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The list of available media routes has changed or
|
// The list of available media routes has changed or
|
||||||
/// cef_media_router_t::NotifyCurrentRoutes was called.
|
// cef_media_router_t::NotifyCurrentRoutes was called.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_routes)(struct _cef_media_observer_t* self,
|
void(CEF_CALLBACK* on_routes)(struct _cef_media_observer_t* self,
|
||||||
size_t routesCount,
|
size_t routesCount,
|
||||||
struct _cef_media_route_t* const* routes);
|
struct _cef_media_route_t* const* routes);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The connection state of |route| has changed.
|
// The connection state of |route| has changed.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_route_state_changed)(
|
void(CEF_CALLBACK* on_route_state_changed)(
|
||||||
struct _cef_media_observer_t* self,
|
struct _cef_media_observer_t* self,
|
||||||
@@ -156,8 +156,8 @@ typedef struct _cef_media_observer_t {
|
|||||||
cef_media_route_connection_state_t state);
|
cef_media_route_connection_state_t state);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// A message was received over |route|. |message| is only valid for the scope
|
// A message was recieved over |route|. |message| is only valid for the scope
|
||||||
/// of this callback and should be copied if necessary.
|
// of this callback and should be copied if necessary.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_route_message_received)(
|
void(CEF_CALLBACK* on_route_message_received)(
|
||||||
struct _cef_media_observer_t* self,
|
struct _cef_media_observer_t* self,
|
||||||
@@ -167,65 +167,65 @@ typedef struct _cef_media_observer_t {
|
|||||||
} cef_media_observer_t;
|
} cef_media_observer_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Represents the route between a media source and sink. Instances of this
|
// Represents the route between a media source and sink. Instances of this
|
||||||
/// object are created via cef_media_router_t::CreateRoute and retrieved via
|
// object are created via cef_media_router_t::CreateRoute and retrieved via
|
||||||
/// cef_media_observer_t::OnRoutes. Contains the status and metadata of a
|
// cef_media_observer_t::OnRoutes. Contains the status and metadata of a routing
|
||||||
/// routing operation. The functions of this structure may be called on any
|
// operation. The functions of this structure may be called on any browser
|
||||||
/// browser process thread unless otherwise indicated.
|
// process thread unless otherwise indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_media_route_t {
|
typedef struct _cef_media_route_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the ID for this route.
|
// Returns the ID for this route.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_route_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the source associated with this route.
|
// Returns the source associated with this route.
|
||||||
///
|
///
|
||||||
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
|
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
|
||||||
struct _cef_media_route_t* self);
|
struct _cef_media_route_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the sink associated with this route.
|
// Returns the sink associated with this route.
|
||||||
///
|
///
|
||||||
struct _cef_media_sink_t*(CEF_CALLBACK* get_sink)(
|
struct _cef_media_sink_t*(CEF_CALLBACK* get_sink)(
|
||||||
struct _cef_media_route_t* self);
|
struct _cef_media_route_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Send a message over this route. |message| will be copied if necessary.
|
// Send a message over this route. |message| will be copied if necessary.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* send_route_message)(struct _cef_media_route_t* self,
|
void(CEF_CALLBACK* send_route_message)(struct _cef_media_route_t* self,
|
||||||
const void* message,
|
const void* message,
|
||||||
size_t message_size);
|
size_t message_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Terminate this route. Will result in an asynchronous call to
|
// Terminate this route. Will result in an asynchronous call to
|
||||||
/// cef_media_observer_t::OnRoutes on all registered observers.
|
// cef_media_observer_t::OnRoutes on all registered observers.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* terminate)(struct _cef_media_route_t* self);
|
void(CEF_CALLBACK* terminate)(struct _cef_media_route_t* self);
|
||||||
} cef_media_route_t;
|
} cef_media_route_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure for cef_media_router_t::CreateRoute. The functions of
|
// Callback structure for cef_media_router_t::CreateRoute. The functions of this
|
||||||
/// this structure will be called on the browser process UI thread.
|
// structure will be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_media_route_create_callback_t {
|
typedef struct _cef_media_route_create_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be executed when the route creation has finished.
|
// Method that will be executed when the route creation has finished. |result|
|
||||||
/// |result| will be CEF_MRCR_OK if the route creation succeeded. |error| will
|
// will be CEF_MRCR_OK if the route creation succeeded. |error| will be a
|
||||||
/// be a description of the error if the route creation failed. |route| is the
|
// description of the error if the route creation failed. |route| is the
|
||||||
/// resulting route, or NULL if the route creation failed.
|
// resulting route, or NULL if the route creation failed.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_media_route_create_finished)(
|
void(CEF_CALLBACK* on_media_route_create_finished)(
|
||||||
struct _cef_media_route_create_callback_t* self,
|
struct _cef_media_route_create_callback_t* self,
|
||||||
@@ -235,71 +235,78 @@ typedef struct _cef_media_route_create_callback_t {
|
|||||||
} cef_media_route_create_callback_t;
|
} cef_media_route_create_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Represents a sink to which media can be routed. Instances of this object are
|
// 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
|
// retrieved via cef_media_observer_t::OnSinks. The functions of this structure
|
||||||
/// may be called on any browser process thread unless otherwise indicated.
|
// may be called on any browser process thread unless otherwise indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_media_sink_t {
|
typedef struct _cef_media_sink_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the ID for this sink.
|
// Returns the ID for this sink.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_sink_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the name of this sink.
|
// Returns the name of this sink.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_media_sink_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the icon type for this sink.
|
// 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)(
|
cef_media_sink_icon_type_t(CEF_CALLBACK* get_icon_type)(
|
||||||
struct _cef_media_sink_t* self);
|
struct _cef_media_sink_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Asynchronously retrieves device info.
|
// Asynchronously retrieves device info.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_device_info)(
|
void(CEF_CALLBACK* get_device_info)(
|
||||||
struct _cef_media_sink_t* self,
|
struct _cef_media_sink_t* self,
|
||||||
struct _cef_media_sink_device_info_callback_t* callback);
|
struct _cef_media_sink_device_info_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this sink accepts content via Cast.
|
// Returns true (1) if this sink accepts content via Cast.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_cast_sink)(struct _cef_media_sink_t* self);
|
int(CEF_CALLBACK* is_cast_sink)(struct _cef_media_sink_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this sink accepts content via DIAL.
|
// Returns true (1) if this sink accepts content via DIAL.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_dial_sink)(struct _cef_media_sink_t* self);
|
int(CEF_CALLBACK* is_dial_sink)(struct _cef_media_sink_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this sink is compatible with |source|.
|
// Returns true (1) if this sink is compatible with |source|.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_compatible_with)(struct _cef_media_sink_t* self,
|
int(CEF_CALLBACK* is_compatible_with)(struct _cef_media_sink_t* self,
|
||||||
struct _cef_media_source_t* source);
|
struct _cef_media_source_t* source);
|
||||||
} cef_media_sink_t;
|
} cef_media_sink_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure for cef_media_sink_t::GetDeviceInfo. The functions of
|
// Callback structure for cef_media_sink_t::GetDeviceInfo. The functions of this
|
||||||
/// this structure will be called on the browser process UI thread.
|
// structure will be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_media_sink_device_info_callback_t {
|
typedef struct _cef_media_sink_device_info_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Method that will be executed asyncronously once device information has
|
// Method that will be executed asyncronously once device information has been
|
||||||
/// been retrieved.
|
// retrieved.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_media_sink_device_info)(
|
void(CEF_CALLBACK* on_media_sink_device_info)(
|
||||||
struct _cef_media_sink_device_info_callback_t* self,
|
struct _cef_media_sink_device_info_callback_t* self,
|
||||||
@@ -307,30 +314,30 @@ typedef struct _cef_media_sink_device_info_callback_t {
|
|||||||
} cef_media_sink_device_info_callback_t;
|
} cef_media_sink_device_info_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Represents a source from which media can be routed. Instances of this object
|
// 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
|
// are retrieved via cef_media_router_t::GetSource. The functions of this
|
||||||
/// structure may be called on any browser process thread unless otherwise
|
// structure may be called on any browser process thread unless otherwise
|
||||||
/// indicated.
|
// indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_media_source_t {
|
typedef struct _cef_media_source_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the ID (media source URN or URL) for this source.
|
// Returns the ID (media source URN or URL) for this source.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
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.
|
// Returns true (1) if this source outputs its content via Cast.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_cast_source)(struct _cef_media_source_t* self);
|
int(CEF_CALLBACK* is_cast_source)(struct _cef_media_source_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this source outputs its content via DIAL.
|
// Returns true (1) if this source outputs its content via DIAL.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_dial_source)(struct _cef_media_source_t* self);
|
int(CEF_CALLBACK* is_dial_source)(struct _cef_media_source_t* self);
|
||||||
} cef_media_source_t;
|
} cef_media_source_t;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=5dae0b1a1271e79a5fd9b2c6e71e7a719a450161$
|
// $hash=28fa978051bd3ddff69d58e0dc8f445f64a61480$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
||||||
@@ -48,54 +48,54 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Supports creation and modification of menus. See cef_menu_id_t for the
|
// Supports creation and modification of menus. See cef_menu_id_t for the
|
||||||
/// command ids that have default implementations. All user-defined command ids
|
// command ids that have default implementations. All user-defined command ids
|
||||||
/// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of
|
// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of
|
||||||
/// this structure can only be accessed on the browser process the UI thread.
|
// this structure can only be accessed on the browser process the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_menu_model_t {
|
typedef struct _cef_menu_model_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this menu is a submenu.
|
// Returns true (1) if this menu is a submenu.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_sub_menu)(struct _cef_menu_model_t* self);
|
int(CEF_CALLBACK* is_sub_menu)(struct _cef_menu_model_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Clears the menu. Returns true (1) on success.
|
// 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.
|
// Returns the number of items in this menu.
|
||||||
///
|
///
|
||||||
size_t(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.
|
// 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.
|
// Add an item to the menu. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* add_item)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* add_item)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add a check item to the menu. Returns true (1) on success.
|
// 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(CEF_CALLBACK* add_check_item)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add a radio item to the menu. Only a single item with the specified
|
// 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.
|
// |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(CEF_CALLBACK* add_radio_item)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
@@ -103,7 +103,7 @@ typedef struct _cef_menu_model_t {
|
|||||||
int group_id);
|
int group_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add a sub-menu to the menu. The new sub-menu is returned.
|
// 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*(CEF_CALLBACK* add_sub_menu)(
|
||||||
struct _cef_menu_model_t* self,
|
struct _cef_menu_model_t* self,
|
||||||
@@ -111,266 +111,260 @@ typedef struct _cef_menu_model_t {
|
|||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Insert a separator in the menu at the specified |index|. Returns true (1)
|
// Insert a separator in the menu at the specified |index|. Returns true (1)
|
||||||
/// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* insert_separator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* insert_separator_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index);
|
int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Insert an item in the menu at the specified |index|. Returns true (1) on
|
// Insert an item in the menu at the specified |index|. Returns true (1) on
|
||||||
/// success.
|
// success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* insert_item_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* insert_item_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int command_id,
|
int command_id,
|
||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Insert a check item in the menu at the specified |index|. Returns true (1)
|
// Insert a check item in the menu at the specified |index|. Returns true (1)
|
||||||
/// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* insert_check_item_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* insert_check_item_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int command_id,
|
int command_id,
|
||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Insert a radio item in the menu at the specified |index|. Only a single
|
// 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
|
// item with the specified |group_id| can be checked at a time. Returns true
|
||||||
/// (1) on success.
|
// (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* insert_radio_item_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* insert_radio_item_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int command_id,
|
int command_id,
|
||||||
const cef_string_t* label,
|
const cef_string_t* label,
|
||||||
int group_id);
|
int group_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Insert a sub-menu in the menu at the specified |index|. The new sub-menu
|
// Insert a sub-menu in the menu at the specified |index|. The new sub-menu is
|
||||||
/// is returned.
|
// returned.
|
||||||
///
|
///
|
||||||
struct _cef_menu_model_t*(CEF_CALLBACK* insert_sub_menu_at)(
|
struct _cef_menu_model_t*(CEF_CALLBACK* insert_sub_menu_at)(
|
||||||
struct _cef_menu_model_t* self,
|
struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int command_id,
|
int command_id,
|
||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Removes the item with the specified |command_id|. Returns true (1) on
|
// Removes the item with the specified |command_id|. Returns true (1) on
|
||||||
/// success.
|
// 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.
|
// Removes the item at the specified |index|. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* remove_at)(struct _cef_menu_model_t* self, size_t 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
|
// Returns the index associated with the specified |command_id| or -1 if not
|
||||||
/// found due to the command id not existing in the menu.
|
// found due to the command id not existing in the menu.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_index_of)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_index_of)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the command id at the specified |index| or -1 if not found due to
|
// Returns the command id at the specified |index| or -1 if not found due to
|
||||||
/// invalid range or the index being a separator.
|
// invalid range or the index being a separator.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_command_id_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_command_id_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index);
|
int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Sets the command id at the specified |index|. Returns true (1) on success.
|
// 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(CEF_CALLBACK* set_command_id_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the label for the specified |command_id| or NULL if not found.
|
// 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().
|
// 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,
|
cef_string_userfree_t(CEF_CALLBACK* get_label)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the label at the specified |index| or NULL if not found due to
|
// Returns the label at the specified |index| or NULL if not found due to
|
||||||
/// invalid range or the index being a separator.
|
// invalid range or the index being a separator.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t(
|
cef_string_userfree_t(
|
||||||
CEF_CALLBACK* get_label_at)(struct _cef_menu_model_t* self, size_t index);
|
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
|
// Sets the label for the specified |command_id|. Returns true (1) on success.
|
||||||
/// success.
|
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_label)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_label)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the label at the specified |index|. Returns true (1) on success.
|
// 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(CEF_CALLBACK* set_label_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the item type for the specified |command_id|.
|
// Returns the item type for the specified |command_id|.
|
||||||
///
|
///
|
||||||
cef_menu_item_type_t(CEF_CALLBACK* get_type)(struct _cef_menu_model_t* self,
|
cef_menu_item_type_t(CEF_CALLBACK* get_type)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the item type at the specified |index|.
|
// Returns the item type at the specified |index|.
|
||||||
///
|
///
|
||||||
cef_menu_item_type_t(
|
cef_menu_item_type_t(
|
||||||
CEF_CALLBACK* get_type_at)(struct _cef_menu_model_t* self, size_t index);
|
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.
|
// 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(CEF_CALLBACK* get_group_id)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the group id at the specified |index| or -1 if invalid.
|
// 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(CEF_CALLBACK* get_group_id_at)(struct _cef_menu_model_t* self, int index);
|
||||||
size_t index);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Sets the group id for the specified |command_id|. Returns true (1) on
|
// Sets the group id for the specified |command_id|. Returns true (1) on
|
||||||
/// success.
|
// success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_group_id)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_group_id)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
int group_id);
|
int group_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Sets the group id at the specified |index|. Returns true (1) on success.
|
// 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(CEF_CALLBACK* set_group_id_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int group_id);
|
int group_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the submenu for the specified |command_id| or NULL if invalid.
|
// 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*(CEF_CALLBACK* get_sub_menu)(
|
||||||
struct _cef_menu_model_t* self,
|
struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the submenu at the specified |index| or NULL if invalid.
|
// 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*(
|
||||||
struct _cef_menu_model_t* self,
|
CEF_CALLBACK* get_sub_menu_at)(struct _cef_menu_model_t* self, int index);
|
||||||
size_t index);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the specified |command_id| is visible.
|
// 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.
|
// Returns true (1) if the specified |index| is visible.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_visible_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* is_visible_at)(struct _cef_menu_model_t* self, int index);
|
||||||
size_t index);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Change the visibility of the specified |command_id|. Returns true (1) on
|
// Change the visibility of the specified |command_id|. Returns true (1) on
|
||||||
/// success.
|
// success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_visible)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_visible)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
int visible);
|
int visible);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Change the visibility at the specified |index|. Returns true (1) on
|
// Change the visibility at the specified |index|. Returns true (1) on
|
||||||
/// success.
|
// success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_visible_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_visible_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int visible);
|
int visible);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the specified |command_id| is enabled.
|
// 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.
|
// Returns true (1) if the specified |index| is enabled.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_enabled_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* is_enabled_at)(struct _cef_menu_model_t* self, int index);
|
||||||
size_t index);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Change the enabled status of the specified |command_id|. Returns true (1)
|
// Change the enabled status of the specified |command_id|. Returns true (1)
|
||||||
/// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_enabled)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_enabled)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
int enabled);
|
int enabled);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Change the enabled status at the specified |index|. Returns true (1) on
|
// Change the enabled status at the specified |index|. Returns true (1) on
|
||||||
/// success.
|
// success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_enabled_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_enabled_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int enabled);
|
int enabled);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the specified |command_id| is checked. Only applies to
|
// Returns true (1) if the specified |command_id| is checked. Only applies to
|
||||||
/// check and radio items.
|
// 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
|
// Returns true (1) if the specified |index| is checked. Only applies to check
|
||||||
/// check and radio items.
|
// and radio items.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* is_checked_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* is_checked_at)(struct _cef_menu_model_t* self, int index);
|
||||||
size_t index);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Check the specified |command_id|. Only applies to check and radio items.
|
// Check the specified |command_id|. Only applies to check and radio items.
|
||||||
/// Returns true (1) on success.
|
// Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_checked)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_checked)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
int checked);
|
int checked);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Check the specified |index|. Only applies to check and radio items.
|
// Check the specified |index|. Only applies to check and radio items. Returns
|
||||||
/// Returns true (1) on success.
|
// true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_checked_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_checked_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int checked);
|
int checked);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the specified |command_id| has a keyboard accelerator
|
// Returns true (1) if the specified |command_id| has a keyboard accelerator
|
||||||
/// assigned.
|
// assigned.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* has_accelerator)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* has_accelerator)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the specified |index| has a keyboard accelerator
|
// Returns true (1) if the specified |index| has a keyboard accelerator
|
||||||
/// assigned.
|
// assigned.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* has_accelerator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* has_accelerator_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index);
|
int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the keyboard accelerator for the specified |command_id|. |key_code|
|
// Set the keyboard accelerator for the specified |command_id|. |key_code| can
|
||||||
/// can be any virtual key or character value. Returns true (1) on success.
|
// be any virtual key or character value. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_accelerator)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_accelerator)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
@@ -380,33 +374,33 @@ typedef struct _cef_menu_model_t {
|
|||||||
int alt_pressed);
|
int alt_pressed);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the keyboard accelerator at the specified |index|. |key_code| can be
|
// Set the keyboard accelerator at the specified |index|. |key_code| can be
|
||||||
/// any virtual key or character value. Returns true (1) on success.
|
// any virtual key or character value. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_accelerator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_accelerator_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int key_code,
|
int key_code,
|
||||||
int shift_pressed,
|
int shift_pressed,
|
||||||
int ctrl_pressed,
|
int ctrl_pressed,
|
||||||
int alt_pressed);
|
int alt_pressed);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Remove the keyboard accelerator for the specified |command_id|. Returns
|
// Remove the keyboard accelerator for the specified |command_id|. Returns
|
||||||
/// true (1) on success.
|
// true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* remove_accelerator)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* remove_accelerator)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Remove the keyboard accelerator at the specified |index|. Returns true (1)
|
// Remove the keyboard accelerator at the specified |index|. Returns true (1)
|
||||||
/// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* remove_accelerator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* remove_accelerator_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index);
|
int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Retrieves the keyboard accelerator for the specified |command_id|. Returns
|
// Retrieves the keyboard accelerator for the specified |command_id|. Returns
|
||||||
/// true (1) on success.
|
// true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_accelerator)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_accelerator)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
@@ -416,21 +410,21 @@ typedef struct _cef_menu_model_t {
|
|||||||
int* alt_pressed);
|
int* alt_pressed);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Retrieves the keyboard accelerator for the specified |index|. Returns true
|
// Retrieves the keyboard accelerator for the specified |index|. Returns true
|
||||||
/// (1) on success.
|
// (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_accelerator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_accelerator_at)(struct _cef_menu_model_t* self,
|
||||||
size_t index,
|
int index,
|
||||||
int* key_code,
|
int* key_code,
|
||||||
int* shift_pressed,
|
int* shift_pressed,
|
||||||
int* ctrl_pressed,
|
int* ctrl_pressed,
|
||||||
int* alt_pressed);
|
int* alt_pressed);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the explicit color for |command_id| and |color_type| to |color|.
|
// 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
|
// 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
|
// color or default color is set for |color_type| then the system color will
|
||||||
/// be used. Returns true (1) on success.
|
// be used. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_color)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_color)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
@@ -438,11 +432,11 @@ typedef struct _cef_menu_model_t {
|
|||||||
cef_color_t color);
|
cef_color_t color);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the explicit color for |command_id| and |index| to |color|. Specify a
|
// 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
|
// |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
|
// of -1 to set the default color for items that do not have an explicit color
|
||||||
/// color set. If no explicit color or default color is set for |color_type|
|
// set. If no explicit color or default color is set for |color_type| then the
|
||||||
/// then the system color will be used. Returns true (1) on success.
|
// system color will be used. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_color_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_color_at)(struct _cef_menu_model_t* self,
|
||||||
int index,
|
int index,
|
||||||
@@ -450,9 +444,9 @@ typedef struct _cef_menu_model_t {
|
|||||||
cef_color_t color);
|
cef_color_t color);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns in |color| the color that was explicitly set for |command_id| and
|
// 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|.
|
// |color_type|. If a color was not set then 0 will be returned in |color|.
|
||||||
/// Returns true (1) on success.
|
// Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_color)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_color)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
@@ -460,10 +454,10 @@ typedef struct _cef_menu_model_t {
|
|||||||
cef_color_t* color);
|
cef_color_t* color);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns in |color| the color that was explicitly set for |command_id| and
|
// 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
|
// |color_type|. Specify an |index| value of -1 to return the default color in
|
||||||
/// in |color|. If a color was not set then 0 will be returned in |color|.
|
// |color|. If a color was not set then 0 will be returned in |color|. Returns
|
||||||
/// Returns true (1) on success.
|
// true (1) on success.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_color_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_color_at)(struct _cef_menu_model_t* self,
|
||||||
int index,
|
int index,
|
||||||
@@ -471,33 +465,33 @@ typedef struct _cef_menu_model_t {
|
|||||||
cef_color_t* color);
|
cef_color_t* color);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Sets the font list for the specified |command_id|. If |font_list| is NULL
|
// 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
|
// the system font will be used. Returns true (1) on success. The format is
|
||||||
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
|
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma-
|
||||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
// separated list of font family names, - STYLES is an optional space-
|
||||||
/// - STYLES is an optional space-separated list of style names (case-
|
// separated list of style names (case-sensitive
|
||||||
/// sensitive "Bold" and "Italic" are supported), and
|
// "Bold" and "Italic" are supported), and
|
||||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
// - SIZE is an integer font size in pixels with the suffix "px".
|
||||||
///
|
//
|
||||||
/// Here are examples of valid font description strings:
|
// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
// Bold Italic 14px" - "Arial, 14px"
|
||||||
/// - "Arial, 14px"
|
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* set_font_list)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_font_list)(struct _cef_menu_model_t* self,
|
||||||
int command_id,
|
int command_id,
|
||||||
const cef_string_t* font_list);
|
const cef_string_t* font_list);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Sets the font list for the specified |index|. Specify an |index| value of
|
// 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
|
// -1 to set the default font. If |font_list| is NULL the system font will be
|
||||||
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
|
// used. Returns true (1) on success. The format is
|
||||||
/// - STYLES is an optional space-separated list of style names (case-
|
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma-
|
||||||
/// sensitive "Bold" and "Italic" are supported), and
|
// separated list of font family names, - STYLES is an optional space-
|
||||||
/// - SIZE is an integer font size in pixels with the suffix "px".
|
// separated list of style names (case-sensitive
|
||||||
///
|
// "Bold" and "Italic" are supported), and
|
||||||
/// Here are examples of valid font description strings:
|
// - SIZE is an integer font size in pixels with the suffix "px".
|
||||||
/// - "Arial, Helvetica, Bold Italic 14px"
|
//
|
||||||
/// - "Arial, 14px"
|
// 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(CEF_CALLBACK* set_font_list_at)(struct _cef_menu_model_t* self,
|
||||||
int index,
|
int index,
|
||||||
@@ -505,7 +499,7 @@ typedef struct _cef_menu_model_t {
|
|||||||
} cef_menu_model_t;
|
} cef_menu_model_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new MenuModel with the specified |delegate|.
|
// Create a new MenuModel with the specified |delegate|.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
|
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
|
||||||
struct _cef_menu_model_delegate_t* delegate);
|
struct _cef_menu_model_delegate_t* delegate);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=01bdeaf96ea01591689b52b0955504644d6614b8$
|
// $hash=edc411cb0447a6c2965cdeb5f709fe56c43ec2bb$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
||||||
@@ -49,19 +49,19 @@ extern "C" {
|
|||||||
struct _cef_menu_model_t;
|
struct _cef_menu_model_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle menu model events. The functions of this
|
// Implement this structure to handle menu model events. The functions of this
|
||||||
/// structure will be called on the browser process UI thread unless otherwise
|
// structure will be called on the browser process UI thread unless otherwise
|
||||||
/// indicated.
|
// indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_menu_model_delegate_t {
|
typedef struct _cef_menu_model_delegate_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Perform the action associated with the specified |command_id| and optional
|
// Perform the action associated with the specified |command_id| and optional
|
||||||
/// |event_flags|.
|
// |event_flags|.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* execute_command)(struct _cef_menu_model_delegate_t* self,
|
void(CEF_CALLBACK* execute_command)(struct _cef_menu_model_delegate_t* self,
|
||||||
struct _cef_menu_model_t* menu_model,
|
struct _cef_menu_model_t* menu_model,
|
||||||
@@ -69,8 +69,8 @@ typedef struct _cef_menu_model_delegate_t {
|
|||||||
cef_event_flags_t event_flags);
|
cef_event_flags_t event_flags);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the user moves the mouse outside the menu and over the owning
|
// Called when the user moves the mouse outside the menu and over the owning
|
||||||
/// window.
|
// window.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* mouse_outside_menu)(
|
void(CEF_CALLBACK* mouse_outside_menu)(
|
||||||
struct _cef_menu_model_delegate_t* self,
|
struct _cef_menu_model_delegate_t* self,
|
||||||
@@ -78,8 +78,8 @@ typedef struct _cef_menu_model_delegate_t {
|
|||||||
const cef_point_t* screen_point);
|
const cef_point_t* screen_point);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on unhandled open submenu keyboard commands. |is_rtl| will be true
|
// Called on unhandled open submenu keyboard commands. |is_rtl| will be true
|
||||||
/// (1) if the menu is displaying a right-to-left language.
|
// (1) if the menu is displaying a right-to-left language.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* unhandled_open_submenu)(
|
void(CEF_CALLBACK* unhandled_open_submenu)(
|
||||||
struct _cef_menu_model_delegate_t* self,
|
struct _cef_menu_model_delegate_t* self,
|
||||||
@@ -87,8 +87,8 @@ typedef struct _cef_menu_model_delegate_t {
|
|||||||
int is_rtl);
|
int is_rtl);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called on unhandled close submenu keyboard commands. |is_rtl| will be true
|
// Called on unhandled close submenu keyboard commands. |is_rtl| will be true
|
||||||
/// (1) if the menu is displaying a right-to-left language.
|
// (1) if the menu is displaying a right-to-left language.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* unhandled_close_submenu)(
|
void(CEF_CALLBACK* unhandled_close_submenu)(
|
||||||
struct _cef_menu_model_delegate_t* self,
|
struct _cef_menu_model_delegate_t* self,
|
||||||
@@ -96,20 +96,20 @@ typedef struct _cef_menu_model_delegate_t {
|
|||||||
int is_rtl);
|
int is_rtl);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The menu is about to show.
|
// The menu is about to show.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* menu_will_show)(struct _cef_menu_model_delegate_t* self,
|
void(CEF_CALLBACK* menu_will_show)(struct _cef_menu_model_delegate_t* self,
|
||||||
struct _cef_menu_model_t* menu_model);
|
struct _cef_menu_model_t* menu_model);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The menu has closed.
|
// The menu has closed.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* menu_closed)(struct _cef_menu_model_delegate_t* self,
|
void(CEF_CALLBACK* menu_closed)(struct _cef_menu_model_delegate_t* self,
|
||||||
struct _cef_menu_model_t* menu_model);
|
struct _cef_menu_model_t* menu_model);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Optionally modify a menu item label. Return true (1) if |label| was
|
// Optionally modify a menu item label. Return true (1) if |label| was
|
||||||
/// modified.
|
// modified.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* format_label)(struct _cef_menu_model_delegate_t* self,
|
int(CEF_CALLBACK* format_label)(struct _cef_menu_model_delegate_t* self,
|
||||||
struct _cef_menu_model_t* menu_model,
|
struct _cef_menu_model_t* menu_model,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=dbdac05f2ebd8e8a357eacfe5095676a5bd5b1ac$
|
// $hash=f14afbd6941bcb37b14cce81569882512c3d7194$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
|
||||||
@@ -48,79 +48,78 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to represent an entry in navigation history.
|
// Structure used to represent an entry in navigation history.
|
||||||
///
|
///
|
||||||
typedef struct _cef_navigation_entry_t {
|
typedef struct _cef_navigation_entry_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
/// if this function returns false (0).
|
// 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
|
// Returns the actual URL of the page. For some pages this may be data: URL or
|
||||||
/// or similar. Use get_display_url() to return a display-friendly version.
|
// similar. Use get_display_url() to return a display-friendly version.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns a display-friendly version of the URL.
|
// Returns a display-friendly version of the URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the original URL that was entered by the user before any
|
// Returns the original URL that was entered by the user before any redirects.
|
||||||
/// redirects.
|
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the title set by the page. This value may be NULL.
|
// Returns the title set by the page. This value may be NULL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the transition type which indicates what the user did to move to
|
// Returns the transition type which indicates what the user did to move to
|
||||||
/// this page from the previous page.
|
// 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);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this navigation includes post data.
|
// 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
|
// 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
|
// navigation may be completed more than once if the page is reloaded. May be
|
||||||
/// 0 if the navigation has not yet completed.
|
// 0 if the navigation has not yet completed.
|
||||||
///
|
///
|
||||||
cef_basetime_t(CEF_CALLBACK* get_completion_time)(
|
cef_time_t(CEF_CALLBACK* get_completion_time)(
|
||||||
struct _cef_navigation_entry_t* self);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the HTTP status code for the last known successful navigation
|
// Returns the HTTP status code for the last known successful navigation
|
||||||
/// response. May be 0 if the response has not yet been received or if the
|
// response. May be 0 if the response has not yet been received or if the
|
||||||
/// navigation has not yet completed.
|
// 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.
|
// 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);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=f146fd9172033e77e90994841df9fa55ff71aa4b$
|
// $hash=6798e6147540596c1abac8c7457d9d1d4d99bd54$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
||||||
@@ -47,41 +47,40 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add an entry to the cross-origin access whitelist.
|
// Add an entry to the cross-origin access whitelist.
|
||||||
///
|
//
|
||||||
/// The same-origin policy restricts how scripts hosted from different origins
|
// The same-origin policy restricts how scripts hosted from different origins
|
||||||
/// (scheme + domain + port) can communicate. By default, scripts can only
|
// (scheme + domain + port) can communicate. By default, scripts can only access
|
||||||
/// access resources with the same origin. Scripts hosted on the HTTP and HTTPS
|
// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes
|
||||||
/// schemes (but no other schemes) can use the "Access-Control-Allow-Origin"
|
// (but no other schemes) can use the "Access-Control-Allow-Origin" header to
|
||||||
/// header to allow cross-origin requests. For example,
|
// allow cross-origin requests. For example, https://source.example.com can make
|
||||||
/// https://source.example.com can make XMLHttpRequest requests on
|
// XMLHttpRequest requests on http://target.example.com if the
|
||||||
/// http://target.example.com if the http://target.example.com request returns
|
// http://target.example.com request returns an "Access-Control-Allow-Origin:
|
||||||
/// an "Access-Control-Allow-Origin: https://source.example.com" response
|
// https://source.example.com" response header.
|
||||||
/// header.
|
//
|
||||||
///
|
// Scripts in separate frames or iframes and hosted from the same protocol and
|
||||||
/// Scripts in separate frames or iframes and hosted from the same protocol and
|
// domain suffix can execute cross-origin JavaScript if both pages set the
|
||||||
/// domain suffix can execute cross-origin JavaScript if both pages set the
|
// document.domain value to the same domain suffix. For example,
|
||||||
/// document.domain value to the same domain suffix. For example,
|
// scheme://foo.example.com and scheme://bar.example.com can communicate using
|
||||||
/// scheme://foo.example.com and scheme://bar.example.com can communicate using
|
// JavaScript if both domains set document.domain="example.com".
|
||||||
/// JavaScript if both domains set document.domain="example.com".
|
//
|
||||||
///
|
// This function is used to allow access to origins that would otherwise violate
|
||||||
/// This function is used to allow access to origins that would otherwise
|
// the same-origin policy. Scripts hosted underneath the fully qualified
|
||||||
/// violate the same-origin policy. Scripts hosted underneath the fully
|
// |source_origin| URL (like http://www.example.com) will be allowed access to
|
||||||
/// qualified |source_origin| URL (like http://www.example.com) will be allowed
|
// all resources hosted on the specified |target_protocol| and |target_domain|.
|
||||||
/// access to all resources hosted on the specified |target_protocol| and
|
// If |target_domain| is non-NULL and |allow_target_subdomains| if false (0)
|
||||||
/// |target_domain|. If |target_domain| is non-NULL and
|
// only exact domain matches will be allowed. If |target_domain| contains a top-
|
||||||
/// |allow_target_subdomains| is false (0) only exact domain matches will be
|
// level domain component (like "example.com") and |allow_target_subdomains| is
|
||||||
/// allowed. If |target_domain| contains a top- level domain component (like
|
// true (1) sub-domain matches will be allowed. If |target_domain| is NULL and
|
||||||
/// "example.com") and |allow_target_subdomains| is true (1) sub-domain matches
|
// |allow_target_subdomains| if true (1) all domains and IP addresses will be
|
||||||
/// will be allowed. If |target_domain| is NULL and |allow_target_subdomains| if
|
// allowed.
|
||||||
/// true (1) all domains and IP addresses will be allowed.
|
//
|
||||||
///
|
// This function cannot be used to bypass the restrictions on local or display
|
||||||
/// This function cannot be used to bypass the restrictions on local or display
|
// isolated schemes. See the comments on CefRegisterCustomScheme for more
|
||||||
/// isolated schemes. See the comments on CefRegisterCustomScheme for more
|
// information.
|
||||||
/// information.
|
//
|
||||||
///
|
// This function may be called on any thread. Returns false (0) if
|
||||||
/// This function may be called on any thread. Returns false (0) if
|
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||||
/// |source_origin| is invalid or the whitelist cannot be accessed.
|
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
||||||
const cef_string_t* source_origin,
|
const cef_string_t* source_origin,
|
||||||
@@ -90,8 +89,8 @@ CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
|||||||
int allow_target_subdomains);
|
int allow_target_subdomains);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Remove an entry from the cross-origin access whitelist. Returns false (0) if
|
// Remove an entry from the cross-origin access whitelist. Returns false (0) if
|
||||||
/// |source_origin| is invalid or the whitelist cannot be accessed.
|
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
||||||
const cef_string_t* source_origin,
|
const cef_string_t* source_origin,
|
||||||
@@ -100,10 +99,10 @@ CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
|||||||
int allow_target_subdomains);
|
int allow_target_subdomains);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Remove all entries from the cross-origin access whitelist. Returns false (0)
|
// Remove all entries from the cross-origin access whitelist. Returns false (0)
|
||||||
/// if the whitelist cannot be accessed.
|
// if the whitelist cannot be accessed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_clear_cross_origin_whitelist(void);
|
CEF_EXPORT int cef_clear_cross_origin_whitelist();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=8accded29b97df1549e86e58d8976fe0f800359a$
|
// $hash=84149324b177c47287b935dcb3d5900a33acfdf5$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
|
||||||
@@ -47,92 +47,84 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Combines specified |base_url| and |relative_url| into |resolved_url|.
|
// Parse the specified |url| into its component parts. Returns false (0) if the
|
||||||
/// Returns false (0) if one of the URLs is NULL or invalid.
|
// URL is NULL or invalid.
|
||||||
///
|
|
||||||
CEF_EXPORT int cef_resolve_url(const cef_string_t* base_url,
|
|
||||||
const cef_string_t* relative_url,
|
|
||||||
cef_string_t* resolved_url);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// 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,
|
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
|
// Creates a URL from the specified |parts|, which must contain a non-NULL spec
|
||||||
/// or a non-NULL host and path (at a minimum), but not both. Returns false (0)
|
// or a non-NULL host and path (at a minimum), but not both. Returns false (0)
|
||||||
/// if |parts| isn't initialized as described.
|
// if |parts| isn't initialized as described.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
|
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-
|
// This is a convenience function for formatting a URL in a concise and human-
|
||||||
/// friendly way to help users make security-related decisions (or in other
|
// friendly way to help users make security-related decisions (or in other
|
||||||
/// circumstances when people need to distinguish sites, origins, or otherwise-
|
// circumstances when people need to distinguish sites, origins, or otherwise-
|
||||||
/// simplified URLs from each other). Internationalized domain names (IDN) may
|
// simplified URLs from each other). Internationalized domain names (IDN) may be
|
||||||
/// be presented in Unicode if the conversion is considered safe. The returned
|
// presented in Unicode if the conversion is considered safe. The returned value
|
||||||
/// value will (a) omit the path for standard schemes, excepting file and
|
// will (a) omit the path for standard schemes, excepting file and filesystem,
|
||||||
/// filesystem, and (b) omit the port if it is the default for the scheme. Do
|
// and (b) omit the port if it is the default for the scheme. Do not use this
|
||||||
/// not use this for URLs which will be parsed or sent to other applications.
|
// for URLs which will be parsed or sent to other applications.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t
|
CEF_EXPORT cef_string_userfree_t
|
||||||
cef_format_url_for_security_display(const cef_string_t* origin_url);
|
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
|
// Returns the mime type for the specified file extension or an NULL string if
|
||||||
/// unknown.
|
// unknown.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t
|
CEF_EXPORT cef_string_userfree_t
|
||||||
cef_get_mime_type(const cef_string_t* extension);
|
cef_get_mime_type(const cef_string_t* extension);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the extensions associated with the given mime type. This should be
|
// Get the extensions associated with the given mime type. This should be passed
|
||||||
/// passed in lower case. There could be multiple extensions for a given mime
|
// in lower case. There could be multiple extensions for a given mime type, like
|
||||||
/// type, like "html,htm" for "text/html", or "txt,text,html,..." for "text/*".
|
// "html,htm" for "text/html", or "txt,text,html,..." for "text/*". Any existing
|
||||||
/// Any existing elements in the provided vector will not be erased.
|
// 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_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.
|
// Encodes |data| as a base64 string.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data,
|
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
|
// Decodes the base64 encoded string |data|. The returned value will be NULL if
|
||||||
/// the decoding fails.
|
// the decoding fails.
|
||||||
///
|
///
|
||||||
CEF_EXPORT struct _cef_binary_value_t* cef_base64decode(
|
CEF_EXPORT struct _cef_binary_value_t* cef_base64decode(
|
||||||
const cef_string_t* data);
|
const cef_string_t* data);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Escapes characters in |text| which are unsuitable for use as a query
|
// Escapes characters in |text| which are unsuitable for use as a query
|
||||||
/// parameter value. Everything except alphanumerics and -_.!~*'() will be
|
// parameter value. Everything except alphanumerics and -_.!~*'() will be
|
||||||
/// converted to "%XX". If |use_plus| is true (1) spaces will change to "+". The
|
// converted to "%XX". If |use_plus| is true (1) spaces will change to "+". The
|
||||||
/// result is basically the same as encodeURIComponent in Javacript.
|
// result is basically the same as encodeURIComponent in Javacript.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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,
|
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
|
// Unescapes |text| and returns the result. Unescaping consists of looking for
|
||||||
/// the exact pattern "%XX" where each X is a hex digit and converting to the
|
// the exact pattern "%XX" where each X is a hex digit and converting to the
|
||||||
/// character with the numerical value of those digits (e.g. "i%20=%203%3b"
|
// character with the numerical value of those digits (e.g. "i%20=%203%3b"
|
||||||
/// unescapes to "i = 3;"). If |convert_to_utf8| is true (1) this function will
|
// unescapes to "i = 3;"). If |convert_to_utf8| is true (1) this function will
|
||||||
/// attempt to interpret the initial decoded result as UTF-8. If the result is
|
// attempt to interpret the initial decoded result as UTF-8. If the result is
|
||||||
/// convertable into UTF-8 it will be returned as converted. Otherwise the
|
// convertable into UTF-8 it will be returned as converted. Otherwise the
|
||||||
/// initial decoded result will be returned. The |unescape_rule| parameter
|
// initial decoded result will be returned. The |unescape_rule| parameter
|
||||||
/// supports further customization the decoding process.
|
// supports further customization the decoding process.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t
|
CEF_EXPORT cef_string_userfree_t
|
||||||
@@ -141,17 +133,17 @@ cef_uridecode(const cef_string_t* text,
|
|||||||
cef_uri_unescape_rule_t unescape_rule);
|
cef_uri_unescape_rule_t unescape_rule);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Parses the specified |json_string| and returns a dictionary or list
|
// Parses the specified |json_string| and returns a dictionary or list
|
||||||
/// representation. If JSON parsing fails this function returns NULL.
|
// representation. If JSON parsing fails this function returns NULL.
|
||||||
///
|
///
|
||||||
CEF_EXPORT struct _cef_value_t* cef_parse_json(
|
CEF_EXPORT struct _cef_value_t* cef_parse_json(
|
||||||
const cef_string_t* json_string,
|
const cef_string_t* json_string,
|
||||||
cef_json_parser_options_t options);
|
cef_json_parser_options_t options);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Parses the specified UTF8-encoded |json| buffer of size |json_size| and
|
// Parses the specified UTF8-encoded |json| buffer of size |json_size| and
|
||||||
/// returns a dictionary or list representation. If JSON parsing fails this
|
// returns a dictionary or list representation. If JSON parsing fails this
|
||||||
/// function returns NULL.
|
// function returns NULL.
|
||||||
///
|
///
|
||||||
CEF_EXPORT struct _cef_value_t* cef_parse_json_buffer(
|
CEF_EXPORT struct _cef_value_t* cef_parse_json_buffer(
|
||||||
const void* json,
|
const void* json,
|
||||||
@@ -159,9 +151,9 @@ CEF_EXPORT struct _cef_value_t* cef_parse_json_buffer(
|
|||||||
cef_json_parser_options_t options);
|
cef_json_parser_options_t options);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Parses the specified |json_string| and returns a dictionary or list
|
// Parses the specified |json_string| and returns a dictionary or list
|
||||||
/// representation. If JSON parsing fails this function returns NULL and
|
// representation. If JSON parsing fails this function returns NULL and
|
||||||
/// populates |error_msg_out| with a formatted error message.
|
// populates |error_msg_out| with a formatted error message.
|
||||||
///
|
///
|
||||||
CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
|
CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
|
||||||
const cef_string_t* json_string,
|
const cef_string_t* json_string,
|
||||||
@@ -169,9 +161,9 @@ CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
|
|||||||
cef_string_t* error_msg_out);
|
cef_string_t* error_msg_out);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Generates a JSON string from the specified root |node| which should be a
|
// Generates a JSON string from the specified root |node| which should be a
|
||||||
/// dictionary or list value. Returns an NULL string on failure. This function
|
// dictionary or list value. Returns an NULL string on failure. This function
|
||||||
/// requires exclusive access to |node| including any underlying data.
|
// requires exclusive access to |node| including any underlying data.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t
|
CEF_EXPORT cef_string_userfree_t
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=ee0c50b4e1f51fb2286da24bb9244ae74f3b0c6f$
|
// $hash=0ae1fe7f7141eb05eb7fd44c2d41e4c576afae1e$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
|
||||||
@@ -47,8 +47,8 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Retrieve the path associated with the specified |key|. Returns true (1) on
|
// Retrieve the path associated with the specified |key|. Returns true (1) on
|
||||||
/// success. Can be called on any thread in the browser process.
|
// success. Can be called on any thread in the browser process.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path);
|
CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path);
|
||||||
|
|
||||||
|
|||||||
@@ -1,164 +0,0 @@
|
|||||||
// Copyright (c) 2024 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=c9b3913701581cd6a1077fa3a39d197f338a2507$
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_
|
|
||||||
#define CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "include/capi/cef_base_capi.h"
|
|
||||||
#include "include/capi/cef_browser_capi.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Callback structure used for asynchronous continuation of media access
|
|
||||||
/// permission requests.
|
|
||||||
///
|
|
||||||
typedef struct _cef_media_access_callback_t {
|
|
||||||
///
|
|
||||||
/// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Call to allow or deny media access. If this callback was initiated in
|
|
||||||
/// response to a getUserMedia (indicated by
|
|
||||||
/// CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE and/or
|
|
||||||
/// CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE being set) then
|
|
||||||
/// |allowed_permissions| must match |required_permissions| passed to
|
|
||||||
/// OnRequestMediaAccessPermission.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_media_access_callback_t* self,
|
|
||||||
uint32_t allowed_permissions);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Cancel the media access request.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* cancel)(struct _cef_media_access_callback_t* self);
|
|
||||||
} cef_media_access_callback_t;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Callback structure used for asynchronous continuation of permission prompts.
|
|
||||||
///
|
|
||||||
typedef struct _cef_permission_prompt_callback_t {
|
|
||||||
///
|
|
||||||
/// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Complete the permissions request with the specified |result|.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_permission_prompt_callback_t* self,
|
|
||||||
cef_permission_request_result_t result);
|
|
||||||
} cef_permission_prompt_callback_t;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Implement this structure to handle events related to permission requests.
|
|
||||||
/// The functions of this structure will be called on the browser process UI
|
|
||||||
/// thread.
|
|
||||||
///
|
|
||||||
typedef struct _cef_permission_handler_t {
|
|
||||||
///
|
|
||||||
/// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called when a page requests permission to access media.
|
|
||||||
/// |requesting_origin| is the URL origin requesting permission.
|
|
||||||
/// |requested_permissions| is a combination of values from
|
|
||||||
/// cef_media_access_permission_types_t that represent the requested
|
|
||||||
/// permissions. Return true (1) and call cef_media_access_callback_t
|
|
||||||
/// functions either in this function or at a later time to continue or cancel
|
|
||||||
/// the request. Return false (0) to proceed with default handling. With the
|
|
||||||
/// Chrome runtime, default handling will display the permission request UI.
|
|
||||||
/// With the Alloy runtime, default handling will deny the request. This
|
|
||||||
/// function will not be called if the "--enable-media-stream" command-line
|
|
||||||
/// switch is used to grant all permissions.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* on_request_media_access_permission)(
|
|
||||||
struct _cef_permission_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
struct _cef_frame_t* frame,
|
|
||||||
const cef_string_t* requesting_origin,
|
|
||||||
uint32_t requested_permissions,
|
|
||||||
struct _cef_media_access_callback_t* callback);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called when a page should show a permission prompt. |prompt_id| uniquely
|
|
||||||
/// identifies the prompt. |requesting_origin| is the URL origin requesting
|
|
||||||
/// permission. |requested_permissions| is a combination of values from
|
|
||||||
/// cef_permission_request_types_t that represent the requested permissions.
|
|
||||||
/// Return true (1) and call cef_permission_prompt_callback_t::Continue either
|
|
||||||
/// in this function or at a later time to continue or cancel the request.
|
|
||||||
/// Return false (0) to proceed with default handling. With the Chrome
|
|
||||||
/// runtime, default handling will display the permission prompt UI. With the
|
|
||||||
/// Alloy runtime, default handling is CEF_PERMISSION_RESULT_IGNORE.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* on_show_permission_prompt)(
|
|
||||||
struct _cef_permission_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
uint64_t prompt_id,
|
|
||||||
const cef_string_t* requesting_origin,
|
|
||||||
uint32_t requested_permissions,
|
|
||||||
struct _cef_permission_prompt_callback_t* callback);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called when a permission prompt handled via OnShowPermissionPrompt is
|
|
||||||
/// dismissed. |prompt_id| will match the value that was passed to
|
|
||||||
/// OnShowPermissionPrompt. |result| will be the value passed to
|
|
||||||
/// cef_permission_prompt_callback_t::Continue or CEF_PERMISSION_RESULT_IGNORE
|
|
||||||
/// if the dialog was dismissed for other reasons such as navigation, browser
|
|
||||||
/// closure, etc. This function will not be called if OnShowPermissionPrompt
|
|
||||||
/// returned false (0) for |prompt_id|.
|
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* on_dismiss_permission_prompt)(
|
|
||||||
struct _cef_permission_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
uint64_t prompt_id,
|
|
||||||
cef_permission_request_result_t result);
|
|
||||||
} cef_permission_handler_t;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
// Copyright (c) 2024 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=1c0e469a283538945834404bcd5934b9bb9a0756$
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_
|
|
||||||
#define CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "include/capi/cef_base_capi.h"
|
|
||||||
#include "include/capi/cef_values_capi.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Structure that manages custom preference registrations.
|
|
||||||
///
|
|
||||||
typedef struct _cef_preference_registrar_t {
|
|
||||||
///
|
|
||||||
/// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_scoped_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Register a preference with the specified |name| and |default_value|. To
|
|
||||||
/// avoid conflicts with built-in preferences the |name| value should contain
|
|
||||||
/// an application-specific prefix followed by a period (e.g. "myapp.value").
|
|
||||||
/// The contents of |default_value| will be copied. The data type for the
|
|
||||||
/// preference will be inferred from |default_value|'s type and cannot be
|
|
||||||
/// changed after registration. Returns true (1) on success. Returns false (0)
|
|
||||||
/// if |name| is already registered or if |default_value| has an invalid type.
|
|
||||||
/// This function must be called from within the scope of the
|
|
||||||
/// cef_browser_process_handler_t::OnRegisterCustomPreferences callback.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* add_preference)(struct _cef_preference_registrar_t* self,
|
|
||||||
const cef_string_t* name,
|
|
||||||
struct _cef_value_t* default_value);
|
|
||||||
} cef_preference_registrar_t;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Manage access to preferences. Many built-in preferences are registered by
|
|
||||||
/// Chromium. Custom preferences can be registered in
|
|
||||||
/// cef_browser_process_handler_t::OnRegisterCustomPreferences.
|
|
||||||
///
|
|
||||||
typedef struct _cef_preference_manager_t {
|
|
||||||
///
|
|
||||||
/// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns true (1) if a preference with the specified |name| exists. This
|
|
||||||
/// function must be called on the browser process UI thread.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* has_preference)(struct _cef_preference_manager_t* self,
|
|
||||||
const cef_string_t* name);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns the value for the preference with the specified |name|. Returns
|
|
||||||
/// NULL if the preference does not exist. The returned object contains a copy
|
|
||||||
/// of the underlying preference value and modifications to the returned
|
|
||||||
/// object will not modify the underlying preference value. This function must
|
|
||||||
/// be called on the browser process UI thread.
|
|
||||||
///
|
|
||||||
struct _cef_value_t*(CEF_CALLBACK* get_preference)(
|
|
||||||
struct _cef_preference_manager_t* self,
|
|
||||||
const cef_string_t* name);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns all preferences as a dictionary. If |include_defaults| is true (1)
|
|
||||||
/// then preferences currently at their default value will be included. The
|
|
||||||
/// returned object contains a copy of the underlying preference values and
|
|
||||||
/// modifications to the returned object will not modify the underlying
|
|
||||||
/// preference values. This function must be called on the browser process UI
|
|
||||||
/// thread.
|
|
||||||
///
|
|
||||||
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_all_preferences)(
|
|
||||||
struct _cef_preference_manager_t* self,
|
|
||||||
int include_defaults);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns true (1) if the preference with the specified |name| can be
|
|
||||||
/// modified using SetPreference. As one example preferences set via the
|
|
||||||
/// command-line usually cannot be modified. This function must be called on
|
|
||||||
/// the browser process UI thread.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* can_set_preference)(struct _cef_preference_manager_t* self,
|
|
||||||
const cef_string_t* name);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Set the |value| associated with preference |name|. Returns true (1) if the
|
|
||||||
/// value is set successfully and false (0) otherwise. If |value| is NULL the
|
|
||||||
/// preference will be restored to its default value. If setting the
|
|
||||||
/// preference fails then |error| will be populated with a detailed
|
|
||||||
/// description of the problem. This function must be called on the browser
|
|
||||||
/// process UI thread.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* set_preference)(struct _cef_preference_manager_t* self,
|
|
||||||
const cef_string_t* name,
|
|
||||||
struct _cef_value_t* value,
|
|
||||||
cef_string_t* error);
|
|
||||||
} cef_preference_manager_t;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns the global preference manager object.
|
|
||||||
///
|
|
||||||
CEF_EXPORT cef_preference_manager_t* cef_preference_manager_get_global(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
// Copyright (c) 2022 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=1f5dd49cfc5aeb4b673c10750de01768f5cd2694$
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PREFERENCE_MANAGER_CAPI_H_
|
|
||||||
#define CEF_INCLUDE_CAPI_CEF_PREFERENCE_MANAGER_CAPI_H_
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "include/capi/cef_base_capi.h"
|
|
||||||
#include "include/capi/cef_values_capi.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Manage access to preferences.
|
|
||||||
///
|
|
||||||
typedef struct _cef_preference_manager_t {
|
|
||||||
///
|
|
||||||
/// Base structure.
|
|
||||||
///
|
|
||||||
cef_base_ref_counted_t base;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns true (1) if a preference with the specified |name| exists. This
|
|
||||||
/// function must be called on the browser process UI thread.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* has_preference)(struct _cef_preference_manager_t* self,
|
|
||||||
const cef_string_t* name);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns the value for the preference with the specified |name|. Returns
|
|
||||||
/// NULL if the preference does not exist. The returned object contains a copy
|
|
||||||
/// of the underlying preference value and modifications to the returned
|
|
||||||
/// object will not modify the underlying preference value. This function must
|
|
||||||
/// be called on the browser process UI thread.
|
|
||||||
///
|
|
||||||
struct _cef_value_t*(CEF_CALLBACK* get_preference)(
|
|
||||||
struct _cef_preference_manager_t* self,
|
|
||||||
const cef_string_t* name);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns all preferences as a dictionary. If |include_defaults| is true (1)
|
|
||||||
/// then preferences currently at their default value will be included. The
|
|
||||||
/// returned object contains a copy of the underlying preference values and
|
|
||||||
/// modifications to the returned object will not modify the underlying
|
|
||||||
/// preference values. This function must be called on the browser process UI
|
|
||||||
/// thread.
|
|
||||||
///
|
|
||||||
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_all_preferences)(
|
|
||||||
struct _cef_preference_manager_t* self,
|
|
||||||
int include_defaults);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns true (1) if the preference with the specified |name| can be
|
|
||||||
/// modified using SetPreference. As one example preferences set via the
|
|
||||||
/// command-line usually cannot be modified. This function must be called on
|
|
||||||
/// the browser process UI thread.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* can_set_preference)(struct _cef_preference_manager_t* self,
|
|
||||||
const cef_string_t* name);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Set the |value| associated with preference |name|. Returns true (1) if the
|
|
||||||
/// value is set successfully and false (0) otherwise. If |value| is NULL the
|
|
||||||
/// preference will be restored to its default value. If setting the
|
|
||||||
/// preference fails then |error| will be populated with a detailed
|
|
||||||
/// description of the problem. This function must be called on the browser
|
|
||||||
/// process UI thread.
|
|
||||||
///
|
|
||||||
int(CEF_CALLBACK* set_preference)(struct _cef_preference_manager_t* self,
|
|
||||||
const cef_string_t* name,
|
|
||||||
struct _cef_value_t* value,
|
|
||||||
cef_string_t* error);
|
|
||||||
} cef_preference_manager_t;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CAPI_CEF_PREFERENCE_MANAGER_CAPI_H_
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=96d5b6c0dc8f2575e686fb79684c63787cdfe876$
|
// $hash=84fc58b3898f25476d9cdd260553390ba5e0b30b$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
|
||||||
@@ -49,66 +49,65 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure for asynchronous continuation of print dialog requests.
|
// Callback structure for asynchronous continuation of print dialog requests.
|
||||||
///
|
///
|
||||||
typedef struct _cef_print_dialog_callback_t {
|
typedef struct _cef_print_dialog_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Continue printing with the specified |settings|.
|
// Continue printing with the specified |settings|.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* cont)(struct _cef_print_dialog_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_print_dialog_callback_t* self,
|
||||||
struct _cef_print_settings_t* settings);
|
struct _cef_print_settings_t* settings);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Cancel the printing.
|
// 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;
|
} cef_print_dialog_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure for asynchronous continuation of print job requests.
|
// Callback structure for asynchronous continuation of print job requests.
|
||||||
///
|
///
|
||||||
typedef struct _cef_print_job_callback_t {
|
typedef struct _cef_print_job_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Indicate completion of the print job.
|
// 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;
|
} cef_print_job_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle printing on Linux. Each browser will have
|
// 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
|
// only one print job in progress at a time. The functions of this structure
|
||||||
/// will be called on the browser process UI thread.
|
// will be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_print_handler_t {
|
typedef struct _cef_print_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when printing has started for the specified |browser|. This
|
// Called when printing has started for the specified |browser|. This function
|
||||||
/// function will be called before the other OnPrint*() functions and
|
// will be called before the other OnPrint*() functions and irrespective of
|
||||||
/// irrespective of how printing was initiated (e.g.
|
// how printing was initiated (e.g. cef_browser_host_t::print(), JavaScript
|
||||||
/// cef_browser_host_t::print(), JavaScript window.print() or PDF extension
|
// window.print() or PDF extension print button).
|
||||||
/// print button).
|
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_print_start)(struct _cef_print_handler_t* self,
|
void(CEF_CALLBACK* on_print_start)(struct _cef_print_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Synchronize |settings| with client state. If |get_defaults| is true (1)
|
// Synchronize |settings| with client state. If |get_defaults| is true (1)
|
||||||
/// then populate |settings| with the default print settings. Do not keep a
|
// then populate |settings| with the default print settings. Do not keep a
|
||||||
/// reference to |settings| outside of this callback.
|
// reference to |settings| outside of this callback.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_print_settings)(struct _cef_print_handler_t* self,
|
void(CEF_CALLBACK* on_print_settings)(struct _cef_print_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -116,9 +115,9 @@ typedef struct _cef_print_handler_t {
|
|||||||
int get_defaults);
|
int get_defaults);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Show the print dialog. Execute |callback| once the dialog is dismissed.
|
// 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
|
// Return true (1) if the dialog will be displayed or false (0) to cancel the
|
||||||
/// printing immediately.
|
// printing immediately.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_print_dialog)(
|
int(CEF_CALLBACK* on_print_dialog)(
|
||||||
struct _cef_print_handler_t* self,
|
struct _cef_print_handler_t* self,
|
||||||
@@ -127,9 +126,9 @@ typedef struct _cef_print_handler_t {
|
|||||||
struct _cef_print_dialog_callback_t* callback);
|
struct _cef_print_dialog_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Send the print job to the printer. Execute |callback| once the job is
|
// 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
|
// completed. Return true (1) if the job will proceed or false (0) to cancel
|
||||||
/// the job immediately.
|
// the job immediately.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* on_print_job)(struct _cef_print_handler_t* self,
|
int(CEF_CALLBACK* on_print_job)(struct _cef_print_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -138,14 +137,14 @@ typedef struct _cef_print_handler_t {
|
|||||||
struct _cef_print_job_callback_t* callback);
|
struct _cef_print_job_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Reset client state related to printing.
|
// Reset client state related to printing.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_print_reset)(struct _cef_print_handler_t* self,
|
void(CEF_CALLBACK* on_print_reset)(struct _cef_print_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the PDF paper size in device units. Used in combination with
|
// Return the PDF paper size in device units. Used in combination with
|
||||||
/// cef_browser_host_t::print_to_pdf().
|
// cef_browser_host_t::print_to_pdf().
|
||||||
///
|
///
|
||||||
cef_size_t(CEF_CALLBACK* get_pdf_paper_size)(
|
cef_size_t(CEF_CALLBACK* get_pdf_paper_size)(
|
||||||
struct _cef_print_handler_t* self,
|
struct _cef_print_handler_t* self,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=63977fcbe4567db202914f69539f49b254352053$
|
// $hash=4b52323c4ce2d0ebcc3438e16fc9a9b181a58adc$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
|
||||||
@@ -47,41 +47,41 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure representing print settings.
|
// Structure representing print settings.
|
||||||
///
|
///
|
||||||
typedef struct _cef_print_settings_t {
|
typedef struct _cef_print_settings_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
/// if this function returns false (0).
|
// 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
|
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||||
/// expose read-only objects.
|
// 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);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the page orientation.
|
// Set the page orientation.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_orientation)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_orientation)(struct _cef_print_settings_t* self,
|
||||||
int landscape);
|
int landscape);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if the orientation is 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
|
// Set the printer printable area in device units. Some platforms already
|
||||||
/// provide flipped area. Set |landscape_needs_flip| to false (0) on those
|
// provide flipped area. Set |landscape_needs_flip| to false (0) on those
|
||||||
/// platforms to avoid double flipping.
|
// 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,
|
struct _cef_print_settings_t* self,
|
||||||
@@ -90,110 +90,110 @@ typedef struct _cef_print_settings_t {
|
|||||||
int landscape_needs_flip);
|
int landscape_needs_flip);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the device name.
|
// Set the device name.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_device_name)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_device_name)(struct _cef_print_settings_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the device name.
|
// Get the device name.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the DPI (dots per inch).
|
// 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).
|
// 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.
|
// Set the page ranges.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_page_ranges)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_page_ranges)(struct _cef_print_settings_t* self,
|
||||||
size_t rangesCount,
|
size_t rangesCount,
|
||||||
cef_range_t const* ranges);
|
cef_range_t const* ranges);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the number of page ranges that currently exist.
|
// 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);
|
struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Retrieve the page ranges.
|
// Retrieve the page ranges.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_page_ranges)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* get_page_ranges)(struct _cef_print_settings_t* self,
|
||||||
size_t* rangesCount,
|
size_t* rangesCount,
|
||||||
cef_range_t* ranges);
|
cef_range_t* ranges);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set whether only the selection will be printed.
|
// Set whether only the selection will be printed.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_selection_only)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_selection_only)(struct _cef_print_settings_t* self,
|
||||||
int selection_only);
|
int selection_only);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if only the selection will be printed.
|
// 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.
|
// Set whether pages will be collated.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_collate)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_collate)(struct _cef_print_settings_t* self,
|
||||||
int collate);
|
int collate);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if pages will be collated.
|
// 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.
|
// Set the color model.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_color_model)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_color_model)(struct _cef_print_settings_t* self,
|
||||||
cef_color_model_t model);
|
cef_color_model_t model);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the color 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);
|
struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the number of copies.
|
// Set the number of copies.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_copies)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_copies)(struct _cef_print_settings_t* self,
|
||||||
int copies);
|
int copies);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the number of 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.
|
// Set the duplex mode.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_duplex_mode)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_duplex_mode)(struct _cef_print_settings_t* self,
|
||||||
cef_duplex_mode_t mode);
|
cef_duplex_mode_t mode);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the duplex 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);
|
struct _cef_print_settings_t* self);
|
||||||
} cef_print_settings_t;
|
} cef_print_settings_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new cef_print_settings_t object.
|
// Create a new cef_print_settings_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_print_settings_t* cef_print_settings_create(void);
|
CEF_EXPORT cef_print_settings_t* cef_print_settings_create();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=89c569df7e5e4a6035d4527218ce4dc1d68e20f0$
|
// $hash=53ff22b73527aa331d2bd96e008f4cb4f0413042$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
||||||
@@ -41,7 +41,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "include/capi/cef_base_capi.h"
|
#include "include/capi/cef_base_capi.h"
|
||||||
#include "include/capi/cef_shared_memory_region_capi.h"
|
|
||||||
#include "include/capi/cef_values_capi.h"
|
#include "include/capi/cef_values_capi.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -49,57 +48,48 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure representing a message. Can be used on any process and thread.
|
// Structure representing a message. Can be used on any process and thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_process_message_t {
|
typedef struct _cef_process_message_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
/// if this function returns false (0).
|
// 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
|
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||||
/// expose read-only objects.
|
// 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. Returns nullptr when message
|
// Returns a writable copy of this object.
|
||||||
/// contains a shared memory region.
|
|
||||||
///
|
///
|
||||||
struct _cef_process_message_t*(CEF_CALLBACK* copy)(
|
struct _cef_process_message_t*(CEF_CALLBACK* copy)(
|
||||||
struct _cef_process_message_t* self);
|
struct _cef_process_message_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the message name.
|
// Returns the message name.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_process_message_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the list of arguments. Returns nullptr when message contains a
|
// Returns the list of arguments.
|
||||||
/// shared memory region.
|
|
||||||
///
|
///
|
||||||
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);
|
struct _cef_process_message_t* self);
|
||||||
|
|
||||||
///
|
|
||||||
/// Returns the shared memory region. Returns nullptr when message contains an
|
|
||||||
/// argument list.
|
|
||||||
///
|
|
||||||
struct _cef_shared_memory_region_t*(CEF_CALLBACK* get_shared_memory_region)(
|
|
||||||
struct _cef_process_message_t* self);
|
|
||||||
} cef_process_message_t;
|
} cef_process_message_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new cef_process_message_t object with the specified name.
|
// Create a new cef_process_message_t object with the specified name.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_process_message_t* cef_process_message_create(
|
CEF_EXPORT cef_process_message_t* cef_process_message_create(
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=a61a639c7e53ecd9481eae363bac557055f0442e$
|
// $hash=c476a8d22852994d9d9695db901efaef13bbfc9d$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
||||||
@@ -47,14 +47,14 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Launches the process specified via |command_line|. Returns true (1) upon
|
// Launches the process specified via |command_line|. Returns true (1) upon
|
||||||
/// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
|
// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
|
||||||
///
|
//
|
||||||
/// Unix-specific notes:
|
// Unix-specific notes: - All file descriptors open in the parent process will
|
||||||
/// - All file descriptors open in the parent process will be closed in the
|
// be closed in the
|
||||||
/// child process except for stdin, stdout, and stderr.
|
// child process except for stdin, stdout, and stderr.
|
||||||
/// - If the first argument on the command line does not contain a slash, PATH
|
// - If the first argument on the command line does not contain a slash,
|
||||||
/// will be searched. (See man execvp.)
|
// PATH will be searched. (See man execvp.)
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line);
|
CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=c53a67bbf1497a51766bf03040714b5edb2117d5$
|
// $hash=8cde223bdb8d25ff163edd95da0d9e238b298016$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_
|
||||||
@@ -47,11 +47,11 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Generic callback structure used for managing the lifespan of a registration.
|
// Generic callback structure used for managing the lifespan of a registration.
|
||||||
///
|
///
|
||||||
typedef struct _cef_registration_t {
|
typedef struct _cef_registration_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
} cef_registration_t;
|
} cef_registration_t;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=5151b6ea3c06e46a75f2cd7679044a2891063d29$
|
// $hash=e4bdab963041a270edabc0954b415eb4cae8e5cb$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
||||||
@@ -50,44 +50,42 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Implement this structure to handle events when window rendering is disabled.
|
// Implement this structure to handle events when window rendering is disabled.
|
||||||
/// The functions of this structure will be called on the UI thread.
|
// The functions of this structure will be called on the UI thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_render_handler_t {
|
typedef struct _cef_render_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for accessibility notifications. If no handler is
|
// Return the handler for accessibility notifications. If no handler is
|
||||||
/// provided the default implementation will be used.
|
// provided the default implementation will be used.
|
||||||
///
|
///
|
||||||
struct _cef_accessibility_handler_t*(CEF_CALLBACK* get_accessibility_handler)(
|
struct _cef_accessibility_handler_t*(CEF_CALLBACK* get_accessibility_handler)(
|
||||||
struct _cef_render_handler_t* self);
|
struct _cef_render_handler_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to retrieve the root window rectangle in screen DIP coordinates.
|
// Called to retrieve the root window rectangle in screen coordinates. Return
|
||||||
/// Return true (1) if the rectangle was provided. If this function returns
|
// true (1) if the rectangle was provided. If this function returns false (0)
|
||||||
/// false (0) the rectangle from GetViewRect will be used.
|
// the rectangle from GetViewRect will be used.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_root_screen_rect)(struct _cef_render_handler_t* self,
|
int(CEF_CALLBACK* get_root_screen_rect)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
cef_rect_t* rect);
|
cef_rect_t* rect);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to retrieve the view rectangle in screen DIP coordinates. This
|
// Called to retrieve the view rectangle which is relative to screen
|
||||||
/// function must always provide a non-NULL rectangle.
|
// coordinates. This function must always provide a non-NULL rectangle.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_view_rect)(struct _cef_render_handler_t* self,
|
void(CEF_CALLBACK* get_view_rect)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
cef_rect_t* rect);
|
cef_rect_t* rect);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to retrieve the translation from view DIP coordinates to screen
|
// Called to retrieve the translation from view coordinates to actual screen
|
||||||
/// coordinates. Windows/Linux should provide screen device (pixel)
|
// coordinates. Return true (1) if the screen coordinates were provided.
|
||||||
/// coordinates and MacOS should provide screen DIP coordinates. Return true
|
|
||||||
/// (1) if the requested coordinates were provided.
|
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_screen_point)(struct _cef_render_handler_t* self,
|
int(CEF_CALLBACK* get_screen_point)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -97,44 +95,44 @@ typedef struct _cef_render_handler_t {
|
|||||||
int* screenY);
|
int* screenY);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to allow the client to fill in the CefScreenInfo object with
|
// Called to allow the client to fill in the CefScreenInfo object with
|
||||||
/// appropriate values. Return true (1) if the |screen_info| structure has
|
// appropriate values. Return true (1) if the |screen_info| structure has been
|
||||||
/// been modified.
|
// modified.
|
||||||
///
|
//
|
||||||
/// If the screen info rectangle is left NULL the rectangle from GetViewRect
|
// If the screen info rectangle is left NULL the rectangle from GetViewRect
|
||||||
/// will be used. If the rectangle is still NULL or invalid popups may not be
|
// will be used. If the rectangle is still NULL or invalid popups may not be
|
||||||
/// drawn correctly.
|
// drawn correctly.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* get_screen_info)(struct _cef_render_handler_t* self,
|
int(CEF_CALLBACK* get_screen_info)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
cef_screen_info_t* screen_info);
|
struct _cef_screen_info_t* screen_info);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the browser wants to show or hide the popup widget. The popup
|
// 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).
|
// 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,
|
void(CEF_CALLBACK* on_popup_show)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
int show);
|
int show);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the browser wants to move or resize the popup widget. |rect|
|
// Called when the browser wants to move or resize the popup widget. |rect|
|
||||||
/// contains the new location and size in view coordinates.
|
// contains the new location and size in view coordinates.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_popup_size)(struct _cef_render_handler_t* self,
|
void(CEF_CALLBACK* on_popup_size)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
const cef_rect_t* rect);
|
const cef_rect_t* rect);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when an element should be painted. Pixel values passed to this
|
// Called when an element should be painted. Pixel values passed to this
|
||||||
/// function are scaled relative to view coordinates based on the value of
|
// function are scaled relative to view coordinates based on the value of
|
||||||
/// CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type|
|
// CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type|
|
||||||
/// indicates whether the element is the view or the popup widget. |buffer|
|
// indicates whether the element is the view or the popup widget. |buffer|
|
||||||
/// contains the pixel data for the whole image. |dirtyRects| contains the set
|
// contains the pixel data for the whole image. |dirtyRects| contains the set
|
||||||
/// of rectangles in pixel coordinates that need to be repainted. |buffer|
|
// of rectangles in pixel coordinates that need to be repainted. |buffer| will
|
||||||
/// will be |width|*|height|*4 bytes in size and represents a BGRA image with
|
// be |width|*|height|*4 bytes in size and represents a BGRA image with an
|
||||||
/// an upper-left origin. This function is only called when
|
// upper-left origin. This function is only called when
|
||||||
/// cef_window_tInfo::shared_texture_enabled is set to false (0).
|
// cef_window_tInfo::shared_texture_enabled is set to false (0).
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_paint)(struct _cef_render_handler_t* self,
|
void(CEF_CALLBACK* on_paint)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -146,63 +144,34 @@ typedef struct _cef_render_handler_t {
|
|||||||
int height);
|
int height);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when an element has been rendered to the shared texture handle.
|
// Called when an element has been rendered to the shared texture handle.
|
||||||
/// |type| indicates whether the element is the view or the popup widget.
|
// |type| indicates whether the element is the view or the popup widget.
|
||||||
/// |dirtyRects| contains the set of rectangles in pixel coordinates that need
|
// |dirtyRects| contains the set of rectangles in pixel coordinates that need
|
||||||
/// to be repainted. |info| contains the shared handle; on Windows it is a
|
// to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that
|
||||||
/// HANDLE to a texture that can be opened with D3D11 OpenSharedResource, on
|
// can be accessed via ID3D11Device using the OpenSharedResource function.
|
||||||
/// macOS it is an IOSurface pointer that can be opened with Metal or OpenGL,
|
// This function is only called when cef_window_tInfo::shared_texture_enabled
|
||||||
/// and on Linux it contains several planes, each with an fd to the underlying
|
// is set to true (1), and is currently only supported on Windows.
|
||||||
/// system native buffer.
|
|
||||||
///
|
///
|
||||||
/// The underlying implementation uses a pool to deliver frames. As a result,
|
void(CEF_CALLBACK* on_accelerated_paint)(struct _cef_render_handler_t* self,
|
||||||
/// the handle may differ every frame depending on how many frames are in-
|
struct _cef_browser_t* browser,
|
||||||
/// progress. The handle's resource cannot be cached and cannot be accessed
|
cef_paint_element_type_t type,
|
||||||
/// outside of this callback. It should be reopened each time this callback is
|
size_t dirtyRectsCount,
|
||||||
/// executed and the contents should be copied to a texture owned by the
|
cef_rect_t const* dirtyRects,
|
||||||
/// client application. The contents of |info| will be released back to the
|
void* shared_handle);
|
||||||
/// pool after this callback returns.
|
|
||||||
///
|
|
||||||
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,
|
|
||||||
const cef_accelerated_paint_info_t* info);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called to retrieve the size of the touch handle for the specified
|
// Called when the user starts dragging content in the web view. Contextual
|
||||||
/// |orientation|.
|
// information about the dragged content is supplied by |drag_data|. (|x|,
|
||||||
///
|
// |y|) is the drag start location in screen coordinates. OS APIs that run a
|
||||||
void(CEF_CALLBACK* get_touch_handle_size)(
|
// system message loop may be used within the StartDragging call.
|
||||||
struct _cef_render_handler_t* self,
|
//
|
||||||
struct _cef_browser_t* browser,
|
// Return false (0) to abort the drag operation. Don't call any of
|
||||||
cef_horizontal_alignment_t orientation,
|
// cef_browser_host_t::DragSource*Ended* functions after returning false (0).
|
||||||
cef_size_t* size);
|
//
|
||||||
|
// Return true (1) to handle the drag operation. Call
|
||||||
///
|
// cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either
|
||||||
/// Called when touch handle state is updated. The client is responsible for
|
// synchronously or asynchronously to inform the web view that the drag
|
||||||
/// rendering the touch handles.
|
// operation has ended.
|
||||||
///
|
|
||||||
void(CEF_CALLBACK* on_touch_handle_state_changed)(
|
|
||||||
struct _cef_render_handler_t* self,
|
|
||||||
struct _cef_browser_t* browser,
|
|
||||||
const cef_touch_handle_state_t* state);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Called when the user starts dragging content in the web view. Contextual
|
|
||||||
/// information about the dragged content is supplied by |drag_data|. (|x|,
|
|
||||||
/// |y|) is the drag start location in screen coordinates. OS APIs that run a
|
|
||||||
/// system message loop may be used within the StartDragging call.
|
|
||||||
///
|
|
||||||
/// Return false (0) to abort the drag operation. Don't call any of
|
|
||||||
/// cef_browser_host_t::DragSource*Ended* functions after returning false (0).
|
|
||||||
///
|
|
||||||
/// Return true (1) to handle the drag operation. Call
|
|
||||||
/// cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either
|
|
||||||
/// 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,
|
int(CEF_CALLBACK* start_dragging)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
@@ -212,16 +181,16 @@ typedef struct _cef_render_handler_t {
|
|||||||
int y);
|
int y);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the web view wants to update the mouse cursor during a drag &
|
// Called when the web view wants to update the mouse cursor during a drag &
|
||||||
/// drop operation. |operation| describes the allowed operation (none, move,
|
// drop operation. |operation| describes the allowed operation (none, move,
|
||||||
/// copy, link).
|
// copy, link).
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* update_drag_cursor)(struct _cef_render_handler_t* self,
|
void(CEF_CALLBACK* update_drag_cursor)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
cef_drag_operations_mask_t operation);
|
cef_drag_operations_mask_t operation);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the scroll offset has changed.
|
// Called when the scroll offset has changed.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_scroll_offset_changed)(
|
void(CEF_CALLBACK* on_scroll_offset_changed)(
|
||||||
struct _cef_render_handler_t* self,
|
struct _cef_render_handler_t* self,
|
||||||
@@ -230,9 +199,9 @@ typedef struct _cef_render_handler_t {
|
|||||||
double y);
|
double y);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when the IME composition range has changed. |selected_range| is the
|
// Called when the IME composition range has changed. |selected_range| is the
|
||||||
/// range of characters that have been selected. |character_bounds| is the
|
// range of characters that have been selected. |character_bounds| is the
|
||||||
/// bounds of each character in view coordinates.
|
// bounds of each character in view coordinates.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_ime_composition_range_changed)(
|
void(CEF_CALLBACK* on_ime_composition_range_changed)(
|
||||||
struct _cef_render_handler_t* self,
|
struct _cef_render_handler_t* self,
|
||||||
@@ -242,9 +211,9 @@ typedef struct _cef_render_handler_t {
|
|||||||
cef_rect_t const* character_bounds);
|
cef_rect_t const* character_bounds);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when text selection has changed for the specified |browser|.
|
// Called when text selection has changed for the specified |browser|.
|
||||||
/// |selected_text| is the currently selected text and |selected_range| is the
|
// |selected_text| is the currently selected text and |selected_range| is the
|
||||||
/// character range.
|
// character range.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_text_selection_changed)(
|
void(CEF_CALLBACK* on_text_selection_changed)(
|
||||||
struct _cef_render_handler_t* self,
|
struct _cef_render_handler_t* self,
|
||||||
@@ -253,10 +222,10 @@ typedef struct _cef_render_handler_t {
|
|||||||
const cef_range_t* selected_range);
|
const cef_range_t* selected_range);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when an on-screen keyboard should be shown or hidden for the
|
// Called when an on-screen keyboard should be shown or hidden for the
|
||||||
/// specified |browser|. |input_mode| specifies what kind of keyboard should
|
// specified |browser|. |input_mode| specifies what kind of keyboard should be
|
||||||
/// be opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing
|
// opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing keyboard
|
||||||
/// keyboard for this browser should be hidden.
|
// for this browser should be hidden.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_virtual_keyboard_requested)(
|
void(CEF_CALLBACK* on_virtual_keyboard_requested)(
|
||||||
struct _cef_render_handler_t* self,
|
struct _cef_render_handler_t* self,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=6e2fccb5a8e49918d723f6c5223062cf98b0f9de$
|
// $hash=4ebf99611a11cc8714d710c37417fbd9f50f0618$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
||||||
@@ -54,30 +54,30 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to implement render process callbacks. The functions of this
|
// Structure used to implement render process callbacks. The functions of this
|
||||||
/// structure will be called on the render process main thread (TID_RENDERER)
|
// structure will be called on the render process main thread (TID_RENDERER)
|
||||||
/// unless otherwise indicated.
|
// unless otherwise indicated.
|
||||||
///
|
///
|
||||||
typedef struct _cef_render_process_handler_t {
|
typedef struct _cef_render_process_handler_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called after WebKit has been initialized.
|
// 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);
|
struct _cef_render_process_handler_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called after a browser has been created. When browsing cross-origin a new
|
// 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
|
// browser will be created before the old browser with the same identifier is
|
||||||
/// destroyed. |extra_info| is an optional read-only value originating from
|
// destroyed. |extra_info| is an optional read-only value originating from
|
||||||
/// cef_browser_host_t::cef_browser_host_create_browser(),
|
// cef_browser_host_t::cef_browser_host_create_browser(),
|
||||||
/// cef_browser_host_t::cef_browser_host_create_browser_sync(),
|
// cef_browser_host_t::cef_browser_host_create_browser_sync(),
|
||||||
/// cef_life_span_handler_t::on_before_popup() or
|
// cef_life_span_handler_t::on_before_popup() or
|
||||||
/// cef_browser_view_t::cef_browser_view_create().
|
// cef_browser_view_t::cef_browser_view_create().
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* on_browser_created)(
|
void(CEF_CALLBACK* on_browser_created)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_render_process_handler_t* self,
|
||||||
@@ -85,25 +85,25 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
struct _cef_dictionary_value_t* extra_info);
|
struct _cef_dictionary_value_t* extra_info);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called before a browser is destroyed.
|
// 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_render_process_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the handler for browser load status events.
|
// 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);
|
struct _cef_render_process_handler_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called immediately after the V8 context for a frame has been created. To
|
// Called immediately after the V8 context for a frame has been created. To
|
||||||
/// retrieve the JavaScript 'window' object use the
|
// retrieve the JavaScript 'window' object use the
|
||||||
/// cef_v8context_t::get_global() function. V8 handles can only be accessed
|
// cef_v8context_t::get_global() function. V8 handles can only be accessed
|
||||||
/// from the thread on which they are created. A task runner for posting tasks
|
// from the thread on which they are created. A task runner for posting tasks
|
||||||
/// on the associated thread can be retrieved via the
|
// on the associated thread can be retrieved via the
|
||||||
/// cef_v8context_t::get_task_runner() function.
|
// 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_render_process_handler_t* self,
|
||||||
@@ -112,8 +112,8 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
struct _cef_v8context_t* context);
|
struct _cef_v8context_t* context);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called immediately before the V8 context for a frame is released. No
|
// Called immediately before the V8 context for a frame is released. No
|
||||||
/// references to the context should be kept after this function is called.
|
// 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_render_process_handler_t* self,
|
||||||
@@ -122,9 +122,9 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
struct _cef_v8context_t* context);
|
struct _cef_v8context_t* context);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called for global uncaught exceptions in a frame. Execution of this
|
// Called for global uncaught exceptions in a frame. Execution of this
|
||||||
/// callback is disabled by default. To enable set
|
// callback is disabled by default. To enable set
|
||||||
/// cef_settings_t.uncaught_exception_stack_size > 0.
|
// 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_render_process_handler_t* self,
|
||||||
@@ -135,12 +135,12 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
struct _cef_v8stack_trace_t* stackTrace);
|
struct _cef_v8stack_trace_t* stackTrace);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a new node in the the browser gets focus. The |node| value may
|
// Called when a new node in the the browser gets focus. The |node| value may
|
||||||
/// be NULL if no specific node has gained focus. The node object passed to
|
// be NULL if no specific node has gained focus. The node object passed to
|
||||||
/// this function represents a snapshot of the DOM at the time this function
|
// this function represents a snapshot of the DOM at the time this function is
|
||||||
/// is executed. DOM objects are only valid for the scope of this function. Do
|
// executed. DOM objects are only valid for the scope of this function. Do not
|
||||||
/// not keep references to or attempt to access any DOM objects outside the
|
// keep references to or attempt to access any DOM objects outside the scope
|
||||||
/// scope of this function.
|
// 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_render_process_handler_t* self,
|
||||||
@@ -149,9 +149,9 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
struct _cef_domnode_t* node);
|
struct _cef_domnode_t* node);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Called when a new message is received from a different process. Return
|
// Called when a new message is received from a different process. Return true
|
||||||
/// true (1) if the message was handled or false (0) otherwise. It is safe to
|
// (1) if the message was handled or false (0) otherwise. It is safe to keep a
|
||||||
/// keep a reference to |message| outside of this callback.
|
// reference to |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_render_process_handler_t* self,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,11 +33,11 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=9ad38f2709d9e3b1bd0e99c279b0497b8aa4c82a$
|
// $hash=273af5bd01c6ab5d4df8efb2af2b4e2da9c21760$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_UNRESPONSIVE_PROCESS_CALLBACK_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CALLBACK_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_UNRESPONSIVE_PROCESS_CALLBACK_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CALLBACK_CAPI_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "include/capi/cef_base_capi.h"
|
#include "include/capi/cef_base_capi.h"
|
||||||
@@ -47,28 +47,28 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Callback structure for asynchronous handling of an unresponsive process.
|
// Callback structure used for asynchronous continuation of url requests.
|
||||||
///
|
///
|
||||||
typedef struct _cef_unresponsive_process_callback_t {
|
typedef struct _cef_request_callback_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Reset the timeout for the unresponsive process.
|
// Continue the url request. If |allow| is true (1) the request will be
|
||||||
|
// continued. Otherwise, the request will be canceled.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* wait)(struct _cef_unresponsive_process_callback_t* self);
|
void(CEF_CALLBACK* cont)(struct _cef_request_callback_t* self, int allow);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Terminate the unresponsive process.
|
// Cancel the url request.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* terminate)(
|
void(CEF_CALLBACK* cancel)(struct _cef_request_callback_t* self);
|
||||||
struct _cef_unresponsive_process_callback_t* self);
|
} cef_request_callback_t;
|
||||||
} cef_unresponsive_process_callback_t;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CAPI_CEF_UNRESPONSIVE_PROCESS_CALLBACK_CAPI_H_
|
#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CALLBACK_CAPI_H_
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
|
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
// $hash=14ce483864835eca476d08d39ed4236fbd1a874c$
|
// $hash=a5e9055958c3588d583d4d128a5d7c8639f39946$
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
||||||
@@ -50,96 +50,96 @@ struct _cef_post_data_element_t;
|
|||||||
struct _cef_post_data_t;
|
struct _cef_post_data_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to represent a web request. The functions of this structure
|
// Structure used to represent a web request. The functions of this structure
|
||||||
/// may be called on any thread.
|
// may be called on any thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_request_t {
|
typedef struct _cef_request_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is read-only.
|
// 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.
|
// Get the fully qualified URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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.
|
// Set the fully qualified URL.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_url)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_url)(struct _cef_request_t* self,
|
||||||
const cef_string_t* url);
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the request function type. The value will default to POST if post data
|
// Get the request function type. The value will default to POST if post data
|
||||||
/// is provided and GET otherwise.
|
// is provided and GET otherwise.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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.
|
// Set the request function type.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_method)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_method)(struct _cef_request_t* self,
|
||||||
const cef_string_t* method);
|
const cef_string_t* method);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the referrer URL and policy. If non-NULL the referrer URL must be
|
// Set the referrer URL and policy. If non-NULL the referrer URL must be fully
|
||||||
/// fully qualified with an HTTP or HTTPS scheme component. Any username,
|
// qualified with an HTTP or HTTPS scheme component. Any username, password or
|
||||||
/// password or ref component will be removed.
|
// ref component will be removed.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_referrer)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_referrer)(struct _cef_request_t* self,
|
||||||
const cef_string_t* referrer_url,
|
const cef_string_t* referrer_url,
|
||||||
cef_referrer_policy_t policy);
|
cef_referrer_policy_t policy);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the referrer URL.
|
// Get the referrer URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the referrer policy.
|
// 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);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the post data.
|
// 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);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the post data.
|
// Set the post data.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_post_data)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_post_data)(struct _cef_request_t* self,
|
||||||
struct _cef_post_data_t* postData);
|
struct _cef_post_data_t* postData);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the header values. Will not include the Referer value if any.
|
// Get the header values. Will not include the Referer value if any.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_header_map)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* get_header_map)(struct _cef_request_t* self,
|
||||||
cef_string_multimap_t headerMap);
|
cef_string_multimap_t headerMap);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the header values. If a Referer value exists in the header map it will
|
// Set the header values. If a Referer value exists in the header map it will
|
||||||
/// be removed and ignored.
|
// be removed and ignored.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_header_map)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_header_map)(struct _cef_request_t* self,
|
||||||
cef_string_multimap_t headerMap);
|
cef_string_multimap_t headerMap);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the first header value for |name| or an NULL string if not found.
|
// 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
|
// Will not return the Referer value if any. Use GetHeaderMap instead if
|
||||||
/// |name| might have multiple values.
|
// |name| might have multiple values.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t(CEF_CALLBACK* get_header_by_name)(
|
cef_string_userfree_t(CEF_CALLBACK* get_header_by_name)(
|
||||||
@@ -147,10 +147,10 @@ typedef struct _cef_request_t {
|
|||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the header |name| to |value|. If |overwrite| is true (1) any existing
|
// 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)
|
// values will be replaced with the new value. If |overwrite| is false (0) any
|
||||||
/// any existing values will not be overwritten. The Referer value cannot be
|
// existing values will not be overwritten. The Referer value cannot be set
|
||||||
/// set using this function.
|
// using this function.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_header_by_name)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_header_by_name)(struct _cef_request_t* self,
|
||||||
const cef_string_t* name,
|
const cef_string_t* name,
|
||||||
@@ -158,7 +158,7 @@ typedef struct _cef_request_t {
|
|||||||
int overwrite);
|
int overwrite);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set all values at one time.
|
// Set all values at one time.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set)(struct _cef_request_t* self,
|
||||||
const cef_string_t* url,
|
const cef_string_t* url,
|
||||||
@@ -167,176 +167,174 @@ typedef struct _cef_request_t {
|
|||||||
cef_string_multimap_t headerMap);
|
cef_string_multimap_t headerMap);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the flags used in combination with cef_urlrequest_t. See
|
// Get the flags used in combination with cef_urlrequest_t. See
|
||||||
/// cef_urlrequest_flags_t for supported values.
|
// 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
|
// Set the flags used in combination with cef_urlrequest_t. See
|
||||||
/// cef_urlrequest_flags_t for supported values.
|
// cef_urlrequest_flags_t for supported values.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_flags)(struct _cef_request_t* self, int flags);
|
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
|
// Get the URL to the first party for cookies used in combination with
|
||||||
/// cef_urlrequest_t.
|
// cef_urlrequest_t.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t(CEF_CALLBACK* get_first_party_for_cookies)(
|
cef_string_userfree_t(CEF_CALLBACK* get_first_party_for_cookies)(
|
||||||
struct _cef_request_t* self);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set the URL to the first party for cookies used in combination with
|
// Set the URL to the first party for cookies used in combination with
|
||||||
/// cef_urlrequest_t.
|
// cef_urlrequest_t.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_first_party_for_cookies)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_first_party_for_cookies)(struct _cef_request_t* self,
|
||||||
const cef_string_t* url);
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the resource type for this request. Only available in the browser
|
// Get the resource type for this request. Only available in the browser
|
||||||
/// process.
|
// process.
|
||||||
///
|
///
|
||||||
cef_resource_type_t(CEF_CALLBACK* get_resource_type)(
|
cef_resource_type_t(CEF_CALLBACK* get_resource_type)(
|
||||||
struct _cef_request_t* self);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Get the transition type for this request. Only available in the browser
|
// Get the transition type for this request. Only available in the browser
|
||||||
/// process and only applies to requests that represent a main frame or sub-
|
// process and only applies to requests that represent a main frame or sub-
|
||||||
/// frame navigation.
|
// 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);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the globally unique identifier for this request or 0 if not
|
// Returns the globally unique identifier for this request or 0 if not
|
||||||
/// specified. Can be used by cef_resource_request_handler_t implementations
|
// specified. Can be used by cef_resource_request_handler_t implementations in
|
||||||
/// in the browser process to track a single request across multiple
|
// the browser process to track a single request across multiple callbacks.
|
||||||
/// callbacks.
|
|
||||||
///
|
///
|
||||||
uint64_t(CEF_CALLBACK* get_identifier)(struct _cef_request_t* self);
|
uint64(CEF_CALLBACK* get_identifier)(struct _cef_request_t* self);
|
||||||
} cef_request_t;
|
} cef_request_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new cef_request_t object.
|
// Create a new cef_request_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_request_t* cef_request_create(void);
|
CEF_EXPORT cef_request_t* cef_request_create();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to represent post data for a web request. The functions of
|
// Structure used to represent post data for a web request. The functions of
|
||||||
/// this structure may be called on any thread.
|
// this structure may be called on any thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_post_data_t {
|
typedef struct _cef_post_data_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is read-only.
|
// 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
|
// Returns true (1) if the underlying POST data includes elements that are not
|
||||||
/// not represented by this cef_post_data_t object (for example, multi-part
|
// represented by this cef_post_data_t object (for example, multi-part file
|
||||||
/// file upload data). Modifying cef_post_data_t objects with excluded
|
// upload data). Modifying cef_post_data_t objects with excluded elements may
|
||||||
/// elements may result in the request failing.
|
// 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.
|
// 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.
|
// Retrieve the post data elements.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* get_elements)(struct _cef_post_data_t* self,
|
void(CEF_CALLBACK* get_elements)(struct _cef_post_data_t* self,
|
||||||
size_t* elementsCount,
|
size_t* elementsCount,
|
||||||
struct _cef_post_data_element_t** elements);
|
struct _cef_post_data_element_t** elements);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Remove the specified post data element. Returns true (1) if the removal
|
// Remove the specified post data element. Returns true (1) if the removal
|
||||||
/// succeeds.
|
// succeeds.
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* remove_element)(struct _cef_post_data_t* self,
|
int(CEF_CALLBACK* remove_element)(struct _cef_post_data_t* self,
|
||||||
struct _cef_post_data_element_t* element);
|
struct _cef_post_data_element_t* element);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Add the specified post data element. Returns true (1) if the add
|
// Add the specified post data element. Returns true (1) if the add succeeds.
|
||||||
/// succeeds.
|
|
||||||
///
|
///
|
||||||
int(CEF_CALLBACK* add_element)(struct _cef_post_data_t* self,
|
int(CEF_CALLBACK* add_element)(struct _cef_post_data_t* self,
|
||||||
struct _cef_post_data_element_t* element);
|
struct _cef_post_data_element_t* element);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Remove all existing post data elements.
|
// 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;
|
} cef_post_data_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new cef_post_data_t object.
|
// Create a new cef_post_data_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_post_data_t* cef_post_data_create(void);
|
CEF_EXPORT cef_post_data_t* cef_post_data_create();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Structure used to represent a single element in the request post data. The
|
// Structure used to represent a single element in the request post data. The
|
||||||
/// functions of this structure may be called on any thread.
|
// functions of this structure may be called on any thread.
|
||||||
///
|
///
|
||||||
typedef struct _cef_post_data_element_t {
|
typedef struct _cef_post_data_element_t {
|
||||||
///
|
///
|
||||||
/// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_ref_counted_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns true (1) if this object is read-only.
|
// 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.
|
// 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.
|
// The post data element will represent a file.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_to_file)(struct _cef_post_data_element_t* self,
|
void(CEF_CALLBACK* set_to_file)(struct _cef_post_data_element_t* self,
|
||||||
const cef_string_t* fileName);
|
const cef_string_t* fileName);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The post data element will represent bytes. The bytes passed in will be
|
// The post data element will represent bytes. The bytes passed in will be
|
||||||
/// copied.
|
// copied.
|
||||||
///
|
///
|
||||||
void(CEF_CALLBACK* set_to_bytes)(struct _cef_post_data_element_t* self,
|
void(CEF_CALLBACK* set_to_bytes)(struct _cef_post_data_element_t* self,
|
||||||
size_t size,
|
size_t size,
|
||||||
const void* bytes);
|
const void* bytes);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the type of this post data element.
|
// 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);
|
struct _cef_post_data_element_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the file name.
|
// Return the file name.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// 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);
|
struct _cef_post_data_element_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the number of bytes.
|
// 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
|
// Read up to |size| bytes into |bytes| and return the number of bytes
|
||||||
/// actually read.
|
// actually read.
|
||||||
///
|
///
|
||||||
size_t(CEF_CALLBACK* get_bytes)(struct _cef_post_data_element_t* self,
|
size_t(CEF_CALLBACK* get_bytes)(struct _cef_post_data_element_t* self,
|
||||||
size_t size,
|
size_t size,
|
||||||
@@ -344,9 +342,9 @@ typedef struct _cef_post_data_element_t {
|
|||||||
} cef_post_data_element_t;
|
} cef_post_data_element_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Create a new cef_post_data_element_t object.
|
// Create a new cef_post_data_element_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create(void);
|
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user