mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
302 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
cb937fc9cd | ||
|
56227877aa | ||
|
e710be4f64 | ||
|
458cc98590 | ||
|
1d1fe01a48 | ||
|
5e6699b223 | ||
|
678fa78c28 | ||
|
924c2e339e | ||
|
c8ac6c879d | ||
|
5969b2bbb8 | ||
|
fbc59483b9 | ||
|
dcdb070ecd | ||
|
b69a4a2e3d | ||
|
df6fb4f06e | ||
|
b8ca094aca | ||
|
01ef24d928 | ||
|
ce3a5d5a7b | ||
|
36bc0371bf | ||
|
391685c279 | ||
|
7016b2def6 | ||
|
f9b6257652 | ||
|
6d61f0c90f | ||
|
006d0629a0 | ||
|
8f5df4027b | ||
|
1489b9dde4 | ||
|
e858849615 | ||
|
876e82f444 | ||
|
74b4a5fe27 | ||
|
b3f2995808 | ||
|
5fa11acf79 | ||
|
a64237bcb0 | ||
|
ea0e213bef | ||
|
a659b48fd1 | ||
|
4cc3a221c3 | ||
|
dec98a5534 | ||
|
fcad76b405 | ||
|
0fb03e7aa1 | ||
|
7f3c21b64a | ||
|
339ce47575 | ||
|
7d09642925 | ||
|
fad6aec5d0 | ||
|
96bd993d99 | ||
|
8e9d736cda | ||
|
6a76bdb040 | ||
|
cf5b322efc | ||
|
7139f01103 | ||
|
0d12959a50 | ||
|
10c01ff43e | ||
|
66b5dc3d55 | ||
|
f12ad6b634 | ||
|
5bf4d4febd | ||
|
448a112352 | ||
|
9229cdd0eb | ||
|
9e22c975fa | ||
|
6301e06c8a | ||
|
123324f5f9 | ||
|
eb3325a9ae | ||
|
2d48a07bec | ||
|
669e8673ce | ||
|
b03c54bfbe | ||
|
35830c88e5 | ||
|
3c3045a5cb | ||
|
b25374c8e7 | ||
|
4f28c5ffff | ||
|
12043b16e7 | ||
|
d9ebd4c50f | ||
|
f6f2c9a0ca | ||
|
21310e4374 | ||
|
08ff72fa20 | ||
|
12cc069b69 | ||
|
cd27cbc802 | ||
|
a9f0fa9dfe | ||
|
240ba800ed | ||
|
84e2286995 | ||
|
58413e16b1 | ||
|
58e2e4b23d | ||
|
77dc8157d0 | ||
|
8426da0de6 | ||
|
66484d799e | ||
|
dcf533cc3c | ||
|
67708d07f2 | ||
|
d1d4f7a3ef | ||
|
46e8152b6d | ||
|
1f4f8f4af7 | ||
|
f24f885eeb | ||
|
a3c55f1d26 | ||
|
f6c9a96a12 | ||
|
4b33c17533 | ||
|
0677d0d9de | ||
|
64d86a7397 | ||
|
87e33b1692 | ||
|
4315f3b724 | ||
|
bb28b85bdd | ||
|
90863b8c5d | ||
|
c3f5e6463c | ||
|
b220672c42 | ||
|
acb0922500 | ||
|
b44919e3c5 | ||
|
a1f47abaf6 | ||
|
ff8aa46e5e | ||
|
d4ec164297 | ||
|
e312a35ef3 | ||
|
3018e1866b | ||
|
7a59914f97 | ||
|
4fb6e1ba29 | ||
|
e030236c36 | ||
|
a98c6b1f52 | ||
|
5b136976e9 | ||
|
56bbee8efb | ||
|
cd6ff760dd | ||
|
5caccda56c | ||
|
3b499d3d11 | ||
|
cca0bcc8e0 | ||
|
39ccd85d77 | ||
|
0ac37cefa1 | ||
|
36668efc2f | ||
|
a5a5e7ff08 | ||
|
57b9cf9ddd | ||
|
57fb011377 | ||
|
9e644b7538 | ||
|
ac86b61139 | ||
|
c3f2c2e91c | ||
|
de1bd286f8 | ||
|
98de8e79db | ||
|
d34d3d1b3b | ||
|
d7e1312e9d | ||
|
a2f430c6f3 | ||
|
128fbfb2d6 | ||
|
6006f77bd9 | ||
|
232f6bc427 | ||
|
50ca6928c3 | ||
|
1c7391b70a | ||
|
0cd8169125 | ||
|
6e457d6bb1 | ||
|
8b4b6ac2ed | ||
|
3750c59aaa | ||
|
7b3d7b8575 | ||
|
e5d0cfe639 | ||
|
f02e7b54b3 | ||
|
accf1f1613 | ||
|
a724e90d52 | ||
|
4ddff77339 | ||
|
54a015f785 | ||
|
f052e282dd | ||
|
2fe9f7bd31 | ||
|
cafa5954dc | ||
|
d8bc3d8372 | ||
|
4c5ccce85f | ||
|
552a3bf353 | ||
|
c04652d193 | ||
|
56557833d9 | ||
|
6a9a51222e | ||
|
14c030174e | ||
|
8d51acb9be | ||
|
d5e141648b | ||
|
4c795f5188 | ||
|
7fe13d87c6 | ||
|
7dcabf547b | ||
|
69178d519e | ||
|
493bec52c9 | ||
|
b14167ad04 | ||
|
85d041c0e2 | ||
|
be2160e6c3 | ||
|
232a68480e | ||
|
facee1f750 | ||
|
7e783d6a37 | ||
|
059ed41926 | ||
|
7840b4f406 | ||
|
4a6e9b636e | ||
|
89a1f2b372 | ||
|
bfdc2655ad | ||
|
51136f6541 | ||
|
9f7bdcf7d5 | ||
|
486e69e23b | ||
|
c506c8c5c0 | ||
|
4787b45db2 | ||
|
2733a561e4 | ||
|
9334a09176 | ||
|
8b4980b4ca | ||
|
c80264ab11 | ||
|
607a1d9f49 | ||
|
3006329678 | ||
|
f372e90025 | ||
|
6bcbefa5fc | ||
|
b0edce9c9d | ||
|
c95b92f1e8 | ||
|
c1269e105d | ||
|
3f48f8ec54 | ||
|
d8a602ed2f | ||
|
a028976ac4 | ||
|
22d2fc50d1 | ||
|
05cddc2490 | ||
|
ed5208366c | ||
|
dddfce456c | ||
|
64e6971099 | ||
|
7f6c18af09 | ||
|
9cff99dc4e | ||
|
5b12134a45 | ||
|
76eb49196e | ||
|
b153ba46db | ||
|
7b94ec0c8b | ||
|
f229796a39 | ||
|
6da2bbf229 | ||
|
85c945bc00 | ||
|
0c24e90b44 | ||
|
1aea3a06a5 | ||
|
796c7b6c59 | ||
|
700123d3eb | ||
|
b216f427f6 | ||
|
c080187908 | ||
|
75acd20e9a | ||
|
8e69e3dcea | ||
|
cb0dfccddc | ||
|
2773518869 | ||
|
70a01250e1 | ||
|
dce5d5c28f | ||
|
5918d426b3 | ||
|
943ffb217b | ||
|
09f021be88 | ||
|
5c79944b31 | ||
|
12150b43d2 | ||
|
59606b88d2 | ||
|
d4f06e3806 | ||
|
f6eb19f8d6 | ||
|
24e20aec0f | ||
|
31d9407ee2 | ||
|
a566549e04 | ||
|
816f700d3e | ||
|
64fcfa6068 | ||
|
67e23b472a | ||
|
eaa0942690 | ||
|
49d1fe3b30 | ||
|
eea39b8413 | ||
|
b28a6145a1 | ||
|
7a02419cac | ||
|
1347fec298 | ||
|
51e8c53f30 | ||
|
77097ffab7 | ||
|
96f9108343 | ||
|
e5ad5a8fcd | ||
|
86c329e790 | ||
|
3f970689a0 | ||
|
5a5b538af7 | ||
|
6d97cfb761 | ||
|
b85e69a94c | ||
|
03e25c778a | ||
|
6a603af993 | ||
|
4fe6ac0d4b | ||
|
a2b8c250a8 | ||
|
0a2b82757a | ||
|
f440f850ef | ||
|
f2b988a0ce | ||
|
10fccbd6cf | ||
|
3f71138d64 | ||
|
2f6475c0d8 | ||
|
33b52839c6 | ||
|
b66cddb919 | ||
|
aacc3aae9a | ||
|
e7ac0d0ff5 | ||
|
c6838d8ca8 | ||
|
bab532b35b | ||
|
608f2d4170 | ||
|
54647945f1 | ||
|
fe68aee82c | ||
|
d2f48f6e08 | ||
|
7de882ece3 | ||
|
70f51c972a | ||
|
c01f40017b | ||
|
8fa8af357b | ||
|
b08f0ed713 | ||
|
10f9a9484f | ||
|
f8909fe9e0 | ||
|
16125bdbbd | ||
|
6eaf11f07a | ||
|
fbc8b983d5 | ||
|
c8c3ef4792 | ||
|
6ed4fe96b8 | ||
|
bd1b80198f | ||
|
e4867b5afb | ||
|
b7556bdddf | ||
|
c82ef82c21 | ||
|
897c0f01ed | ||
|
43001c0a94 | ||
|
54424d0edc | ||
|
feaca0ddf2 | ||
|
4054d66de0 | ||
|
903da5e452 | ||
|
0a62a4dca8 | ||
|
0afcb82ee6 | ||
|
07ba48b082 | ||
|
9dd0ca2661 | ||
|
aa398d8798 | ||
|
fda2f34c75 | ||
|
661fa722a7 | ||
|
caef479ae0 | ||
|
d6531b9fe6 | ||
|
94f604975d | ||
|
a90b50f1ff | ||
|
30451b7ca5 | ||
|
5c160e018b | ||
|
a56ac9782e | ||
|
dda50912ed |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -46,7 +46,4 @@ Thumbs.db
|
||||
/binary_distrib
|
||||
/docs
|
||||
# CEF generated files
|
||||
/include/cef_pack_resources.h
|
||||
/include/cef_pack_strings.h
|
||||
/include/cef_version.h
|
||||
/patch/patch_state.h
|
||||
|
9
.style.cfg
Normal file
9
.style.cfg
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||
# reserved. Use of this source code is governed by a BSD-style license that
|
||||
# can be found in the LICENSE file
|
||||
|
||||
# Configuration settings for tools/fix_style.py
|
||||
{
|
||||
# Directories containing these path components will be ignored.
|
||||
'ignore_directories': ['yapf'],
|
||||
}
|
2
.style.yapf
Normal file
2
.style.yapf
Normal file
@@ -0,0 +1,2 @@
|
||||
[style]
|
||||
based_on_style = chromium
|
@@ -7,5 +7,5 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/57.0.2987.133',
|
||||
'chromium_checkout': 'refs/tags/70.0.3538.102',
|
||||
}
|
||||
|
73
CHROMIUM_UPDATE.txt
Normal file
73
CHROMIUM_UPDATE.txt
Normal file
@@ -0,0 +1,73 @@
|
||||
# The Chromium Embedded Framework (CEF) project is built on top of the Chromium
|
||||
# project source tree. When updating Chromium to a new version certain files and
|
||||
# patterns should be observed for changes. If changes are detected then the CEF
|
||||
# source code or patch files will likely need to be updated.
|
||||
#
|
||||
# Add `--log-chromium-changes` to the automate-git.py command-line to output
|
||||
# the following files in the <download-dir>:
|
||||
#
|
||||
# * chromium_update_changes.diff
|
||||
# Files in the chromium/src directory that have changed. See the 'files'
|
||||
# section below.
|
||||
#
|
||||
# * chromium_update_patterns.txt
|
||||
# Files in the chromium/src directory that contain invalid/unexpected
|
||||
# patterns. See the 'patterns' section below. Failure of this step is
|
||||
# considered a fatal error during update.
|
||||
#
|
||||
# * chromium_update_patches.txt
|
||||
# Output from attempting to update existing Chromium patch files using the
|
||||
# patch_updater.py tool. Failure of this step is considered a fatal error
|
||||
# during update.
|
||||
#
|
||||
# For complete update instructions see:
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/ChromiumUpdate.md
|
||||
|
||||
{
|
||||
# Files in the chromium/src directory that should be evaluated for changes.
|
||||
# Similar changes may need to be applied to the CEF source code.
|
||||
'files': [
|
||||
'chrome/browser/browser_process.h',
|
||||
'chrome/browser/extensions/api/tabs/tabs_api.*',
|
||||
'chrome/browser/extensions/chrome_component_extension_resource_manager.*',
|
||||
'chrome/browser/extensions/chrome_extension_web_contents_observer.*',
|
||||
'chrome/browser/extensions/component_loader.*',
|
||||
'chrome/browser/extensions/extension_service.*',
|
||||
'chrome/browser/printing/print_view_manager*',
|
||||
'chrome/browser/printing/printing_message_filter*',
|
||||
'chrome/browser/profiles/profile.h',
|
||||
'chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.*',
|
||||
'chrome/common/extensions/api/*_features.json',
|
||||
'chrome/renderer/chrome_content_renderer_client.*',
|
||||
'chrome/renderer/extensions/chrome_extensions_renderer_client.*',
|
||||
'content/browser/renderer_host/render_widget_host_view_base.*',
|
||||
'content/public/browser/content_browser_client.*',
|
||||
'content/public/browser/render_widget_host_view.h',
|
||||
'content/public/browser/storage_partition.h',
|
||||
'content/public/browser/web_contents_delegate.h',
|
||||
'content/public/common/content_features.cc',
|
||||
'content/shell/BUILD.gn',
|
||||
'content/shell/app/*',
|
||||
'content/shell/browser/shell_*',
|
||||
'content/shell/browser/renderer_host/shell_*',
|
||||
'content/shell/common/shell_*',
|
||||
'content/shell/gpu/shell_*',
|
||||
'content/shell/renderer/shell_*',
|
||||
'content/shell/utility/shell_*',
|
||||
'extensions/shell/*',
|
||||
'net/cookies/cookie_store.h',
|
||||
],
|
||||
# Patterns that should not be found in the chromium/src directory after
|
||||
# applying patch files.
|
||||
'patterns': [
|
||||
{
|
||||
# New instances of this static_cast are added to the Chromium sources with
|
||||
# some regularity. If unfixed they will result in runtime crashes.
|
||||
'pattern': 'static_cast<StoragePartitionImpl\*>(',
|
||||
'exclude_matches': '^(.+?)test(.+?):',
|
||||
'message': 'New instances in non-test files should be converted to ' +\
|
||||
'call StoragePartition methods.' +\
|
||||
'\nSee storage_partition_1973.patch.',
|
||||
},
|
||||
],
|
||||
}
|
@@ -48,13 +48,13 @@
|
||||
# libgtkglext1-dev (required by the cefclient target only)
|
||||
#
|
||||
# - Mac OS X requirements:
|
||||
# Xcode 5 or newer building on Mac OS X 10.9 (Mavericks) or newer. Xcode 7.2
|
||||
# and OS X 10.11 are recommended. The Xcode command-line tools must also be
|
||||
# Xcode 5 or newer building on Mac OS X 10.9 (Mavericks) or newer. Xcode 8.3
|
||||
# and OS X 10.12 are recommended. The Xcode command-line tools must also be
|
||||
# installed. Only 64-bit builds are supported on OS X.
|
||||
#
|
||||
# - Windows requirements:
|
||||
# Visual Studio 2010 or newer building on Windows 7 or newer. Visual Studio
|
||||
# 2015 Update 2 and Windows 10 64-bit are recommended.
|
||||
# 2015 Update 3 and Windows 10 64-bit are recommended.
|
||||
#
|
||||
# BUILD EXAMPLES
|
||||
#
|
||||
@@ -199,10 +199,12 @@ add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
|
||||
# Include application targets.
|
||||
# Comes from the <target>/CMakeLists.txt file in the current directory.
|
||||
# TODO: Change these lines to match your project target when you copy this file.
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
|
||||
add_subdirectory(tests/cefclient)
|
||||
add_subdirectory(tests/cefsimple)
|
||||
add_subdirectory(tests/gtest)
|
||||
add_subdirectory(tests/ceftests)
|
||||
endif()
|
||||
|
||||
# Display configuration settings.
|
||||
PRINT_CEF_CONFIG()
|
||||
|
@@ -42,12 +42,13 @@ The CEF project is an extension of the Chromium project. CEF maintains developme
|
||||
|
||||
The base CEF framework includes support for the C and C++ programming languages. Thanks to the hard work of external maintainers CEF can integrate with a number of other programming languages and frameworks. These external projects are not maintained by CEF so please contact the respective project maintainer if you have any questions or issues.
|
||||
|
||||
* .Net - https://github.com/chillitom/CefSharp
|
||||
* .Net (CEF3) - https://github.com/cefsharp/CefSharp
|
||||
* .Net (CEF1) - https://bitbucket.org/fddima/cefglue
|
||||
* .Net/Mono (CEF3) - https://bitbucket.org/xilium/xilium.cefglue
|
||||
* .Net (CEF3) - https://bitbucket.org/chromiumfx/chromiumfx
|
||||
* Delphi (CEF1) - http://code.google.com/p/delphichromiumembedded/
|
||||
* Delphi (CEF3) - http://code.google.com/p/dcef3/
|
||||
* Delphi (CEF3) - https://github.com/hgourvest/dcef3
|
||||
* Delphi (CEF3) - https://github.com/salvadordf/CEF4Delphi
|
||||
* Go - https://github.com/CzarekTomczak/cef2go
|
||||
* Java - https://bitbucket.org/chromiumembedded/java-cef
|
||||
* Java - http://code.google.com/p/javacef/
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||
# Copyright (c) 2018 The Chromium Embedded Framework Authors. All rights
|
||||
# reserved. Use of this source code is governed by a BSD-style license that
|
||||
# can be found in the LICENSE file.
|
||||
#
|
||||
@@ -8,10 +8,13 @@
|
||||
# by hand. See the translator.README.txt file in the tools directory for
|
||||
# more information.
|
||||
#
|
||||
# $hash=67bc21133e37f5361a39f25dcfe004616d467dbc$
|
||||
#
|
||||
|
||||
{
|
||||
'variables': {
|
||||
'autogen_cpp_includes': [
|
||||
'include/cef_accessibility_handler.h',
|
||||
'include/cef_app.h',
|
||||
'include/cef_auth_callback.h',
|
||||
'include/cef_browser.h',
|
||||
@@ -29,12 +32,12 @@
|
||||
'include/cef_download_item.h',
|
||||
'include/cef_drag_data.h',
|
||||
'include/cef_drag_handler.h',
|
||||
'include/cef_extension.h',
|
||||
'include/cef_extension_handler.h',
|
||||
'include/cef_file_util.h',
|
||||
'include/cef_find_handler.h',
|
||||
'include/cef_focus_handler.h',
|
||||
'include/cef_frame.h',
|
||||
'include/cef_geolocation.h',
|
||||
'include/cef_geolocation_handler.h',
|
||||
'include/cef_image.h',
|
||||
'include/cef_jsdialog_handler.h',
|
||||
'include/cef_keyboard_handler.h',
|
||||
@@ -62,6 +65,7 @@
|
||||
'include/cef_response.h',
|
||||
'include/cef_response_filter.h',
|
||||
'include/cef_scheme.h',
|
||||
'include/cef_server.h',
|
||||
'include/cef_ssl_info.h',
|
||||
'include/cef_ssl_status.h',
|
||||
'include/cef_stream.h',
|
||||
@@ -77,6 +81,7 @@
|
||||
'include/cef_x509_certificate.h',
|
||||
'include/cef_xml_reader.h',
|
||||
'include/cef_zip_reader.h',
|
||||
'include/test/cef_test_helpers.h',
|
||||
'include/test/cef_translator_test.h',
|
||||
'include/views/cef_box_layout.h',
|
||||
'include/views/cef_browser_view.h',
|
||||
@@ -100,6 +105,7 @@
|
||||
'include/views/cef_window_delegate.h',
|
||||
],
|
||||
'autogen_capi_includes': [
|
||||
'include/capi/cef_accessibility_handler_capi.h',
|
||||
'include/capi/cef_app_capi.h',
|
||||
'include/capi/cef_auth_callback_capi.h',
|
||||
'include/capi/cef_browser_capi.h',
|
||||
@@ -117,12 +123,12 @@
|
||||
'include/capi/cef_download_item_capi.h',
|
||||
'include/capi/cef_drag_data_capi.h',
|
||||
'include/capi/cef_drag_handler_capi.h',
|
||||
'include/capi/cef_extension_capi.h',
|
||||
'include/capi/cef_extension_handler_capi.h',
|
||||
'include/capi/cef_file_util_capi.h',
|
||||
'include/capi/cef_find_handler_capi.h',
|
||||
'include/capi/cef_focus_handler_capi.h',
|
||||
'include/capi/cef_frame_capi.h',
|
||||
'include/capi/cef_geolocation_capi.h',
|
||||
'include/capi/cef_geolocation_handler_capi.h',
|
||||
'include/capi/cef_image_capi.h',
|
||||
'include/capi/cef_jsdialog_handler_capi.h',
|
||||
'include/capi/cef_keyboard_handler_capi.h',
|
||||
@@ -150,6 +156,7 @@
|
||||
'include/capi/cef_response_capi.h',
|
||||
'include/capi/cef_response_filter_capi.h',
|
||||
'include/capi/cef_scheme_capi.h',
|
||||
'include/capi/cef_server_capi.h',
|
||||
'include/capi/cef_ssl_info_capi.h',
|
||||
'include/capi/cef_ssl_status_capi.h',
|
||||
'include/capi/cef_stream_capi.h',
|
||||
@@ -165,6 +172,7 @@
|
||||
'include/capi/cef_x509_certificate_capi.h',
|
||||
'include/capi/cef_xml_reader_capi.h',
|
||||
'include/capi/cef_zip_reader_capi.h',
|
||||
'include/capi/test/cef_test_helpers_capi.h',
|
||||
'include/capi/test/cef_translator_test_capi.h',
|
||||
'include/capi/views/cef_box_layout_capi.h',
|
||||
'include/capi/views/cef_browser_view_capi.h',
|
||||
@@ -188,6 +196,8 @@
|
||||
'include/capi/views/cef_window_delegate_capi.h',
|
||||
],
|
||||
'autogen_library_side': [
|
||||
'libcef_dll/ctocpp/accessibility_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/accessibility_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/app_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/app_ctocpp.h',
|
||||
'libcef_dll/cpptoc/auth_callback_cpptoc.cc',
|
||||
@@ -258,6 +268,10 @@
|
||||
'libcef_dll/ctocpp/drag_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/end_tracing_callback_ctocpp.h',
|
||||
'libcef_dll/cpptoc/extension_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/extension_cpptoc.h',
|
||||
'libcef_dll/ctocpp/extension_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/extension_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.h',
|
||||
'libcef_dll/cpptoc/views/fill_layout_cpptoc.cc',
|
||||
@@ -268,12 +282,8 @@
|
||||
'libcef_dll/ctocpp/focus_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/frame_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/frame_cpptoc.h',
|
||||
'libcef_dll/cpptoc/geolocation_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/geolocation_callback_cpptoc.h',
|
||||
'libcef_dll/ctocpp/geolocation_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/geolocation_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h',
|
||||
'libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h',
|
||||
'libcef_dll/cpptoc/image_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/image_cpptoc.h',
|
||||
'libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc',
|
||||
@@ -296,6 +306,8 @@
|
||||
'libcef_dll/cpptoc/views/menu_button_cpptoc.h',
|
||||
'libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h',
|
||||
'libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.h',
|
||||
'libcef_dll/cpptoc/menu_model_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/menu_model_cpptoc.h',
|
||||
'libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc',
|
||||
@@ -370,6 +382,10 @@
|
||||
'libcef_dll/cpptoc/views/scroll_view_cpptoc.h',
|
||||
'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h',
|
||||
'libcef_dll/cpptoc/server_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/server_cpptoc.h',
|
||||
'libcef_dll/ctocpp/server_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/server_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.h',
|
||||
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
|
||||
@@ -416,6 +432,8 @@
|
||||
'libcef_dll/ctocpp/urlrequest_client_ctocpp.h',
|
||||
'libcef_dll/ctocpp/v8accessor_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8accessor_ctocpp.h',
|
||||
'libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h',
|
||||
'libcef_dll/cpptoc/v8context_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8context_cpptoc.h',
|
||||
'libcef_dll/cpptoc/v8exception_cpptoc.cc',
|
||||
@@ -460,6 +478,8 @@
|
||||
'libcef_dll/cpptoc/zip_reader_cpptoc.h',
|
||||
],
|
||||
'autogen_client_side': [
|
||||
'libcef_dll/cpptoc/accessibility_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/accessibility_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/app_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/app_cpptoc.h',
|
||||
'libcef_dll/ctocpp/auth_callback_ctocpp.cc',
|
||||
@@ -530,6 +550,10 @@
|
||||
'libcef_dll/cpptoc/drag_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/end_tracing_callback_cpptoc.h',
|
||||
'libcef_dll/ctocpp/extension_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/extension_ctocpp.h',
|
||||
'libcef_dll/cpptoc/extension_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/extension_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.h',
|
||||
'libcef_dll/ctocpp/views/fill_layout_ctocpp.cc',
|
||||
@@ -540,12 +564,8 @@
|
||||
'libcef_dll/cpptoc/focus_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/frame_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/frame_ctocpp.h',
|
||||
'libcef_dll/ctocpp/geolocation_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/geolocation_callback_ctocpp.h',
|
||||
'libcef_dll/cpptoc/geolocation_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/geolocation_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h',
|
||||
'libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h',
|
||||
'libcef_dll/ctocpp/image_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/image_ctocpp.h',
|
||||
'libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc',
|
||||
@@ -568,6 +588,8 @@
|
||||
'libcef_dll/ctocpp/views/menu_button_ctocpp.h',
|
||||
'libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h',
|
||||
'libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.h',
|
||||
'libcef_dll/ctocpp/menu_model_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/menu_model_ctocpp.h',
|
||||
'libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc',
|
||||
@@ -642,6 +664,10 @@
|
||||
'libcef_dll/ctocpp/views/scroll_view_ctocpp.h',
|
||||
'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h',
|
||||
'libcef_dll/ctocpp/server_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/server_ctocpp.h',
|
||||
'libcef_dll/cpptoc/server_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/server_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.h',
|
||||
'libcef_dll/ctocpp/stream_reader_ctocpp.cc',
|
||||
@@ -688,6 +714,8 @@
|
||||
'libcef_dll/cpptoc/urlrequest_client_cpptoc.h',
|
||||
'libcef_dll/cpptoc/v8accessor_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8accessor_cpptoc.h',
|
||||
'libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h',
|
||||
'libcef_dll/ctocpp/v8context_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8context_ctocpp.h',
|
||||
'libcef_dll/ctocpp/v8exception_ctocpp.cc',
|
||||
|
@@ -26,7 +26,6 @@
|
||||
'include/base/cef_string16.h',
|
||||
'include/base/cef_template_util.h',
|
||||
'include/base/cef_thread_checker.h',
|
||||
'include/base/cef_thread_collision_warner.h',
|
||||
'include/base/cef_trace_event.h',
|
||||
'include/base/cef_tuple.h',
|
||||
'include/base/cef_weak_ptr.h',
|
||||
@@ -66,6 +65,9 @@
|
||||
'include/wrapper/cef_xml_object.h',
|
||||
'include/wrapper/cef_zip_archive.h',
|
||||
],
|
||||
'includes_wrapper_mac': [
|
||||
'include/wrapper/cef_library_loader.h',
|
||||
],
|
||||
'includes_win': [
|
||||
'include/base/internal/cef_atomicops_x86_msvc.h',
|
||||
'include/base/internal/cef_bind_internal_win.h',
|
||||
@@ -77,6 +79,7 @@
|
||||
'include/base/internal/cef_atomicops_atomicword_compat.h',
|
||||
'include/base/internal/cef_atomicops_mac.h',
|
||||
'include/cef_application_mac.h',
|
||||
'include/cef_sandbox_mac.h',
|
||||
'include/internal/cef_mac.h',
|
||||
'include/internal/cef_types_mac.h',
|
||||
],
|
||||
@@ -115,7 +118,6 @@
|
||||
'libcef_dll/base/cef_ref_counted.cc',
|
||||
'libcef_dll/base/cef_string16.cc',
|
||||
'libcef_dll/base/cef_thread_checker_impl.cc',
|
||||
'libcef_dll/base/cef_thread_collision_warner.cc',
|
||||
'libcef_dll/base/cef_weak_ptr.cc',
|
||||
],
|
||||
'libcef_dll_wrapper_sources_common': [
|
||||
@@ -143,9 +145,17 @@
|
||||
'libcef_dll/wrapper/libcef_dll_wrapper.cc',
|
||||
'libcef_dll/wrapper/libcef_dll_wrapper2.cc',
|
||||
],
|
||||
'libcef_dll_wrapper_sources_mac': [
|
||||
'libcef_dll/wrapper/cef_library_loader_mac.mm',
|
||||
'libcef_dll/wrapper/libcef_dll_dylib.cc',
|
||||
],
|
||||
'shared_sources_browser': [
|
||||
'tests/shared/browser/client_app_browser.cc',
|
||||
'tests/shared/browser/client_app_browser.h',
|
||||
'tests/shared/browser/extension_util.cc',
|
||||
'tests/shared/browser/extension_util.h',
|
||||
'tests/shared/browser/file_util.cc',
|
||||
'tests/shared/browser/file_util.h',
|
||||
'tests/shared/browser/geometry_util.cc',
|
||||
'tests/shared/browser/geometry_util.h',
|
||||
'tests/shared/browser/main_message_loop.cc',
|
||||
@@ -155,8 +165,6 @@
|
||||
'tests/shared/browser/main_message_loop_std.cc',
|
||||
'tests/shared/browser/main_message_loop_std.h',
|
||||
'tests/shared/browser/resource_util.h',
|
||||
'tests/shared/browser/resource_util.cc',
|
||||
'tests/shared/browser/resource_util.h',
|
||||
],
|
||||
'shared_sources_common': [
|
||||
'tests/shared/common/client_app.cc',
|
||||
@@ -216,6 +224,8 @@
|
||||
'tests/cefclient/browser/dialog_test.h',
|
||||
'tests/cefclient/browser/drm_test.cc',
|
||||
'tests/cefclient/browser/drm_test.h',
|
||||
'tests/cefclient/browser/image_cache.cc',
|
||||
'tests/cefclient/browser/image_cache.h',
|
||||
'tests/cefclient/browser/main_context.cc',
|
||||
'tests/cefclient/browser/main_context.h',
|
||||
'tests/cefclient/browser/main_context_impl.cc',
|
||||
@@ -235,6 +245,8 @@
|
||||
'tests/cefclient/browser/root_window_manager.h',
|
||||
'tests/cefclient/browser/scheme_test.cc',
|
||||
'tests/cefclient/browser/scheme_test.h',
|
||||
'tests/cefclient/browser/server_test.cc',
|
||||
'tests/cefclient/browser/server_test.h',
|
||||
'tests/cefclient/browser/temp_window.h',
|
||||
'tests/cefclient/browser/test_runner.cc',
|
||||
'tests/cefclient/browser/test_runner.h',
|
||||
@@ -273,11 +285,20 @@
|
||||
'tests/cefclient/resources/performance2.html',
|
||||
'tests/cefclient/resources/preferences.html',
|
||||
'tests/cefclient/resources/response_filter.html',
|
||||
'tests/cefclient/resources/server.html',
|
||||
'tests/cefclient/resources/transparency.html',
|
||||
'tests/cefclient/resources/urlrequest.html',
|
||||
'tests/cefclient/resources/websocket.html',
|
||||
'tests/cefclient/resources/window.html',
|
||||
'tests/cefclient/resources/xmlhttprequest.html',
|
||||
],
|
||||
'cefclient_sources_resources_extensions_set_page_color': [
|
||||
'tests/cefclient/resources/extensions/set_page_color/icon.png',
|
||||
'tests/cefclient/resources/extensions/set_page_color/manifest.json',
|
||||
'tests/cefclient/resources/extensions/set_page_color/popup.html',
|
||||
'tests/cefclient/resources/extensions/set_page_color/popup.js',
|
||||
'tests/cefclient/resources/extensions/set_page_color/README.md',
|
||||
],
|
||||
'cefclient_sources_win': [
|
||||
'tests/cefclient/browser/browser_window_osr_win.cc',
|
||||
'tests/cefclient/browser/browser_window_osr_win.h',
|
||||
@@ -286,6 +307,11 @@
|
||||
'tests/cefclient/browser/main_context_impl_win.cc',
|
||||
'tests/cefclient/browser/main_message_loop_multithreaded_win.cc',
|
||||
'tests/cefclient/browser/main_message_loop_multithreaded_win.h',
|
||||
'tests/cefclient/browser/osr_accessibility_helper.cc',
|
||||
'tests/cefclient/browser/osr_accessibility_helper.h',
|
||||
'tests/cefclient/browser/osr_accessibility_node.cc',
|
||||
'tests/cefclient/browser/osr_accessibility_node.h',
|
||||
'tests/cefclient/browser/osr_accessibility_node_win.cc',
|
||||
'tests/cefclient/browser/osr_dragdrop_win.cc',
|
||||
'tests/cefclient/browser/osr_dragdrop_win.h',
|
||||
'tests/cefclient/browser/osr_ime_handler_win.cc',
|
||||
@@ -321,6 +347,11 @@
|
||||
'tests/cefclient/browser/browser_window_std_mac.h',
|
||||
'tests/cefclient/browser/browser_window_std_mac.mm',
|
||||
'tests/cefclient/browser/main_context_impl_posix.cc',
|
||||
'tests/cefclient/browser/osr_accessibility_helper.cc',
|
||||
'tests/cefclient/browser/osr_accessibility_helper.h',
|
||||
'tests/cefclient/browser/osr_accessibility_node.cc',
|
||||
'tests/cefclient/browser/osr_accessibility_node.h',
|
||||
'tests/cefclient/browser/osr_accessibility_node_mac.mm',
|
||||
'tests/cefclient/browser/root_window_mac.h',
|
||||
'tests/cefclient/browser/root_window_mac.mm',
|
||||
'tests/cefclient/browser/temp_window_mac.h',
|
||||
@@ -345,6 +376,8 @@
|
||||
'tests/cefclient/browser/dialog_handler_gtk.cc',
|
||||
'tests/cefclient/browser/dialog_handler_gtk.h',
|
||||
'tests/cefclient/browser/main_context_impl_posix.cc',
|
||||
'tests/cefclient/browser/main_message_loop_multithreaded_gtk.cc',
|
||||
'tests/cefclient/browser/main_message_loop_multithreaded_gtk.h',
|
||||
'tests/cefclient/browser/print_handler_gtk.cc',
|
||||
'tests/cefclient/browser/print_handler_gtk.h',
|
||||
'tests/cefclient/browser/resource_util_linux.cc',
|
||||
@@ -354,6 +387,8 @@
|
||||
'tests/cefclient/browser/root_window_views.h',
|
||||
'tests/cefclient/browser/temp_window_x11.cc',
|
||||
'tests/cefclient/browser/temp_window_x11.h',
|
||||
'tests/cefclient/browser/util_gtk.cc',
|
||||
'tests/cefclient/browser/util_gtk.h',
|
||||
'tests/cefclient/browser/views_menu_bar.cc',
|
||||
'tests/cefclient/browser/views_menu_bar.h',
|
||||
'tests/cefclient/browser/views_style.cc',
|
||||
@@ -407,11 +442,15 @@
|
||||
'tests/ceftests/dom_unittest.cc',
|
||||
'tests/ceftests/download_unittest.cc',
|
||||
'tests/ceftests/draggable_regions_unittest.cc',
|
||||
'tests/ceftests/file_util.cc',
|
||||
'tests/ceftests/file_util.h',
|
||||
'tests/ceftests/extensions/background_unittest.cc',
|
||||
'tests/ceftests/extensions/chrome_alarms_unittest.cc',
|
||||
'tests/ceftests/extensions/chrome_storage_unittest.cc',
|
||||
'tests/ceftests/extensions/chrome_tabs_unittest.cc',
|
||||
'tests/ceftests/extensions/extension_test_handler.cc',
|
||||
'tests/ceftests/extensions/extension_test_handler.h',
|
||||
'tests/ceftests/extensions/view_unittest.cc',
|
||||
'tests/ceftests/file_util_unittest.cc',
|
||||
'tests/ceftests/frame_unittest.cc',
|
||||
'tests/ceftests/geolocation_unittest.cc',
|
||||
'tests/ceftests/image_unittest.cc',
|
||||
'tests/ceftests/image_util.cc',
|
||||
'tests/ceftests/image_util.h',
|
||||
@@ -420,6 +459,8 @@
|
||||
'tests/ceftests/message_router_unittest.cc',
|
||||
'tests/ceftests/navigation_unittest.cc',
|
||||
'tests/ceftests/os_rendering_unittest.cc',
|
||||
'tests/ceftests/osr_accessibility_unittest.cc',
|
||||
'tests/ceftests/osr_display_unittest.cc',
|
||||
'tests/ceftests/parser_unittest.cc',
|
||||
'tests/ceftests/plugin_unittest.cc',
|
||||
'tests/ceftests/preference_unittest.cc',
|
||||
@@ -435,6 +476,7 @@
|
||||
'tests/ceftests/run_all_unittests.cc',
|
||||
'tests/ceftests/scheme_handler_unittest.cc',
|
||||
'tests/ceftests/scoped_temp_dir_unittest.cc',
|
||||
'tests/ceftests/server_unittest.cc',
|
||||
'tests/ceftests/stream_unittest.cc',
|
||||
'tests/ceftests/stream_resource_handler_unittest.cc',
|
||||
'tests/ceftests/string_unittest.cc',
|
||||
@@ -482,15 +524,14 @@
|
||||
'tests/ceftests/run_all_unittests_mac.mm',
|
||||
],
|
||||
'ceftests_sources_mac_helper': [
|
||||
'tests/shared/browser/resource_util.cc',
|
||||
'tests/shared/browser/file_util.cc',
|
||||
'tests/shared/browser/file_util.h',
|
||||
'tests/shared/browser/resource_util.h',
|
||||
'tests/shared/browser/resource_util_mac.mm',
|
||||
'tests/shared/browser/resource_util_posix.cc',
|
||||
'tests/ceftests/client_app_delegates.cc',
|
||||
'tests/ceftests/cookie_unittest.cc',
|
||||
'tests/ceftests/dom_unittest.cc',
|
||||
'tests/ceftests/file_util.cc',
|
||||
'tests/ceftests/file_util.h',
|
||||
'tests/ceftests/frame_unittest.cc',
|
||||
'tests/ceftests/message_router_unittest.cc',
|
||||
'tests/ceftests/navigation_unittest.cc',
|
||||
|
@@ -19,7 +19,7 @@ macro(PRINT_CEF_CONFIG)
|
||||
message(STATUS "Platform: ${CMAKE_SYSTEM_NAME}")
|
||||
message(STATUS "Project architecture: ${PROJECT_ARCH}")
|
||||
|
||||
if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
||||
if(GEN_NINJA OR GEN_MAKEFILES)
|
||||
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
|
||||
@@ -31,10 +31,11 @@ macro(PRINT_CEF_CONFIG)
|
||||
endif()
|
||||
|
||||
if(OS_WINDOWS)
|
||||
message(STATUS "CEF Windows sandbox: ${USE_SANDBOX}")
|
||||
message(STATUS "Visual Studio ATL support: ${USE_ATL}")
|
||||
endif()
|
||||
|
||||
message(STATUS "CEF sandbox: ${USE_SANDBOX}")
|
||||
|
||||
set(_libraries ${CEF_STANDARD_LIBS})
|
||||
if(OS_WINDOWS AND USE_SANDBOX)
|
||||
list(APPEND _libraries ${CEF_SANDBOX_STANDARD_LIBS})
|
||||
@@ -81,8 +82,7 @@ endmacro()
|
||||
|
||||
# Determine the target output directory based on platform and generator.
|
||||
macro(SET_CEF_TARGET_OUT_DIR)
|
||||
if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR
|
||||
${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
||||
if(GEN_NINJA OR GEN_MAKEFILES)
|
||||
# By default Ninja and Make builds don't create a subdirectory named after
|
||||
# the configuration.
|
||||
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
|
||||
@@ -102,7 +102,19 @@ macro(COPY_FILES target file_list source_dir target_dir)
|
||||
set(source_file ${source_dir}/${FILENAME})
|
||||
get_filename_component(target_name ${FILENAME} NAME)
|
||||
set(target_file ${target_dir}/${target_name})
|
||||
if(IS_DIRECTORY ${source_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()
|
||||
else()
|
||||
set(existing_source_file ${source_file})
|
||||
endif()
|
||||
|
||||
if(IS_DIRECTORY ${existing_source_file})
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
@@ -174,22 +186,6 @@ endif(OS_LINUX)
|
||||
|
||||
if(OS_MACOSX)
|
||||
|
||||
# Fix the framework rpath in the helper executable.
|
||||
macro(FIX_MACOSX_HELPER_FRAMEWORK_RPATH target)
|
||||
# The helper is in $app_name.app/Contents/Frameworks/$app_name Helper.app/Contents/MacOS/
|
||||
# so set rpath up to Contents/ so that the loader can find Frameworks/.
|
||||
set_target_properties(${target} PROPERTIES INSTALL_RPATH "@executable_path/../../../..")
|
||||
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
endmacro()
|
||||
|
||||
# Fix the framework rpath in the main executable.
|
||||
macro(FIX_MACOSX_MAIN_FRAMEWORK_RPATH target)
|
||||
# The main app is at $app_name.app/Contents/MacOS/$app_name
|
||||
# so set rpath up to Contents/ so that the loader can find Frameworks/.
|
||||
set_target_properties(${target} PROPERTIES INSTALL_RPATH "@executable_path/..")
|
||||
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
endmacro()
|
||||
|
||||
# Manually process and copy over resource files.
|
||||
macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path)
|
||||
foreach(FILENAME ${resource_list})
|
||||
@@ -276,17 +272,17 @@ endmacro()
|
||||
# SET_EXECUTABLE_TARGET_PROPERTIES() instead of calling this macro directly.
|
||||
macro(SET_COMMON_TARGET_PROPERTIES target)
|
||||
# Compile flags.
|
||||
target_compile_options(${target} PUBLIC ${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS})
|
||||
target_compile_options(${target} PUBLIC $<$<CONFIG:Debug>:${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}>)
|
||||
target_compile_options(${target} PUBLIC $<$<CONFIG:Release>:${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}>)
|
||||
target_compile_options(${target} PRIVATE ${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS})
|
||||
target_compile_options(${target} PRIVATE $<$<CONFIG:Debug>:${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}>)
|
||||
target_compile_options(${target} PRIVATE $<$<CONFIG:Release>:${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}>)
|
||||
|
||||
# Compile definitions.
|
||||
target_compile_definitions(${target} PUBLIC ${CEF_COMPILER_DEFINES})
|
||||
target_compile_definitions(${target} PUBLIC $<$<CONFIG:Debug>:${CEF_COMPILER_DEFINES_DEBUG}>)
|
||||
target_compile_definitions(${target} PUBLIC $<$<CONFIG:Release>:${CEF_COMPILER_DEFINES_RELEASE}>)
|
||||
target_compile_definitions(${target} PRIVATE ${CEF_COMPILER_DEFINES})
|
||||
target_compile_definitions(${target} PRIVATE $<$<CONFIG:Debug>:${CEF_COMPILER_DEFINES_DEBUG}>)
|
||||
target_compile_definitions(${target} PRIVATE $<$<CONFIG:Release>:${CEF_COMPILER_DEFINES_RELEASE}>)
|
||||
|
||||
# Include directories.
|
||||
target_include_directories(${target} PUBLIC ${CEF_INCLUDE_PATH})
|
||||
target_include_directories(${target} PRIVATE ${CEF_INCLUDE_PATH})
|
||||
|
||||
# Linker flags.
|
||||
if(CEF_LINKER_FLAGS)
|
||||
|
@@ -37,9 +37,14 @@ if(NOT DEFINED PROJECT_ARCH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
|
||||
set(GEN_NINJA 1)
|
||||
elseif(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
||||
set(GEN_MAKEFILES 1)
|
||||
endif()
|
||||
|
||||
# Determine the build type.
|
||||
if(NOT CMAKE_BUILD_TYPE AND
|
||||
(${CMAKE_GENERATOR} STREQUAL "Ninja" OR ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles"))
|
||||
if(NOT CMAKE_BUILD_TYPE AND (GEN_NINJA OR GEN_MAKEFILES))
|
||||
# CMAKE_BUILD_TYPE should be specified when using Ninja or Unix Makefiles.
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
message(WARNING "No CMAKE_BUILD_TYPE value selected, using ${CMAKE_BUILD_TYPE}")
|
||||
@@ -61,6 +66,10 @@ list(APPEND CEF_COMPILER_DEFINES
|
||||
)
|
||||
|
||||
|
||||
# Configure use of the sandbox.
|
||||
option(USE_SANDBOX "Enable or disable use of the sandbox." ON)
|
||||
|
||||
|
||||
#
|
||||
# Linux configuration.
|
||||
#
|
||||
@@ -81,6 +90,8 @@ if(OS_LINUX)
|
||||
-Werror # Treat warnings as errors
|
||||
-Wno-missing-field-initializers # Don't warn about missing field initializers
|
||||
-Wno-unused-parameter # Don't warn about unused parameters
|
||||
-Wno-error=comment # Don't warn about code in comments
|
||||
-Wno-comment # Don't warn about code in comments
|
||||
)
|
||||
list(APPEND CEF_C_COMPILER_FLAGS
|
||||
-std=c99 # Use the C99 language standard
|
||||
@@ -192,8 +203,12 @@ if(OS_LINUX)
|
||||
set(CEF_BINARY_FILES
|
||||
chrome-sandbox
|
||||
libcef.so
|
||||
libEGL.so
|
||||
libGLESv2.so
|
||||
natives_blob.bin
|
||||
snapshot_blob.bin
|
||||
v8_context_snapshot.bin
|
||||
swiftshader
|
||||
)
|
||||
|
||||
# List of CEF resource files.
|
||||
@@ -206,6 +221,12 @@ if(OS_LINUX)
|
||||
icudtl.dat
|
||||
locales
|
||||
)
|
||||
|
||||
if(USE_SANDBOX)
|
||||
list(APPEND CEF_COMPILER_DEFINES
|
||||
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -303,9 +324,15 @@ if(OS_MACOSX)
|
||||
set(CEF_BINARY_DIR_DEBUG "${_CEF_ROOT}/Debug")
|
||||
set(CEF_BINARY_DIR_RELEASE "${_CEF_ROOT}/Release")
|
||||
|
||||
# CEF library paths.
|
||||
set(CEF_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/Chromium Embedded Framework.framework/Chromium Embedded Framework")
|
||||
set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/Chromium Embedded Framework.framework/Chromium Embedded Framework")
|
||||
if(USE_SANDBOX)
|
||||
list(APPEND CEF_COMPILER_DEFINES
|
||||
CEF_USE_SANDBOX # Used by apps to test if the sandbox is enabled
|
||||
)
|
||||
|
||||
# CEF sandbox library paths.
|
||||
set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a")
|
||||
set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -314,27 +341,44 @@ endif()
|
||||
#
|
||||
|
||||
if(OS_WINDOWS)
|
||||
# Configure use of the sandbox.
|
||||
option(USE_SANDBOX "Enable or disable use of the sandbox." ON)
|
||||
if(USE_SANDBOX AND NOT MSVC_VERSION EQUAL 1900)
|
||||
# The cef_sandbox.lib static library is currently built with VS2015. It will
|
||||
# not link successfully with other VS versions.
|
||||
set(USE_SANDBOX OFF)
|
||||
if (GEN_NINJA)
|
||||
# When using the Ninja generator clear the CMake defaults to avoid excessive
|
||||
# console warnings (see issue #2120).
|
||||
set(CMAKE_CXX_FLAGS "")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "")
|
||||
endif()
|
||||
|
||||
# Configure use of official build compiler settings.
|
||||
# When using an official build the "Debug" build is actually a Release build
|
||||
# with DCHECKs enabled. In order to link the sandbox the Debug build must
|
||||
# be configured with some Release-related compiler settings.
|
||||
option(USE_OFFICIAL_BUILD_SANDBOX "Enable or disable use of an official build sandbox." ON)
|
||||
if(NOT USE_SANDBOX)
|
||||
# Don't need official build settings when the sandbox is off.
|
||||
set(USE_OFFICIAL_BUILD_SANDBOX OFF)
|
||||
if(USE_SANDBOX)
|
||||
# Check if the current MSVC version is compatible with the cef_sandbox.lib
|
||||
# static library. For a list of all version numbers see
|
||||
# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
|
||||
list(APPEND supported_msvc_versions
|
||||
1900 # VS2015 and updates 1, 2, & 3
|
||||
1910 # VS2017 version 15.1 & 15.2
|
||||
1911 # VS2017 version 15.3 & 15.4
|
||||
1912 # VS2017 version 15.5
|
||||
1913 # VS2017 version 15.6
|
||||
1914 # VS2017 version 15.7
|
||||
1915 # VS2017 version 15.8
|
||||
)
|
||||
list(FIND supported_msvc_versions ${MSVC_VERSION} _index)
|
||||
if (${_index} EQUAL -1)
|
||||
message(WARNING "CEF sandbox is not compatible with the current MSVC version (${MSVC_VERSION})")
|
||||
set(USE_SANDBOX OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Consumers who run into LNK4099 warnings can pass /Z7 instead (see issue #385).
|
||||
set(CEF_DEBUG_INFO_FLAG "/Zi" CACHE STRING "Optional flag specifying specific /Z flag to use")
|
||||
|
||||
# Consumers using different runtime types may want to pass different flags
|
||||
set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Optional flag specifying which runtime to use")
|
||||
if (CEF_RUNTIME_LIBRARY_FLAG)
|
||||
list(APPEND CEF_COMPILER_FLAGS_DEBUG ${CEF_RUNTIME_LIBRARY_FLAG}d)
|
||||
list(APPEND CEF_COMPILER_FLAGS_RELEASE ${CEF_RUNTIME_LIBRARY_FLAG})
|
||||
endif()
|
||||
|
||||
# Platform-specific compiler/linker flags.
|
||||
set(CEF_LIBTYPE STATIC)
|
||||
list(APPEND CEF_COMPILER_FLAGS
|
||||
@@ -353,24 +397,11 @@ if(OS_WINDOWS)
|
||||
/wd4996 # Ignore "function or variable may be unsafe" warning
|
||||
${CEF_DEBUG_INFO_FLAG}
|
||||
)
|
||||
if(USE_OFFICIAL_BUILD_SANDBOX)
|
||||
# CMake adds /RTC1, /D"_DEBUG" and a few other values by default for Debug
|
||||
# builds. We can't link the sandbox with those values so clear the CMake
|
||||
# defaults here.
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "")
|
||||
|
||||
list(APPEND CEF_COMPILER_FLAGS_DEBUG
|
||||
/MT # Multithreaded release runtime
|
||||
)
|
||||
else()
|
||||
list(APPEND CEF_COMPILER_FLAGS_DEBUG
|
||||
/MTd # Multithreaded debug runtime
|
||||
/RTC1 # Disable optimizations
|
||||
/Od # Enable basic run-time checks
|
||||
)
|
||||
endif()
|
||||
list(APPEND CEF_COMPILER_FLAGS_RELEASE
|
||||
/MT # Multithreaded release runtime
|
||||
/O2 # Optimize for maximum speed
|
||||
/Ob2 # Inline any suitable function
|
||||
/GF # Enable string pooling
|
||||
@@ -390,12 +421,6 @@ if(OS_WINDOWS)
|
||||
WIN32_LEAN_AND_MEAN # Exclude less common API declarations
|
||||
_HAS_EXCEPTIONS=0 # Disable exceptions
|
||||
)
|
||||
if(USE_OFFICIAL_BUILD_SANDBOX)
|
||||
list(APPEND CEF_COMPILER_DEFINES_DEBUG
|
||||
NDEBUG _NDEBUG # Not a debug build
|
||||
DCHECK_ALWAYS_ON=1 # DCHECKs are enabled
|
||||
)
|
||||
endif()
|
||||
list(APPEND CEF_COMPILER_DEFINES_RELEASE
|
||||
NDEBUG _NDEBUG # Not a debug build
|
||||
)
|
||||
@@ -428,6 +453,8 @@ if(OS_WINDOWS)
|
||||
libGLESv2.dll
|
||||
natives_blob.bin
|
||||
snapshot_blob.bin
|
||||
v8_context_snapshot.bin
|
||||
swiftshader
|
||||
)
|
||||
|
||||
# List of CEF resource files.
|
||||
@@ -452,6 +479,7 @@ if(OS_WINDOWS)
|
||||
dbghelp.lib
|
||||
psapi.lib
|
||||
version.lib
|
||||
wbemuuid.lib
|
||||
winmm.lib
|
||||
)
|
||||
|
||||
@@ -463,10 +491,26 @@ if(OS_WINDOWS)
|
||||
# Configure use of ATL.
|
||||
option(USE_ATL "Enable or disable use of ATL." ON)
|
||||
if(USE_ATL)
|
||||
# Locate the atlmfc directory if it exists. It may be at any depth inside
|
||||
# the VC directory. The cl.exe path returned by CMAKE_CXX_COMPILER may also
|
||||
# be at different depths depending on the toolchain version
|
||||
# (e.g. "VC/bin/cl.exe", "VC/bin/amd64_x86/cl.exe",
|
||||
# "VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe", etc).
|
||||
set(HAS_ATLMFC 0)
|
||||
get_filename_component(VC_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
|
||||
get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
|
||||
while(NOT ${VC_DIR_NAME} STREQUAL "VC")
|
||||
get_filename_component(VC_DIR ${VC_DIR} DIRECTORY)
|
||||
if(IS_DIRECTORY "${VC_DIR}/atlmfc")
|
||||
set(HAS_ATLMFC 1)
|
||||
break()
|
||||
endif()
|
||||
get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
|
||||
endwhile()
|
||||
|
||||
# Determine if the Visual Studio install supports ATL.
|
||||
get_filename_component(VC_BIN_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
|
||||
get_filename_component(VC_DIR ${VC_BIN_DIR} DIRECTORY)
|
||||
if(NOT IS_DIRECTORY "${VC_DIR}/atlmfc")
|
||||
if(NOT HAS_ATLMFC)
|
||||
message(WARNING "ATL is not supported by your VC installation.")
|
||||
set(USE_ATL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -39,14 +39,49 @@
|
||||
#define CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(BASE_ATOMIC_REF_COUNT_H_)
|
||||
// Do nothing if the Chromium header has already been included.
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/atomic_ref_count.h"
|
||||
|
||||
// Used when declaring a base::AtomicRefCount value. This is an object type with
|
||||
// Chromium headers.
|
||||
#define ATOMIC_DECLARATION (0)
|
||||
|
||||
// Maintaining compatibility with AtompicRefCount* functions that were removed
|
||||
// from Chromium in http://crrev.com/ee96d561.
|
||||
namespace base {
|
||||
|
||||
// Increment a reference count by 1.
|
||||
inline void AtomicRefCountInc(volatile AtomicRefCount* ptr) {
|
||||
const_cast<AtomicRefCount*>(ptr)->Increment();
|
||||
}
|
||||
|
||||
// Decrement a reference count by 1 and return whether the result is non-zero.
|
||||
// Insert barriers to ensure that state written before the reference count
|
||||
// became zero will be visible to a thread that has just made the count zero.
|
||||
inline bool AtomicRefCountDec(volatile AtomicRefCount* ptr) {
|
||||
return const_cast<AtomicRefCount*>(ptr)->Decrement();
|
||||
}
|
||||
|
||||
// Return whether the reference count is one. If the reference count is used
|
||||
// in the conventional way, a refrerence count of 1 implies that the current
|
||||
// thread owns the reference and no other thread shares it. This call performs
|
||||
// the test for a reference count of one, and performs the memory barrier
|
||||
// needed for the owning thread to act on the object, knowing that it has
|
||||
// exclusive access to the object.
|
||||
inline bool AtomicRefCountIsOne(volatile AtomicRefCount* ptr) {
|
||||
return const_cast<AtomicRefCount*>(ptr)->IsOne();
|
||||
}
|
||||
|
||||
// Return whether the reference count is zero. With conventional object
|
||||
// referencing counting, the object will be destroyed, so the reference count
|
||||
// should never be zero. Hence this is generally used for a debug check.
|
||||
inline bool AtomicRefCountIsZero(volatile AtomicRefCount* ptr) {
|
||||
return const_cast<AtomicRefCount*>(ptr)->IsZero();
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
@@ -58,6 +93,10 @@
|
||||
#define ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
|
||||
#define ANNOTATE_HAPPENS_AFTER(obj) /* empty */
|
||||
|
||||
// Used when declaring a base::AtomicRefCount value. This is an integer/ptr type
|
||||
// with CEF headers.
|
||||
#define ATOMIC_DECLARATION = 0
|
||||
|
||||
namespace base {
|
||||
|
||||
typedef subtle::Atomic32 AtomicRefCount;
|
||||
|
@@ -122,8 +122,7 @@ Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value);
|
||||
// *ptr with the increment applied. This routine implies no memory barriers.
|
||||
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
|
||||
|
||||
Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||
Atomic32 increment);
|
||||
Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
|
||||
|
||||
// These following lower-level operations are typically useful only to people
|
||||
// implementing higher-level synchronization operations like spinlocks,
|
||||
|
@@ -43,11 +43,11 @@
|
||||
// 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_MACOSX) && !defined(OS_OPENBSD)
|
||||
typedef long int64; // NOLINT(runtime/int)
|
||||
typedef unsigned long uint64; // NOLINT(runtime/int)
|
||||
typedef long int64;
|
||||
typedef unsigned long uint64;
|
||||
#else
|
||||
typedef long long int64; // NOLINT(runtime/int)
|
||||
typedef unsigned long long uint64; // NOLINT(runtime/int)
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
#endif
|
||||
|
||||
// TODO: Remove these type guards. These are to avoid conflicts with
|
||||
@@ -64,6 +64,16 @@ typedef int int32;
|
||||
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.
|
||||
// This should be kept synchronized with base/strings/string16.h
|
||||
#ifndef char16
|
||||
|
@@ -89,34 +89,32 @@
|
||||
namespace base {
|
||||
|
||||
template <typename Functor>
|
||||
base::Callback<
|
||||
typename cef_internal::BindState<
|
||||
base::Callback<typename cef_internal::BindState<
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||
void()>
|
||||
::UnboundRunType>
|
||||
void()>::UnboundRunType>
|
||||
Bind(Functor functor) {
|
||||
// Typedefs for how to store and run the functor.
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||
|
||||
typedef cef_internal::BindState<RunnableType, RunType, void()> BindState;
|
||||
|
||||
|
||||
return Callback<typename BindState::UnboundRunType>(
|
||||
new BindState(cef_internal::MakeRunnable(functor)));
|
||||
}
|
||||
|
||||
template <typename Functor, typename P1>
|
||||
base::Callback<
|
||||
typename cef_internal::BindState<
|
||||
base::Callback<typename cef_internal::BindState<
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>
|
||||
::UnboundRunType>
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>::
|
||||
UnboundRunType>
|
||||
Bind(Functor functor, const P1& p1) {
|
||||
// Typedefs for how to store and run the functor.
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||
|
||||
// Use RunnableType::RunType instead of RunType above because our
|
||||
@@ -138,32 +136,32 @@ Bind(Functor functor, const P1& p1) {
|
||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||
// methods. We also disallow binding of an array as the method's target
|
||||
// object.
|
||||
COMPILE_ASSERT(
|
||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
!is_array<P1>::value,
|
||||
first_bound_argument_to_method_cannot_be_array);
|
||||
typedef cef_internal::BindState<RunnableType, RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)> BindState;
|
||||
|
||||
typedef cef_internal::BindState<
|
||||
RunnableType, RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>
|
||||
BindState;
|
||||
|
||||
return Callback<typename BindState::UnboundRunType>(
|
||||
new BindState(cef_internal::MakeRunnable(functor), p1));
|
||||
}
|
||||
|
||||
template <typename Functor, typename P1, typename P2>
|
||||
base::Callback<
|
||||
typename cef_internal::BindState<
|
||||
base::Callback<typename cef_internal::BindState<
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType)>
|
||||
::UnboundRunType>
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType)>::
|
||||
UnboundRunType>
|
||||
Bind(Functor functor, const P1& p1, const P2& p2) {
|
||||
// Typedefs for how to store and run the functor.
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||
|
||||
// Use RunnableType::RunType instead of RunType above because our
|
||||
@@ -186,8 +184,7 @@ Bind(Functor functor, const P1& p1, const P2& p2) {
|
||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||
// methods. We also disallow binding of an array as the method's target
|
||||
// object.
|
||||
COMPILE_ASSERT(
|
||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
@@ -195,27 +192,28 @@ Bind(Functor functor, const P1& p1, const P2& p2) {
|
||||
first_bound_argument_to_method_cannot_be_array);
|
||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
|
||||
p2_is_refcounted_type_and_needs_scoped_refptr);
|
||||
typedef cef_internal::BindState<RunnableType, RunType,
|
||||
typedef cef_internal::BindState<
|
||||
RunnableType, RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType)> BindState;
|
||||
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType)>
|
||||
BindState;
|
||||
|
||||
return Callback<typename BindState::UnboundRunType>(
|
||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2));
|
||||
}
|
||||
|
||||
template <typename Functor, typename P1, typename P2, typename P3>
|
||||
base::Callback<
|
||||
typename cef_internal::BindState<
|
||||
base::Callback<typename cef_internal::BindState<
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType)>
|
||||
::UnboundRunType>
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType)>::
|
||||
UnboundRunType>
|
||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
|
||||
// Typedefs for how to store and run the functor.
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||
|
||||
// Use RunnableType::RunType instead of RunType above because our
|
||||
@@ -239,8 +237,7 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
|
||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||
// methods. We also disallow binding of an array as the method's target
|
||||
// object.
|
||||
COMPILE_ASSERT(
|
||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
@@ -250,29 +247,30 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
|
||||
p2_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
|
||||
p3_is_refcounted_type_and_needs_scoped_refptr);
|
||||
typedef cef_internal::BindState<RunnableType, RunType,
|
||||
typedef cef_internal::BindState<
|
||||
RunnableType, RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType)> BindState;
|
||||
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType)>
|
||||
BindState;
|
||||
|
||||
return Callback<typename BindState::UnboundRunType>(
|
||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3));
|
||||
}
|
||||
|
||||
template <typename Functor, typename P1, typename P2, typename P3, typename P4>
|
||||
base::Callback<
|
||||
typename cef_internal::BindState<
|
||||
base::Callback<typename cef_internal::BindState<
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType)>
|
||||
::UnboundRunType>
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType)>::
|
||||
UnboundRunType>
|
||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
|
||||
// Typedefs for how to store and run the functor.
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||
|
||||
// Use RunnableType::RunType instead of RunType above because our
|
||||
@@ -297,8 +295,7 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
|
||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||
// methods. We also disallow binding of an array as the method's target
|
||||
// object.
|
||||
COMPILE_ASSERT(
|
||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
@@ -310,33 +307,42 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
|
||||
p3_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
|
||||
p4_is_refcounted_type_and_needs_scoped_refptr);
|
||||
typedef cef_internal::BindState<RunnableType, RunType,
|
||||
typedef cef_internal::BindState<
|
||||
RunnableType, RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType)> BindState;
|
||||
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType)>
|
||||
BindState;
|
||||
|
||||
return Callback<typename BindState::UnboundRunType>(
|
||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4));
|
||||
}
|
||||
|
||||
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
|
||||
template <typename Functor,
|
||||
typename P1,
|
||||
typename P2,
|
||||
typename P3,
|
||||
typename P4,
|
||||
typename P5>
|
||||
base::Callback<
|
||||
typename cef_internal::BindState<
|
||||
base::Callback<typename cef_internal::BindState<
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P5>::StorageType)>
|
||||
::UnboundRunType>
|
||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
typename cef_internal::CallbackParamTraits<P5>::StorageType)>::
|
||||
UnboundRunType>
|
||||
Bind(Functor functor,
|
||||
const P1& p1,
|
||||
const P2& p2,
|
||||
const P3& p3,
|
||||
const P4& p4,
|
||||
const P5& p5) {
|
||||
// Typedefs for how to store and run the functor.
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||
|
||||
// Use RunnableType::RunType instead of RunType above because our
|
||||
@@ -362,8 +368,7 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||
// methods. We also disallow binding of an array as the method's target
|
||||
// object.
|
||||
COMPILE_ASSERT(
|
||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
@@ -377,22 +382,27 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
p4_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
|
||||
p5_is_refcounted_type_and_needs_scoped_refptr);
|
||||
typedef cef_internal::BindState<RunnableType, RunType,
|
||||
typedef cef_internal::BindState<
|
||||
RunnableType, RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P5>::StorageType)> BindState;
|
||||
|
||||
typename cef_internal::CallbackParamTraits<P5>::StorageType)>
|
||||
BindState;
|
||||
|
||||
return Callback<typename BindState::UnboundRunType>(
|
||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5));
|
||||
}
|
||||
|
||||
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
|
||||
typename P5, typename P6>
|
||||
base::Callback<
|
||||
typename cef_internal::BindState<
|
||||
template <typename Functor,
|
||||
typename P1,
|
||||
typename P2,
|
||||
typename P3,
|
||||
typename P4,
|
||||
typename P5,
|
||||
typename P6>
|
||||
base::Callback<typename cef_internal::BindState<
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
@@ -400,12 +410,18 @@ base::Callback<
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P6>::StorageType)>
|
||||
::UnboundRunType>
|
||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
const P5& p5, const P6& p6) {
|
||||
typename cef_internal::CallbackParamTraits<P6>::StorageType)>::
|
||||
UnboundRunType>
|
||||
Bind(Functor functor,
|
||||
const P1& p1,
|
||||
const P2& p2,
|
||||
const P3& p3,
|
||||
const P4& p4,
|
||||
const P5& p5,
|
||||
const P6& p6) {
|
||||
// Typedefs for how to store and run the functor.
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||
|
||||
// Use RunnableType::RunType instead of RunType above because our
|
||||
@@ -432,8 +448,7 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||
// methods. We also disallow binding of an array as the method's target
|
||||
// object.
|
||||
COMPILE_ASSERT(
|
||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
@@ -449,23 +464,29 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
p5_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
|
||||
p6_is_refcounted_type_and_needs_scoped_refptr);
|
||||
typedef cef_internal::BindState<RunnableType, RunType,
|
||||
typedef cef_internal::BindState<
|
||||
RunnableType, RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P6>::StorageType)> BindState;
|
||||
typename cef_internal::CallbackParamTraits<P6>::StorageType)>
|
||||
BindState;
|
||||
|
||||
|
||||
return Callback<typename BindState::UnboundRunType>(
|
||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6));
|
||||
return Callback<typename BindState::UnboundRunType>(new BindState(
|
||||
cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6));
|
||||
}
|
||||
|
||||
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
|
||||
typename P5, typename P6, typename P7>
|
||||
base::Callback<
|
||||
typename cef_internal::BindState<
|
||||
template <typename Functor,
|
||||
typename P1,
|
||||
typename P2,
|
||||
typename P3,
|
||||
typename P4,
|
||||
typename P5,
|
||||
typename P6,
|
||||
typename P7>
|
||||
base::Callback<typename cef_internal::BindState<
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
@@ -474,12 +495,19 @@ base::Callback<
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P6>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P7>::StorageType)>
|
||||
::UnboundRunType>
|
||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
const P5& p5, const P6& p6, const P7& p7) {
|
||||
typename cef_internal::CallbackParamTraits<P7>::StorageType)>::
|
||||
UnboundRunType>
|
||||
Bind(Functor functor,
|
||||
const P1& p1,
|
||||
const P2& p2,
|
||||
const P3& p3,
|
||||
const P4& p4,
|
||||
const P5& p5,
|
||||
const P6& p6,
|
||||
const P7& p7) {
|
||||
// Typedefs for how to store and run the functor.
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef
|
||||
typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
|
||||
typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||
|
||||
// Use RunnableType::RunType instead of RunType above because our
|
||||
@@ -507,8 +535,7 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||
// methods. We also disallow binding of an array as the method's target
|
||||
// object.
|
||||
COMPILE_ASSERT(
|
||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||
@@ -526,19 +553,19 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
p6_is_refcounted_type_and_needs_scoped_refptr);
|
||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P7>::value,
|
||||
p7_is_refcounted_type_and_needs_scoped_refptr);
|
||||
typedef cef_internal::BindState<RunnableType, RunType,
|
||||
typedef cef_internal::BindState<
|
||||
RunnableType, RunType,
|
||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P6>::StorageType,
|
||||
typename cef_internal::CallbackParamTraits<P7>::StorageType)> BindState;
|
||||
typename cef_internal::CallbackParamTraits<P7>::StorageType)>
|
||||
BindState;
|
||||
|
||||
|
||||
return Callback<typename BindState::UnboundRunType>(
|
||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6,
|
||||
p7));
|
||||
return Callback<typename BindState::UnboundRunType>(new BindState(
|
||||
cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7));
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
@@ -276,13 +276,13 @@ class SupportsAddRefAndRelease {
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4624)
|
||||
#endif
|
||||
struct Base : public T, public BaseMixin {
|
||||
};
|
||||
struct Base : public T, public BaseMixin {};
|
||||
#if defined(OS_WIN)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
template <void(BaseMixin::*)(void)> struct Helper {};
|
||||
template <void (BaseMixin::*)(void)>
|
||||
struct Helper {};
|
||||
|
||||
template <typename C>
|
||||
static No& Check(Helper<&C::AddRef>*);
|
||||
@@ -297,22 +297,18 @@ class SupportsAddRefAndRelease {
|
||||
// Helpers to assert that arguments of a recounted type are bound with a
|
||||
// scoped_refptr.
|
||||
template <bool IsClasstype, typename T>
|
||||
struct UnsafeBindtoRefCountedArgHelper : false_type {
|
||||
};
|
||||
struct UnsafeBindtoRefCountedArgHelper : false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct UnsafeBindtoRefCountedArgHelper<true, T>
|
||||
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {
|
||||
};
|
||||
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {};
|
||||
|
||||
template <typename T>
|
||||
struct UnsafeBindtoRefCountedArg : false_type {
|
||||
};
|
||||
struct UnsafeBindtoRefCountedArg : false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct UnsafeBindtoRefCountedArg<T*>
|
||||
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {
|
||||
};
|
||||
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {};
|
||||
|
||||
template <typename T>
|
||||
class HasIsMethodTag {
|
||||
@@ -334,6 +330,7 @@ class UnretainedWrapper {
|
||||
public:
|
||||
explicit UnretainedWrapper(T* o) : ptr_(o) {}
|
||||
T* get() const { return ptr_; }
|
||||
|
||||
private:
|
||||
T* ptr_;
|
||||
};
|
||||
@@ -343,6 +340,7 @@ class ConstRefWrapper {
|
||||
public:
|
||||
explicit ConstRefWrapper(const T& o) : ptr_(&o) {}
|
||||
const T& get() const { return *ptr_; }
|
||||
|
||||
private:
|
||||
const T* ptr_;
|
||||
};
|
||||
@@ -409,8 +407,7 @@ class PassedWrapper {
|
||||
public:
|
||||
explicit PassedWrapper(T scoper) : is_valid_(true), scoper_(scoper.Pass()) {}
|
||||
PassedWrapper(const PassedWrapper& other)
|
||||
: is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) {
|
||||
}
|
||||
: is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) {}
|
||||
T Pass() const {
|
||||
CHECK(is_valid_);
|
||||
is_valid_ = false;
|
||||
@@ -460,17 +457,13 @@ struct UnwrapTraits<WeakPtr<T> > {
|
||||
template <typename T>
|
||||
struct UnwrapTraits<OwnedWrapper<T>> {
|
||||
typedef T* ForwardType;
|
||||
static ForwardType Unwrap(const OwnedWrapper<T>& o) {
|
||||
return o.get();
|
||||
}
|
||||
static ForwardType Unwrap(const OwnedWrapper<T>& o) { return o.get(); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct UnwrapTraits<PassedWrapper<T>> {
|
||||
typedef T ForwardType;
|
||||
static T Unwrap(PassedWrapper<T>& o) {
|
||||
return o.Pass();
|
||||
}
|
||||
static T Unwrap(PassedWrapper<T>& o) { return o.Pass(); }
|
||||
};
|
||||
|
||||
// Utility for handling different refcounting semantics in the Bind()
|
||||
@@ -567,8 +560,8 @@ static inline cef_internal::IgnoreResultHelper<T> IgnoreResult(T data) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static inline cef_internal::IgnoreResultHelper<Callback<T> >
|
||||
IgnoreResult(const Callback<T>& data) {
|
||||
static inline cef_internal::IgnoreResultHelper<Callback<T>> IgnoreResult(
|
||||
const Callback<T>& data) {
|
||||
return cef_internal::IgnoreResultHelper<Callback<T>>(data);
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,6 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||
#pragma once
|
||||
@@ -116,12 +115,10 @@
|
||||
// Type detection for wchar_t.
|
||||
#if defined(OS_WIN)
|
||||
#define WCHAR_T_IS_UTF16
|
||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
|
||||
defined(__WCHAR_MAX__) && \
|
||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
|
||||
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
|
||||
#define WCHAR_T_IS_UTF32
|
||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
|
||||
defined(__WCHAR_MAX__) && \
|
||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
|
||||
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
|
||||
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
|
||||
// compile in this mode (in particular, Chrome doesn't). This is intended for
|
||||
@@ -165,6 +162,16 @@
|
||||
#define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0
|
||||
#endif
|
||||
|
||||
// Sanitizers annotations.
|
||||
#if defined(__has_attribute)
|
||||
#if __has_attribute(no_sanitize)
|
||||
#define NO_SANITIZE(what) __attribute__((no_sanitize(what)))
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(NO_SANITIZE)
|
||||
#define NO_SANITIZE(what)
|
||||
#endif
|
||||
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
// Annotate a virtual method indicating it must be overriding a virtual method
|
||||
@@ -191,8 +198,7 @@
|
||||
|
||||
// Check for C++11 template alias support which was added in VS2013 and GCC4.7.
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
|
||||
#if __cplusplus > 199711L || \
|
||||
(defined(_MSC_VER) && _MSC_VER >= 1800) || \
|
||||
#if __cplusplus > 199711L || (defined(_MSC_VER) && _MSC_VER >= 1800) || \
|
||||
(defined(__GNUC__) && \
|
||||
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ >= 40700))
|
||||
#define HAS_CPP11_TEMPLATE_ALIAS_SUPPORT
|
||||
|
@@ -45,9 +45,9 @@
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
|
||||
#include "include/base/internal/cef_callback_internal.h"
|
||||
#include "include/base/cef_callback_forward.h"
|
||||
#include "include/base/cef_template_util.h"
|
||||
#include "include/base/internal/cef_callback_internal.h"
|
||||
|
||||
// NOTE: Header files that do not require the full definition of Callback or
|
||||
// Closure should #include "base/cef_callback_forward.h" instead of this file.
|
||||
@@ -412,16 +412,15 @@ class Callback<R(void)> : public cef_internal::CallbackBase {
|
||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||
// return the exact Callback<> type. See base/bind.h for details.
|
||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>* bind_state)
|
||||
Callback(
|
||||
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||
: CallbackBase(bind_state) {
|
||||
|
||||
// Force the assignment to a local variable of PolymorphicInvoke
|
||||
// so the compiler will typecheck that the passed in Run() method has
|
||||
// the correct type.
|
||||
PolymorphicInvoke invoke_func =
|
||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
||||
::InvokerType::Run;
|
||||
&cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>::InvokerType::Run;
|
||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||
}
|
||||
|
||||
@@ -437,9 +436,7 @@ class Callback<R(void)> : public cef_internal::CallbackBase {
|
||||
}
|
||||
|
||||
private:
|
||||
typedef R(*PolymorphicInvoke)(
|
||||
cef_internal::BindStateBase*);
|
||||
|
||||
typedef R (*PolymorphicInvoke)(cef_internal::BindStateBase*);
|
||||
};
|
||||
|
||||
template <typename R, typename A1>
|
||||
@@ -452,16 +449,15 @@ class Callback<R(A1)> : public cef_internal::CallbackBase {
|
||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||
// return the exact Callback<> type. See base/bind.h for details.
|
||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>* bind_state)
|
||||
Callback(
|
||||
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||
: CallbackBase(bind_state) {
|
||||
|
||||
// Force the assignment to a local variable of PolymorphicInvoke
|
||||
// so the compiler will typecheck that the passed in Run() method has
|
||||
// the correct type.
|
||||
PolymorphicInvoke invoke_func =
|
||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
||||
::InvokerType::Run;
|
||||
&cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>::InvokerType::Run;
|
||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||
}
|
||||
|
||||
@@ -480,7 +476,6 @@ class Callback<R(A1)> : public cef_internal::CallbackBase {
|
||||
typedef R (*PolymorphicInvoke)(
|
||||
cef_internal::BindStateBase*,
|
||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType);
|
||||
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2>
|
||||
@@ -493,16 +488,15 @@ class Callback<R(A1, A2)> : public cef_internal::CallbackBase {
|
||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||
// return the exact Callback<> type. See base/bind.h for details.
|
||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>* bind_state)
|
||||
Callback(
|
||||
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||
: CallbackBase(bind_state) {
|
||||
|
||||
// Force the assignment to a local variable of PolymorphicInvoke
|
||||
// so the compiler will typecheck that the passed in Run() method has
|
||||
// the correct type.
|
||||
PolymorphicInvoke invoke_func =
|
||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
||||
::InvokerType::Run;
|
||||
&cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>::InvokerType::Run;
|
||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||
}
|
||||
|
||||
@@ -524,7 +518,6 @@ class Callback<R(A1, A2)> : public cef_internal::CallbackBase {
|
||||
cef_internal::BindStateBase*,
|
||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A2>::ForwardType);
|
||||
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2, typename A3>
|
||||
@@ -537,16 +530,15 @@ class Callback<R(A1, A2, A3)> : public cef_internal::CallbackBase {
|
||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||
// return the exact Callback<> type. See base/bind.h for details.
|
||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>* bind_state)
|
||||
Callback(
|
||||
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||
: CallbackBase(bind_state) {
|
||||
|
||||
// Force the assignment to a local variable of PolymorphicInvoke
|
||||
// so the compiler will typecheck that the passed in Run() method has
|
||||
// the correct type.
|
||||
PolymorphicInvoke invoke_func =
|
||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
||||
::InvokerType::Run;
|
||||
&cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>::InvokerType::Run;
|
||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||
}
|
||||
|
||||
@@ -571,7 +563,6 @@ class Callback<R(A1, A2, A3)> : public cef_internal::CallbackBase {
|
||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A3>::ForwardType);
|
||||
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4>
|
||||
@@ -584,16 +575,15 @@ class Callback<R(A1, A2, A3, A4)> : public cef_internal::CallbackBase {
|
||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||
// return the exact Callback<> type. See base/bind.h for details.
|
||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>* bind_state)
|
||||
Callback(
|
||||
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||
: CallbackBase(bind_state) {
|
||||
|
||||
// Force the assignment to a local variable of PolymorphicInvoke
|
||||
// so the compiler will typecheck that the passed in Run() method has
|
||||
// the correct type.
|
||||
PolymorphicInvoke invoke_func =
|
||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
||||
::InvokerType::Run;
|
||||
&cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>::InvokerType::Run;
|
||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||
}
|
||||
|
||||
@@ -621,10 +611,13 @@ class Callback<R(A1, A2, A3, A4)> : public cef_internal::CallbackBase {
|
||||
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A4>::ForwardType);
|
||||
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
template <typename R,
|
||||
typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5>
|
||||
class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
|
||||
public:
|
||||
@@ -635,16 +628,15 @@ class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
|
||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||
// return the exact Callback<> type. See base/bind.h for details.
|
||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>* bind_state)
|
||||
Callback(
|
||||
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||
: CallbackBase(bind_state) {
|
||||
|
||||
// Force the assignment to a local variable of PolymorphicInvoke
|
||||
// so the compiler will typecheck that the passed in Run() method has
|
||||
// the correct type.
|
||||
PolymorphicInvoke invoke_func =
|
||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
||||
::InvokerType::Run;
|
||||
&cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>::InvokerType::Run;
|
||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||
}
|
||||
|
||||
@@ -660,11 +652,10 @@ class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
|
||||
PolymorphicInvoke f =
|
||||
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
|
||||
|
||||
return f(bind_state_.get(), cef_internal::CallbackForward(a1),
|
||||
cef_internal::CallbackForward(a2),
|
||||
cef_internal::CallbackForward(a3),
|
||||
cef_internal::CallbackForward(a4),
|
||||
cef_internal::CallbackForward(a5));
|
||||
return f(
|
||||
bind_state_.get(), cef_internal::CallbackForward(a1),
|
||||
cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3),
|
||||
cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5));
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -675,11 +666,15 @@ class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
|
||||
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A5>::ForwardType);
|
||||
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6>
|
||||
template <typename R,
|
||||
typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5,
|
||||
typename A6>
|
||||
class Callback<R(A1, A2, A3, A4, A5, A6)> : public cef_internal::CallbackBase {
|
||||
public:
|
||||
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
|
||||
@@ -689,16 +684,15 @@ class Callback<R(A1, A2, A3, A4, A5, A6)> : public cef_internal::CallbackBase {
|
||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||
// return the exact Callback<> type. See base/bind.h for details.
|
||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>* bind_state)
|
||||
Callback(
|
||||
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||
: CallbackBase(bind_state) {
|
||||
|
||||
// Force the assignment to a local variable of PolymorphicInvoke
|
||||
// so the compiler will typecheck that the passed in Run() method has
|
||||
// the correct type.
|
||||
PolymorphicInvoke invoke_func =
|
||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
||||
::InvokerType::Run;
|
||||
&cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>::InvokerType::Run;
|
||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||
}
|
||||
|
||||
@@ -715,11 +709,10 @@ class Callback<R(A1, A2, A3, A4, A5, A6)> : public cef_internal::CallbackBase {
|
||||
PolymorphicInvoke f =
|
||||
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
|
||||
|
||||
return f(bind_state_.get(), cef_internal::CallbackForward(a1),
|
||||
cef_internal::CallbackForward(a2),
|
||||
cef_internal::CallbackForward(a3),
|
||||
cef_internal::CallbackForward(a4),
|
||||
cef_internal::CallbackForward(a5),
|
||||
return f(
|
||||
bind_state_.get(), cef_internal::CallbackForward(a1),
|
||||
cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3),
|
||||
cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5),
|
||||
cef_internal::CallbackForward(a6));
|
||||
}
|
||||
|
||||
@@ -732,12 +725,18 @@ class Callback<R(A1, A2, A3, A4, A5, A6)> : public cef_internal::CallbackBase {
|
||||
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A6>::ForwardType);
|
||||
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6, typename A7>
|
||||
class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : public cef_internal::CallbackBase {
|
||||
template <typename R,
|
||||
typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5,
|
||||
typename A6,
|
||||
typename A7>
|
||||
class Callback<R(A1, A2, A3, A4, A5, A6, A7)>
|
||||
: public cef_internal::CallbackBase {
|
||||
public:
|
||||
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
|
||||
|
||||
@@ -746,16 +745,15 @@ class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : public cef_internal::CallbackBas
|
||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||
// return the exact Callback<> type. See base/bind.h for details.
|
||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>* bind_state)
|
||||
Callback(
|
||||
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||
: CallbackBase(bind_state) {
|
||||
|
||||
// Force the assignment to a local variable of PolymorphicInvoke
|
||||
// so the compiler will typecheck that the passed in Run() method has
|
||||
// the correct type.
|
||||
PolymorphicInvoke invoke_func =
|
||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
||||
::InvokerType::Run;
|
||||
&cef_internal::BindState<Runnable, BindRunType,
|
||||
BoundArgsType>::InvokerType::Run;
|
||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||
}
|
||||
|
||||
@@ -773,13 +771,11 @@ class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : public cef_internal::CallbackBas
|
||||
PolymorphicInvoke f =
|
||||
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
|
||||
|
||||
return f(bind_state_.get(), cef_internal::CallbackForward(a1),
|
||||
cef_internal::CallbackForward(a2),
|
||||
cef_internal::CallbackForward(a3),
|
||||
cef_internal::CallbackForward(a4),
|
||||
cef_internal::CallbackForward(a5),
|
||||
cef_internal::CallbackForward(a6),
|
||||
cef_internal::CallbackForward(a7));
|
||||
return f(
|
||||
bind_state_.get(), cef_internal::CallbackForward(a1),
|
||||
cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3),
|
||||
cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5),
|
||||
cef_internal::CallbackForward(a6), cef_internal::CallbackForward(a7));
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -792,10 +788,8 @@ class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : public cef_internal::CallbackBas
|
||||
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A6>::ForwardType,
|
||||
typename cef_internal::CallbackParamTraits<A7>::ForwardType);
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Syntactic sugar to make Callbacks<void(void)> easier to declare since it
|
||||
// will be used in a lot of APIs with delayed execution.
|
||||
typedef Callback<void(void)> Closure;
|
||||
|
@@ -48,12 +48,12 @@
|
||||
#include <list>
|
||||
|
||||
#include "include/base/cef_basictypes.h"
|
||||
#include "include/base/cef_callback.h"
|
||||
#include "include/base/internal/cef_callback_internal.h"
|
||||
#include "include/base/cef_build.h"
|
||||
#include "include/base/cef_callback.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/base/cef_scoped_ptr.h"
|
||||
#include "include/base/internal/cef_callback_internal.h"
|
||||
|
||||
// OVERVIEW:
|
||||
//
|
||||
@@ -120,9 +120,7 @@ class CallbackListBase {
|
||||
public:
|
||||
Subscription(CallbackListBase<CallbackType>* list,
|
||||
typename std::list<CallbackType>::iterator iter)
|
||||
: list_(list),
|
||||
iter_(iter) {
|
||||
}
|
||||
: list_(list), iter_(iter) {}
|
||||
|
||||
~Subscription() {
|
||||
if (list_->active_iterator_count_) {
|
||||
@@ -167,14 +165,12 @@ class CallbackListBase {
|
||||
class Iterator {
|
||||
public:
|
||||
explicit Iterator(CallbackListBase<CallbackType>* list)
|
||||
: list_(list),
|
||||
list_iter_(list_->callbacks_.begin()) {
|
||||
: list_(list), list_iter_(list_->callbacks_.begin()) {
|
||||
++list_->active_iterator_count_;
|
||||
}
|
||||
|
||||
Iterator(const Iterator& iter)
|
||||
: list_(iter.list_),
|
||||
list_iter_(iter.list_iter_) {
|
||||
: list_(iter.list_), list_iter_(iter.list_iter_) {
|
||||
++list_->active_iterator_count_;
|
||||
}
|
||||
|
||||
@@ -210,9 +206,7 @@ class CallbackListBase {
|
||||
|
||||
// Returns an instance of a CallbackListBase::Iterator which can be used
|
||||
// to run callbacks.
|
||||
Iterator GetIterator() {
|
||||
return Iterator(this);
|
||||
}
|
||||
Iterator GetIterator() { return Iterator(this); }
|
||||
|
||||
// Compact the list: remove any entries which were NULLed out during
|
||||
// iteration.
|
||||
@@ -242,7 +236,8 @@ class CallbackListBase {
|
||||
|
||||
} // namespace cef_internal
|
||||
|
||||
template <typename Sig> class CallbackList;
|
||||
template <typename Sig>
|
||||
class CallbackList;
|
||||
|
||||
template <>
|
||||
class CallbackList<void(void)>
|
||||
@@ -357,7 +352,8 @@ class CallbackList<void(A1, A2, A3, A4)>
|
||||
|
||||
template <typename A1, typename A2, typename A3, typename A4, typename A5>
|
||||
class CallbackList<void(A1, A2, A3, A4, A5)>
|
||||
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5)> > {
|
||||
: public cef_internal::CallbackListBase<
|
||||
Callback<void(A1, A2, A3, A4, A5)>> {
|
||||
public:
|
||||
typedef Callback<void(A1, A2, A3, A4, A5)> CallbackType;
|
||||
|
||||
@@ -380,11 +376,15 @@ class CallbackList<void(A1, A2, A3, A4, A5)>
|
||||
DISALLOW_COPY_AND_ASSIGN(CallbackList);
|
||||
};
|
||||
|
||||
template <typename A1, typename A2, typename A3, typename A4, typename A5,
|
||||
template <typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5,
|
||||
typename A6>
|
||||
class CallbackList<void(A1, A2, A3, A4, A5, A6)>
|
||||
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5,
|
||||
A6)> > {
|
||||
: public cef_internal::CallbackListBase<
|
||||
Callback<void(A1, A2, A3, A4, A5, A6)>> {
|
||||
public:
|
||||
typedef Callback<void(A1, A2, A3, A4, A5, A6)> CallbackType;
|
||||
|
||||
@@ -408,11 +408,16 @@ class CallbackList<void(A1, A2, A3, A4, A5, A6)>
|
||||
DISALLOW_COPY_AND_ASSIGN(CallbackList);
|
||||
};
|
||||
|
||||
template <typename A1, typename A2, typename A3, typename A4, typename A5,
|
||||
typename A6, typename A7>
|
||||
template <typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5,
|
||||
typename A6,
|
||||
typename A7>
|
||||
class CallbackList<void(A1, A2, A3, A4, A5, A6, A7)>
|
||||
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5, A6,
|
||||
A7)> > {
|
||||
: public cef_internal::CallbackListBase<
|
||||
Callback<void(A1, A2, A3, A4, A5, A6, A7)>> {
|
||||
public:
|
||||
typedef Callback<void(A1, A2, A3, A4, A5, A6, A7)> CallbackType;
|
||||
|
||||
|
@@ -83,8 +83,8 @@
|
||||
// updated to match.
|
||||
|
||||
#include "include/base/cef_bind.h"
|
||||
#include "include/base/cef_callback.h"
|
||||
#include "include/base/cef_build.h"
|
||||
#include "include/base/cef_callback.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/base/cef_weak_ptr.h"
|
||||
@@ -102,8 +102,7 @@ class CancelableCallback<void(void)> {
|
||||
|
||||
// |callback| must not be null.
|
||||
explicit CancelableCallback(const base::Callback<void(void)>& callback)
|
||||
: weak_factory_(this),
|
||||
callback_(callback) {
|
||||
: weak_factory_(this), callback_(callback) {
|
||||
DCHECK(!callback.is_null());
|
||||
InitializeForwarder();
|
||||
}
|
||||
@@ -118,9 +117,7 @@ class CancelableCallback<void(void)> {
|
||||
}
|
||||
|
||||
// Returns true if the wrapped callback has been cancelled.
|
||||
bool IsCancelled() const {
|
||||
return callback_.is_null();
|
||||
}
|
||||
bool IsCancelled() const { return callback_.is_null(); }
|
||||
|
||||
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
||||
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
||||
@@ -137,14 +134,10 @@ class CancelableCallback<void(void)> {
|
||||
}
|
||||
|
||||
// Returns a callback that can be disabled by calling Cancel().
|
||||
const base::Callback<void(void)>& callback() const {
|
||||
return forwarder_;
|
||||
}
|
||||
const base::Callback<void(void)>& callback() const { return forwarder_; }
|
||||
|
||||
private:
|
||||
void Forward() {
|
||||
callback_.Run();
|
||||
}
|
||||
void Forward() { callback_.Run(); }
|
||||
|
||||
// Helper method to bind |forwarder_| using a weak pointer from
|
||||
// |weak_factory_|.
|
||||
@@ -172,8 +165,7 @@ class CancelableCallback<void(A1)> {
|
||||
|
||||
// |callback| must not be null.
|
||||
explicit CancelableCallback(const base::Callback<void(A1)>& callback)
|
||||
: weak_factory_(this),
|
||||
callback_(callback) {
|
||||
: weak_factory_(this), callback_(callback) {
|
||||
DCHECK(!callback.is_null());
|
||||
InitializeForwarder();
|
||||
}
|
||||
@@ -188,9 +180,7 @@ class CancelableCallback<void(A1)> {
|
||||
}
|
||||
|
||||
// Returns true if the wrapped callback has been cancelled.
|
||||
bool IsCancelled() const {
|
||||
return callback_.is_null();
|
||||
}
|
||||
bool IsCancelled() const { return callback_.is_null(); }
|
||||
|
||||
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
||||
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
||||
@@ -207,14 +197,10 @@ class CancelableCallback<void(A1)> {
|
||||
}
|
||||
|
||||
// Returns a callback that can be disabled by calling Cancel().
|
||||
const base::Callback<void(A1)>& callback() const {
|
||||
return forwarder_;
|
||||
}
|
||||
const base::Callback<void(A1)>& callback() const { return forwarder_; }
|
||||
|
||||
private:
|
||||
void Forward(A1 a1) const {
|
||||
callback_.Run(a1);
|
||||
}
|
||||
void Forward(A1 a1) const { callback_.Run(a1); }
|
||||
|
||||
// Helper method to bind |forwarder_| using a weak pointer from
|
||||
// |weak_factory_|.
|
||||
@@ -242,8 +228,7 @@ class CancelableCallback<void(A1, A2)> {
|
||||
|
||||
// |callback| must not be null.
|
||||
explicit CancelableCallback(const base::Callback<void(A1, A2)>& callback)
|
||||
: weak_factory_(this),
|
||||
callback_(callback) {
|
||||
: weak_factory_(this), callback_(callback) {
|
||||
DCHECK(!callback.is_null());
|
||||
InitializeForwarder();
|
||||
}
|
||||
@@ -258,9 +243,7 @@ class CancelableCallback<void(A1, A2)> {
|
||||
}
|
||||
|
||||
// Returns true if the wrapped callback has been cancelled.
|
||||
bool IsCancelled() const {
|
||||
return callback_.is_null();
|
||||
}
|
||||
bool IsCancelled() const { return callback_.is_null(); }
|
||||
|
||||
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
||||
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
||||
@@ -277,14 +260,10 @@ class CancelableCallback<void(A1, A2)> {
|
||||
}
|
||||
|
||||
// Returns a callback that can be disabled by calling Cancel().
|
||||
const base::Callback<void(A1, A2)>& callback() const {
|
||||
return forwarder_;
|
||||
}
|
||||
const base::Callback<void(A1, A2)>& callback() const { return forwarder_; }
|
||||
|
||||
private:
|
||||
void Forward(A1 a1, A2 a2) const {
|
||||
callback_.Run(a1, a2);
|
||||
}
|
||||
void Forward(A1 a1, A2 a2) const { callback_.Run(a1, a2); }
|
||||
|
||||
// Helper method to bind |forwarder_| using a weak pointer from
|
||||
// |weak_factory_|.
|
||||
|
@@ -125,9 +125,7 @@ class AutoLock {
|
||||
public:
|
||||
struct AlreadyAcquired {};
|
||||
|
||||
explicit AutoLock(Lock& lock) : lock_(lock) {
|
||||
lock_.Acquire();
|
||||
}
|
||||
explicit AutoLock(Lock& lock) : lock_(lock) { lock_.Acquire(); }
|
||||
|
||||
AutoLock(Lock& lock, const AlreadyAcquired&) : lock_(lock) {
|
||||
lock_.AssertAcquired();
|
||||
@@ -153,9 +151,7 @@ class AutoUnlock {
|
||||
lock_.Release();
|
||||
}
|
||||
|
||||
~AutoUnlock() {
|
||||
lock_.Acquire();
|
||||
}
|
||||
~AutoUnlock() { lock_.Acquire(); }
|
||||
|
||||
private:
|
||||
Lock& lock_;
|
||||
|
@@ -158,9 +158,9 @@
|
||||
// updated to match.
|
||||
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "include/base/cef_build.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
@@ -217,16 +217,11 @@ const LogSeverity LOG_DFATAL = LOG_FATAL;
|
||||
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_DFATAL, \
|
||||
##__VA_ARGS__)
|
||||
|
||||
#define COMPACT_GOOGLE_LOG_INFO \
|
||||
COMPACT_GOOGLE_LOG_EX_INFO(LogMessage)
|
||||
#define COMPACT_GOOGLE_LOG_WARNING \
|
||||
COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
|
||||
#define COMPACT_GOOGLE_LOG_ERROR \
|
||||
COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage)
|
||||
#define COMPACT_GOOGLE_LOG_FATAL \
|
||||
COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage)
|
||||
#define COMPACT_GOOGLE_LOG_DFATAL \
|
||||
COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage)
|
||||
#define COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(LogMessage)
|
||||
#define COMPACT_GOOGLE_LOG_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
|
||||
#define COMPACT_GOOGLE_LOG_ERROR COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage)
|
||||
#define COMPACT_GOOGLE_LOG_FATAL COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage)
|
||||
#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage)
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets
|
||||
@@ -291,11 +286,13 @@ const LogSeverity LOG_0 = LOG_ERROR;
|
||||
#if defined(OS_WIN)
|
||||
#define VPLOG_STREAM(verbose_level) \
|
||||
cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \
|
||||
::cef::logging::GetLastSystemErrorCode()).stream()
|
||||
::cef::logging::GetLastSystemErrorCode()) \
|
||||
.stream()
|
||||
#elif defined(OS_POSIX)
|
||||
#define VPLOG_STREAM(verbose_level) \
|
||||
cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \
|
||||
::cef::logging::GetLastSystemErrorCode()).stream()
|
||||
::cef::logging::GetLastSystemErrorCode()) \
|
||||
.stream()
|
||||
#endif
|
||||
|
||||
#define VPLOG(verbose_level) \
|
||||
@@ -315,15 +312,16 @@ const LogSeverity LOG_0 = LOG_ERROR;
|
||||
#if defined(OS_WIN)
|
||||
#define PLOG_STREAM(severity) \
|
||||
COMPACT_GOOGLE_LOG_EX_##severity(Win32ErrorLogMessage, \
|
||||
::cef::logging::GetLastSystemErrorCode()).stream()
|
||||
::cef::logging::GetLastSystemErrorCode()) \
|
||||
.stream()
|
||||
#elif defined(OS_POSIX)
|
||||
#define PLOG_STREAM(severity) \
|
||||
COMPACT_GOOGLE_LOG_EX_##severity(ErrnoLogMessage, \
|
||||
::cef::logging::GetLastSystemErrorCode()).stream()
|
||||
::cef::logging::GetLastSystemErrorCode()) \
|
||||
.stream()
|
||||
#endif
|
||||
|
||||
#define PLOG(severity) \
|
||||
LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
|
||||
#define PLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
|
||||
|
||||
#define PLOG_IF(severity, condition) \
|
||||
LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition))
|
||||
@@ -353,9 +351,8 @@ const LogSeverity LOG_0 = LOG_ERROR;
|
||||
// TODO(akalin): Rewrite this so that constructs like if (...)
|
||||
// CHECK_EQ(...) else { ... } work properly.
|
||||
#define CHECK_OP(name, op, val1, val2) \
|
||||
if (std::string* _result = \
|
||||
cef::logging::Check##name##Impl((val1), (val2), \
|
||||
#val1 " " #op " " #val2)) \
|
||||
if (std::string* _result = cef::logging::Check##name##Impl( \
|
||||
(val1), (val2), #val1 " " #op " " #val2)) \
|
||||
cef::logging::LogMessage(__FILE__, __LINE__, _result).stream()
|
||||
|
||||
// Build the error message string. This is separate from the "Impl"
|
||||
@@ -374,20 +371,25 @@ std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
|
||||
#if !defined(COMPILER_MSVC)
|
||||
// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated
|
||||
// in logging.cc.
|
||||
extern template std::string* MakeCheckOpString<int, int>(
|
||||
const int&, const int&, const char* names);
|
||||
extern template
|
||||
std::string* MakeCheckOpString<unsigned long, unsigned long>(
|
||||
const unsigned long&, const unsigned long&, const char* names);
|
||||
extern template
|
||||
std::string* MakeCheckOpString<unsigned long, unsigned int>(
|
||||
const unsigned long&, const unsigned int&, const char* names);
|
||||
extern template
|
||||
std::string* MakeCheckOpString<unsigned int, unsigned long>(
|
||||
const unsigned int&, const unsigned long&, const char* names);
|
||||
extern template
|
||||
std::string* MakeCheckOpString<std::string, std::string>(
|
||||
const std::string&, const std::string&, const char* name);
|
||||
extern template std::string* MakeCheckOpString<int, int>(const int&,
|
||||
const int&,
|
||||
const char* names);
|
||||
extern template std::string* MakeCheckOpString<unsigned long, unsigned long>(
|
||||
const unsigned long&,
|
||||
const unsigned long&,
|
||||
const char* names);
|
||||
extern template std::string* MakeCheckOpString<unsigned long, unsigned int>(
|
||||
const unsigned long&,
|
||||
const unsigned int&,
|
||||
const char* names);
|
||||
extern template std::string* MakeCheckOpString<unsigned int, unsigned long>(
|
||||
const unsigned int&,
|
||||
const unsigned long&,
|
||||
const char* names);
|
||||
extern template std::string* MakeCheckOpString<std::string, std::string>(
|
||||
const std::string&,
|
||||
const std::string&,
|
||||
const char* name);
|
||||
#endif
|
||||
|
||||
// Helper functions for CHECK_OP macro.
|
||||
@@ -398,12 +400,16 @@ std::string* MakeCheckOpString<std::string, std::string>(
|
||||
template <class t1, class t2> \
|
||||
inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \
|
||||
const char* names) { \
|
||||
if (v1 op v2) return NULL; \
|
||||
else return MakeCheckOpString(v1, v2, names); \
|
||||
if (v1 op v2) \
|
||||
return NULL; \
|
||||
else \
|
||||
return MakeCheckOpString(v1, v2, names); \
|
||||
} \
|
||||
inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \
|
||||
if (v1 op v2) return NULL; \
|
||||
else return MakeCheckOpString(v1, v2, names); \
|
||||
if (v1 op v2) \
|
||||
return NULL; \
|
||||
else \
|
||||
return MakeCheckOpString(v1, v2, names); \
|
||||
}
|
||||
DEFINE_CHECK_OP_IMPL(EQ, ==)
|
||||
DEFINE_CHECK_OP_IMPL(NE, !=)
|
||||
@@ -471,11 +477,9 @@ enum { DEBUG_MODE = ENABLE_DLOG };
|
||||
|
||||
#undef ENABLE_DLOG
|
||||
|
||||
#define DLOG(severity) \
|
||||
LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity))
|
||||
#define DLOG(severity) LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity))
|
||||
|
||||
#define DPLOG(severity) \
|
||||
LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
|
||||
#define DPLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
|
||||
|
||||
#define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel))
|
||||
|
||||
@@ -519,8 +523,9 @@ const LogSeverity LOG_DCHECK = LOG_INFO;
|
||||
if (DCHECK_IS_ON()) \
|
||||
if (std::string* _result = cef::logging::Check##name##Impl( \
|
||||
(val1), (val2), #val1 " " #op " " #val2)) \
|
||||
cef::logging::LogMessage(__FILE__, __LINE__, \
|
||||
::cef::logging::LOG_DCHECK, _result).stream()
|
||||
cef::logging::LogMessage(__FILE__, __LINE__, ::cef::logging::LOG_DCHECK, \
|
||||
_result) \
|
||||
.stream()
|
||||
|
||||
// Equality/Inequality checks - compare two values, and log a
|
||||
// LOG_DCHECK message including the two values when the result is not
|
||||
@@ -549,8 +554,8 @@ const LogSeverity LOG_DCHECK = LOG_INFO;
|
||||
#define DCHECK_GT(val1, val2) DCHECK_OP(GT, >, val1, val2)
|
||||
|
||||
#if defined(NDEBUG) && defined(OS_CHROMEOS)
|
||||
#define NOTREACHED() LOG(ERROR) << "NOTREACHED() hit in " << \
|
||||
__FUNCTION__ << ". "
|
||||
#define NOTREACHED() \
|
||||
LOG(ERROR) << "NOTREACHED() hit in " << __FUNCTION__ << ". "
|
||||
#else
|
||||
#define NOTREACHED() DCHECK(false)
|
||||
#endif
|
||||
@@ -577,7 +582,9 @@ class LogMessage {
|
||||
LogMessage(const char* file, int line, std::string* result);
|
||||
|
||||
// Used for DCHECK_EQ(), etc. Takes ownership of the given string.
|
||||
LogMessage(const char* file, int line, LogSeverity severity,
|
||||
LogMessage(const char* file,
|
||||
int line,
|
||||
LogSeverity severity,
|
||||
std::string* result);
|
||||
|
||||
~LogMessage();
|
||||
@@ -739,7 +746,8 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
|
||||
#elif NOTIMPLEMENTED_POLICY == 4
|
||||
#define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG
|
||||
#elif NOTIMPLEMENTED_POLICY == 5
|
||||
#define NOTIMPLEMENTED() do {\
|
||||
#define NOTIMPLEMENTED() \
|
||||
do { \
|
||||
static bool logged_once = false; \
|
||||
LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG; \
|
||||
logged_once = true; \
|
||||
|
@@ -126,14 +126,13 @@ char (&ArraySizeHelper(const T (&array)[N]))[N];
|
||||
namespace cef {
|
||||
|
||||
template <bool>
|
||||
struct CompileAssert {
|
||||
};
|
||||
struct CompileAssert {};
|
||||
|
||||
} // namespace cef
|
||||
|
||||
#define COMPILE_ASSERT(expr, msg) \
|
||||
typedef cef::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] \
|
||||
ALLOW_UNUSED_TYPE
|
||||
typedef cef::CompileAssert<(bool(expr))> \
|
||||
msg[bool(expr) ? 1 : -1] ALLOW_UNUSED_TYPE
|
||||
|
||||
// Implementation details of COMPILE_ASSERT:
|
||||
//
|
||||
@@ -182,13 +181,12 @@ struct CompileAssert {
|
||||
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST)
|
||||
#if defined(COMPILER_MSVC)
|
||||
#if !defined(MSVC_PUSH_DISABLE_WARNING) && defined(COMPILER_MSVC)
|
||||
|
||||
// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled.
|
||||
// The warning remains disabled until popped by MSVC_POP_WARNING.
|
||||
#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \
|
||||
__pragma(warning(disable:n))
|
||||
#define MSVC_PUSH_DISABLE_WARNING(n) \
|
||||
__pragma(warning(push)) __pragma(warning(disable : n))
|
||||
|
||||
// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level
|
||||
// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all
|
||||
@@ -198,6 +196,10 @@ struct CompileAssert {
|
||||
// Pop effects of innermost MSVC_PUSH_* macro.
|
||||
#define MSVC_POP_WARNING() __pragma(warning(pop))
|
||||
|
||||
#endif // !defined(MSVC_PUSH_DISABLE_WARNING) && defined(COMPILER_MSVC)
|
||||
|
||||
#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST)
|
||||
#if defined(COMPILER_MSVC)
|
||||
// Allows |this| to be passed as an argument in constructor initializer lists.
|
||||
// This uses push/pop instead of the seemingly simpler suppress feature to avoid
|
||||
// having the warning be disabled for more than just |code|.
|
||||
@@ -207,13 +209,11 @@ struct CompileAssert {
|
||||
//
|
||||
// Compiler warning C4355: 'this': used in base member initializer list:
|
||||
// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
|
||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \
|
||||
code \
|
||||
MSVC_POP_WARNING()
|
||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) \
|
||||
MSVC_PUSH_DISABLE_WARNING(4355) \
|
||||
code MSVC_POP_WARNING()
|
||||
#else // !COMPILER_MSVC
|
||||
|
||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
|
||||
|
||||
#endif // !COMPILER_MSVC
|
||||
#endif // !ALLOW_THIS_IN_INITIALIZER_LIST
|
||||
|
||||
|
@@ -248,10 +248,12 @@
|
||||
}; \
|
||||
type(type&); \
|
||||
void operator=(type&); \
|
||||
\
|
||||
public: \
|
||||
operator rvalue_type() { return rvalue_type(this); } \
|
||||
type Pass() { return type(rvalue_type(this)); } \
|
||||
typedef void MoveOnlyTypeForCPP03; \
|
||||
\
|
||||
private:
|
||||
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
@@ -69,21 +69,14 @@ class PlatformThreadRef {
|
||||
public:
|
||||
typedef cef_platform_thread_handle_t RefType;
|
||||
|
||||
PlatformThreadRef()
|
||||
: id_(0) {
|
||||
}
|
||||
PlatformThreadRef() : id_(0) {}
|
||||
|
||||
explicit PlatformThreadRef(RefType id)
|
||||
: id_(id) {
|
||||
}
|
||||
explicit PlatformThreadRef(RefType id) : id_(id) {}
|
||||
|
||||
bool operator==(PlatformThreadRef other) const {
|
||||
return id_ == other.id_;
|
||||
}
|
||||
bool operator==(PlatformThreadRef other) const { return id_ == other.id_; }
|
||||
|
||||
bool is_null() const { return id_ == 0; }
|
||||
|
||||
bool is_null() const {
|
||||
return id_ == 0;
|
||||
}
|
||||
private:
|
||||
RefType id_;
|
||||
};
|
||||
|
@@ -51,7 +51,7 @@
|
||||
#include "include/base/cef_atomic_ref_count.h"
|
||||
#include "include/base/cef_build.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_thread_collision_warner.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
@@ -60,12 +60,14 @@ namespace cef_subtle {
|
||||
class RefCountedBase {
|
||||
public:
|
||||
bool HasOneRef() const { return ref_count_ == 1; }
|
||||
bool HasAtLeastOneRef() const { return ref_count_ >= 1; }
|
||||
|
||||
protected:
|
||||
RefCountedBase()
|
||||
: ref_count_(0)
|
||||
#if DCHECK_IS_ON()
|
||||
, in_dtor_(false)
|
||||
,
|
||||
in_dtor_(false)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
@@ -76,12 +78,7 @@ class RefCountedBase {
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void AddRef() const {
|
||||
// TODO(maruel): Add back once it doesn't assert 500 times/sec.
|
||||
// Current thread books the critical section "AddRelease"
|
||||
// without release it.
|
||||
// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
|
||||
#if DCHECK_IS_ON()
|
||||
DCHECK(!in_dtor_);
|
||||
#endif
|
||||
@@ -90,10 +87,6 @@ class RefCountedBase {
|
||||
|
||||
// Returns true if the object should self-delete.
|
||||
bool Release() const {
|
||||
// TODO(maruel): Add back once it doesn't assert 500 times/sec.
|
||||
// Current thread books the critical section "AddRelease"
|
||||
// without release it.
|
||||
// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
|
||||
#if DCHECK_IS_ON()
|
||||
DCHECK(!in_dtor_);
|
||||
#endif
|
||||
@@ -112,14 +105,13 @@ class RefCountedBase {
|
||||
mutable bool in_dtor_;
|
||||
#endif
|
||||
|
||||
DFAKE_MUTEX(add_release_);
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
|
||||
};
|
||||
|
||||
class RefCountedThreadSafeBase {
|
||||
public:
|
||||
bool HasOneRef() const;
|
||||
bool HasAtLeastOneRef() const;
|
||||
|
||||
protected:
|
||||
RefCountedThreadSafeBase();
|
||||
@@ -160,9 +152,7 @@ class RefCounted : public cef_subtle::RefCountedBase {
|
||||
public:
|
||||
RefCounted() {}
|
||||
|
||||
void AddRef() const {
|
||||
cef_subtle::RefCountedBase::AddRef();
|
||||
}
|
||||
void AddRef() const { cef_subtle::RefCountedBase::AddRef(); }
|
||||
|
||||
void Release() const {
|
||||
if (cef_subtle::RefCountedBase::Release()) {
|
||||
@@ -178,7 +168,8 @@ class RefCounted : public cef_subtle::RefCountedBase {
|
||||
};
|
||||
|
||||
// Forward declaration.
|
||||
template <class T, typename Traits> class RefCountedThreadSafe;
|
||||
template <class T, typename Traits>
|
||||
class RefCountedThreadSafe;
|
||||
|
||||
// Default traits for RefCountedThreadSafe<T>. Deletes the object when its ref
|
||||
// count reaches 0. Overload to delete it on a different thread etc.
|
||||
@@ -188,8 +179,8 @@ struct DefaultRefCountedThreadSafeTraits {
|
||||
// Delete through RefCountedThreadSafe to make child classes only need to be
|
||||
// friend with RefCountedThreadSafe instead of this struct, which is an
|
||||
// implementation detail.
|
||||
RefCountedThreadSafe<T,
|
||||
DefaultRefCountedThreadSafeTraits>::DeleteInternal(x);
|
||||
RefCountedThreadSafe<T, DefaultRefCountedThreadSafeTraits>::DeleteInternal(
|
||||
x);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -210,9 +201,7 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
||||
public:
|
||||
RefCountedThreadSafe() {}
|
||||
|
||||
void AddRef() const {
|
||||
cef_subtle::RefCountedThreadSafeBase::AddRef();
|
||||
}
|
||||
void AddRef() const { cef_subtle::RefCountedThreadSafeBase::AddRef(); }
|
||||
|
||||
void Release() const {
|
||||
if (cef_subtle::RefCountedThreadSafeBase::Release()) {
|
||||
@@ -303,8 +292,7 @@ class scoped_refptr {
|
||||
public:
|
||||
typedef T element_type;
|
||||
|
||||
scoped_refptr() : ptr_(NULL) {
|
||||
}
|
||||
scoped_refptr() : ptr_(NULL) {}
|
||||
|
||||
scoped_refptr(T* p) : ptr_(p) {
|
||||
if (ptr_)
|
||||
@@ -364,9 +352,7 @@ class scoped_refptr {
|
||||
*pp = p;
|
||||
}
|
||||
|
||||
void swap(scoped_refptr<T>& r) {
|
||||
swap(&r.ptr_);
|
||||
}
|
||||
void swap(scoped_refptr<T>& r) { swap(&r.ptr_); }
|
||||
|
||||
protected:
|
||||
T* ptr_;
|
||||
|
@@ -154,7 +154,8 @@ class RefCountedThreadSafeBase;
|
||||
template <class T>
|
||||
struct DefaultDeleter {
|
||||
DefaultDeleter() {}
|
||||
template <typename U> DefaultDeleter(const DefaultDeleter<U>& other) {
|
||||
template <typename U>
|
||||
DefaultDeleter(const DefaultDeleter<U>& other) {
|
||||
// IMPLEMENTATION NOTE: C++11 20.7.1.1.2p2 only provides this constructor
|
||||
// if U* is implicitly convertible to T* and U is not an array type.
|
||||
//
|
||||
@@ -194,7 +195,8 @@ struct DefaultDeleter<T[]> {
|
||||
// References:
|
||||
// C++98 [expr.delete]p3
|
||||
// http://cplusplus.github.com/LWG/lwg-defects.html#938
|
||||
template <typename U> void operator()(U* array) const;
|
||||
template <typename U>
|
||||
void operator()(U* array) const;
|
||||
};
|
||||
|
||||
template <class T, int n>
|
||||
@@ -209,18 +211,18 @@ struct DefaultDeleter<T[n]> {
|
||||
// scoped_ptr<int, base::FreeDeleter> foo_ptr(
|
||||
// static_cast<int*>(malloc(sizeof(int))));
|
||||
struct FreeDeleter {
|
||||
inline void operator()(void* ptr) const {
|
||||
free(ptr);
|
||||
}
|
||||
inline void operator()(void* ptr) const { free(ptr); }
|
||||
};
|
||||
|
||||
namespace cef_internal {
|
||||
|
||||
template <typename T> struct IsNotRefCounted {
|
||||
template <typename T>
|
||||
struct IsNotRefCounted {
|
||||
enum {
|
||||
value = !base::is_convertible<T*, base::subtle::RefCountedBase*>::value &&
|
||||
!base::is_convertible<T*, base::subtle::RefCountedThreadSafeBase*>::
|
||||
value
|
||||
value =
|
||||
!base::is_convertible<T*, base::subtle::RefCountedBase*>::value &&
|
||||
!base::is_convertible<T*,
|
||||
base::subtle::RefCountedThreadSafeBase*>::value
|
||||
};
|
||||
};
|
||||
|
||||
@@ -309,7 +311,8 @@ class scoped_ptr_impl {
|
||||
|
||||
private:
|
||||
// Needed to allow type-converting constructor.
|
||||
template <typename U, typename V> friend class scoped_ptr_impl;
|
||||
template <typename U, typename V>
|
||||
friend class scoped_ptr_impl;
|
||||
|
||||
// Use the empty base class optimization to allow us to have a D
|
||||
// member, while avoiding any space overhead for it when D is an
|
||||
@@ -443,18 +446,14 @@ class scoped_ptr {
|
||||
bool operator!=(const element_type* p) const { return impl_.get() != p; }
|
||||
|
||||
// Swap two scoped pointers.
|
||||
void swap(scoped_ptr& p2) {
|
||||
impl_.swap(p2.impl_);
|
||||
}
|
||||
void swap(scoped_ptr& p2) { impl_.swap(p2.impl_); }
|
||||
|
||||
// Release a pointer.
|
||||
// The return value is the current pointer held by this object.
|
||||
// If this object holds a NULL pointer, the return value is NULL.
|
||||
// After this operation, this object will hold a NULL pointer,
|
||||
// and will not own the object any more.
|
||||
element_type* release() WARN_UNUSED_RESULT {
|
||||
return impl_.release();
|
||||
}
|
||||
element_type* release() WARN_UNUSED_RESULT { return impl_.release(); }
|
||||
|
||||
// C++98 doesn't support functions templates with default parameters which
|
||||
// makes it hard to write a PassAs() that understands converting the deleter
|
||||
@@ -469,7 +468,8 @@ class scoped_ptr {
|
||||
|
||||
private:
|
||||
// Needed to reach into |impl_| in the constructor.
|
||||
template <typename U, typename V> friend class scoped_ptr;
|
||||
template <typename U, typename V>
|
||||
friend class scoped_ptr;
|
||||
base::cef_internal::scoped_ptr_impl<element_type, deleter_type> impl_;
|
||||
|
||||
// Forbidden for API compatibility with std::unique_ptr.
|
||||
@@ -479,8 +479,10 @@ class scoped_ptr {
|
||||
// doesn't make sense, and if U == T, it still doesn't make sense
|
||||
// because you should never have the same object owned by two different
|
||||
// scoped_ptrs.
|
||||
template <class U> bool operator==(scoped_ptr<U> const& p2) const;
|
||||
template <class U> bool operator!=(scoped_ptr<U> const& p2) const;
|
||||
template <class U>
|
||||
bool operator==(scoped_ptr<U> const& p2) const;
|
||||
template <class U>
|
||||
bool operator!=(scoped_ptr<U> const& p2) const;
|
||||
};
|
||||
|
||||
template <class T, class D>
|
||||
@@ -553,18 +555,14 @@ class scoped_ptr<T[], D> {
|
||||
bool operator!=(element_type* array) const { return impl_.get() != array; }
|
||||
|
||||
// Swap two scoped pointers.
|
||||
void swap(scoped_ptr& p2) {
|
||||
impl_.swap(p2.impl_);
|
||||
}
|
||||
void swap(scoped_ptr& p2) { impl_.swap(p2.impl_); }
|
||||
|
||||
// Release a pointer.
|
||||
// The return value is the current pointer held by this object.
|
||||
// If this object holds a NULL pointer, the return value is NULL.
|
||||
// After this operation, this object will hold a NULL pointer,
|
||||
// and will not own the object any more.
|
||||
element_type* release() WARN_UNUSED_RESULT {
|
||||
return impl_.release();
|
||||
}
|
||||
element_type* release() WARN_UNUSED_RESULT { return impl_.release(); }
|
||||
|
||||
private:
|
||||
// Force element_type to be a complete type.
|
||||
@@ -578,20 +576,24 @@ class scoped_ptr<T[], D> {
|
||||
// private and has no definition. This is disabled because it is not safe to
|
||||
// call delete[] on an array whose static type does not match its dynamic
|
||||
// type.
|
||||
template <typename U> explicit scoped_ptr(U* array);
|
||||
template <typename U>
|
||||
explicit scoped_ptr(U* array);
|
||||
explicit scoped_ptr(int disallow_construction_from_null);
|
||||
|
||||
// Disable reset() from any type other than element_type*, for the same
|
||||
// reasons as the constructor above.
|
||||
template <typename U> void reset(U* array);
|
||||
template <typename U>
|
||||
void reset(U* array);
|
||||
void reset(int disallow_reset_from_null);
|
||||
|
||||
// Forbid comparison of scoped_ptr types. If U != T, it totally
|
||||
// doesn't make sense, and if U == T, it still doesn't make sense
|
||||
// because you should never have the same object owned by two different
|
||||
// scoped_ptrs.
|
||||
template <class U> bool operator==(scoped_ptr<U> const& p2) const;
|
||||
template <class U> bool operator!=(scoped_ptr<U> const& p2) const;
|
||||
template <class U>
|
||||
bool operator==(scoped_ptr<U> const& p2) const;
|
||||
template <class U>
|
||||
bool operator!=(scoped_ptr<U> const& p2) const;
|
||||
};
|
||||
|
||||
// Free functions
|
||||
|
@@ -86,6 +86,7 @@ typedef std::char_traits<wchar_t> string16_char_traits;
|
||||
|
||||
#include "include/base/cef_macros.h"
|
||||
|
||||
namespace cef {
|
||||
namespace base {
|
||||
|
||||
typedef uint16_t char16;
|
||||
@@ -112,26 +113,19 @@ struct string16_char_traits {
|
||||
typedef mbstate_t state_type;
|
||||
typedef std::fpos<state_type> pos_type;
|
||||
|
||||
static void assign(char_type& c1, const char_type& c2) {
|
||||
c1 = c2;
|
||||
}
|
||||
static void assign(char_type& c1, const char_type& c2) { c1 = c2; }
|
||||
|
||||
static bool eq(const char_type& c1, const char_type& c2) {
|
||||
return c1 == c2;
|
||||
}
|
||||
static bool lt(const char_type& c1, const char_type& c2) {
|
||||
return c1 < c2;
|
||||
}
|
||||
static bool eq(const char_type& c1, const char_type& c2) { return c1 == c2; }
|
||||
static bool lt(const char_type& c1, const char_type& c2) { return c1 < c2; }
|
||||
|
||||
static int compare(const char_type* s1, const char_type* s2, size_t n) {
|
||||
return c16memcmp(s1, s2, n);
|
||||
}
|
||||
|
||||
static size_t length(const char_type* s) {
|
||||
return c16len(s);
|
||||
}
|
||||
static size_t length(const char_type* s) { return c16len(s); }
|
||||
|
||||
static const char_type* find(const char_type* s, size_t n,
|
||||
static const char_type* find(const char_type* s,
|
||||
size_t n,
|
||||
const char_type& a) {
|
||||
return c16memchr(s, a, n);
|
||||
}
|
||||
@@ -152,24 +146,26 @@ struct string16_char_traits {
|
||||
return eq_int_type(c, eof()) ? 0 : c;
|
||||
}
|
||||
|
||||
static char_type to_char_type(const int_type& c) {
|
||||
return char_type(c);
|
||||
}
|
||||
static char_type to_char_type(const int_type& c) { return char_type(c); }
|
||||
|
||||
static int_type to_int_type(const char_type& c) {
|
||||
return int_type(c);
|
||||
}
|
||||
static int_type to_int_type(const char_type& c) { return int_type(c); }
|
||||
|
||||
static bool eq_int_type(const int_type& c1, const int_type& c2) {
|
||||
return c1 == c2;
|
||||
}
|
||||
|
||||
static int_type eof() {
|
||||
return static_cast<int_type>(EOF);
|
||||
}
|
||||
static int_type eof() { return static_cast<int_type>(EOF); }
|
||||
};
|
||||
|
||||
typedef std::basic_string<char16, base::string16_char_traits> string16;
|
||||
typedef std::basic_string<char16, string16_char_traits> string16;
|
||||
|
||||
} // namespace base
|
||||
} // namespace cef
|
||||
|
||||
namespace base {
|
||||
|
||||
typedef cef::base::char16 char16;
|
||||
typedef cef::base::string16 string16;
|
||||
|
||||
extern std::ostream& operator<<(std::ostream& out, const string16& str);
|
||||
|
||||
@@ -217,8 +213,8 @@ extern void PrintTo(const string16& str, std::ostream* out);
|
||||
//
|
||||
// TODO(mark): File this bug with Apple and update this note with a bug number.
|
||||
|
||||
extern template
|
||||
class std::basic_string<base::char16, base::string16_char_traits>;
|
||||
extern template class std::basic_string<cef::base::char16,
|
||||
cef::base::string16_char_traits>;
|
||||
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
|
||||
|
@@ -60,13 +60,16 @@ struct integral_constant {
|
||||
typedef integral_constant<T, v> type;
|
||||
};
|
||||
|
||||
template <class T, T v> const T integral_constant<T, v>::value;
|
||||
template <class T, T v>
|
||||
const T integral_constant<T, v>::value;
|
||||
|
||||
typedef integral_constant<bool, true> true_type;
|
||||
typedef integral_constant<bool, false> false_type;
|
||||
|
||||
template <class T> struct is_pointer : false_type {};
|
||||
template <class T> struct is_pointer<T*> : true_type {};
|
||||
template <class T>
|
||||
struct is_pointer : false_type {};
|
||||
template <class T>
|
||||
struct is_pointer<T*> : true_type {};
|
||||
|
||||
// Member function pointer detection up to four params. Add more as needed
|
||||
// below. This is built-in to C++ 11, and we can remove this when we switch.
|
||||
@@ -93,30 +96,49 @@ struct is_member_function_pointer<R(Z::*)(A, B, C)> : true_type {};
|
||||
template <typename R, typename Z, typename A, typename B, typename C>
|
||||
struct is_member_function_pointer<R (Z::*)(A, B, C) const> : true_type {};
|
||||
|
||||
template <typename R, typename Z, typename A, typename B, typename C,
|
||||
template <typename R,
|
||||
typename Z,
|
||||
typename A,
|
||||
typename B,
|
||||
typename C,
|
||||
typename D>
|
||||
struct is_member_function_pointer<R (Z::*)(A, B, C, D)> : true_type {};
|
||||
template <typename R, typename Z, typename A, typename B, typename C,
|
||||
template <typename R,
|
||||
typename Z,
|
||||
typename A,
|
||||
typename B,
|
||||
typename C,
|
||||
typename D>
|
||||
struct is_member_function_pointer<R (Z::*)(A, B, C, D) const> : true_type {};
|
||||
|
||||
template <class T, class U>
|
||||
struct is_same : public false_type {};
|
||||
template <class T>
|
||||
struct is_same<T, T> : true_type {};
|
||||
|
||||
template <class T, class U> struct is_same : public false_type {};
|
||||
template <class T> struct is_same<T,T> : true_type {};
|
||||
template <class>
|
||||
struct is_array : public false_type {};
|
||||
template <class T, size_t n>
|
||||
struct is_array<T[n]> : public true_type {};
|
||||
template <class T>
|
||||
struct is_array<T[]> : public true_type {};
|
||||
|
||||
template<class> struct is_array : public false_type {};
|
||||
template<class T, size_t n> struct is_array<T[n]> : public true_type {};
|
||||
template<class T> struct is_array<T[]> : public true_type {};
|
||||
template <class T>
|
||||
struct is_non_const_reference : false_type {};
|
||||
template <class T>
|
||||
struct is_non_const_reference<T&> : true_type {};
|
||||
template <class T>
|
||||
struct is_non_const_reference<const T&> : false_type {};
|
||||
|
||||
template <class T> struct is_non_const_reference : false_type {};
|
||||
template <class T> struct is_non_const_reference<T&> : true_type {};
|
||||
template <class T> struct is_non_const_reference<const T&> : false_type {};
|
||||
template <class T>
|
||||
struct is_const : false_type {};
|
||||
template <class T>
|
||||
struct is_const<const T> : true_type {};
|
||||
|
||||
template <class T> struct is_const : false_type {};
|
||||
template <class T> struct is_const<const T> : true_type {};
|
||||
|
||||
template <class T> struct is_void : false_type {};
|
||||
template <> struct is_void<void> : true_type {};
|
||||
template <class T>
|
||||
struct is_void : false_type {};
|
||||
template <>
|
||||
struct is_void<void> : true_type {};
|
||||
|
||||
namespace cef_internal {
|
||||
|
||||
@@ -169,21 +191,21 @@ struct is_convertible
|
||||
: integral_constant<bool,
|
||||
sizeof(cef_internal::ConvertHelper::Test<To>(
|
||||
cef_internal::ConvertHelper::Create<From>())) ==
|
||||
sizeof(cef_internal::YesType)> {
|
||||
};
|
||||
sizeof(cef_internal::YesType)> {};
|
||||
|
||||
template <typename T>
|
||||
struct is_class
|
||||
: integral_constant<bool,
|
||||
sizeof(cef_internal::IsClassHelper::Test<T>(0)) ==
|
||||
sizeof(cef_internal::YesType)> {
|
||||
};
|
||||
sizeof(cef_internal::YesType)> {};
|
||||
|
||||
template <bool B, class T = void>
|
||||
struct enable_if {};
|
||||
|
||||
template <class T>
|
||||
struct enable_if<true, T> { typedef T type; };
|
||||
struct enable_if<true, T> {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
} // namespace base
|
||||
|
||||
|
@@ -58,7 +58,6 @@
|
||||
#define ENABLE_THREAD_CHECKER 0
|
||||
#endif
|
||||
|
||||
|
||||
namespace base {
|
||||
|
||||
namespace cef_internal {
|
||||
@@ -69,9 +68,7 @@ namespace cef_internal {
|
||||
// right version for your build configuration.
|
||||
class ThreadCheckerDoNothing {
|
||||
public:
|
||||
bool CalledOnValidThread() const {
|
||||
return true;
|
||||
}
|
||||
bool CalledOnValidThread() const { return true; }
|
||||
|
||||
void DetachFromThread() {}
|
||||
};
|
||||
@@ -110,11 +107,9 @@ class ThreadCheckerDoNothing {
|
||||
//
|
||||
// In Release mode, CalledOnValidThread will always return true.
|
||||
#if ENABLE_THREAD_CHECKER
|
||||
class ThreadChecker : public cef_internal::ThreadCheckerImpl {
|
||||
};
|
||||
class ThreadChecker : public cef_internal::ThreadCheckerImpl {};
|
||||
#else
|
||||
class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {
|
||||
};
|
||||
class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {};
|
||||
#endif // ENABLE_THREAD_CHECKER
|
||||
|
||||
#undef ENABLE_THREAD_CHECKER
|
||||
|
@@ -1,288 +0,0 @@
|
||||
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
|
||||
// Google Inc. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(BASE_THREADING_THREAD_COLLISION_WARNER_H_)
|
||||
// Do nothing if the Chromium header has already been included.
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/threading/thread_collision_warner.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "include/base/cef_atomicops.h"
|
||||
#include "include/base/cef_basictypes.h"
|
||||
#include "include/base/cef_build.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
|
||||
// A helper class alongside macros to be used to verify assumptions about thread
|
||||
// safety of a class.
|
||||
//
|
||||
// Example: Queue implementation non thread-safe but still usable if clients
|
||||
// are synchronized somehow.
|
||||
//
|
||||
// In this case the macro DFAKE_SCOPED_LOCK has to be
|
||||
// used, it checks that if a thread is inside the push/pop then
|
||||
// noone else is still inside the pop/push
|
||||
//
|
||||
// class NonThreadSafeQueue {
|
||||
// public:
|
||||
// ...
|
||||
// void push(int) { DFAKE_SCOPED_LOCK(push_pop_); ... }
|
||||
// int pop() { DFAKE_SCOPED_LOCK(push_pop_); ... }
|
||||
// ...
|
||||
// private:
|
||||
// DFAKE_MUTEX(push_pop_);
|
||||
// };
|
||||
//
|
||||
//
|
||||
// Example: Queue implementation non thread-safe but still usable if clients
|
||||
// are synchronized somehow, it calls a method to "protect" from
|
||||
// a "protected" method
|
||||
//
|
||||
// In this case the macro DFAKE_SCOPED_RECURSIVE_LOCK
|
||||
// has to be used, it checks that if a thread is inside the push/pop
|
||||
// then noone else is still inside the pop/push
|
||||
//
|
||||
// class NonThreadSafeQueue {
|
||||
// public:
|
||||
// void push(int) {
|
||||
// DFAKE_SCOPED_LOCK(push_pop_);
|
||||
// ...
|
||||
// }
|
||||
// int pop() {
|
||||
// DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_);
|
||||
// bar();
|
||||
// ...
|
||||
// }
|
||||
// void bar() { DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_); ... }
|
||||
// ...
|
||||
// private:
|
||||
// DFAKE_MUTEX(push_pop_);
|
||||
// };
|
||||
//
|
||||
//
|
||||
// Example: Queue implementation not usable even if clients are synchronized,
|
||||
// so only one thread in the class life cycle can use the two members
|
||||
// push/pop.
|
||||
//
|
||||
// In this case the macro DFAKE_SCOPED_LOCK_THREAD_LOCKED pins the
|
||||
// specified
|
||||
// critical section the first time a thread enters push or pop, from
|
||||
// that time on only that thread is allowed to execute push or pop.
|
||||
//
|
||||
// class NonThreadSafeQueue {
|
||||
// public:
|
||||
// ...
|
||||
// void push(int) { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... }
|
||||
// int pop() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... }
|
||||
// ...
|
||||
// private:
|
||||
// DFAKE_MUTEX(push_pop_);
|
||||
// };
|
||||
//
|
||||
//
|
||||
// Example: Class that has to be contructed/destroyed on same thread, it has
|
||||
// a "shareable" method (with external synchronization) and a not
|
||||
// shareable method (even with external synchronization).
|
||||
//
|
||||
// In this case 3 Critical sections have to be defined
|
||||
//
|
||||
// class ExoticClass {
|
||||
// public:
|
||||
// ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... }
|
||||
// ~ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... }
|
||||
//
|
||||
// void Shareable() { DFAKE_SCOPED_LOCK(shareable_section_); ... }
|
||||
// void NotShareable() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... }
|
||||
// ...
|
||||
// private:
|
||||
// DFAKE_MUTEX(ctor_dtor_);
|
||||
// DFAKE_MUTEX(shareable_section_);
|
||||
// };
|
||||
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
|
||||
// Defines a class member that acts like a mutex. It is used only as a
|
||||
// verification tool.
|
||||
#define DFAKE_MUTEX(obj) \
|
||||
mutable base::ThreadCollisionWarner obj
|
||||
// Asserts the call is never called simultaneously in two threads. Used at
|
||||
// member function scope.
|
||||
#define DFAKE_SCOPED_LOCK(obj) \
|
||||
base::ThreadCollisionWarner::ScopedCheck s_check_##obj(&obj)
|
||||
// Asserts the call is never called simultaneously in two threads. Used at
|
||||
// member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks.
|
||||
#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \
|
||||
base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj)
|
||||
// Asserts the code is always executed in the same thread.
|
||||
#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \
|
||||
base::ThreadCollisionWarner::Check check_##obj(&obj)
|
||||
|
||||
#else
|
||||
|
||||
#define DFAKE_MUTEX(obj) typedef void InternalFakeMutexType##obj
|
||||
#define DFAKE_SCOPED_LOCK(obj) ((void)0)
|
||||
#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) ((void)0)
|
||||
#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) ((void)0)
|
||||
|
||||
#endif
|
||||
|
||||
namespace base {
|
||||
|
||||
// The class ThreadCollisionWarner uses an Asserter to notify the collision
|
||||
// AsserterBase is the interfaces and DCheckAsserter is the default asserter
|
||||
// used. During the unit tests is used another class that doesn't "DCHECK"
|
||||
// in case of collision (check thread_collision_warner_unittests.cc)
|
||||
struct AsserterBase {
|
||||
virtual ~AsserterBase() {}
|
||||
virtual void warn() = 0;
|
||||
};
|
||||
|
||||
struct DCheckAsserter : public AsserterBase {
|
||||
virtual ~DCheckAsserter() {}
|
||||
virtual void warn() OVERRIDE;
|
||||
};
|
||||
|
||||
class ThreadCollisionWarner {
|
||||
public:
|
||||
// The parameter asserter is there only for test purpose
|
||||
explicit ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter())
|
||||
: valid_thread_id_(0),
|
||||
counter_(0),
|
||||
asserter_(asserter) {}
|
||||
|
||||
~ThreadCollisionWarner() {
|
||||
delete asserter_;
|
||||
}
|
||||
|
||||
// This class is meant to be used through the macro
|
||||
// DFAKE_SCOPED_LOCK_THREAD_LOCKED
|
||||
// it doesn't leave the critical section, as opposed to ScopedCheck,
|
||||
// because the critical section being pinned is allowed to be used only
|
||||
// from one thread
|
||||
class Check {
|
||||
public:
|
||||
explicit Check(ThreadCollisionWarner* warner)
|
||||
: warner_(warner) {
|
||||
warner_->EnterSelf();
|
||||
}
|
||||
|
||||
~Check() {}
|
||||
|
||||
private:
|
||||
ThreadCollisionWarner* warner_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Check);
|
||||
};
|
||||
|
||||
// This class is meant to be used through the macro
|
||||
// DFAKE_SCOPED_LOCK
|
||||
class ScopedCheck {
|
||||
public:
|
||||
explicit ScopedCheck(ThreadCollisionWarner* warner)
|
||||
: warner_(warner) {
|
||||
warner_->Enter();
|
||||
}
|
||||
|
||||
~ScopedCheck() {
|
||||
warner_->Leave();
|
||||
}
|
||||
|
||||
private:
|
||||
ThreadCollisionWarner* warner_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ScopedCheck);
|
||||
};
|
||||
|
||||
// This class is meant to be used through the macro
|
||||
// DFAKE_SCOPED_RECURSIVE_LOCK
|
||||
class ScopedRecursiveCheck {
|
||||
public:
|
||||
explicit ScopedRecursiveCheck(ThreadCollisionWarner* warner)
|
||||
: warner_(warner) {
|
||||
warner_->EnterSelf();
|
||||
}
|
||||
|
||||
~ScopedRecursiveCheck() {
|
||||
warner_->Leave();
|
||||
}
|
||||
|
||||
private:
|
||||
ThreadCollisionWarner* warner_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ScopedRecursiveCheck);
|
||||
};
|
||||
|
||||
private:
|
||||
// This method stores the current thread identifier and does a DCHECK
|
||||
// if a another thread has already done it, it is safe if same thread
|
||||
// calls this multiple time (recursion allowed).
|
||||
void EnterSelf();
|
||||
|
||||
// Same as EnterSelf but recursion is not allowed.
|
||||
void Enter();
|
||||
|
||||
// Removes the thread_id stored in order to allow other threads to
|
||||
// call EnterSelf or Enter.
|
||||
void Leave();
|
||||
|
||||
// This stores the thread id that is inside the critical section, if the
|
||||
// value is 0 then no thread is inside.
|
||||
volatile subtle::Atomic32 valid_thread_id_;
|
||||
|
||||
// Counter to trace how many time a critical section was "pinned"
|
||||
// (when allowed) in order to unpin it when counter_ reaches 0.
|
||||
volatile subtle::Atomic32 counter_;
|
||||
|
||||
// Here only for class unit tests purpose, during the test I need to not
|
||||
// DCHECK but notify the collision with something else.
|
||||
AsserterBase* asserter_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ThreadCollisionWarner);
|
||||
};
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_
|
@@ -166,26 +166,23 @@
|
||||
#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \
|
||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false); \
|
||||
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
||||
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val) \
|
||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, \
|
||||
arg2_name, arg2_val, false); \
|
||||
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \
|
||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val, false); \
|
||||
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
||||
|
||||
// Implementation detail: trace event macros create temporary variable names.
|
||||
// These macros give each temporary variable a unique name based on the line
|
||||
// number to prevent name collisions.
|
||||
#define CEF_INTERNAL_TRACE_EVENT_UID3(a,b) \
|
||||
cef_trace_event_unique_##a##b
|
||||
#define CEF_INTERNAL_TRACE_EVENT_UID2(a,b) \
|
||||
CEF_INTERNAL_TRACE_EVENT_UID3(a,b)
|
||||
#define CEF_INTERNAL_TRACE_EVENT_UID3(a, b) cef_trace_event_unique_##a##b
|
||||
#define CEF_INTERNAL_TRACE_EVENT_UID2(a, b) CEF_INTERNAL_TRACE_EVENT_UID3(a, b)
|
||||
#define CEF_INTERNAL_TRACE_EVENT_UID(name_prefix) \
|
||||
CEF_INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__)
|
||||
|
||||
// Implementation detail: internal macro to end end event when the scope ends.
|
||||
#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \
|
||||
cef_trace_event::CefTraceEndOnScopeClose \
|
||||
CEF_INTERNAL_TRACE_EVENT_UID(profileScope)(category, name)
|
||||
cef_trace_event::CefTraceEndOnScopeClose CEF_INTERNAL_TRACE_EVENT_UID( \
|
||||
profileScope)(category, name)
|
||||
|
||||
// Records a single event called "name" immediately, with 0, 1 or 2
|
||||
// associated arguments. If the category is not enabled, then this
|
||||
@@ -196,8 +193,8 @@
|
||||
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false)
|
||||
#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \
|
||||
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, false)
|
||||
#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \
|
||||
arg2_name, arg2_val) \
|
||||
#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val) \
|
||||
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val, false)
|
||||
#define TRACE_EVENT_COPY_INSTANT0(category, name) \
|
||||
@@ -218,8 +215,8 @@
|
||||
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false)
|
||||
#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \
|
||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false)
|
||||
#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, \
|
||||
arg2_name, arg2_val) \
|
||||
#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val) \
|
||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val, false)
|
||||
#define TRACE_EVENT_COPY_BEGIN0(category, name) \
|
||||
@@ -239,16 +236,16 @@
|
||||
cef_trace_event_end(category, name, NULL, 0, NULL, 0, false)
|
||||
#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \
|
||||
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, false)
|
||||
#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, \
|
||||
arg2_name, arg2_val) \
|
||||
#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val) \
|
||||
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val, false)
|
||||
#define TRACE_EVENT_COPY_END0(category, name) \
|
||||
cef_trace_event_end(category, name, NULL, 0, NULL, 0, true)
|
||||
#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \
|
||||
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, true)
|
||||
#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, \
|
||||
arg2_name, arg2_val) \
|
||||
#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)
|
||||
|
||||
@@ -266,8 +263,8 @@
|
||||
// values as a stacked-bar chart.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
#define TRACE_COUNTER2(category, name, value1_name, value1_val, \
|
||||
value2_name, value2_val) \
|
||||
#define TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, \
|
||||
value2_val) \
|
||||
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
|
||||
value2_val, false)
|
||||
#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \
|
||||
@@ -301,12 +298,11 @@
|
||||
value2_name, value2_val) \
|
||||
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
||||
value2_name, value2_val, false)
|
||||
#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, \
|
||||
value1_val, value2_name, value2_val) \
|
||||
#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val, \
|
||||
value2_name, value2_val) \
|
||||
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
||||
value2_name, value2_val, true)
|
||||
|
||||
|
||||
// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
|
||||
// associated arguments. If the category is not enabled, then this
|
||||
// does nothing.
|
||||
@@ -334,12 +330,11 @@
|
||||
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) \
|
||||
#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) \
|
||||
#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)
|
||||
|
||||
@@ -351,14 +346,14 @@
|
||||
// ASYNC_STEP_PAST events.
|
||||
#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \
|
||||
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false)
|
||||
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, \
|
||||
arg1_name, arg1_val) \
|
||||
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
|
||||
arg1_val) \
|
||||
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
|
||||
arg1_val, false)
|
||||
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO0(category, name, id, step) \
|
||||
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, true)
|
||||
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, \
|
||||
arg1_name, arg1_val) \
|
||||
#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)
|
||||
|
||||
@@ -370,14 +365,14 @@
|
||||
// ASYNC_STEP_INTO events.
|
||||
#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \
|
||||
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false)
|
||||
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, \
|
||||
arg1_name, arg1_val) \
|
||||
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
|
||||
arg1_val) \
|
||||
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
|
||||
arg1_val, false)
|
||||
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST0(category, name, id, step) \
|
||||
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, true)
|
||||
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, \
|
||||
arg1_name, arg1_val) \
|
||||
#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)
|
||||
|
||||
@@ -394,12 +389,11 @@
|
||||
arg2_name, arg2_val, false)
|
||||
#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \
|
||||
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, true)
|
||||
#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, \
|
||||
arg1_val) \
|
||||
#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
|
||||
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
|
||||
true)
|
||||
#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, \
|
||||
arg1_val, arg2_name, arg2_val) \
|
||||
#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)
|
||||
|
||||
@@ -409,8 +403,7 @@ namespace cef_trace_event {
|
||||
class CefTraceEndOnScopeClose {
|
||||
public:
|
||||
CefTraceEndOnScopeClose(const char* category, const char* name)
|
||||
: category_(category), name_(name) {
|
||||
}
|
||||
: category_(category), name_(name) {}
|
||||
~CefTraceEndOnScopeClose() {
|
||||
cef_trace_event_end(category_, name_, NULL, 0, NULL, 0, false);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -117,8 +117,10 @@
|
||||
|
||||
namespace base {
|
||||
|
||||
template <typename T> class SupportsWeakPtr;
|
||||
template <typename T> class WeakPtr;
|
||||
template <typename T>
|
||||
class SupportsWeakPtr;
|
||||
template <typename T>
|
||||
class WeakPtr;
|
||||
|
||||
namespace cef_internal {
|
||||
// These classes are part of the WeakPtr implementation.
|
||||
@@ -164,9 +166,7 @@ class WeakReferenceOwner {
|
||||
|
||||
WeakReference GetRef() const;
|
||||
|
||||
bool HasRefs() const {
|
||||
return flag_.get() && !flag_->HasOneRef();
|
||||
}
|
||||
bool HasRefs() const { return flag_.get() && !flag_->HasOneRef(); }
|
||||
|
||||
void Invalidate();
|
||||
|
||||
@@ -200,8 +200,8 @@ class SupportsWeakPtrBase {
|
||||
// function that makes calling this easier.
|
||||
template <typename Derived>
|
||||
static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
|
||||
typedef
|
||||
is_convertible<Derived, cef_internal::SupportsWeakPtrBase&> convertible;
|
||||
typedef is_convertible<Derived, cef_internal::SupportsWeakPtrBase&>
|
||||
convertible;
|
||||
COMPILE_ASSERT(convertible::value,
|
||||
AsWeakPtr_argument_inherits_from_SupportsWeakPtr);
|
||||
return AsWeakPtrImpl<Derived>(t, *t);
|
||||
@@ -212,8 +212,8 @@ class SupportsWeakPtrBase {
|
||||
// which is an instance of SupportsWeakPtr<Base>. We can then safely
|
||||
// static_cast the Base* to a Derived*.
|
||||
template <typename Derived, typename Base>
|
||||
static WeakPtr<Derived> AsWeakPtrImpl(
|
||||
Derived* t, const SupportsWeakPtr<Base>&) {
|
||||
static WeakPtr<Derived> AsWeakPtrImpl(Derived* t,
|
||||
const SupportsWeakPtr<Base>&) {
|
||||
WeakPtr<Base> ptr = t->Base::AsWeakPtr();
|
||||
return WeakPtr<Derived>(ptr.ref_, static_cast<Derived*>(ptr.ptr_));
|
||||
}
|
||||
@@ -221,7 +221,8 @@ class SupportsWeakPtrBase {
|
||||
|
||||
} // namespace cef_internal
|
||||
|
||||
template <typename T> class WeakPtrFactory;
|
||||
template <typename T>
|
||||
class WeakPtrFactory;
|
||||
|
||||
// The WeakPtr class holds a weak reference to |T*|.
|
||||
//
|
||||
@@ -239,14 +240,12 @@ template <typename T> class WeakPtrFactory;
|
||||
template <typename T>
|
||||
class WeakPtr : public cef_internal::WeakPtrBase {
|
||||
public:
|
||||
WeakPtr() : ptr_(NULL) {
|
||||
}
|
||||
WeakPtr() : ptr_(NULL) {}
|
||||
|
||||
// Allow conversion from U to T provided U "is a" T. Note that this
|
||||
// is separate from the (implicit) copy constructor.
|
||||
template <typename U>
|
||||
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other), ptr_(other.ptr_) {
|
||||
}
|
||||
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other), ptr_(other.ptr_) {}
|
||||
|
||||
T* get() const { return ref_.is_valid() ? ptr_ : NULL; }
|
||||
|
||||
@@ -280,18 +279,19 @@ class WeakPtr : public cef_internal::WeakPtrBase {
|
||||
private:
|
||||
// Explicitly declare comparison operators as required by the bool
|
||||
// trick, but keep them private.
|
||||
template <class U> bool operator==(WeakPtr<U> const&) const;
|
||||
template <class U> bool operator!=(WeakPtr<U> const&) const;
|
||||
template <class U>
|
||||
bool operator==(WeakPtr<U> const&) const;
|
||||
template <class U>
|
||||
bool operator!=(WeakPtr<U> const&) const;
|
||||
|
||||
friend class cef_internal::SupportsWeakPtrBase;
|
||||
template <typename U> friend class WeakPtr;
|
||||
template <typename U>
|
||||
friend class WeakPtr;
|
||||
friend class SupportsWeakPtr<T>;
|
||||
friend class WeakPtrFactory<T>;
|
||||
|
||||
WeakPtr(const cef_internal::WeakReference& ref, T* ptr)
|
||||
: WeakPtrBase(ref),
|
||||
ptr_(ptr) {
|
||||
}
|
||||
: WeakPtrBase(ref), ptr_(ptr) {}
|
||||
|
||||
// This pointer is only valid when ref_.is_valid() is true. Otherwise, its
|
||||
// value is undefined (as opposed to NULL).
|
||||
@@ -306,12 +306,9 @@ class WeakPtr : public cef_internal::WeakPtrBase {
|
||||
template <class T>
|
||||
class WeakPtrFactory {
|
||||
public:
|
||||
explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {
|
||||
}
|
||||
explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {}
|
||||
|
||||
~WeakPtrFactory() {
|
||||
ptr_ = NULL;
|
||||
}
|
||||
~WeakPtrFactory() { ptr_ = NULL; }
|
||||
|
||||
WeakPtr<T> GetWeakPtr() {
|
||||
DCHECK(ptr_);
|
||||
|
@@ -103,7 +103,8 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
|
||||
// reloop = 0
|
||||
// if (prev_value != old_value)
|
||||
// reloop = STREX(ptr, new_value)
|
||||
__asm__ __volatile__(" ldrex %0, [%3]\n"
|
||||
__asm__ __volatile__(
|
||||
" ldrex %0, [%3]\n"
|
||||
" mov %1, #0\n"
|
||||
" cmp %0, %4\n"
|
||||
#ifdef __thumb2__
|
||||
@@ -143,7 +144,8 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||
// value += increment
|
||||
// reloop = STREX(ptr, value)
|
||||
//
|
||||
__asm__ __volatile__(" ldrex %0, [%3]\n"
|
||||
__asm__ __volatile__(
|
||||
" ldrex %0, [%3]\n"
|
||||
" add %0, %0, %4\n"
|
||||
" strex %1, %0, [%3]\n"
|
||||
: "=&r"(value), "=&r"(reloop), "+m"(*ptr)
|
||||
@@ -171,7 +173,8 @@ inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
|
||||
do {
|
||||
// old_value = LDREX(ptr)
|
||||
// reloop = STREX(ptr, new_value)
|
||||
__asm__ __volatile__(" ldrex %0, [%3]\n"
|
||||
__asm__ __volatile__(
|
||||
" ldrex %0, [%3]\n"
|
||||
" strex %1, %4, [%3]\n"
|
||||
: "=&r"(old_value), "=&r"(reloop), "+m"(*ptr)
|
||||
: "r"(ptr), "r"(new_value)
|
||||
@@ -301,7 +304,9 @@ inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
|
||||
*ptr = value;
|
||||
}
|
||||
|
||||
inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { return *ptr; }
|
||||
inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
|
||||
Atomic32 value = *ptr;
|
||||
|
@@ -52,26 +52,26 @@ namespace subtle {
|
||||
inline AtomicWord NoBarrier_CompareAndSwap(volatile AtomicWord* ptr,
|
||||
AtomicWord old_value,
|
||||
AtomicWord new_value) {
|
||||
return NoBarrier_CompareAndSwap(
|
||||
reinterpret_cast<volatile Atomic32*>(ptr), old_value, new_value);
|
||||
return NoBarrier_CompareAndSwap(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||
old_value, new_value);
|
||||
}
|
||||
|
||||
inline AtomicWord NoBarrier_AtomicExchange(volatile AtomicWord* ptr,
|
||||
AtomicWord new_value) {
|
||||
return NoBarrier_AtomicExchange(
|
||||
reinterpret_cast<volatile Atomic32*>(ptr), new_value);
|
||||
return NoBarrier_AtomicExchange(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||
new_value);
|
||||
}
|
||||
|
||||
inline AtomicWord NoBarrier_AtomicIncrement(volatile AtomicWord* ptr,
|
||||
AtomicWord increment) {
|
||||
return NoBarrier_AtomicIncrement(
|
||||
reinterpret_cast<volatile Atomic32*>(ptr), increment);
|
||||
return NoBarrier_AtomicIncrement(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||
increment);
|
||||
}
|
||||
|
||||
inline AtomicWord Barrier_AtomicIncrement(volatile AtomicWord* ptr,
|
||||
AtomicWord increment) {
|
||||
return Barrier_AtomicIncrement(
|
||||
reinterpret_cast<volatile Atomic32*>(ptr), increment);
|
||||
return Barrier_AtomicIncrement(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||
increment);
|
||||
}
|
||||
|
||||
inline AtomicWord Acquire_CompareAndSwap(volatile AtomicWord* ptr,
|
||||
@@ -89,23 +89,21 @@ inline AtomicWord Release_CompareAndSwap(volatile AtomicWord* ptr,
|
||||
}
|
||||
|
||||
inline void NoBarrier_Store(volatile AtomicWord* ptr, AtomicWord value) {
|
||||
NoBarrier_Store(
|
||||
reinterpret_cast<volatile Atomic32*>(ptr), value);
|
||||
NoBarrier_Store(reinterpret_cast<volatile Atomic32*>(ptr), value);
|
||||
}
|
||||
|
||||
inline void Acquire_Store(volatile AtomicWord* ptr, AtomicWord value) {
|
||||
return base::subtle::Acquire_Store(
|
||||
reinterpret_cast<volatile Atomic32*>(ptr), value);
|
||||
return base::subtle::Acquire_Store(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||
value);
|
||||
}
|
||||
|
||||
inline void Release_Store(volatile AtomicWord* ptr, AtomicWord value) {
|
||||
return base::subtle::Release_Store(
|
||||
reinterpret_cast<volatile Atomic32*>(ptr), value);
|
||||
return base::subtle::Release_Store(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||
value);
|
||||
}
|
||||
|
||||
inline AtomicWord NoBarrier_Load(volatile const AtomicWord* ptr) {
|
||||
return NoBarrier_Load(
|
||||
reinterpret_cast<volatile const Atomic32*>(ptr));
|
||||
return NoBarrier_Load(reinterpret_cast<volatile const Atomic32*>(ptr));
|
||||
}
|
||||
|
||||
inline AtomicWord Acquire_Load(volatile const AtomicWord* ptr) {
|
||||
|
@@ -41,8 +41,7 @@ struct AtomicOps_x86CPUFeatureStruct {
|
||||
bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
|
||||
// after acquire compare-and-swap.
|
||||
};
|
||||
extern struct AtomicOps_x86CPUFeatureStruct
|
||||
AtomicOps_Internalx86CPUFeatures;
|
||||
extern struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures;
|
||||
|
||||
#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
|
||||
|
||||
@@ -76,7 +75,8 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||
Atomic32 temp = increment;
|
||||
__asm__ __volatile__("lock; xaddl %0,%1"
|
||||
: "+r"(temp), "+m"(*ptr)
|
||||
: : "memory");
|
||||
:
|
||||
: "memory");
|
||||
// temp now holds the old value of *ptr
|
||||
return temp + increment;
|
||||
}
|
||||
@@ -86,7 +86,8 @@ inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||
Atomic32 temp = increment;
|
||||
__asm__ __volatile__("lock; xaddl %0,%1"
|
||||
: "+r"(temp), "+m"(*ptr)
|
||||
: : "memory");
|
||||
:
|
||||
: "memory");
|
||||
// temp now holds the old value of *ptr
|
||||
if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
|
||||
__asm__ __volatile__("lfence" : : : "memory");
|
||||
@@ -174,7 +175,8 @@ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
|
||||
Atomic64 temp = increment;
|
||||
__asm__ __volatile__("lock; xaddq %0,%1"
|
||||
: "+r"(temp), "+m"(*ptr)
|
||||
: : "memory");
|
||||
:
|
||||
: "memory");
|
||||
// temp now contains the previous value of *ptr
|
||||
return temp + increment;
|
||||
}
|
||||
@@ -184,7 +186,8 @@ inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
|
||||
Atomic64 temp = increment;
|
||||
__asm__ __volatile__("lock; xaddq %0,%1"
|
||||
: "+r"(temp), "+m"(*ptr)
|
||||
: : "memory");
|
||||
:
|
||||
: "memory");
|
||||
// temp now contains the previous value of *ptr
|
||||
if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
|
||||
__asm__ __volatile__("lfence" : : : "memory");
|
||||
|
@@ -55,25 +55,23 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
|
||||
Atomic32 old_value,
|
||||
Atomic32 new_value) {
|
||||
LONG result = _InterlockedCompareExchange(
|
||||
reinterpret_cast<volatile LONG*>(ptr),
|
||||
static_cast<LONG>(new_value),
|
||||
reinterpret_cast<volatile LONG*>(ptr), static_cast<LONG>(new_value),
|
||||
static_cast<LONG>(old_value));
|
||||
return static_cast<Atomic32>(result);
|
||||
}
|
||||
|
||||
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
|
||||
Atomic32 new_value) {
|
||||
LONG result = _InterlockedExchange(
|
||||
reinterpret_cast<volatile LONG*>(ptr),
|
||||
LONG result = _InterlockedExchange(reinterpret_cast<volatile LONG*>(ptr),
|
||||
static_cast<LONG>(new_value));
|
||||
return static_cast<Atomic32>(result);
|
||||
}
|
||||
|
||||
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||
Atomic32 increment) {
|
||||
return _InterlockedExchangeAdd(
|
||||
reinterpret_cast<volatile LONG*>(ptr),
|
||||
static_cast<LONG>(increment)) + increment;
|
||||
return _InterlockedExchangeAdd(reinterpret_cast<volatile LONG*>(ptr),
|
||||
static_cast<LONG>(increment)) +
|
||||
increment;
|
||||
}
|
||||
|
||||
inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||
@@ -151,17 +149,17 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
|
||||
|
||||
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
|
||||
Atomic64 new_value) {
|
||||
PVOID result = InterlockedExchangePointer(
|
||||
reinterpret_cast<volatile PVOID*>(ptr),
|
||||
PVOID result =
|
||||
InterlockedExchangePointer(reinterpret_cast<volatile PVOID*>(ptr),
|
||||
reinterpret_cast<PVOID>(new_value));
|
||||
return reinterpret_cast<Atomic64>(result);
|
||||
}
|
||||
|
||||
inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
|
||||
Atomic64 increment) {
|
||||
return InterlockedExchangeAdd64(
|
||||
reinterpret_cast<volatile LONGLONG*>(ptr),
|
||||
static_cast<LONGLONG>(increment)) + increment;
|
||||
return InterlockedExchangeAdd64(reinterpret_cast<volatile LONGLONG*>(ptr),
|
||||
static_cast<LONGLONG>(increment)) +
|
||||
increment;
|
||||
}
|
||||
|
||||
inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
|
||||
@@ -215,7 +213,6 @@ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
|
||||
return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
|
||||
}
|
||||
|
||||
|
||||
#endif // defined(_WIN64)
|
||||
|
||||
} // namespace base::subtle
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -52,13 +52,9 @@ class RunnableAdapter<R(__stdcall *)()> {
|
||||
public:
|
||||
typedef R(RunType)();
|
||||
|
||||
explicit RunnableAdapter(R(__stdcall *function)())
|
||||
: function_(function) {
|
||||
}
|
||||
explicit RunnableAdapter(R(__stdcall* function)()) : function_(function) {}
|
||||
|
||||
R Run() {
|
||||
return function_();
|
||||
}
|
||||
R Run() { return function_(); }
|
||||
|
||||
private:
|
||||
R(__stdcall* function_)();
|
||||
@@ -70,13 +66,9 @@ class RunnableAdapter<R(__fastcall *)()> {
|
||||
public:
|
||||
typedef R(RunType)();
|
||||
|
||||
explicit RunnableAdapter(R(__fastcall *function)())
|
||||
: function_(function) {
|
||||
}
|
||||
explicit RunnableAdapter(R(__fastcall* function)()) : function_(function) {}
|
||||
|
||||
R Run() {
|
||||
return function_();
|
||||
}
|
||||
R Run() { return function_(); }
|
||||
|
||||
private:
|
||||
R(__fastcall* function_)();
|
||||
@@ -88,9 +80,7 @@ class RunnableAdapter<R(__stdcall *)(A1)> {
|
||||
public:
|
||||
typedef R(RunType)(A1);
|
||||
|
||||
explicit RunnableAdapter(R(__stdcall *function)(A1))
|
||||
: function_(function) {
|
||||
}
|
||||
explicit RunnableAdapter(R(__stdcall* function)(A1)) : function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
|
||||
return function_(a1);
|
||||
@@ -106,9 +96,7 @@ class RunnableAdapter<R(__fastcall *)(A1)> {
|
||||
public:
|
||||
typedef R(RunType)(A1);
|
||||
|
||||
explicit RunnableAdapter(R(__fastcall *function)(A1))
|
||||
: function_(function) {
|
||||
}
|
||||
explicit RunnableAdapter(R(__fastcall* function)(A1)) : function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
|
||||
return function_(a1);
|
||||
@@ -125,8 +113,7 @@ class RunnableAdapter<R(__stdcall *)(A1, A2)> {
|
||||
typedef R(RunType)(A1, A2);
|
||||
|
||||
explicit RunnableAdapter(R(__stdcall* function)(A1, A2))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2) {
|
||||
@@ -144,8 +131,7 @@ class RunnableAdapter<R(__fastcall *)(A1, A2)> {
|
||||
typedef R(RunType)(A1, A2);
|
||||
|
||||
explicit RunnableAdapter(R(__fastcall* function)(A1, A2))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2) {
|
||||
@@ -163,8 +149,7 @@ class RunnableAdapter<R(__stdcall *)(A1, A2, A3)> {
|
||||
typedef R(RunType)(A1, A2, A3);
|
||||
|
||||
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
@@ -183,8 +168,7 @@ class RunnableAdapter<R(__fastcall *)(A1, A2, A3)> {
|
||||
typedef R(RunType)(A1, A2, A3);
|
||||
|
||||
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
@@ -203,8 +187,7 @@ class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4)> {
|
||||
typedef R(RunType)(A1, A2, A3, A4);
|
||||
|
||||
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
@@ -224,8 +207,7 @@ class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4)> {
|
||||
typedef R(RunType)(A1, A2, A3, A4);
|
||||
|
||||
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
@@ -239,15 +221,18 @@ class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4)> {
|
||||
};
|
||||
|
||||
// __stdcall Function: Arity 5.
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
template <typename R,
|
||||
typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5>
|
||||
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4, A5)> {
|
||||
public:
|
||||
typedef R(RunType)(A1, A2, A3, A4, A5);
|
||||
|
||||
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
@@ -262,15 +247,18 @@ class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5)> {
|
||||
};
|
||||
|
||||
// __fastcall Function: Arity 5.
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
template <typename R,
|
||||
typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5>
|
||||
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4, A5)> {
|
||||
public:
|
||||
typedef R(RunType)(A1, A2, A3, A4, A5);
|
||||
|
||||
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
@@ -285,15 +273,19 @@ class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5)> {
|
||||
};
|
||||
|
||||
// __stdcall Function: Arity 6.
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6>
|
||||
template <typename R,
|
||||
typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5,
|
||||
typename A6>
|
||||
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4, A5, A6)> {
|
||||
public:
|
||||
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
|
||||
|
||||
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5, A6))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
@@ -309,15 +301,19 @@ class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6)> {
|
||||
};
|
||||
|
||||
// __fastcall Function: Arity 6.
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6>
|
||||
template <typename R,
|
||||
typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5,
|
||||
typename A6>
|
||||
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4, A5, A6)> {
|
||||
public:
|
||||
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
|
||||
|
||||
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5, A6))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
@@ -333,15 +329,20 @@ class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6)> {
|
||||
};
|
||||
|
||||
// __stdcall Function: Arity 7.
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6, typename A7>
|
||||
template <typename R,
|
||||
typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5,
|
||||
typename A6,
|
||||
typename A7>
|
||||
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4, A5, A6, A7)> {
|
||||
public:
|
||||
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
|
||||
|
||||
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5, A6, A7))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
@@ -358,15 +359,20 @@ class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7)> {
|
||||
};
|
||||
|
||||
// __fastcall Function: Arity 7.
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6, typename A7>
|
||||
template <typename R,
|
||||
typename A1,
|
||||
typename A2,
|
||||
typename A3,
|
||||
typename A4,
|
||||
typename A5,
|
||||
typename A6,
|
||||
typename A7>
|
||||
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4, A5, A6, A7)> {
|
||||
public:
|
||||
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
|
||||
|
||||
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5, A6, A7))
|
||||
: function_(function) {
|
||||
}
|
||||
: function_(function) {}
|
||||
|
||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||
|
@@ -115,15 +115,16 @@ class CallbackBase {
|
||||
// A helper template to determine if given type is non-const move-only-type,
|
||||
// i.e. if a value of the given type should be passed via .Pass() in a
|
||||
// destructive way.
|
||||
template <typename T> struct IsMoveOnlyType {
|
||||
template <typename T>
|
||||
struct IsMoveOnlyType {
|
||||
template <typename U>
|
||||
static YesType Test(const typename U::MoveOnlyTypeForCPP03*);
|
||||
|
||||
template <typename U>
|
||||
static NoType Test(...);
|
||||
|
||||
static const bool value = sizeof(Test<T>(0)) == sizeof(YesType) &&
|
||||
!is_const<T>::value;
|
||||
static const bool value =
|
||||
sizeof(Test<T>(0)) == sizeof(YesType) && !is_const<T>::value;
|
||||
};
|
||||
|
||||
// This is a typetraits object that's used to take an argument type, and
|
||||
|
@@ -51,9 +51,7 @@ namespace cef_internal {
|
||||
template <typename T>
|
||||
struct NeedsScopedRefptrButGetsRawPtr {
|
||||
#if defined(OS_WIN)
|
||||
enum {
|
||||
value = base::false_type::value
|
||||
};
|
||||
enum { value = base::false_type::value };
|
||||
#else
|
||||
enum {
|
||||
// Human readable translation: you needed to be a scoped_refptr if you are a
|
||||
@@ -83,68 +81,97 @@ struct ParamsUseScopedRefptrCorrectly<Tuple1<A> > {
|
||||
|
||||
template <typename A, typename B>
|
||||
struct ParamsUseScopedRefptrCorrectly<Tuple2<A, B>> {
|
||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<B>::value) };
|
||||
enum {
|
||||
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<B>::value)
|
||||
};
|
||||
};
|
||||
|
||||
template <typename A, typename B, typename C>
|
||||
struct ParamsUseScopedRefptrCorrectly<Tuple3<A, B, C>> {
|
||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
enum {
|
||||
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<C>::value) };
|
||||
NeedsScopedRefptrButGetsRawPtr<C>::value)
|
||||
};
|
||||
};
|
||||
|
||||
template <typename A, typename B, typename C, typename D>
|
||||
struct ParamsUseScopedRefptrCorrectly<Tuple4<A, B, C, D>> {
|
||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
enum {
|
||||
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<D>::value) };
|
||||
NeedsScopedRefptrButGetsRawPtr<D>::value)
|
||||
};
|
||||
};
|
||||
|
||||
template <typename A, typename B, typename C, typename D, typename E>
|
||||
struct ParamsUseScopedRefptrCorrectly<Tuple5<A, B, C, D, E>> {
|
||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
enum {
|
||||
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<E>::value) };
|
||||
NeedsScopedRefptrButGetsRawPtr<E>::value)
|
||||
};
|
||||
};
|
||||
|
||||
template <typename A, typename B, typename C, typename D, typename E,
|
||||
template <typename A,
|
||||
typename B,
|
||||
typename C,
|
||||
typename D,
|
||||
typename E,
|
||||
typename F>
|
||||
struct ParamsUseScopedRefptrCorrectly<Tuple6<A, B, C, D, E, F>> {
|
||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
enum {
|
||||
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<F>::value) };
|
||||
NeedsScopedRefptrButGetsRawPtr<F>::value)
|
||||
};
|
||||
};
|
||||
|
||||
template <typename A, typename B, typename C, typename D, typename E,
|
||||
typename F, typename G>
|
||||
template <typename A,
|
||||
typename B,
|
||||
typename C,
|
||||
typename D,
|
||||
typename E,
|
||||
typename F,
|
||||
typename G>
|
||||
struct ParamsUseScopedRefptrCorrectly<Tuple7<A, B, C, D, E, F, G>> {
|
||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
enum {
|
||||
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<F>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<G>::value) };
|
||||
NeedsScopedRefptrButGetsRawPtr<G>::value)
|
||||
};
|
||||
};
|
||||
|
||||
template <typename A, typename B, typename C, typename D, typename E,
|
||||
typename F, typename G, typename H>
|
||||
template <typename A,
|
||||
typename B,
|
||||
typename C,
|
||||
typename D,
|
||||
typename E,
|
||||
typename F,
|
||||
typename G,
|
||||
typename H>
|
||||
struct ParamsUseScopedRefptrCorrectly<Tuple8<A, B, C, D, E, F, G, H>> {
|
||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
enum {
|
||||
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<F>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<G>::value ||
|
||||
NeedsScopedRefptrButGetsRawPtr<H>::value) };
|
||||
NeedsScopedRefptrButGetsRawPtr<H>::value)
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace cef_internal
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,73 +33,49 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=3e20b926af7550a1dc4000bfdf261332222a64b8$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_browser_capi.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of geolocation
|
||||
// permission requests.
|
||||
// Implement this structure to receive accessibility notification when
|
||||
// accessibility events have been registered. The functions of this structure
|
||||
// will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_geolocation_callback_t {
|
||||
typedef struct _cef_accessibility_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Call to allow or deny geolocation access.
|
||||
// Called after renderer process sends accessibility tree changes to the
|
||||
// browser process.
|
||||
///
|
||||
void (CEF_CALLBACK *cont)(struct _cef_geolocation_callback_t* self,
|
||||
int allow);
|
||||
} cef_geolocation_callback_t;
|
||||
|
||||
void(CEF_CALLBACK* on_accessibility_tree_change)(
|
||||
struct _cef_accessibility_handler_t* self,
|
||||
struct _cef_value_t* value);
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to geolocation permission
|
||||
// requests. The functions of this structure will be called on the browser
|
||||
// process UI thread.
|
||||
// Called after renderer process sends accessibility location changes to the
|
||||
// browser process.
|
||||
///
|
||||
typedef struct _cef_geolocation_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called when a page requests permission to access geolocation information.
|
||||
// |requesting_url| is the URL requesting permission and |request_id| is the
|
||||
// unique ID for the permission request. Return true (1) and call
|
||||
// cef_geolocation_callback_t::cont() either in this function or at a later
|
||||
// time to continue or cancel the request. Return false (0) to cancel the
|
||||
// request immediately.
|
||||
///
|
||||
int (CEF_CALLBACK *on_request_geolocation_permission)(
|
||||
struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser,
|
||||
const cef_string_t* requesting_url, int request_id,
|
||||
struct _cef_geolocation_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called when a geolocation access request is canceled. |request_id| is the
|
||||
// unique ID for the permission request.
|
||||
///
|
||||
void (CEF_CALLBACK *on_cancel_geolocation_permission)(
|
||||
struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser,
|
||||
int request_id);
|
||||
} cef_geolocation_handler_t;
|
||||
|
||||
void(CEF_CALLBACK* on_accessibility_location_change)(
|
||||
struct _cef_accessibility_handler_t* self,
|
||||
struct _cef_value_t* value);
|
||||
} cef_accessibility_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ca069c86d9b09fb6f939ce72682e15ce95571ead$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
||||
@@ -73,7 +75,8 @@ typedef struct _cef_app_t {
|
||||
// in undefined behavior including crashes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_before_command_line_processing)(
|
||||
struct _cef_app_t* self, const cef_string_t* process_type,
|
||||
struct _cef_app_t* self,
|
||||
const cef_string_t* process_type,
|
||||
struct _cef_command_line_t* command_line);
|
||||
|
||||
///
|
||||
@@ -82,7 +85,8 @@ typedef struct _cef_app_t {
|
||||
// each process and the registered schemes should be the same across all
|
||||
// processes.
|
||||
///
|
||||
void (CEF_CALLBACK *on_register_custom_schemes)(struct _cef_app_t* self,
|
||||
void(CEF_CALLBACK* on_register_custom_schemes)(
|
||||
struct _cef_app_t* self,
|
||||
struct _cef_scheme_registrar_t* registrar);
|
||||
|
||||
///
|
||||
@@ -109,7 +113,6 @@ typedef struct _cef_app_t {
|
||||
CEF_CALLBACK* get_render_process_handler)(struct _cef_app_t* self);
|
||||
} cef_app_t;
|
||||
|
||||
|
||||
///
|
||||
// This function should be called from the application entry point function to
|
||||
// execute a secondary process. It can be used to run secondary processes from
|
||||
@@ -123,7 +126,8 @@ typedef struct _cef_app_t {
|
||||
// cef_sandbox_win.h for details).
|
||||
///
|
||||
CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
|
||||
cef_app_t* application, void* windows_sandbox_info);
|
||||
cef_app_t* application,
|
||||
void* windows_sandbox_info);
|
||||
|
||||
///
|
||||
// This function should be called on the main application thread to initialize
|
||||
@@ -133,7 +137,8 @@ CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
|
||||
// be NULL (see cef_sandbox_win.h for details).
|
||||
///
|
||||
CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
|
||||
const struct _cef_settings_t* settings, cef_app_t* application,
|
||||
const struct _cef_settings_t* settings,
|
||||
cef_app_t* application,
|
||||
void* windows_sandbox_info);
|
||||
|
||||
///
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=899e57614c5810d61b61d182ed823cfbd193b4d4$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of authentication
|
||||
// requests.
|
||||
@@ -59,7 +60,8 @@ typedef struct _cef_auth_callback_t {
|
||||
// Continue the authentication request.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_auth_callback_t* self,
|
||||
const cef_string_t* username, const cef_string_t* password);
|
||||
const cef_string_t* username,
|
||||
const cef_string_t* password);
|
||||
|
||||
///
|
||||
// Cancel the authentication request.
|
||||
@@ -67,7 +69,6 @@ typedef struct _cef_auth_callback_t {
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_auth_callback_t* self);
|
||||
} cef_auth_callback_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -27,7 +27,6 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
|
||||
|
||||
@@ -70,8 +69,12 @@ typedef struct _cef_base_ref_counted_t {
|
||||
// Returns true (1) if the current reference count is 1.
|
||||
///
|
||||
int(CEF_CALLBACK* has_one_ref)(struct _cef_base_ref_counted_t* self);
|
||||
} cef_base_ref_counted_t;
|
||||
|
||||
///
|
||||
// Returns true (1) if the current reference count is at least 1.
|
||||
///
|
||||
int(CEF_CALLBACK* has_at_least_one_ref)(struct _cef_base_ref_counted_t* self);
|
||||
} cef_base_ref_counted_t;
|
||||
|
||||
///
|
||||
// All scoped framework structures must include this structure first.
|
||||
@@ -89,16 +92,14 @@ typedef struct _cef_base_scoped_t {
|
||||
|
||||
} cef_base_scoped_t;
|
||||
|
||||
|
||||
// Check that the structure |s|, which is defined with a size_t member at the
|
||||
// top, is large enough to contain the specified member |f|.
|
||||
#define CEF_MEMBER_EXISTS(s, f) \
|
||||
((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= \
|
||||
*reinterpret_cast<size_t*>(s))
|
||||
((intptr_t) & \
|
||||
((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= *reinterpret_cast<size_t*>(s))
|
||||
|
||||
#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ff3ebc51ed5743aabac0be94caf2edeedbd413b7$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||
@@ -113,7 +115,8 @@ typedef struct _cef_browser_t {
|
||||
void(CEF_CALLBACK* stop_load)(struct _cef_browser_t* self);
|
||||
|
||||
///
|
||||
// Returns the globally unique identifier for this browser.
|
||||
// Returns the globally unique identifier for this browser. This value is also
|
||||
// used as the tabId for extension APIs.
|
||||
///
|
||||
int(CEF_CALLBACK* get_identifier)(struct _cef_browser_t* self);
|
||||
|
||||
@@ -150,7 +153,8 @@ typedef struct _cef_browser_t {
|
||||
// Returns the frame with the specified identifier, or NULL if not found.
|
||||
///
|
||||
struct _cef_frame_t*(CEF_CALLBACK* get_frame_byident)(
|
||||
struct _cef_browser_t* self, int64 identifier);
|
||||
struct _cef_browser_t* self,
|
||||
int64 identifier);
|
||||
|
||||
///
|
||||
// Returns the frame with the specified name, or NULL if not found.
|
||||
@@ -167,7 +171,8 @@ typedef struct _cef_browser_t {
|
||||
// Returns the identifiers of all existing frames.
|
||||
///
|
||||
void(CEF_CALLBACK* get_frame_identifiers)(struct _cef_browser_t* self,
|
||||
size_t* identifiersCount, int64* identifiers);
|
||||
size_t* identifiersCount,
|
||||
int64* identifiers);
|
||||
|
||||
///
|
||||
// Returns the names of all existing frames.
|
||||
@@ -179,12 +184,12 @@ typedef struct _cef_browser_t {
|
||||
// Send a message to the specified |target_process|. Returns true (1) if the
|
||||
// message was sent successfully.
|
||||
///
|
||||
int (CEF_CALLBACK *send_process_message)(struct _cef_browser_t* self,
|
||||
int(CEF_CALLBACK* send_process_message)(
|
||||
struct _cef_browser_t* self,
|
||||
cef_process_id_t target_process,
|
||||
struct _cef_process_message_t* message);
|
||||
} cef_browser_t;
|
||||
|
||||
|
||||
///
|
||||
// Callback structure for cef_browser_host_t::RunFileDialog. The functions of
|
||||
// this structure will be called on the browser process UI thread.
|
||||
@@ -203,11 +208,11 @@ typedef struct _cef_run_file_dialog_callback_t {
|
||||
// dialog mode. If the selection was cancelled |file_paths| will be NULL.
|
||||
///
|
||||
void(CEF_CALLBACK* on_file_dialog_dismissed)(
|
||||
struct _cef_run_file_dialog_callback_t* self, int selected_accept_filter,
|
||||
struct _cef_run_file_dialog_callback_t* self,
|
||||
int selected_accept_filter,
|
||||
cef_string_list_t file_paths);
|
||||
} cef_run_file_dialog_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Callback structure for cef_browser_host_t::GetNavigationEntries. The
|
||||
// functions of this structure will be called on the browser process UI thread.
|
||||
@@ -226,11 +231,12 @@ typedef struct _cef_navigation_entry_visitor_t {
|
||||
// the total number of entries.
|
||||
///
|
||||
int(CEF_CALLBACK* visit)(struct _cef_navigation_entry_visitor_t* self,
|
||||
struct _cef_navigation_entry_t* entry, int current, int index,
|
||||
struct _cef_navigation_entry_t* entry,
|
||||
int current,
|
||||
int index,
|
||||
int total);
|
||||
} cef_navigation_entry_visitor_t;
|
||||
|
||||
|
||||
///
|
||||
// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
|
||||
// structure will be called on the browser process UI thread.
|
||||
@@ -247,11 +253,11 @@ typedef struct _cef_pdf_print_callback_t {
|
||||
// successfully or false (0) otherwise.
|
||||
///
|
||||
void(CEF_CALLBACK* on_pdf_print_finished)(
|
||||
struct _cef_pdf_print_callback_t* self, const cef_string_t* path,
|
||||
struct _cef_pdf_print_callback_t* self,
|
||||
const cef_string_t* path,
|
||||
int ok);
|
||||
} cef_pdf_print_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Callback structure for cef_browser_host_t::DownloadImage. The functions of
|
||||
// this structure will be called on the browser process UI thread.
|
||||
@@ -270,11 +276,11 @@ typedef struct _cef_download_image_callback_t {
|
||||
///
|
||||
void(CEF_CALLBACK* on_download_image_finished)(
|
||||
struct _cef_download_image_callback_t* self,
|
||||
const cef_string_t* image_url, int http_status_code,
|
||||
const cef_string_t* image_url,
|
||||
int http_status_code,
|
||||
struct _cef_image_t* image);
|
||||
} cef_download_image_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent the browser process aspects of a browser window.
|
||||
// The functions of this structure can only be called in the browser process.
|
||||
@@ -385,9 +391,12 @@ typedef struct _cef_browser_host_t {
|
||||
// dismissed or immediately if another dialog is already pending. The dialog
|
||||
// will be initiated asynchronously on the UI thread.
|
||||
///
|
||||
void (CEF_CALLBACK *run_file_dialog)(struct _cef_browser_host_t* self,
|
||||
cef_file_dialog_mode_t mode, const cef_string_t* title,
|
||||
const cef_string_t* default_file_path, cef_string_list_t accept_filters,
|
||||
void(CEF_CALLBACK* run_file_dialog)(
|
||||
struct _cef_browser_host_t* self,
|
||||
cef_file_dialog_mode_t mode,
|
||||
const cef_string_t* title,
|
||||
const cef_string_t* default_file_path,
|
||||
cef_string_list_t accept_filters,
|
||||
int selected_accept_filter,
|
||||
struct _cef_run_file_dialog_callback_t* callback);
|
||||
|
||||
@@ -409,9 +418,13 @@ typedef struct _cef_browser_host_t {
|
||||
// unlimited. If |bypass_cache| is true (1) then |image_url| is requested from
|
||||
// the server even if it is present in the browser cache.
|
||||
///
|
||||
void (CEF_CALLBACK *download_image)(struct _cef_browser_host_t* self,
|
||||
const cef_string_t* image_url, int is_favicon, uint32 max_image_size,
|
||||
int bypass_cache, struct _cef_download_image_callback_t* callback);
|
||||
void(CEF_CALLBACK* download_image)(
|
||||
struct _cef_browser_host_t* self,
|
||||
const cef_string_t* image_url,
|
||||
int is_favicon,
|
||||
uint32 max_image_size,
|
||||
int bypass_cache,
|
||||
struct _cef_download_image_callback_t* callback);
|
||||
|
||||
///
|
||||
// Print the current browser contents.
|
||||
@@ -424,21 +437,28 @@ typedef struct _cef_browser_host_t {
|
||||
// |path| when done. For PDF printing to work on Linux you must implement the
|
||||
// cef_print_handler_t::GetPdfPaperSize function.
|
||||
///
|
||||
void (CEF_CALLBACK *print_to_pdf)(struct _cef_browser_host_t* self,
|
||||
void(CEF_CALLBACK* print_to_pdf)(
|
||||
struct _cef_browser_host_t* self,
|
||||
const cef_string_t* path,
|
||||
const struct _cef_pdf_print_settings_t* settings,
|
||||
struct _cef_pdf_print_callback_t* callback);
|
||||
|
||||
///
|
||||
// Search for |searchText|. |identifier| can be used to have multiple searches
|
||||
// running simultaniously. |forward| indicates whether to search forward or
|
||||
// backward within the page. |matchCase| indicates whether the search should
|
||||
// be case-sensitive. |findNext| indicates whether this is the first request
|
||||
// or a follow-up. The cef_find_handler_t instance, if any, returned via
|
||||
// cef_client_t::GetFindHandler will be called to report find results.
|
||||
// Search for |searchText|. |identifier| must be a unique ID and these IDs
|
||||
// must strictly increase so that newer requests always have greater IDs than
|
||||
// older requests. If |identifier| is zero or less than the previous ID value
|
||||
// then it will be automatically assigned a new valid ID. |forward| indicates
|
||||
// whether to search forward or backward within the page. |matchCase|
|
||||
// indicates whether the search should be case-sensitive. |findNext| indicates
|
||||
// whether this is the first request or a follow-up. The cef_find_handler_t
|
||||
// instance, if any, returned via cef_client_t::GetFindHandler will be called
|
||||
// to report find results.
|
||||
///
|
||||
void (CEF_CALLBACK *find)(struct _cef_browser_host_t* self, int identifier,
|
||||
const cef_string_t* searchText, int forward, int matchCase,
|
||||
void(CEF_CALLBACK* find)(struct _cef_browser_host_t* self,
|
||||
int identifier,
|
||||
const cef_string_t* searchText,
|
||||
int forward,
|
||||
int matchCase,
|
||||
int findNext);
|
||||
|
||||
///
|
||||
@@ -456,7 +476,8 @@ typedef struct _cef_browser_host_t {
|
||||
// inspected. The |windowInfo| parameter will be ignored if this browser is
|
||||
// wrapped in a cef_browser_view_t.
|
||||
///
|
||||
void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_host_t* self,
|
||||
void(CEF_CALLBACK* show_dev_tools)(
|
||||
struct _cef_browser_host_t* self,
|
||||
const struct _cef_window_info_t* windowInfo,
|
||||
struct _cef_client_t* client,
|
||||
const struct _cef_browser_settings_t* settings,
|
||||
@@ -479,14 +500,17 @@ typedef struct _cef_browser_host_t {
|
||||
// navigation entry will be sent, otherwise all navigation entries will be
|
||||
// sent.
|
||||
///
|
||||
void (CEF_CALLBACK *get_navigation_entries)(struct _cef_browser_host_t* self,
|
||||
struct _cef_navigation_entry_visitor_t* visitor, int current_only);
|
||||
void(CEF_CALLBACK* get_navigation_entries)(
|
||||
struct _cef_browser_host_t* self,
|
||||
struct _cef_navigation_entry_visitor_t* visitor,
|
||||
int current_only);
|
||||
|
||||
///
|
||||
// Set whether mouse cursor change is disabled.
|
||||
///
|
||||
void(CEF_CALLBACK* set_mouse_cursor_change_disabled)(
|
||||
struct _cef_browser_host_t* self, int disabled);
|
||||
struct _cef_browser_host_t* self,
|
||||
int disabled);
|
||||
|
||||
///
|
||||
// Returns true (1) if mouse cursor change is disabled.
|
||||
@@ -557,16 +581,21 @@ typedef struct _cef_browser_host_t {
|
||||
// Send a mouse click event to the browser. The |x| and |y| coordinates are
|
||||
// relative to the upper-left corner of the view.
|
||||
///
|
||||
void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_host_t* self,
|
||||
const struct _cef_mouse_event_t* event, cef_mouse_button_type_t type,
|
||||
int mouseUp, int clickCount);
|
||||
void(CEF_CALLBACK* send_mouse_click_event)(
|
||||
struct _cef_browser_host_t* self,
|
||||
const struct _cef_mouse_event_t* event,
|
||||
cef_mouse_button_type_t type,
|
||||
int mouseUp,
|
||||
int clickCount);
|
||||
|
||||
///
|
||||
// Send a mouse move event to the browser. The |x| and |y| coordinates are
|
||||
// relative to the upper-left corner of the view.
|
||||
///
|
||||
void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_host_t* self,
|
||||
const struct _cef_mouse_event_t* event, int mouseLeave);
|
||||
void(CEF_CALLBACK* send_mouse_move_event)(
|
||||
struct _cef_browser_host_t* self,
|
||||
const struct _cef_mouse_event_t* event,
|
||||
int mouseLeave);
|
||||
|
||||
///
|
||||
// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
|
||||
@@ -575,8 +604,11 @@ typedef struct _cef_browser_host_t {
|
||||
// In order to scroll inside select popups with window rendering disabled
|
||||
// cef_render_handler_t::GetScreenPoint should be implemented properly.
|
||||
///
|
||||
void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_host_t* self,
|
||||
const struct _cef_mouse_event_t* event, int deltaX, int deltaY);
|
||||
void(CEF_CALLBACK* send_mouse_wheel_event)(
|
||||
struct _cef_browser_host_t* self,
|
||||
const struct _cef_mouse_event_t* event,
|
||||
int deltaX,
|
||||
int deltaY);
|
||||
|
||||
///
|
||||
// Send a focus event to the browser.
|
||||
@@ -587,8 +619,7 @@ typedef struct _cef_browser_host_t {
|
||||
///
|
||||
// Send a capture lost event to the browser.
|
||||
///
|
||||
void (CEF_CALLBACK *send_capture_lost_event)(
|
||||
struct _cef_browser_host_t* self);
|
||||
void(CEF_CALLBACK* send_capture_lost_event)(struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Notify the browser that the window hosting it is about to be moved or
|
||||
@@ -615,7 +646,8 @@ typedef struct _cef_browser_host_t {
|
||||
// set at browser creation via cef_browser_tSettings.windowless_frame_rate.
|
||||
///
|
||||
void(CEF_CALLBACK* set_windowless_frame_rate)(
|
||||
struct _cef_browser_host_t* self, int frame_rate);
|
||||
struct _cef_browser_host_t* self,
|
||||
int frame_rate);
|
||||
|
||||
///
|
||||
// Begins a new composition or updates the existing composition. Blink has a
|
||||
@@ -640,8 +672,10 @@ typedef struct _cef_browser_host_t {
|
||||
//
|
||||
// This function is only used when window rendering is disabled.
|
||||
///
|
||||
void (CEF_CALLBACK *ime_set_composition)(struct _cef_browser_host_t* self,
|
||||
const cef_string_t* text, size_t underlinesCount,
|
||||
void(CEF_CALLBACK* ime_set_composition)(
|
||||
struct _cef_browser_host_t* self,
|
||||
const cef_string_t* text,
|
||||
size_t underlinesCount,
|
||||
cef_composition_underline_t const* underlines,
|
||||
const cef_range_t* replacement_range,
|
||||
const cef_range_t* selection_range);
|
||||
@@ -656,7 +690,8 @@ typedef struct _cef_browser_host_t {
|
||||
// used when window rendering is disabled.
|
||||
///
|
||||
void(CEF_CALLBACK* ime_commit_text)(struct _cef_browser_host_t* self,
|
||||
const cef_string_t* text, const cef_range_t* replacement_range,
|
||||
const cef_string_t* text,
|
||||
const cef_range_t* replacement_range,
|
||||
int relative_cursor_pos);
|
||||
|
||||
///
|
||||
@@ -666,7 +701,8 @@ typedef struct _cef_browser_host_t {
|
||||
// function is only used when window rendering is disabled.
|
||||
///
|
||||
void(CEF_CALLBACK* ime_finish_composing_text)(
|
||||
struct _cef_browser_host_t* self, int keep_selection);
|
||||
struct _cef_browser_host_t* self,
|
||||
int keep_selection);
|
||||
|
||||
///
|
||||
// Cancels the existing composition and discards the composition node contents
|
||||
@@ -684,7 +720,8 @@ typedef struct _cef_browser_host_t {
|
||||
// cef_render_handler_t::StartDragging). This function is only used when
|
||||
// window rendering is disabled.
|
||||
///
|
||||
void (CEF_CALLBACK *drag_target_drag_enter)(struct _cef_browser_host_t* self,
|
||||
void(CEF_CALLBACK* drag_target_drag_enter)(
|
||||
struct _cef_browser_host_t* self,
|
||||
struct _cef_drag_data_t* drag_data,
|
||||
const struct _cef_mouse_event_t* event,
|
||||
cef_drag_operations_mask_t allowed_ops);
|
||||
@@ -695,7 +732,8 @@ typedef struct _cef_browser_host_t {
|
||||
// DragTargetDragLeave/DragTargetDrop). This function is only used when window
|
||||
// rendering is disabled.
|
||||
///
|
||||
void (CEF_CALLBACK *drag_target_drag_over)(struct _cef_browser_host_t* self,
|
||||
void(CEF_CALLBACK* drag_target_drag_over)(
|
||||
struct _cef_browser_host_t* self,
|
||||
const struct _cef_mouse_event_t* event,
|
||||
cef_drag_operations_mask_t allowed_ops);
|
||||
|
||||
@@ -726,7 +764,9 @@ typedef struct _cef_browser_host_t {
|
||||
// disabled.
|
||||
///
|
||||
void(CEF_CALLBACK* drag_source_ended_at)(struct _cef_browser_host_t* self,
|
||||
int x, int y, cef_drag_operations_mask_t op);
|
||||
int x,
|
||||
int y,
|
||||
cef_drag_operations_mask_t op);
|
||||
|
||||
///
|
||||
// Call this function when the drag operation started by a
|
||||
@@ -745,8 +785,59 @@ typedef struct _cef_browser_host_t {
|
||||
///
|
||||
struct _cef_navigation_entry_t*(CEF_CALLBACK* get_visible_navigation_entry)(
|
||||
struct _cef_browser_host_t* self);
|
||||
} cef_browser_host_t;
|
||||
|
||||
///
|
||||
// Set accessibility state for all frames. |accessibility_state| may be
|
||||
// default, enabled or disabled. If |accessibility_state| is STATE_DEFAULT
|
||||
// then accessibility will be disabled by default and the state may be further
|
||||
// controlled with the "force-renderer-accessibility" and "disable-renderer-
|
||||
// accessibility" command-line switches. If |accessibility_state| is
|
||||
// STATE_ENABLED then accessibility will be enabled. If |accessibility_state|
|
||||
// is STATE_DISABLED then accessibility will be completely disabled.
|
||||
//
|
||||
// For windowed browsers accessibility will be enabled in Complete mode (which
|
||||
// corresponds to kAccessibilityModeComplete in Chromium). In this mode all
|
||||
// platform accessibility objects will be created and managed by Chromium's
|
||||
// internal implementation. The client needs only to detect the screen reader
|
||||
// and call this function appropriately. For example, on macOS the client can
|
||||
// handle the @"AXEnhancedUserStructure" accessibility attribute to detect
|
||||
// VoiceOver state changes and on Windows the client can handle WM_GETOBJECT
|
||||
// with OBJID_CLIENT to detect accessibility readers.
|
||||
//
|
||||
// For windowless browsers accessibility will be enabled in TreeOnly mode
|
||||
// (which corresponds to kAccessibilityModeWebContentsOnly in Chromium). In
|
||||
// this mode renderer accessibility is enabled, the full tree is computed, and
|
||||
// events are passed to CefAccessibiltyHandler, but platform accessibility
|
||||
// objects are not created. The client may implement platform accessibility
|
||||
// objects using CefAccessibiltyHandler callbacks if desired.
|
||||
///
|
||||
void(CEF_CALLBACK* set_accessibility_state)(struct _cef_browser_host_t* self,
|
||||
cef_state_t accessibility_state);
|
||||
|
||||
///
|
||||
// Enable notifications of auto resize via
|
||||
// cef_display_handler_t::OnAutoResize. Notifications are disabled by default.
|
||||
// |min_size| and |max_size| define the range of allowed sizes.
|
||||
///
|
||||
void(CEF_CALLBACK* set_auto_resize_enabled)(struct _cef_browser_host_t* self,
|
||||
int enabled,
|
||||
const cef_size_t* min_size,
|
||||
const cef_size_t* max_size);
|
||||
|
||||
///
|
||||
// Returns the extension hosted in this browser or NULL if no extension is
|
||||
// hosted. See cef_request_tContext::LoadExtension for details.
|
||||
///
|
||||
struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
|
||||
struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this browser is hosting an extension background script.
|
||||
// Background hosts do not have a window and are not displayable. See
|
||||
// cef_request_tContext::LoadExtension for details.
|
||||
///
|
||||
int(CEF_CALLBACK* is_background_host)(struct _cef_browser_host_t* self);
|
||||
} cef_browser_host_t;
|
||||
|
||||
///
|
||||
// Create a new browser window using the window parameters specified by
|
||||
@@ -756,8 +847,10 @@ typedef struct _cef_browser_host_t {
|
||||
// thread and will not block.
|
||||
///
|
||||
CEF_EXPORT int cef_browser_host_create_browser(
|
||||
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
|
||||
const cef_string_t* url, const struct _cef_browser_settings_t* settings,
|
||||
const cef_window_info_t* windowInfo,
|
||||
struct _cef_client_t* client,
|
||||
const cef_string_t* url,
|
||||
const struct _cef_browser_settings_t* settings,
|
||||
struct _cef_request_context_t* request_context);
|
||||
|
||||
///
|
||||
@@ -766,11 +859,12 @@ CEF_EXPORT int cef_browser_host_create_browser(
|
||||
// used. This function can only be called on the browser process UI thread.
|
||||
///
|
||||
CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync(
|
||||
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
|
||||
const cef_string_t* url, const struct _cef_browser_settings_t* settings,
|
||||
const cef_window_info_t* windowInfo,
|
||||
struct _cef_client_t* client,
|
||||
const cef_string_t* url,
|
||||
const struct _cef_browser_settings_t* settings,
|
||||
struct _cef_request_context_t* request_context);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=437eae6454931ccf2687f60f8050fcf216966e09$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
|
||||
@@ -47,7 +49,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used to implement browser process callbacks. The functions of this
|
||||
// structure will be called on the browser process main thread unless otherwise
|
||||
@@ -109,10 +110,10 @@ typedef struct _cef_browser_process_handler_t {
|
||||
// cancelled.
|
||||
///
|
||||
void(CEF_CALLBACK* on_schedule_message_pump_work)(
|
||||
struct _cef_browser_process_handler_t* self, int64 delay_ms);
|
||||
struct _cef_browser_process_handler_t* self,
|
||||
int64 delay_ms);
|
||||
} cef_browser_process_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=41c1f253d23f062f96debd7184f3b5e5dac03a89$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Generic callback structure used for asynchronous continuation.
|
||||
///
|
||||
@@ -65,7 +66,6 @@ typedef struct _cef_callback_t {
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_callback_t* self);
|
||||
} cef_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Generic callback structure used for asynchronous completion.
|
||||
///
|
||||
@@ -81,7 +81,6 @@ typedef struct _cef_completion_callback_t {
|
||||
void(CEF_CALLBACK* on_complete)(struct _cef_completion_callback_t* self);
|
||||
} cef_completion_callback_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1dbb0adf7ac5fd42b5a79d271834781664a7fd47$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||
@@ -46,7 +48,6 @@
|
||||
#include "include/capi/cef_drag_handler_capi.h"
|
||||
#include "include/capi/cef_find_handler_capi.h"
|
||||
#include "include/capi/cef_focus_handler_capi.h"
|
||||
#include "include/capi/cef_geolocation_handler_capi.h"
|
||||
#include "include/capi/cef_jsdialog_handler_capi.h"
|
||||
#include "include/capi/cef_keyboard_handler_capi.h"
|
||||
#include "include/capi/cef_life_span_handler_capi.h"
|
||||
@@ -59,7 +60,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to provide handler implementations.
|
||||
///
|
||||
@@ -114,13 +114,6 @@ typedef struct _cef_client_t {
|
||||
struct _cef_focus_handler_t*(CEF_CALLBACK* get_focus_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for geolocation permissions requests. If no handler is
|
||||
// provided geolocation access will be denied by default.
|
||||
///
|
||||
struct _cef_geolocation_handler_t* (CEF_CALLBACK *get_geolocation_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for JavaScript dialogs. If no handler is provided the
|
||||
// default implementation will be used.
|
||||
@@ -163,12 +156,13 @@ typedef struct _cef_client_t {
|
||||
// (1) if the message was handled or false (0) otherwise. Do not keep a
|
||||
// reference to or attempt to access the message outside of this callback.
|
||||
///
|
||||
int (CEF_CALLBACK *on_process_message_received)(struct _cef_client_t* self,
|
||||
struct _cef_browser_t* browser, cef_process_id_t source_process,
|
||||
int(CEF_CALLBACK* on_process_message_received)(
|
||||
struct _cef_client_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_process_id_t source_process,
|
||||
struct _cef_process_message_t* message);
|
||||
} cef_client_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=4e9afcf5b6d90535ea4b98c3493e242244373f9e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used to create and/or parse command line arguments. Arguments with
|
||||
// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
|
||||
@@ -85,7 +86,8 @@ typedef struct _cef_command_line_t {
|
||||
// supported on non-Windows platforms.
|
||||
///
|
||||
void(CEF_CALLBACK* init_from_argv)(struct _cef_command_line_t* self,
|
||||
int argc, const char* const* argv);
|
||||
int argc,
|
||||
const char* const* argv);
|
||||
|
||||
///
|
||||
// Initialize the command line with the string returned by calling
|
||||
@@ -145,7 +147,8 @@ typedef struct _cef_command_line_t {
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_switch_value)(
|
||||
struct _cef_command_line_t* self, const cef_string_t* name);
|
||||
struct _cef_command_line_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Returns the map of switch names and values. If a switch has no value an
|
||||
@@ -164,8 +167,8 @@ typedef struct _cef_command_line_t {
|
||||
///
|
||||
// Add a switch with the specified value to the end of the command line.
|
||||
///
|
||||
void (CEF_CALLBACK *append_switch_with_value)(
|
||||
struct _cef_command_line_t* self, const cef_string_t* name,
|
||||
void(CEF_CALLBACK* append_switch_with_value)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* name,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
@@ -193,7 +196,6 @@ typedef struct _cef_command_line_t {
|
||||
const cef_string_t* wrapper);
|
||||
} cef_command_line_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_command_line_t instance.
|
||||
///
|
||||
@@ -205,7 +207,6 @@ CEF_EXPORT cef_command_line_t* cef_command_line_create();
|
||||
///
|
||||
CEF_EXPORT cef_command_line_t* cef_command_line_get_global();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=fdd4de9c81a7b01a94aee020b2c314e519cd8e55$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
|
||||
@@ -63,7 +65,8 @@ typedef struct _cef_run_context_menu_callback_t {
|
||||
// |event_flags|.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_run_context_menu_callback_t* self,
|
||||
int command_id, cef_event_flags_t event_flags);
|
||||
int command_id,
|
||||
cef_event_flags_t event_flags);
|
||||
|
||||
///
|
||||
// Cancel context menu display.
|
||||
@@ -71,7 +74,6 @@ typedef struct _cef_run_context_menu_callback_t {
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_run_context_menu_callback_t* self);
|
||||
} cef_run_context_menu_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle context menu events. The functions of this
|
||||
// structure will be called on the UI thread.
|
||||
@@ -90,8 +92,10 @@ typedef struct _cef_context_menu_handler_t {
|
||||
// |model| outside of this callback.
|
||||
///
|
||||
void(CEF_CALLBACK* on_before_context_menu)(
|
||||
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_context_menu_params_t* params,
|
||||
struct _cef_menu_model_t* model);
|
||||
|
||||
///
|
||||
@@ -102,8 +106,10 @@ typedef struct _cef_context_menu_handler_t {
|
||||
// selected command ID. For default display return false (0). Do not keep
|
||||
// references to |params| or |model| outside of this callback.
|
||||
///
|
||||
int (CEF_CALLBACK *run_context_menu)(struct _cef_context_menu_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
int(CEF_CALLBACK* run_context_menu)(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_context_menu_params_t* params,
|
||||
struct _cef_menu_model_t* model,
|
||||
struct _cef_run_context_menu_callback_t* callback);
|
||||
@@ -118,20 +124,23 @@ typedef struct _cef_context_menu_handler_t {
|
||||
// this callback.
|
||||
///
|
||||
int(CEF_CALLBACK* on_context_menu_command)(
|
||||
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
|
||||
int command_id, cef_event_flags_t event_flags);
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_context_menu_params_t* params,
|
||||
int command_id,
|
||||
cef_event_flags_t event_flags);
|
||||
|
||||
///
|
||||
// Called when the context menu is dismissed irregardless of whether the menu
|
||||
// was NULL or a command was selected.
|
||||
///
|
||||
void(CEF_CALLBACK* on_context_menu_dismissed)(
|
||||
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame);
|
||||
} cef_context_menu_handler_t;
|
||||
|
||||
|
||||
///
|
||||
// Provides information about the context menu state. The ethods of this
|
||||
// structure can only be accessed on browser process the UI thread.
|
||||
@@ -257,7 +266,8 @@ typedef struct _cef_context_menu_params_t {
|
||||
// is one.
|
||||
///
|
||||
int(CEF_CALLBACK* get_dictionary_suggestions)(
|
||||
struct _cef_context_menu_params_t* self, cef_string_list_t suggestions);
|
||||
struct _cef_context_menu_params_t* self,
|
||||
cef_string_list_t suggestions);
|
||||
|
||||
///
|
||||
// Returns true (1) if the context menu was invoked on an editable node.
|
||||
@@ -291,7 +301,6 @@ typedef struct _cef_context_menu_params_t {
|
||||
int(CEF_CALLBACK* is_pepper_menu)(struct _cef_context_menu_params_t* self);
|
||||
} cef_context_menu_params_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=00e6d1aa80d5998d89cc272dcb199cde0add12fa$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||
@@ -65,8 +67,10 @@ typedef struct _cef_cookie_manager_t {
|
||||
// NULL it will be executed asnychronously on the IO thread after the change
|
||||
// has been applied. Must be called before any cookies are accessed.
|
||||
///
|
||||
void (CEF_CALLBACK *set_supported_schemes)(struct _cef_cookie_manager_t* self,
|
||||
cef_string_list_t schemes, struct _cef_completion_callback_t* callback);
|
||||
void(CEF_CALLBACK* set_supported_schemes)(
|
||||
struct _cef_cookie_manager_t* self,
|
||||
cef_string_list_t schemes,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Visit all cookies on the IO thread. The returned cookies are ordered by
|
||||
@@ -84,7 +88,8 @@ typedef struct _cef_cookie_manager_t {
|
||||
// Returns false (0) if cookies cannot be accessed.
|
||||
///
|
||||
int(CEF_CALLBACK* visit_url_cookies)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* url, int includeHttpOnly,
|
||||
const cef_string_t* url,
|
||||
int includeHttpOnly,
|
||||
struct _cef_cookie_visitor_t* visitor);
|
||||
|
||||
///
|
||||
@@ -97,7 +102,8 @@ typedef struct _cef_cookie_manager_t {
|
||||
// false (0) if an invalid URL is specified or if cookies cannot be accessed.
|
||||
///
|
||||
int(CEF_CALLBACK* set_cookie)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* url, const struct _cef_cookie_t* cookie,
|
||||
const cef_string_t* url,
|
||||
const struct _cef_cookie_t* cookie,
|
||||
struct _cef_set_cookie_callback_t* callback);
|
||||
|
||||
///
|
||||
@@ -111,8 +117,10 @@ typedef struct _cef_cookie_manager_t {
|
||||
// or if cookies cannot be accessed. Cookies can alternately be deleted using
|
||||
// the Visit*Cookies() functions.
|
||||
///
|
||||
int (CEF_CALLBACK *delete_cookies)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* url, const cef_string_t* cookie_name,
|
||||
int(CEF_CALLBACK* delete_cookies)(
|
||||
struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* url,
|
||||
const cef_string_t* cookie_name,
|
||||
struct _cef_delete_cookies_callback_t* callback);
|
||||
|
||||
///
|
||||
@@ -125,8 +133,10 @@ typedef struct _cef_cookie_manager_t {
|
||||
// asnychronously on the IO thread after the manager's storage has been
|
||||
// initialized. Returns false (0) if cookies cannot be accessed.
|
||||
///
|
||||
int (CEF_CALLBACK *set_storage_path)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* path, int persist_session_cookies,
|
||||
int(CEF_CALLBACK* set_storage_path)(
|
||||
struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* path,
|
||||
int persist_session_cookies,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
@@ -138,7 +148,6 @@ typedef struct _cef_cookie_manager_t {
|
||||
struct _cef_completion_callback_t* callback);
|
||||
} cef_cookie_manager_t;
|
||||
|
||||
|
||||
///
|
||||
// Returns the global cookie manager. By default data will be stored at
|
||||
// CefSettings.cache_path if specified or in memory otherwise. If |callback| is
|
||||
@@ -150,6 +159,16 @@ typedef struct _cef_cookie_manager_t {
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Returns a cookie manager that neither stores nor retrieves cookies. All usage
|
||||
// of cookies will be blocked including cookies accessed via the network
|
||||
// (request/response headers), via JavaScript (document.cookie), and via
|
||||
// cef_cookie_manager_t functions. No cookies will be displayed in DevTools. If
|
||||
// you wish to only block cookies sent via the network use the
|
||||
// cef_request_tHandler CanGetCookies and CanSetCookie functions instead.
|
||||
///
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_blocking_manager();
|
||||
|
||||
///
|
||||
// Creates a new cookie manager. If |path| is NULL data will be stored in memory
|
||||
// only. Otherwise, data will be stored at the specified |path|. To persist
|
||||
@@ -160,10 +179,10 @@ CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
||||
// manager's storage has been initialized.
|
||||
///
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager(
|
||||
const cef_string_t* path, int persist_session_cookies,
|
||||
const cef_string_t* path,
|
||||
int persist_session_cookies,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
|
||||
///
|
||||
// Structure to implement for visiting cookie values. The functions of this
|
||||
// structure will always be called on the IO thread.
|
||||
@@ -182,11 +201,12 @@ typedef struct _cef_cookie_visitor_t {
|
||||
// called if no cookies are found.
|
||||
///
|
||||
int(CEF_CALLBACK* visit)(struct _cef_cookie_visitor_t* self,
|
||||
const struct _cef_cookie_t* cookie, int count, int total,
|
||||
const struct _cef_cookie_t* cookie,
|
||||
int count,
|
||||
int total,
|
||||
int* deleteCookie);
|
||||
} cef_cookie_visitor_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure to implement to be notified of asynchronous completion via
|
||||
// cef_cookie_manager_t::set_cookie().
|
||||
@@ -205,7 +225,6 @@ typedef struct _cef_set_cookie_callback_t {
|
||||
int success);
|
||||
} cef_set_cookie_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure to implement to be notified of asynchronous completion via
|
||||
// cef_cookie_manager_t::delete_cookies().
|
||||
@@ -224,7 +243,6 @@ typedef struct _cef_delete_cookies_callback_t {
|
||||
int num_deleted);
|
||||
} cef_delete_cookies_callback_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=e4da4fab11e33d34d70714be22e6f72579586ffe$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Crash reporting is configured using an INI-style config file named
|
||||
// "crash_reporter.cfg". On Windows and Linux this file must be placed next to
|
||||
@@ -128,14 +129,12 @@ extern "C" {
|
||||
//
|
||||
// CrashKeys section:
|
||||
//
|
||||
// Any number of crash keys can be specified for use by the application. Crash
|
||||
// key values will be truncated based on the specified size (small = 63 bytes,
|
||||
// medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set
|
||||
// from any thread or process using the CefSetCrashKeyValue function. These
|
||||
// key/value pairs will be sent to the crash server along with the crash dump
|
||||
// file. Medium and large values will be chunked for submission. For example, if
|
||||
// your key is named "mykey" then the value will be broken into ordered chunks
|
||||
// and submitted using keys named "mykey-1", "mykey-2", etc.
|
||||
// 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();
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ddf4110dadc49faf08ac2744d851511c41ca403f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
|
||||
@@ -45,7 +47,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Callback structure for asynchronous continuation of file dialog requests.
|
||||
///
|
||||
@@ -63,7 +64,8 @@ typedef struct _cef_file_dialog_callback_t {
|
||||
// value is treated the same as calling cancel().
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_file_dialog_callback_t* self,
|
||||
int selected_accept_filter, cef_string_list_t file_paths);
|
||||
int selected_accept_filter,
|
||||
cef_string_list_t file_paths);
|
||||
|
||||
///
|
||||
// Cancel the file selection.
|
||||
@@ -71,7 +73,6 @@ typedef struct _cef_file_dialog_callback_t {
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_file_dialog_callback_t* self);
|
||||
} cef_file_dialog_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle dialog events. The functions of this
|
||||
// structure will be called on the browser process UI thread.
|
||||
@@ -97,14 +98,17 @@ typedef struct _cef_dialog_handler_t {
|
||||
// return true (1) and execute |callback| either inline or at a later time. To
|
||||
// display the default dialog return false (0).
|
||||
///
|
||||
int (CEF_CALLBACK *on_file_dialog)(struct _cef_dialog_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_file_dialog_mode_t mode,
|
||||
const cef_string_t* title, const cef_string_t* default_file_path,
|
||||
cef_string_list_t accept_filters, int selected_accept_filter,
|
||||
int(CEF_CALLBACK* on_file_dialog)(
|
||||
struct _cef_dialog_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_file_dialog_mode_t mode,
|
||||
const cef_string_t* title,
|
||||
const cef_string_t* default_file_path,
|
||||
cef_string_list_t accept_filters,
|
||||
int selected_accept_filter,
|
||||
struct _cef_file_dialog_callback_t* callback);
|
||||
} cef_dialog_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=c7641e41aca6bf30b9c36092861f061d2b16ff82$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||
@@ -46,7 +48,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser display state.
|
||||
// The functions of this structure will be called on the UI thread.
|
||||
@@ -61,20 +62,23 @@ typedef struct _cef_display_handler_t {
|
||||
// Called when a frame's address has changed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_address_change)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Called when the page title changes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_title_change)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_string_t* title);
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* title);
|
||||
|
||||
///
|
||||
// Called when the page icon changes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_favicon_urlchange)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_string_list_t icon_urls);
|
||||
struct _cef_browser_t* browser,
|
||||
cef_string_list_t icon_urls);
|
||||
|
||||
///
|
||||
// Called when web content in the page has toggled fullscreen mode. If
|
||||
@@ -84,7 +88,8 @@ typedef struct _cef_display_handler_t {
|
||||
// responsible for resizing the browser if desired.
|
||||
///
|
||||
void(CEF_CALLBACK* on_fullscreen_mode_change)(
|
||||
struct _cef_display_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int fullscreen);
|
||||
|
||||
///
|
||||
@@ -96,24 +101,47 @@ typedef struct _cef_display_handler_t {
|
||||
// for drawing tooltips and the return value is ignored.
|
||||
///
|
||||
int(CEF_CALLBACK* on_tooltip)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_string_t* text);
|
||||
struct _cef_browser_t* browser,
|
||||
cef_string_t* text);
|
||||
|
||||
///
|
||||
// Called when the browser receives a status message. |value| contains the
|
||||
// text that will be displayed in the status message.
|
||||
///
|
||||
void(CEF_CALLBACK* on_status_message)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_string_t* value);
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
// Called to display a console message. Return true (1) to stop the message
|
||||
// from being output to the console.
|
||||
///
|
||||
int(CEF_CALLBACK* on_console_message)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_string_t* message,
|
||||
const cef_string_t* source, int line);
|
||||
} cef_display_handler_t;
|
||||
struct _cef_browser_t* browser,
|
||||
cef_log_severity_t level,
|
||||
const cef_string_t* message,
|
||||
const cef_string_t* source,
|
||||
int line);
|
||||
|
||||
///
|
||||
// Called when auto-resize is enabled via
|
||||
// cef_browser_host_t::SetAutoResizeEnabled and the contents have auto-
|
||||
// resized. |new_size| will be the desired size in view coordinates. Return
|
||||
// true (1) if the resize was handled or false (0) for default handling.
|
||||
///
|
||||
int(CEF_CALLBACK* on_auto_resize)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_size_t* new_size);
|
||||
|
||||
///
|
||||
// Called when the overall page loading progress has changed. |progress|
|
||||
// ranges from 0.0 to 1.0.
|
||||
///
|
||||
void(CEF_CALLBACK* on_loading_progress_change)(
|
||||
struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
double progress);
|
||||
} cef_display_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=b9bef5257ecbd1933356fcc02687bf725bff9277$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
|
||||
@@ -68,7 +70,6 @@ typedef struct _cef_domvisitor_t {
|
||||
struct _cef_domdocument_t* document);
|
||||
} cef_domvisitor_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a DOM document. The functions of this structure
|
||||
// should only be called on the render process main thread thread.
|
||||
@@ -114,7 +115,8 @@ typedef struct _cef_domdocument_t {
|
||||
// Returns the document element with the specified ID value.
|
||||
///
|
||||
struct _cef_domnode_t*(CEF_CALLBACK* get_element_by_id)(
|
||||
struct _cef_domdocument_t* self, const cef_string_t* id);
|
||||
struct _cef_domdocument_t* self,
|
||||
const cef_string_t* id);
|
||||
|
||||
///
|
||||
// Returns the node that currently has keyboard focus.
|
||||
@@ -165,10 +167,10 @@ typedef struct _cef_domdocument_t {
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_complete_url)(
|
||||
struct _cef_domdocument_t* self, const cef_string_t* partialURL);
|
||||
struct _cef_domdocument_t* self,
|
||||
const cef_string_t* partialURL);
|
||||
} cef_domdocument_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a DOM node. The functions of this structure
|
||||
// should only be called on the render process main thread.
|
||||
@@ -252,8 +254,7 @@ typedef struct _cef_domnode_t {
|
||||
///
|
||||
// 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.
|
||||
@@ -284,7 +285,6 @@ typedef struct _cef_domnode_t {
|
||||
struct _cef_domnode_t*(CEF_CALLBACK* get_last_child)(
|
||||
struct _cef_domnode_t* self);
|
||||
|
||||
|
||||
// The following functions are valid only for element nodes.
|
||||
|
||||
///
|
||||
@@ -310,7 +310,8 @@ typedef struct _cef_domnode_t {
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_element_attribute)(
|
||||
struct _cef_domnode_t* self, const cef_string_t* attrName);
|
||||
struct _cef_domnode_t* self,
|
||||
const cef_string_t* attrName);
|
||||
|
||||
///
|
||||
// Returns a map of all element attributes.
|
||||
@@ -323,7 +324,8 @@ typedef struct _cef_domnode_t {
|
||||
// on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_element_attribute)(struct _cef_domnode_t* self,
|
||||
const cef_string_t* attrName, const cef_string_t* value);
|
||||
const cef_string_t* attrName,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
// Returns the inner text of the element.
|
||||
@@ -338,7 +340,6 @@ typedef struct _cef_domnode_t {
|
||||
cef_rect_t(CEF_CALLBACK* get_element_bounds)(struct _cef_domnode_t* self);
|
||||
} cef_domnode_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=d9cedd8c411dd064eacde55a95d6e05303dea365$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
|
||||
@@ -46,7 +48,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Callback structure used to asynchronously continue a download.
|
||||
///
|
||||
@@ -63,10 +64,10 @@ typedef struct _cef_before_download_callback_t {
|
||||
// (1) if you do wish to show the default "Save As" dialog.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_before_download_callback_t* self,
|
||||
const cef_string_t* download_path, int show_dialog);
|
||||
const cef_string_t* download_path,
|
||||
int show_dialog);
|
||||
} cef_before_download_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Callback structure used to asynchronously cancel a download.
|
||||
///
|
||||
@@ -92,7 +93,6 @@ typedef struct _cef_download_item_callback_t {
|
||||
void(CEF_CALLBACK* resume)(struct _cef_download_item_callback_t* self);
|
||||
} cef_download_item_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to handle file downloads. The functions of this structure will
|
||||
// called on the browser process UI thread.
|
||||
@@ -110,7 +110,8 @@ typedef struct _cef_download_handler_t {
|
||||
// download if desired. Do not keep a reference to |download_item| outside of
|
||||
// this function.
|
||||
///
|
||||
void (CEF_CALLBACK *on_before_download)(struct _cef_download_handler_t* self,
|
||||
void(CEF_CALLBACK* on_before_download)(
|
||||
struct _cef_download_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_download_item_t* download_item,
|
||||
const cef_string_t* suggested_name,
|
||||
@@ -123,13 +124,13 @@ typedef struct _cef_download_handler_t {
|
||||
// download if desired. Do not keep a reference to |download_item| outside of
|
||||
// this function.
|
||||
///
|
||||
void (CEF_CALLBACK *on_download_updated)(struct _cef_download_handler_t* self,
|
||||
void(CEF_CALLBACK* on_download_updated)(
|
||||
struct _cef_download_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_download_item_t* download_item,
|
||||
struct _cef_download_item_callback_t* callback);
|
||||
} cef_download_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=c17ff4fd6d85b1db10dce2e1a5dbea5a4b17e4da$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a download item.
|
||||
///
|
||||
@@ -154,7 +155,6 @@ typedef struct _cef_download_item_t {
|
||||
struct _cef_download_item_t* self);
|
||||
} cef_download_item_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,19 +33,21 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=b72ebf98f79f28a18366c037e65e98326d4a350a$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_image_capi.h"
|
||||
#include "include/capi/cef_stream_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent drag data. The functions of this structure may be
|
||||
// called on any thread.
|
||||
@@ -194,16 +196,31 @@ typedef struct _cef_drag_data_t {
|
||||
// Add a file that is being dragged into the webview.
|
||||
///
|
||||
void(CEF_CALLBACK* add_file)(struct _cef_drag_data_t* self,
|
||||
const cef_string_t* path, const cef_string_t* display_name);
|
||||
} cef_drag_data_t;
|
||||
const cef_string_t* path,
|
||||
const cef_string_t* display_name);
|
||||
|
||||
///
|
||||
// Get the image representation of drag data. May return NULL if no image
|
||||
// representation is available.
|
||||
///
|
||||
struct _cef_image_t*(CEF_CALLBACK* get_image)(struct _cef_drag_data_t* self);
|
||||
|
||||
///
|
||||
// Get the image hotspot (drag start location relative to image dimensions).
|
||||
///
|
||||
cef_point_t(CEF_CALLBACK* get_image_hotspot)(struct _cef_drag_data_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if an image representation of drag data is available.
|
||||
///
|
||||
int(CEF_CALLBACK* has_image)(struct _cef_drag_data_t* self);
|
||||
} cef_drag_data_t;
|
||||
|
||||
///
|
||||
// Create a new cef_drag_data_t object.
|
||||
///
|
||||
CEF_EXPORT cef_drag_data_t* cef_drag_data_create();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=88d9a33295e7fb7238bcb18b25d12906ba4cb791$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
|
||||
@@ -46,7 +48,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to dragging. The functions
|
||||
// of this structure will be called on the UI thread.
|
||||
@@ -64,7 +65,8 @@ typedef struct _cef_drag_handler_t {
|
||||
// to cancel the drag event.
|
||||
///
|
||||
int(CEF_CALLBACK* on_drag_enter)(struct _cef_drag_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_drag_data_t* dragData,
|
||||
cef_drag_operations_mask_t mask);
|
||||
|
||||
///
|
||||
@@ -75,11 +77,12 @@ typedef struct _cef_drag_handler_t {
|
||||
// this function will be called with an NULL vector.
|
||||
///
|
||||
void(CEF_CALLBACK* on_draggable_regions_changed)(
|
||||
struct _cef_drag_handler_t* self, struct _cef_browser_t* browser,
|
||||
size_t regionsCount, cef_draggable_region_t const* regions);
|
||||
struct _cef_drag_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
size_t regionsCount,
|
||||
cef_draggable_region_t const* regions);
|
||||
} cef_drag_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
130
include/capi/cef_extension_capi.h
Normal file
130
include/capi/cef_extension_capi.h
Normal file
@@ -0,0 +1,130 @@
|
||||
// Copyright (c) 2018 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=b681f766235613cce8a09617e7ffb76fee5545a2$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_extension_handler_t;
|
||||
struct _cef_request_context_t;
|
||||
|
||||
///
|
||||
// Object representing an extension. Methods may be called on any thread unless
|
||||
// otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_extension_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns the unique extension identifier. This is calculated based on the
|
||||
// extension public key, if available, or on the extension path. See
|
||||
// https://developer.chrome.com/extensions/manifest/key for details.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
|
||||
struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Returns the absolute path to the extension directory on disk. This value
|
||||
// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to
|
||||
// cef_request_tContext::LoadExtension.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_path)(struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Returns the extension manifest contents as a cef_dictionary_value_t object.
|
||||
// See https://developer.chrome.com/extensions/manifest for details.
|
||||
///
|
||||
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_manifest)(
|
||||
struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is the same extension as |that| object.
|
||||
// Extensions are considered the same if identifier, path and loader context
|
||||
// match.
|
||||
///
|
||||
int(CEF_CALLBACK* is_same)(struct _cef_extension_t* self,
|
||||
struct _cef_extension_t* that);
|
||||
|
||||
///
|
||||
// Returns the handler for this extension. Will return NULL for internal
|
||||
// extensions or if no handler was passed to
|
||||
// cef_request_tContext::LoadExtension.
|
||||
///
|
||||
struct _cef_extension_handler_t*(CEF_CALLBACK* get_handler)(
|
||||
struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Returns the request context that loaded this extension. Will return NULL
|
||||
// for internal extensions or if the extension has been unloaded. See the
|
||||
// cef_request_tContext::LoadExtension documentation for more information
|
||||
// about loader contexts. Must be called on the browser process UI thread.
|
||||
///
|
||||
struct _cef_request_context_t*(CEF_CALLBACK* get_loader_context)(
|
||||
struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this extension is currently loaded. Must be called on
|
||||
// the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* is_loaded)(struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Unload this extension if it is not an internal extension and is currently
|
||||
// loaded. Will result in a call to
|
||||
// cef_extension_tHandler::OnExtensionUnloaded on success.
|
||||
///
|
||||
void(CEF_CALLBACK* unload)(struct _cef_extension_t* self);
|
||||
} cef_extension_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
|
210
include/capi/cef_extension_handler_capi.h
Normal file
210
include/capi/cef_extension_handler_capi.h
Normal file
@@ -0,0 +1,210 @@
|
||||
// Copyright (c) 2018 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=9ce34129b7058aaba2e2f77cd63e3edb23e70bb7$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_browser_capi.h"
|
||||
#include "include/capi/cef_extension_capi.h"
|
||||
#include "include/capi/cef_stream_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_client_t;
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of
|
||||
// cef_extension_tHandler::GetExtensionResource.
|
||||
///
|
||||
typedef struct _cef_get_extension_resource_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Continue the request. Read the resource contents from |stream|.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_get_extension_resource_callback_t* self,
|
||||
struct _cef_stream_reader_t* stream);
|
||||
|
||||
///
|
||||
// Cancel the request.
|
||||
///
|
||||
void(CEF_CALLBACK* cancel)(
|
||||
struct _cef_get_extension_resource_callback_t* self);
|
||||
} cef_get_extension_resource_callback_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser extensions. The
|
||||
// functions of this structure will be called on the UI thread. See
|
||||
// cef_request_tContext::LoadExtension for information about extension loading.
|
||||
///
|
||||
typedef struct _cef_extension_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called if the cef_request_tContext::LoadExtension request fails. |result|
|
||||
// will be the error code.
|
||||
///
|
||||
void(CEF_CALLBACK* on_extension_load_failed)(
|
||||
struct _cef_extension_handler_t* self,
|
||||
cef_errorcode_t result);
|
||||
|
||||
///
|
||||
// Called if the cef_request_tContext::LoadExtension request succeeds.
|
||||
// |extension| is the loaded extension.
|
||||
///
|
||||
void(CEF_CALLBACK* on_extension_loaded)(struct _cef_extension_handler_t* self,
|
||||
struct _cef_extension_t* extension);
|
||||
|
||||
///
|
||||
// Called after the cef_extension_t::Unload request has completed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_extension_unloaded)(
|
||||
struct _cef_extension_handler_t* self,
|
||||
struct _cef_extension_t* extension);
|
||||
|
||||
///
|
||||
// Called when an extension needs a browser to host a background script
|
||||
// specified via the "background" manifest key. The browser will have no
|
||||
// visible window and cannot be displayed. |extension| is the extension that
|
||||
// is loading the background script. |url| is an internally generated
|
||||
// reference to an HTML page that will be used to load the background script
|
||||
// via a <script> src attribute. To allow creation of the browser optionally
|
||||
// modify |client| and |settings| and return false (0). To cancel creation of
|
||||
// the browser (and consequently cancel load of the background script) return
|
||||
// true (1). Successful creation will be indicated by a call to
|
||||
// cef_life_span_handler_t::OnAfterCreated, and
|
||||
// cef_browser_host_t::IsBackgroundHost will return true (1) for the resulting
|
||||
// browser. See https://developer.chrome.com/extensions/event_pages for more
|
||||
// information about extension background script usage.
|
||||
///
|
||||
int(CEF_CALLBACK* on_before_background_browser)(
|
||||
struct _cef_extension_handler_t* self,
|
||||
struct _cef_extension_t* extension,
|
||||
const cef_string_t* url,
|
||||
struct _cef_client_t** client,
|
||||
struct _cef_browser_settings_t* settings);
|
||||
|
||||
///
|
||||
// Called when an extension API (e.g. chrome.tabs.create) requests creation of
|
||||
// a new browser. |extension| and |browser| are the source of the API call.
|
||||
// |active_browser| may optionally be specified via the windowId property or
|
||||
// returned via the get_active_browser() callback and provides the default
|
||||
// |client| and |settings| values for the new browser. |index| is the position
|
||||
// value optionally specified via the index property. |url| is the URL that
|
||||
// will be loaded in the browser. |active| is true (1) if the new browser
|
||||
// should be active when opened. To allow creation of the browser optionally
|
||||
// modify |windowInfo|, |client| and |settings| and return false (0). To
|
||||
// cancel creation of the browser return true (1). Successful creation will be
|
||||
// indicated by a call to cef_life_span_handler_t::OnAfterCreated. Any
|
||||
// modifications to |windowInfo| will be ignored if |active_browser| is
|
||||
// wrapped in a cef_browser_view_t.
|
||||
///
|
||||
int(CEF_CALLBACK* on_before_browser)(
|
||||
struct _cef_extension_handler_t* self,
|
||||
struct _cef_extension_t* extension,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_browser_t* active_browser,
|
||||
int index,
|
||||
const cef_string_t* url,
|
||||
int active,
|
||||
struct _cef_window_info_t* windowInfo,
|
||||
struct _cef_client_t** client,
|
||||
struct _cef_browser_settings_t* settings);
|
||||
|
||||
///
|
||||
// Called when no tabId is specified to an extension API call that accepts a
|
||||
// tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the
|
||||
// source of the API call. Return the browser that will be acted on by the API
|
||||
// call or return NULL to act on |browser|. The returned browser must share
|
||||
// the same cef_request_tContext as |browser|. Incognito browsers should not
|
||||
// be considered unless the source extension has incognito access enabled, in
|
||||
// which case |include_incognito| will be true (1).
|
||||
///
|
||||
struct _cef_browser_t*(CEF_CALLBACK* get_active_browser)(
|
||||
struct _cef_extension_handler_t* self,
|
||||
struct _cef_extension_t* extension,
|
||||
struct _cef_browser_t* browser,
|
||||
int include_incognito);
|
||||
|
||||
///
|
||||
// Called when the tabId associated with |target_browser| is specified to an
|
||||
// extension API call that accepts a tabId parameter (e.g. chrome.tabs.*).
|
||||
// |extension| and |browser| are the source of the API call. Return true (1)
|
||||
// to allow access of false (0) to deny access. Access to incognito browsers
|
||||
// should not be allowed unless the source extension has incognito access
|
||||
// enabled, in which case |include_incognito| will be true (1).
|
||||
///
|
||||
int(CEF_CALLBACK* can_access_browser)(struct _cef_extension_handler_t* self,
|
||||
struct _cef_extension_t* extension,
|
||||
struct _cef_browser_t* browser,
|
||||
int include_incognito,
|
||||
struct _cef_browser_t* target_browser);
|
||||
|
||||
///
|
||||
// Called to retrieve an extension resource that would normally be loaded from
|
||||
// disk (e.g. if a file parameter is specified to chrome.tabs.executeScript).
|
||||
// |extension| and |browser| are the source of the resource request. |file| is
|
||||
// the requested relative file path. To handle the resource request return
|
||||
// true (1) and execute |callback| either synchronously or asynchronously. For
|
||||
// the default behavior which reads the resource from the extension directory
|
||||
// on disk return false (0). Localization substitutions will not be applied to
|
||||
// resources handled via this function.
|
||||
///
|
||||
int(CEF_CALLBACK* get_extension_resource)(
|
||||
struct _cef_extension_handler_t* self,
|
||||
struct _cef_extension_t* extension,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* file,
|
||||
struct _cef_get_extension_resource_callback_t* callback);
|
||||
} cef_extension_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=51f4b75a01dbf07fda0eb4bdbbe7a7f3d3b13bdb$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Creates a directory and all parent directories if they don't already exist.
|
||||
// Returns true (1) on successful creation or if the directory already exists.
|
||||
@@ -82,7 +83,8 @@ CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix,
|
||||
// or IO threads is not allowed.
|
||||
///
|
||||
CEF_EXPORT int cef_create_temp_directory_in_directory(
|
||||
const cef_string_t* base_dir, const cef_string_t* prefix,
|
||||
const cef_string_t* base_dir,
|
||||
const cef_string_t* prefix,
|
||||
cef_string_t* new_dir);
|
||||
|
||||
///
|
||||
@@ -109,7 +111,18 @@ CEF_EXPORT int cef_delete_file(const cef_string_t* path, int recursive);
|
||||
// or IO threads is not allowed.
|
||||
///
|
||||
CEF_EXPORT int cef_zip_directory(const cef_string_t* src_dir,
|
||||
const cef_string_t* dest_file, int include_hidden_files);
|
||||
const cef_string_t* dest_file,
|
||||
int include_hidden_files);
|
||||
|
||||
///
|
||||
// Loads the existing "Certificate Revocation Lists" file that is managed by
|
||||
// Google Chrome. This file can generally be found in Chrome's User Data
|
||||
// directory (e.g. "C:\Users\[User]\AppData\Local\Google\Chrome\User Data\" on
|
||||
// Windows) and is updated periodically by Chrome's component updater service.
|
||||
// Must be called in the browser process after the context has been initialized.
|
||||
// See https://dev.chromium.org/Home/chromium-security/crlsets for background.
|
||||
///
|
||||
CEF_EXPORT void cef_load_crlsets_file(const cef_string_t* path);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=200ff1e9b7fac8d0eda63bbbaec68225570bc099$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
||||
@@ -45,7 +47,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to find results. The
|
||||
// functions of this structure will be called on the UI thread.
|
||||
@@ -65,12 +66,14 @@ typedef struct _cef_find_handler_t {
|
||||
// this is the last find notification.
|
||||
///
|
||||
void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self,
|
||||
struct _cef_browser_t* browser, int identifier, int count,
|
||||
const cef_rect_t* selectionRect, int activeMatchOrdinal,
|
||||
struct _cef_browser_t* browser,
|
||||
int identifier,
|
||||
int count,
|
||||
const cef_rect_t* selectionRect,
|
||||
int activeMatchOrdinal,
|
||||
int finalUpdate);
|
||||
} cef_find_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=365c6d4385b860543225e086dc973609fbfdedc8$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
|
||||
@@ -47,7 +49,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to focus. The functions of
|
||||
// this structure will be called on the UI thread.
|
||||
@@ -65,7 +66,8 @@ typedef struct _cef_focus_handler_t {
|
||||
// false (0) if the browser is giving focus to the previous component.
|
||||
///
|
||||
void(CEF_CALLBACK* on_take_focus)(struct _cef_focus_handler_t* self,
|
||||
struct _cef_browser_t* browser, int next);
|
||||
struct _cef_browser_t* browser,
|
||||
int next);
|
||||
|
||||
///
|
||||
// Called when the browser component is requesting focus. |source| indicates
|
||||
@@ -73,7 +75,8 @@ typedef struct _cef_focus_handler_t {
|
||||
// focus to be set or true (1) to cancel setting the focus.
|
||||
///
|
||||
int(CEF_CALLBACK* on_set_focus)(struct _cef_focus_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_focus_source_t source);
|
||||
struct _cef_browser_t* browser,
|
||||
cef_focus_source_t source);
|
||||
|
||||
///
|
||||
// Called when the browser component has received focus.
|
||||
@@ -82,7 +85,6 @@ typedef struct _cef_focus_handler_t {
|
||||
struct _cef_browser_t* browser);
|
||||
} cef_focus_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=9495bafa6c18cf4a250f4933c39fb2c4597e4212$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
||||
@@ -142,7 +144,8 @@ typedef struct _cef_frame_t {
|
||||
// link clicks and web security restrictions may not behave as expected.
|
||||
///
|
||||
void(CEF_CALLBACK* load_string)(struct _cef_frame_t* self,
|
||||
const cef_string_t* string_val, const cef_string_t* url);
|
||||
const cef_string_t* string_val,
|
||||
const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Execute a string of JavaScript code in this frame. The |script_url|
|
||||
@@ -152,7 +155,8 @@ typedef struct _cef_frame_t {
|
||||
// reporting.
|
||||
///
|
||||
void(CEF_CALLBACK* execute_java_script)(struct _cef_frame_t* self,
|
||||
const cef_string_t* code, const cef_string_t* script_url,
|
||||
const cef_string_t* code,
|
||||
const cef_string_t* script_url,
|
||||
int start_line);
|
||||
|
||||
///
|
||||
@@ -213,7 +217,6 @@ typedef struct _cef_frame_t {
|
||||
struct _cef_domvisitor_t* visitor);
|
||||
} cef_frame_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=7e5e6dfee8fe6c6bc17b8d58d3e5ddfa8537e2c5$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
||||
@@ -45,7 +47,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Container for a single image represented at different scale factors. All
|
||||
// image representations should be the same size in density independent pixel
|
||||
@@ -79,9 +80,13 @@ typedef struct _cef_image_t {
|
||||
// pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in size.
|
||||
// |color_type| and |alpha_type| values specify the pixel format.
|
||||
///
|
||||
int (CEF_CALLBACK *add_bitmap)(struct _cef_image_t* self, float scale_factor,
|
||||
int pixel_width, int pixel_height, cef_color_type_t color_type,
|
||||
cef_alpha_type_t alpha_type, const void* pixel_data,
|
||||
int(CEF_CALLBACK* add_bitmap)(struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
int pixel_width,
|
||||
int pixel_height,
|
||||
cef_color_type_t color_type,
|
||||
cef_alpha_type_t alpha_type,
|
||||
const void* pixel_data,
|
||||
size_t pixel_data_size);
|
||||
|
||||
///
|
||||
@@ -89,16 +94,20 @@ typedef struct _cef_image_t {
|
||||
// data of size |png_data_size|. Any alpha transparency in the PNG data will
|
||||
// be maintained.
|
||||
///
|
||||
int (CEF_CALLBACK *add_png)(struct _cef_image_t* self, float scale_factor,
|
||||
const void* png_data, size_t png_data_size);
|
||||
int(CEF_CALLBACK* add_png)(struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
const void* png_data,
|
||||
size_t png_data_size);
|
||||
|
||||
///
|
||||
// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
|
||||
// image data of size |jpeg_data_size|. The JPEG format does not support
|
||||
// transparency so the alpha byte will be set to 0xFF for all pixels.
|
||||
///
|
||||
int (CEF_CALLBACK *add_jpeg)(struct _cef_image_t* self, float scale_factor,
|
||||
const void* jpeg_data, size_t jpeg_data_size);
|
||||
int(CEF_CALLBACK* add_jpeg)(struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
const void* jpeg_data,
|
||||
size_t jpeg_data_size);
|
||||
|
||||
///
|
||||
// Returns the image width in density independent pixel (DIP) units.
|
||||
@@ -130,7 +139,9 @@ typedef struct _cef_image_t {
|
||||
// size in pixel coordinates. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* get_representation_info)(struct _cef_image_t* self,
|
||||
float scale_factor, float* actual_scale_factor, int* pixel_width,
|
||||
float scale_factor,
|
||||
float* actual_scale_factor,
|
||||
int* pixel_width,
|
||||
int* pixel_height);
|
||||
|
||||
///
|
||||
@@ -142,9 +153,12 @@ typedef struct _cef_image_t {
|
||||
// on failure.
|
||||
///
|
||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_bitmap)(
|
||||
struct _cef_image_t* self, float scale_factor,
|
||||
cef_color_type_t color_type, cef_alpha_type_t alpha_type,
|
||||
int* pixel_width, int* pixel_height);
|
||||
struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
cef_color_type_t color_type,
|
||||
cef_alpha_type_t alpha_type,
|
||||
int* pixel_width,
|
||||
int* pixel_height);
|
||||
|
||||
///
|
||||
// Returns the PNG representation that most closely matches |scale_factor|. If
|
||||
@@ -155,8 +169,11 @@ typedef struct _cef_image_t {
|
||||
// failure.
|
||||
///
|
||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_png)(
|
||||
struct _cef_image_t* self, float scale_factor, int with_transparency,
|
||||
int* pixel_width, int* pixel_height);
|
||||
struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
int with_transparency,
|
||||
int* pixel_width,
|
||||
int* pixel_height);
|
||||
|
||||
///
|
||||
// Returns the JPEG representation that most closely matches |scale_factor|.
|
||||
@@ -168,18 +185,19 @@ typedef struct _cef_image_t {
|
||||
// failure.
|
||||
///
|
||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_jpeg)(
|
||||
struct _cef_image_t* self, float scale_factor, int quality,
|
||||
int* pixel_width, int* pixel_height);
|
||||
struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
int quality,
|
||||
int* pixel_width,
|
||||
int* pixel_height);
|
||||
} cef_image_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_image_t. It will initially be NULL. Use the Add*() functions
|
||||
// to add representations at different scale factors.
|
||||
///
|
||||
CEF_EXPORT cef_image_t* cef_image_create();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f4cd52053981d473b0a5be80d04bd8239d831d46$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
|
||||
@@ -45,7 +47,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of JavaScript dialog
|
||||
// requests.
|
||||
@@ -60,11 +61,11 @@ typedef struct _cef_jsdialog_callback_t {
|
||||
// Continue the JS dialog request. Set |success| to true (1) if the OK button
|
||||
// was pressed. The |user_input| value should be specified for prompt dialogs.
|
||||
///
|
||||
void (CEF_CALLBACK *cont)(struct _cef_jsdialog_callback_t* self, int success,
|
||||
void(CEF_CALLBACK* cont)(struct _cef_jsdialog_callback_t* self,
|
||||
int success,
|
||||
const cef_string_t* user_input);
|
||||
} cef_jsdialog_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to JavaScript dialogs. The
|
||||
// functions of this structure will be called on the UI thread.
|
||||
@@ -93,10 +94,13 @@ typedef struct _cef_jsdialog_handler_t {
|
||||
// dismissed.
|
||||
///
|
||||
int(CEF_CALLBACK* on_jsdialog)(struct _cef_jsdialog_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_string_t* origin_url,
|
||||
cef_jsdialog_type_t dialog_type, const cef_string_t* message_text,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* origin_url,
|
||||
cef_jsdialog_type_t dialog_type,
|
||||
const cef_string_t* message_text,
|
||||
const cef_string_t* default_prompt_text,
|
||||
struct _cef_jsdialog_callback_t* callback, int* suppress_message);
|
||||
struct _cef_jsdialog_callback_t* callback,
|
||||
int* suppress_message);
|
||||
|
||||
///
|
||||
// Called to run a dialog asking the user if they want to leave a page. Return
|
||||
@@ -107,8 +111,10 @@ typedef struct _cef_jsdialog_handler_t {
|
||||
// dialog is dismissed.
|
||||
///
|
||||
int(CEF_CALLBACK* on_before_unload_dialog)(
|
||||
struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser,
|
||||
const cef_string_t* message_text, int is_reload,
|
||||
struct _cef_jsdialog_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* message_text,
|
||||
int is_reload,
|
||||
struct _cef_jsdialog_callback_t* callback);
|
||||
|
||||
///
|
||||
@@ -117,7 +123,8 @@ typedef struct _cef_jsdialog_handler_t {
|
||||
// dialogs are currently pending.
|
||||
///
|
||||
void(CEF_CALLBACK* on_reset_dialog_state)(
|
||||
struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser);
|
||||
struct _cef_jsdialog_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called when the default implementation dialog is closed.
|
||||
@@ -126,7 +133,6 @@ typedef struct _cef_jsdialog_handler_t {
|
||||
struct _cef_browser_t* browser);
|
||||
} cef_jsdialog_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=7efb9ec2ee02bb511c1d0363b8c4d235a6170cad$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
|
||||
@@ -45,7 +47,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to keyboard input. The
|
||||
// functions of this structure will be called on the UI thread.
|
||||
@@ -64,8 +65,10 @@ typedef struct _cef_keyboard_handler_t {
|
||||
// shortcut set |is_keyboard_shortcut| to true (1) and return false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* on_pre_key_event)(struct _cef_keyboard_handler_t* self,
|
||||
struct _cef_browser_t* browser, const struct _cef_key_event_t* event,
|
||||
cef_event_handle_t os_event, int* is_keyboard_shortcut);
|
||||
struct _cef_browser_t* browser,
|
||||
const struct _cef_key_event_t* event,
|
||||
cef_event_handle_t os_event,
|
||||
int* is_keyboard_shortcut);
|
||||
|
||||
///
|
||||
// Called after the renderer and JavaScript in the page has had a chance to
|
||||
@@ -74,11 +77,11 @@ typedef struct _cef_keyboard_handler_t {
|
||||
// if the keyboard event was handled or false (0) otherwise.
|
||||
///
|
||||
int(CEF_CALLBACK* on_key_event)(struct _cef_keyboard_handler_t* self,
|
||||
struct _cef_browser_t* browser, const struct _cef_key_event_t* event,
|
||||
struct _cef_browser_t* browser,
|
||||
const struct _cef_key_event_t* event,
|
||||
cef_event_handle_t os_event);
|
||||
} cef_keyboard_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=eca8f0216a3430fad8ff3714a0ef65ed27e02f0e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||
@@ -59,7 +61,7 @@ typedef struct _cef_life_span_handler_t {
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the IO 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. The
|
||||
// |target_url| and |target_frame_name| values indicate where the popup
|
||||
// browser should navigate and may be NULL if not specified with the request.
|
||||
@@ -76,15 +78,23 @@ typedef struct _cef_life_span_handler_t {
|
||||
// is set to false (0) the new browser will not be scriptable and may not be
|
||||
// hosted in the same renderer process as the source browser. Any
|
||||
// modifications to |windowInfo| will be ignored if the parent browser is
|
||||
// wrapped in a cef_browser_view_t.
|
||||
// wrapped in a cef_browser_view_t. Popup browser creation will be canceled if
|
||||
// the parent browser is destroyed before the popup browser creation completes
|
||||
// (indicated by a call to OnAfterCreated for the popup browser).
|
||||
///
|
||||
int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
const cef_string_t* target_url, const cef_string_t* target_frame_name,
|
||||
cef_window_open_disposition_t target_disposition, int user_gesture,
|
||||
int(CEF_CALLBACK* on_before_popup)(
|
||||
struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
const cef_string_t* target_url,
|
||||
const cef_string_t* target_frame_name,
|
||||
cef_window_open_disposition_t target_disposition,
|
||||
int user_gesture,
|
||||
const struct _cef_popup_features_t* popupFeatures,
|
||||
struct _cef_window_info_t* windowInfo, struct _cef_client_t** client,
|
||||
struct _cef_browser_settings_t* settings, int* no_javascript_access);
|
||||
struct _cef_window_info_t* windowInfo,
|
||||
struct _cef_client_t** client,
|
||||
struct _cef_browser_settings_t* settings,
|
||||
int* no_javascript_access);
|
||||
|
||||
///
|
||||
// Called after a new browser is created. This callback will be the first
|
||||
@@ -196,7 +206,6 @@ typedef struct _cef_life_span_handler_t {
|
||||
struct _cef_browser_t* browser);
|
||||
} cef_life_span_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=94b07e1d76b57fbd125f0cc8d78298ff119f1822$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
||||
@@ -46,7 +48,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser load status. The
|
||||
// functions of this structure will be called on the browser process UI thread
|
||||
@@ -66,22 +67,26 @@ typedef struct _cef_load_handler_t {
|
||||
// calls to OnLoadError and/or OnLoadEnd.
|
||||
///
|
||||
void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser, int isLoading, int canGoBack,
|
||||
struct _cef_browser_t* browser,
|
||||
int isLoading,
|
||||
int canGoBack,
|
||||
int canGoForward);
|
||||
|
||||
///
|
||||
// Called when the browser begins loading a frame. The |frame| value will
|
||||
// never be NULL -- call the is_main() function to check if this frame is the
|
||||
// main frame. |transition_type| provides information about the source of the
|
||||
// navigation and an accurate value is only available in the browser process.
|
||||
// Multiple frames may be loading at the same time. Sub-frames may start or
|
||||
// continue loading after the main frame load has ended. This function will
|
||||
// always be called for all frames irrespective of whether the request
|
||||
// completes successfully. For notification of overall browser load status use
|
||||
// OnLoadingStateChange instead.
|
||||
// Called after a navigation has been committed and before the browser begins
|
||||
// loading contents in the frame. The |frame| value will never be NULL -- call
|
||||
// the is_main() function to check if this frame is the main frame.
|
||||
// |transition_type| provides information about the source of the navigation
|
||||
// and an accurate value is only available in the browser process. Multiple
|
||||
// frames may be loading at the same time. Sub-frames may start or continue
|
||||
// loading after the main frame load has ended. This function will not be
|
||||
// called for same page navigations (fragments, history state, etc.) or for
|
||||
// navigations that fail or are canceled before commit. For notification of
|
||||
// overall browser load status use OnLoadingStateChange instead.
|
||||
///
|
||||
void(CEF_CALLBACK* on_load_start)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
cef_transition_type_t transition_type);
|
||||
|
||||
///
|
||||
@@ -89,27 +94,31 @@ typedef struct _cef_load_handler_t {
|
||||
// never be NULL -- call the is_main() function to check if this frame is the
|
||||
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
||||
// start or continue loading after the main frame load has ended. This
|
||||
// function will always be called for all frames irrespective of whether the
|
||||
// request completes successfully. For notification of overall browser load
|
||||
// status use OnLoadingStateChange instead.
|
||||
// function will not be called for same page navigations (fragments, history
|
||||
// state, etc.) or for navigations that fail or are canceled before commit.
|
||||
// For notification of overall browser load status use OnLoadingStateChange
|
||||
// instead.
|
||||
///
|
||||
void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
int httpStatusCode);
|
||||
|
||||
///
|
||||
// Called when the resource load for a navigation fails or is canceled.
|
||||
// |errorCode| is the error code number, |errorText| is the error text and
|
||||
// |failedUrl| is the URL that failed to load. See net\base\net_error_list.h
|
||||
// for complete descriptions of the error codes.
|
||||
// Called when a navigation fails or is canceled. This function may be called
|
||||
// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
|
||||
// after commit. |errorCode| is the error code number, |errorText| is the
|
||||
// error text and |failedUrl| is the URL that failed to load. See
|
||||
// net\base\net_error_list.h for complete descriptions of the error codes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_load_error)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
cef_errorcode_t errorCode, const cef_string_t* errorText,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
cef_errorcode_t errorCode,
|
||||
const cef_string_t* errorText,
|
||||
const cef_string_t* failedUrl);
|
||||
} cef_load_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=c86c5964cd093de8913b092db47d9e820a169ae8$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
||||
@@ -45,7 +47,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Supports creation and modification of menus. See cef_menu_id_t for the
|
||||
// command ids that have default implementations. All user-defined command ids
|
||||
@@ -81,27 +82,32 @@ typedef struct _cef_menu_model_t {
|
||||
///
|
||||
// Add an item to the menu. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *add_item)(struct _cef_menu_model_t* self, int command_id,
|
||||
int(CEF_CALLBACK* add_item)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Add a check item to the menu. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* add_check_item)(struct _cef_menu_model_t* self,
|
||||
int command_id, const cef_string_t* label);
|
||||
int command_id,
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Add a radio item to the menu. Only a single item with the specified
|
||||
// |group_id| can be checked at a time. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* add_radio_item)(struct _cef_menu_model_t* self,
|
||||
int command_id, const cef_string_t* label, int group_id);
|
||||
int command_id,
|
||||
const cef_string_t* label,
|
||||
int group_id);
|
||||
|
||||
///
|
||||
// Add a sub-menu to the menu. The new sub-menu is returned.
|
||||
///
|
||||
struct _cef_menu_model_t*(CEF_CALLBACK* add_sub_menu)(
|
||||
struct _cef_menu_model_t* self, int command_id,
|
||||
struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
@@ -115,15 +121,19 @@ typedef struct _cef_menu_model_t {
|
||||
// Insert an item in the menu at the specified |index|. Returns true (1) on
|
||||
// success.
|
||||
///
|
||||
int (CEF_CALLBACK *insert_item_at)(struct _cef_menu_model_t* self, int index,
|
||||
int command_id, const cef_string_t* label);
|
||||
int(CEF_CALLBACK* insert_item_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
int command_id,
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Insert a check item in the menu at the specified |index|. Returns true (1)
|
||||
// on success.
|
||||
///
|
||||
int(CEF_CALLBACK* insert_check_item_at)(struct _cef_menu_model_t* self,
|
||||
int index, int command_id, const cef_string_t* label);
|
||||
int index,
|
||||
int command_id,
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Insert a radio item in the menu at the specified |index|. Only a single
|
||||
@@ -131,14 +141,19 @@ typedef struct _cef_menu_model_t {
|
||||
// (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* insert_radio_item_at)(struct _cef_menu_model_t* self,
|
||||
int index, int command_id, const cef_string_t* label, int group_id);
|
||||
int index,
|
||||
int command_id,
|
||||
const cef_string_t* label,
|
||||
int group_id);
|
||||
|
||||
///
|
||||
// Insert a sub-menu in the menu at the specified |index|. The new sub-menu is
|
||||
// returned.
|
||||
///
|
||||
struct _cef_menu_model_t*(CEF_CALLBACK* insert_sub_menu_at)(
|
||||
struct _cef_menu_model_t* self, int index, int command_id,
|
||||
struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
int command_id,
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
@@ -170,33 +185,36 @@ typedef struct _cef_menu_model_t {
|
||||
// Sets the command id at the specified |index|. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_command_id_at)(struct _cef_menu_model_t* self,
|
||||
int index, int command_id);
|
||||
int index,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
// Returns the label for the specified |command_id| or NULL if not found.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_label)(
|
||||
struct _cef_menu_model_t* self, int command_id);
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_label)(struct _cef_menu_model_t* self,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
// Returns the label at the specified |index| or NULL if not found due to
|
||||
// invalid range or the index being a separator.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_label_at)(
|
||||
struct _cef_menu_model_t* self, int index);
|
||||
cef_string_userfree_t(
|
||||
CEF_CALLBACK* get_label_at)(struct _cef_menu_model_t* self, int index);
|
||||
|
||||
///
|
||||
// Sets the label for the specified |command_id|. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *set_label)(struct _cef_menu_model_t* self, int command_id,
|
||||
int(CEF_CALLBACK* set_label)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Set the label at the specified |index|. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *set_label_at)(struct _cef_menu_model_t* self, int index,
|
||||
int(CEF_CALLBACK* set_label_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
@@ -208,8 +226,8 @@ typedef struct _cef_menu_model_t {
|
||||
///
|
||||
// Returns the item type at the specified |index|.
|
||||
///
|
||||
cef_menu_item_type_t (CEF_CALLBACK *get_type_at)(
|
||||
struct _cef_menu_model_t* self, int index);
|
||||
cef_menu_item_type_t(
|
||||
CEF_CALLBACK* get_type_at)(struct _cef_menu_model_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns the group id for the specified |command_id| or -1 if invalid.
|
||||
@@ -220,39 +238,40 @@ typedef struct _cef_menu_model_t {
|
||||
///
|
||||
// Returns the group id at the specified |index| or -1 if invalid.
|
||||
///
|
||||
int (CEF_CALLBACK *get_group_id_at)(struct _cef_menu_model_t* self,
|
||||
int index);
|
||||
int(CEF_CALLBACK* get_group_id_at)(struct _cef_menu_model_t* self, int index);
|
||||
|
||||
///
|
||||
// Sets the group id for the specified |command_id|. Returns true (1) on
|
||||
// success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_group_id)(struct _cef_menu_model_t* self,
|
||||
int command_id, int group_id);
|
||||
int command_id,
|
||||
int group_id);
|
||||
|
||||
///
|
||||
// Sets the group id at the specified |index|. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *set_group_id_at)(struct _cef_menu_model_t* self, int index,
|
||||
int(CEF_CALLBACK* set_group_id_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
int group_id);
|
||||
|
||||
///
|
||||
// Returns the submenu for the specified |command_id| or NULL if invalid.
|
||||
///
|
||||
struct _cef_menu_model_t*(CEF_CALLBACK* get_sub_menu)(
|
||||
struct _cef_menu_model_t* self, int command_id);
|
||||
struct _cef_menu_model_t* self,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
// Returns the submenu at the specified |index| or NULL if invalid.
|
||||
///
|
||||
struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu_at)(
|
||||
struct _cef_menu_model_t* self, int index);
|
||||
struct _cef_menu_model_t*(
|
||||
CEF_CALLBACK* get_sub_menu_at)(struct _cef_menu_model_t* self, int index);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |command_id| is visible.
|
||||
///
|
||||
int (CEF_CALLBACK *is_visible)(struct _cef_menu_model_t* self,
|
||||
int command_id);
|
||||
int(CEF_CALLBACK* is_visible)(struct _cef_menu_model_t* self, int command_id);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |index| is visible.
|
||||
@@ -264,20 +283,21 @@ typedef struct _cef_menu_model_t {
|
||||
// success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_visible)(struct _cef_menu_model_t* self,
|
||||
int command_id, int visible);
|
||||
int command_id,
|
||||
int visible);
|
||||
|
||||
///
|
||||
// Change the visibility at the specified |index|. Returns true (1) on
|
||||
// success.
|
||||
///
|
||||
int (CEF_CALLBACK *set_visible_at)(struct _cef_menu_model_t* self, int index,
|
||||
int(CEF_CALLBACK* set_visible_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
int visible);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |command_id| is enabled.
|
||||
///
|
||||
int (CEF_CALLBACK *is_enabled)(struct _cef_menu_model_t* self,
|
||||
int command_id);
|
||||
int(CEF_CALLBACK* is_enabled)(struct _cef_menu_model_t* self, int command_id);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |index| is enabled.
|
||||
@@ -289,21 +309,22 @@ typedef struct _cef_menu_model_t {
|
||||
// on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_enabled)(struct _cef_menu_model_t* self,
|
||||
int command_id, int enabled);
|
||||
int command_id,
|
||||
int enabled);
|
||||
|
||||
///
|
||||
// Change the enabled status at the specified |index|. Returns true (1) on
|
||||
// success.
|
||||
///
|
||||
int (CEF_CALLBACK *set_enabled_at)(struct _cef_menu_model_t* self, int index,
|
||||
int(CEF_CALLBACK* set_enabled_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
int enabled);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |command_id| is checked. Only applies to
|
||||
// check and radio items.
|
||||
///
|
||||
int (CEF_CALLBACK *is_checked)(struct _cef_menu_model_t* self,
|
||||
int command_id);
|
||||
int(CEF_CALLBACK* is_checked)(struct _cef_menu_model_t* self, int command_id);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |index| is checked. Only applies to check
|
||||
@@ -316,13 +337,15 @@ typedef struct _cef_menu_model_t {
|
||||
// Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_checked)(struct _cef_menu_model_t* self,
|
||||
int command_id, int checked);
|
||||
int command_id,
|
||||
int checked);
|
||||
|
||||
///
|
||||
// Check the specified |index|. Only applies to check and radio items. Returns
|
||||
// true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *set_checked_at)(struct _cef_menu_model_t* self, int index,
|
||||
int(CEF_CALLBACK* set_checked_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
int checked);
|
||||
|
||||
///
|
||||
@@ -344,7 +367,10 @@ typedef struct _cef_menu_model_t {
|
||||
// be any virtual key or character value. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_accelerator)(struct _cef_menu_model_t* self,
|
||||
int command_id, int key_code, int shift_pressed, int ctrl_pressed,
|
||||
int command_id,
|
||||
int key_code,
|
||||
int shift_pressed,
|
||||
int ctrl_pressed,
|
||||
int alt_pressed);
|
||||
|
||||
///
|
||||
@@ -352,7 +378,10 @@ typedef struct _cef_menu_model_t {
|
||||
// any virtual key or character value. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_accelerator_at)(struct _cef_menu_model_t* self,
|
||||
int index, int key_code, int shift_pressed, int ctrl_pressed,
|
||||
int index,
|
||||
int key_code,
|
||||
int shift_pressed,
|
||||
int ctrl_pressed,
|
||||
int alt_pressed);
|
||||
|
||||
///
|
||||
@@ -374,7 +403,10 @@ typedef struct _cef_menu_model_t {
|
||||
// true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* get_accelerator)(struct _cef_menu_model_t* self,
|
||||
int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed,
|
||||
int command_id,
|
||||
int* key_code,
|
||||
int* shift_pressed,
|
||||
int* ctrl_pressed,
|
||||
int* alt_pressed);
|
||||
|
||||
///
|
||||
@@ -382,7 +414,10 @@ typedef struct _cef_menu_model_t {
|
||||
// (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* get_accelerator_at)(struct _cef_menu_model_t* self,
|
||||
int index, int* key_code, int* shift_pressed, int* ctrl_pressed,
|
||||
int index,
|
||||
int* key_code,
|
||||
int* shift_pressed,
|
||||
int* ctrl_pressed,
|
||||
int* alt_pressed);
|
||||
|
||||
///
|
||||
@@ -391,8 +426,10 @@ typedef struct _cef_menu_model_t {
|
||||
// color or default color is set for |color_type| then the system color will
|
||||
// be used. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *set_color)(struct _cef_menu_model_t* self, int command_id,
|
||||
cef_menu_color_type_t color_type, cef_color_t color);
|
||||
int(CEF_CALLBACK* set_color)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
cef_menu_color_type_t color_type,
|
||||
cef_color_t color);
|
||||
|
||||
///
|
||||
// Set the explicit color for |command_id| and |index| to |color|. Specify a
|
||||
@@ -401,16 +438,20 @@ typedef struct _cef_menu_model_t {
|
||||
// set. If no explicit color or default color is set for |color_type| then the
|
||||
// system color will be used. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *set_color_at)(struct _cef_menu_model_t* self, int index,
|
||||
cef_menu_color_type_t color_type, cef_color_t color);
|
||||
int(CEF_CALLBACK* set_color_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
cef_menu_color_type_t color_type,
|
||||
cef_color_t color);
|
||||
|
||||
///
|
||||
// Returns in |color| the color that was explicitly set for |command_id| and
|
||||
// |color_type|. If a color was not set then 0 will be returned in |color|.
|
||||
// Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *get_color)(struct _cef_menu_model_t* self, int command_id,
|
||||
cef_menu_color_type_t color_type, cef_color_t* color);
|
||||
int(CEF_CALLBACK* get_color)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
cef_menu_color_type_t color_type,
|
||||
cef_color_t* color);
|
||||
|
||||
///
|
||||
// Returns in |color| the color that was explicitly set for |command_id| and
|
||||
@@ -418,8 +459,10 @@ typedef struct _cef_menu_model_t {
|
||||
// |color|. If a color was not set then 0 will be returned in |color|. Returns
|
||||
// true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *get_color_at)(struct _cef_menu_model_t* self, int index,
|
||||
cef_menu_color_type_t color_type, cef_color_t* color);
|
||||
int(CEF_CALLBACK* get_color_at)(struct _cef_menu_model_t* self,
|
||||
int index,
|
||||
cef_menu_color_type_t color_type,
|
||||
cef_color_t* color);
|
||||
|
||||
///
|
||||
// Sets the font list for the specified |command_id|. If |font_list| is NULL
|
||||
@@ -434,7 +477,8 @@ typedef struct _cef_menu_model_t {
|
||||
// Bold Italic 14px" - "Arial, 14px"
|
||||
///
|
||||
int(CEF_CALLBACK* set_font_list)(struct _cef_menu_model_t* self,
|
||||
int command_id, const cef_string_t* font_list);
|
||||
int command_id,
|
||||
const cef_string_t* font_list);
|
||||
|
||||
///
|
||||
// Sets the font list for the specified |index|. Specify an |index| value of
|
||||
@@ -450,17 +494,16 @@ typedef struct _cef_menu_model_t {
|
||||
// Bold Italic 14px" - "Arial, 14px"
|
||||
///
|
||||
int(CEF_CALLBACK* set_font_list_at)(struct _cef_menu_model_t* self,
|
||||
int index, const cef_string_t* font_list);
|
||||
int index,
|
||||
const cef_string_t* font_list);
|
||||
} cef_menu_model_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new MenuModel with the specified |delegate|.
|
||||
///
|
||||
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
|
||||
struct _cef_menu_model_delegate_t* delegate);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=d390abde0e3eb8ac8d80d16cbf638d297866b853$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
||||
@@ -62,7 +64,8 @@ typedef struct _cef_menu_model_delegate_t {
|
||||
// |event_flags|.
|
||||
///
|
||||
void(CEF_CALLBACK* execute_command)(struct _cef_menu_model_delegate_t* self,
|
||||
struct _cef_menu_model_t* menu_model, int command_id,
|
||||
struct _cef_menu_model_t* menu_model,
|
||||
int command_id,
|
||||
cef_event_flags_t event_flags);
|
||||
|
||||
///
|
||||
@@ -71,7 +74,8 @@ typedef struct _cef_menu_model_delegate_t {
|
||||
///
|
||||
void(CEF_CALLBACK* mouse_outside_menu)(
|
||||
struct _cef_menu_model_delegate_t* self,
|
||||
struct _cef_menu_model_t* menu_model, const cef_point_t* screen_point);
|
||||
struct _cef_menu_model_t* menu_model,
|
||||
const cef_point_t* screen_point);
|
||||
|
||||
///
|
||||
// Called on unhandled open submenu keyboard commands. |is_rtl| will be true
|
||||
@@ -79,7 +83,8 @@ typedef struct _cef_menu_model_delegate_t {
|
||||
///
|
||||
void(CEF_CALLBACK* unhandled_open_submenu)(
|
||||
struct _cef_menu_model_delegate_t* self,
|
||||
struct _cef_menu_model_t* menu_model, int is_rtl);
|
||||
struct _cef_menu_model_t* menu_model,
|
||||
int is_rtl);
|
||||
|
||||
///
|
||||
// Called on unhandled close submenu keyboard commands. |is_rtl| will be true
|
||||
@@ -87,7 +92,8 @@ typedef struct _cef_menu_model_delegate_t {
|
||||
///
|
||||
void(CEF_CALLBACK* unhandled_close_submenu)(
|
||||
struct _cef_menu_model_delegate_t* self,
|
||||
struct _cef_menu_model_t* menu_model, int is_rtl);
|
||||
struct _cef_menu_model_t* menu_model,
|
||||
int is_rtl);
|
||||
|
||||
///
|
||||
// The menu is about to show.
|
||||
@@ -106,10 +112,10 @@ typedef struct _cef_menu_model_delegate_t {
|
||||
// modified.
|
||||
///
|
||||
int(CEF_CALLBACK* format_label)(struct _cef_menu_model_delegate_t* self,
|
||||
struct _cef_menu_model_t* menu_model, cef_string_t* label);
|
||||
struct _cef_menu_model_t* menu_model,
|
||||
cef_string_t* label);
|
||||
} cef_menu_model_delegate_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=e844a5ea18cdcee85faa937d5f2715452eb19d12$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
|
||||
@@ -45,7 +47,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent an entry in navigation history.
|
||||
///
|
||||
@@ -115,8 +116,7 @@ typedef struct _cef_navigation_entry_t {
|
||||
// response. May be 0 if the response has not yet been received or if the
|
||||
// navigation has not yet completed.
|
||||
///
|
||||
int (CEF_CALLBACK *get_http_status_code)(
|
||||
struct _cef_navigation_entry_t* self);
|
||||
int(CEF_CALLBACK* get_http_status_code)(struct _cef_navigation_entry_t* self);
|
||||
|
||||
///
|
||||
// Returns the SSL information for this navigation entry.
|
||||
@@ -125,7 +125,6 @@ typedef struct _cef_navigation_entry_t {
|
||||
struct _cef_navigation_entry_t* self);
|
||||
} cef_navigation_entry_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=8aa93dd5092138e1cbc66c512624be41de71c1d3$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Add an entry to the cross-origin access whitelist.
|
||||
//
|
||||
@@ -82,16 +83,20 @@ extern "C" {
|
||||
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||
///
|
||||
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
||||
const cef_string_t* source_origin, const cef_string_t* target_protocol,
|
||||
const cef_string_t* target_domain, int allow_target_subdomains);
|
||||
const cef_string_t* source_origin,
|
||||
const cef_string_t* target_protocol,
|
||||
const cef_string_t* target_domain,
|
||||
int allow_target_subdomains);
|
||||
|
||||
///
|
||||
// Remove an entry from the cross-origin access whitelist. Returns false (0) if
|
||||
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||
///
|
||||
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
||||
const cef_string_t* source_origin, const cef_string_t* target_protocol,
|
||||
const cef_string_t* target_domain, int allow_target_subdomains);
|
||||
const cef_string_t* source_origin,
|
||||
const cef_string_t* target_protocol,
|
||||
const cef_string_t* target_domain,
|
||||
int allow_target_subdomains);
|
||||
|
||||
///
|
||||
// Remove all entries from the cross-origin access whitelist. Returns false (0)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=9f1c8c065c1604c5d09435e0869b45fd3f51aa31$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Parse the specified |url| into its component parts. Returns false (0) if the
|
||||
// URL is NULL or invalid.
|
||||
@@ -71,16 +72,16 @@ CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
|
||||
// for URLs which will be parsed or sent to other applications.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t cef_format_url_for_security_display(
|
||||
const cef_string_t* origin_url);
|
||||
CEF_EXPORT cef_string_userfree_t
|
||||
cef_format_url_for_security_display(const cef_string_t* origin_url);
|
||||
|
||||
///
|
||||
// Returns the mime type for the specified file extension or an NULL string if
|
||||
// unknown.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t cef_get_mime_type(
|
||||
const cef_string_t* extension);
|
||||
CEF_EXPORT cef_string_userfree_t
|
||||
cef_get_mime_type(const cef_string_t* extension);
|
||||
|
||||
///
|
||||
// Get the extensions associated with the given mime type. This should be passed
|
||||
@@ -126,14 +127,17 @@ CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text,
|
||||
// supports further customization the decoding process.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t cef_uridecode(const cef_string_t* text,
|
||||
int convert_to_utf8, cef_uri_unescape_rule_t unescape_rule);
|
||||
CEF_EXPORT cef_string_userfree_t
|
||||
cef_uridecode(const cef_string_t* text,
|
||||
int convert_to_utf8,
|
||||
cef_uri_unescape_rule_t unescape_rule);
|
||||
|
||||
///
|
||||
// Parses the specified |json_string| and returns a dictionary or list
|
||||
// representation. If JSON parsing fails this function returns NULL.
|
||||
///
|
||||
CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string,
|
||||
CEF_EXPORT struct _cef_value_t* cef_parse_json(
|
||||
const cef_string_t* json_string,
|
||||
cef_json_parser_options_t options);
|
||||
|
||||
///
|
||||
@@ -143,8 +147,10 @@ CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string,
|
||||
// formatted error message respectively.
|
||||
///
|
||||
CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
|
||||
const cef_string_t* json_string, cef_json_parser_options_t options,
|
||||
cef_json_parser_error_t* error_code_out, cef_string_t* error_msg_out);
|
||||
const cef_string_t* json_string,
|
||||
cef_json_parser_options_t options,
|
||||
cef_json_parser_error_t* error_code_out,
|
||||
cef_string_t* error_msg_out);
|
||||
|
||||
///
|
||||
// Generates a JSON string from the specified root |node| which should be a
|
||||
@@ -152,8 +158,8 @@ CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
|
||||
// requires exclusive access to |node| including any underlying data.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t cef_write_json(struct _cef_value_t* node,
|
||||
cef_json_writer_options_t options);
|
||||
CEF_EXPORT cef_string_userfree_t
|
||||
cef_write_json(struct _cef_value_t* node, cef_json_writer_options_t options);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=9d02d9da5fb643fd5dfe46e12e535da7d2e874c7$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Retrieve the path associated with the specified |key|. Returns true (1) on
|
||||
// success. Can be called on any thread in the browser process.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=e063de969dd9903ca0265346818bbbaa52f5446b$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
|
||||
@@ -46,7 +48,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Callback structure for asynchronous continuation of print dialog requests.
|
||||
///
|
||||
@@ -68,7 +69,6 @@ typedef struct _cef_print_dialog_callback_t {
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_print_dialog_callback_t* self);
|
||||
} cef_print_dialog_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Callback structure for asynchronous continuation of print job requests.
|
||||
///
|
||||
@@ -84,10 +84,10 @@ typedef struct _cef_print_job_callback_t {
|
||||
void(CEF_CALLBACK* cont)(struct _cef_print_job_callback_t* self);
|
||||
} cef_print_job_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle printing on Linux. The functions of this
|
||||
// structure will be called on the browser process UI thread.
|
||||
// Implement this structure to handle printing on Linux. Each browser will have
|
||||
// only one print job in progress at a time. The functions of this structure
|
||||
// will be called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_print_handler_t {
|
||||
///
|
||||
@@ -110,15 +110,20 @@ typedef struct _cef_print_handler_t {
|
||||
// reference to |settings| outside of this callback.
|
||||
///
|
||||
void(CEF_CALLBACK* on_print_settings)(struct _cef_print_handler_t* self,
|
||||
struct _cef_print_settings_t* settings, int get_defaults);
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_print_settings_t* settings,
|
||||
int get_defaults);
|
||||
|
||||
///
|
||||
// Show the print dialog. Execute |callback| once the dialog is dismissed.
|
||||
// Return true (1) if the dialog will be displayed or false (0) to cancel the
|
||||
// printing immediately.
|
||||
///
|
||||
int (CEF_CALLBACK *on_print_dialog)(struct _cef_print_handler_t* self,
|
||||
int has_selection, struct _cef_print_dialog_callback_t* callback);
|
||||
int(CEF_CALLBACK* on_print_dialog)(
|
||||
struct _cef_print_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int has_selection,
|
||||
struct _cef_print_dialog_callback_t* callback);
|
||||
|
||||
///
|
||||
// Send the print job to the printer. Execute |callback| once the job is
|
||||
@@ -126,23 +131,26 @@ typedef struct _cef_print_handler_t {
|
||||
// the job immediately.
|
||||
///
|
||||
int(CEF_CALLBACK* on_print_job)(struct _cef_print_handler_t* self,
|
||||
const cef_string_t* document_name, const cef_string_t* pdf_file_path,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* document_name,
|
||||
const cef_string_t* pdf_file_path,
|
||||
struct _cef_print_job_callback_t* callback);
|
||||
|
||||
///
|
||||
// Reset client state related to printing.
|
||||
///
|
||||
void (CEF_CALLBACK *on_print_reset)(struct _cef_print_handler_t* self);
|
||||
void(CEF_CALLBACK* on_print_reset)(struct _cef_print_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Return the PDF paper size in device units. Used in combination with
|
||||
// cef_browser_host_t::print_to_pdf().
|
||||
///
|
||||
cef_size_t(CEF_CALLBACK* get_pdf_paper_size)(
|
||||
struct _cef_print_handler_t* self, int device_units_per_inch);
|
||||
struct _cef_print_handler_t* self,
|
||||
int device_units_per_inch);
|
||||
} cef_print_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=593308c65c50c7f6bd890541426806a9bf07a00b$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure representing print settings.
|
||||
///
|
||||
@@ -121,7 +122,8 @@ typedef struct _cef_print_settings_t {
|
||||
// Set the page ranges.
|
||||
///
|
||||
void(CEF_CALLBACK* set_page_ranges)(struct _cef_print_settings_t* self,
|
||||
size_t rangesCount, cef_range_t const* ranges);
|
||||
size_t rangesCount,
|
||||
cef_range_t const* ranges);
|
||||
|
||||
///
|
||||
// Returns the number of page ranges that currently exist.
|
||||
@@ -133,7 +135,8 @@ typedef struct _cef_print_settings_t {
|
||||
// Retrieve the page ranges.
|
||||
///
|
||||
void(CEF_CALLBACK* get_page_ranges)(struct _cef_print_settings_t* self,
|
||||
size_t* rangesCount, cef_range_t* ranges);
|
||||
size_t* rangesCount,
|
||||
cef_range_t* ranges);
|
||||
|
||||
///
|
||||
// Set whether only the selection will be printed.
|
||||
@@ -193,13 +196,11 @@ typedef struct _cef_print_settings_t {
|
||||
struct _cef_print_settings_t* self);
|
||||
} cef_print_settings_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_print_settings_t object.
|
||||
///
|
||||
CEF_EXPORT cef_print_settings_t* cef_print_settings_create();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5f8cd4eb4e6215cb0f6161b916dc51197e345204$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
||||
@@ -45,7 +47,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure representing a message. Can be used on any process and thread.
|
||||
///
|
||||
@@ -87,14 +88,12 @@ typedef struct _cef_process_message_t {
|
||||
struct _cef_process_message_t* self);
|
||||
} cef_process_message_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_process_message_t object with the specified name.
|
||||
///
|
||||
CEF_EXPORT cef_process_message_t* cef_process_message_create(
|
||||
const cef_string_t* name);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=aa003bb87d891baa8c79742dadcac6fe75f32737$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Launches the process specified via |command_line|. Returns true (1) upon
|
||||
// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,11 +33,14 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f2f3acb1df9815e4ac9bf34010ce260a2496ae5a$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_accessibility_handler_capi.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_browser_capi.h"
|
||||
#include "include/capi/cef_drag_data_capi.h"
|
||||
@@ -46,7 +49,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events when window rendering is disabled.
|
||||
// The functions of this structure will be called on the UI thread.
|
||||
@@ -57,26 +59,38 @@ typedef struct _cef_render_handler_t {
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Return the handler for accessibility notifications. If no handler is
|
||||
// provided the default implementation will be used.
|
||||
///
|
||||
struct _cef_accessibility_handler_t*(CEF_CALLBACK* get_accessibility_handler)(
|
||||
struct _cef_render_handler_t* self);
|
||||
|
||||
///
|
||||
// Called to retrieve the root window rectangle in screen coordinates. Return
|
||||
// true (1) if the rectangle was provided.
|
||||
///
|
||||
int(CEF_CALLBACK* get_root_screen_rect)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_rect_t* rect);
|
||||
struct _cef_browser_t* browser,
|
||||
cef_rect_t* rect);
|
||||
|
||||
///
|
||||
// Called to retrieve the view rectangle which is relative to screen
|
||||
// coordinates. Return true (1) if the rectangle was provided.
|
||||
///
|
||||
int(CEF_CALLBACK* get_view_rect)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_rect_t* rect);
|
||||
struct _cef_browser_t* browser,
|
||||
cef_rect_t* rect);
|
||||
|
||||
///
|
||||
// Called to retrieve the translation from view coordinates to actual screen
|
||||
// coordinates. Return true (1) if the screen coordinates were provided.
|
||||
///
|
||||
int(CEF_CALLBACK* get_screen_point)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, int viewX, int viewY, int* screenX,
|
||||
struct _cef_browser_t* browser,
|
||||
int viewX,
|
||||
int viewY,
|
||||
int* screenX,
|
||||
int* screenY);
|
||||
|
||||
///
|
||||
@@ -89,21 +103,24 @@ typedef struct _cef_render_handler_t {
|
||||
// drawn correctly.
|
||||
///
|
||||
int(CEF_CALLBACK* get_screen_info)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_screen_info_t* screen_info);
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_screen_info_t* screen_info);
|
||||
|
||||
///
|
||||
// Called when the browser wants to show or hide the popup widget. The popup
|
||||
// should be shown if |show| is true (1) and hidden if |show| is false (0).
|
||||
///
|
||||
void(CEF_CALLBACK* on_popup_show)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, int show);
|
||||
struct _cef_browser_t* browser,
|
||||
int show);
|
||||
|
||||
///
|
||||
// Called when the browser wants to move or resize the popup widget. |rect|
|
||||
// contains the new location and size in view coordinates.
|
||||
///
|
||||
void(CEF_CALLBACK* on_popup_size)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_rect_t* rect);
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_rect_t* rect);
|
||||
|
||||
///
|
||||
// Called when an element should be painted. Pixel values passed to this
|
||||
@@ -116,16 +133,22 @@ typedef struct _cef_render_handler_t {
|
||||
// upper-left origin.
|
||||
///
|
||||
void(CEF_CALLBACK* on_paint)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_paint_element_type_t type,
|
||||
size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer,
|
||||
int width, int height);
|
||||
struct _cef_browser_t* browser,
|
||||
cef_paint_element_type_t type,
|
||||
size_t dirtyRectsCount,
|
||||
cef_rect_t const* dirtyRects,
|
||||
const void* buffer,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
///
|
||||
// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
|
||||
// |custom_cursor_info| will be populated with the custom cursor information.
|
||||
///
|
||||
void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_cursor_handle_t cursor,
|
||||
void(CEF_CALLBACK* on_cursor_change)(
|
||||
struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_cursor_handle_t cursor,
|
||||
cef_cursor_type_t type,
|
||||
const struct _cef_cursor_info_t* custom_cursor_info);
|
||||
|
||||
@@ -144,8 +167,11 @@ typedef struct _cef_render_handler_t {
|
||||
// operation has ended.
|
||||
///
|
||||
int(CEF_CALLBACK* start_dragging)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_drag_data_t* drag_data,
|
||||
cef_drag_operations_mask_t allowed_ops, int x, int y);
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_drag_data_t* drag_data,
|
||||
cef_drag_operations_mask_t allowed_ops,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
///
|
||||
// Called when the web view wants to update the mouse cursor during a drag &
|
||||
@@ -153,14 +179,17 @@ typedef struct _cef_render_handler_t {
|
||||
// copy, link).
|
||||
///
|
||||
void(CEF_CALLBACK* update_drag_cursor)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_drag_operations_mask_t operation);
|
||||
struct _cef_browser_t* browser,
|
||||
cef_drag_operations_mask_t operation);
|
||||
|
||||
///
|
||||
// Called when the scroll offset has changed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_scroll_offset_changed)(
|
||||
struct _cef_render_handler_t* self, struct _cef_browser_t* browser,
|
||||
double x, double y);
|
||||
struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
double x,
|
||||
double y);
|
||||
|
||||
///
|
||||
// Called when the IME composition range has changed. |selected_range| is the
|
||||
@@ -168,11 +197,23 @@ typedef struct _cef_render_handler_t {
|
||||
// bounds of each character in view coordinates.
|
||||
///
|
||||
void(CEF_CALLBACK* on_ime_composition_range_changed)(
|
||||
struct _cef_render_handler_t* self, struct _cef_browser_t* browser,
|
||||
const cef_range_t* selected_range, size_t character_boundsCount,
|
||||
struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_range_t* selected_range,
|
||||
size_t character_boundsCount,
|
||||
cef_rect_t const* character_bounds);
|
||||
} cef_render_handler_t;
|
||||
|
||||
///
|
||||
// Called when text selection has changed for the specified |browser|.
|
||||
// |selected_text| is the currently selected text and |selected_range| is the
|
||||
// character range.
|
||||
///
|
||||
void(CEF_CALLBACK* on_text_selection_changed)(
|
||||
struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* selected_text,
|
||||
const cef_range_t* selected_range);
|
||||
} cef_render_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=fb34d81715ada28d5509cd33aa36f37829933a91$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
||||
@@ -51,7 +53,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used to implement render process callbacks. The functions of this
|
||||
// structure will be called on the render process main thread (TID_RENDERER)
|
||||
@@ -101,17 +102,6 @@ typedef struct _cef_render_process_handler_t {
|
||||
struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)(
|
||||
struct _cef_render_process_handler_t* self);
|
||||
|
||||
///
|
||||
// Called before browser navigation. Return true (1) to cancel the navigation
|
||||
// or false (0) to allow the navigation to proceed. The |request| object
|
||||
// cannot be modified in this callback.
|
||||
///
|
||||
int (CEF_CALLBACK *on_before_navigation)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request, cef_navigation_type_t navigation_type,
|
||||
int is_redirect);
|
||||
|
||||
///
|
||||
// Called immediately after the V8 context for a frame has been created. To
|
||||
// retrieve the JavaScript 'window' object use the
|
||||
@@ -122,7 +112,8 @@ typedef struct _cef_render_process_handler_t {
|
||||
///
|
||||
void(CEF_CALLBACK* on_context_created)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_v8context_t* context);
|
||||
|
||||
///
|
||||
@@ -131,7 +122,8 @@ typedef struct _cef_render_process_handler_t {
|
||||
///
|
||||
void(CEF_CALLBACK* on_context_released)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_v8context_t* context);
|
||||
|
||||
///
|
||||
@@ -141,8 +133,10 @@ typedef struct _cef_render_process_handler_t {
|
||||
///
|
||||
void(CEF_CALLBACK* on_uncaught_exception)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_v8context_t* context, struct _cef_v8exception_t* exception,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_v8context_t* context,
|
||||
struct _cef_v8exception_t* exception,
|
||||
struct _cef_v8stack_trace_t* stackTrace);
|
||||
|
||||
///
|
||||
@@ -155,7 +149,8 @@ typedef struct _cef_render_process_handler_t {
|
||||
///
|
||||
void(CEF_CALLBACK* on_focused_node_changed)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_domnode_t* node);
|
||||
|
||||
///
|
||||
@@ -165,11 +160,11 @@ typedef struct _cef_render_process_handler_t {
|
||||
///
|
||||
int(CEF_CALLBACK* on_process_message_received)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_process_id_t source_process,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_process_id_t source_process,
|
||||
struct _cef_process_message_t* message);
|
||||
} cef_render_process_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=d7f34d867389c53c384f366e08f958ed724f9b90$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
||||
@@ -93,7 +95,8 @@ typedef struct _cef_request_t {
|
||||
// ref component will be removed.
|
||||
///
|
||||
void(CEF_CALLBACK* set_referrer)(struct _cef_request_t* self,
|
||||
const cef_string_t* referrer_url, cef_referrer_policy_t policy);
|
||||
const cef_string_t* referrer_url,
|
||||
cef_referrer_policy_t policy);
|
||||
|
||||
///
|
||||
// Get the referrer URL.
|
||||
@@ -136,8 +139,10 @@ typedef struct _cef_request_t {
|
||||
///
|
||||
// Set all values at one time.
|
||||
///
|
||||
void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url,
|
||||
const cef_string_t* method, struct _cef_post_data_t* postData,
|
||||
void(CEF_CALLBACK* set)(struct _cef_request_t* self,
|
||||
const cef_string_t* url,
|
||||
const cef_string_t* method,
|
||||
struct _cef_post_data_t* postData,
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
@@ -153,7 +158,7 @@ typedef struct _cef_request_t {
|
||||
void(CEF_CALLBACK* set_flags)(struct _cef_request_t* self, int flags);
|
||||
|
||||
///
|
||||
// Set the URL to the first party for cookies used in combination with
|
||||
// Get the URL to the first party for cookies used in combination with
|
||||
// cef_urlrequest_t.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
@@ -161,7 +166,7 @@ typedef struct _cef_request_t {
|
||||
struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Get 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.
|
||||
///
|
||||
void(CEF_CALLBACK* set_first_party_for_cookies)(struct _cef_request_t* self,
|
||||
@@ -190,13 +195,11 @@ typedef struct _cef_request_t {
|
||||
uint64(CEF_CALLBACK* get_identifier)(struct _cef_request_t* self);
|
||||
} cef_request_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_request_t object.
|
||||
///
|
||||
CEF_EXPORT cef_request_t* cef_request_create();
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent post data for a web request. The functions of
|
||||
// this structure may be called on any thread.
|
||||
@@ -229,7 +232,8 @@ typedef struct _cef_post_data_t {
|
||||
// Retrieve the post data elements.
|
||||
///
|
||||
void(CEF_CALLBACK* get_elements)(struct _cef_post_data_t* self,
|
||||
size_t* elementsCount, struct _cef_post_data_element_t** elements);
|
||||
size_t* elementsCount,
|
||||
struct _cef_post_data_element_t** elements);
|
||||
|
||||
///
|
||||
// Remove the specified post data element. Returns true (1) if the removal
|
||||
@@ -250,13 +254,11 @@ typedef struct _cef_post_data_t {
|
||||
void(CEF_CALLBACK* remove_elements)(struct _cef_post_data_t* self);
|
||||
} cef_post_data_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_post_data_t object.
|
||||
///
|
||||
CEF_EXPORT cef_post_data_t* cef_post_data_create();
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a single element in the request post data. The
|
||||
// functions of this structure may be called on any thread.
|
||||
@@ -288,7 +290,8 @@ typedef struct _cef_post_data_element_t {
|
||||
// copied.
|
||||
///
|
||||
void(CEF_CALLBACK* set_to_bytes)(struct _cef_post_data_element_t* self,
|
||||
size_t size, const void* bytes);
|
||||
size_t size,
|
||||
const void* bytes);
|
||||
|
||||
///
|
||||
// Return the type of this post data element.
|
||||
@@ -313,16 +316,15 @@ typedef struct _cef_post_data_element_t {
|
||||
// actually read.
|
||||
///
|
||||
size_t(CEF_CALLBACK* get_bytes)(struct _cef_post_data_element_t* self,
|
||||
size_t size, void* bytes);
|
||||
size_t size,
|
||||
void* bytes);
|
||||
} cef_post_data_element_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_post_data_element_t object.
|
||||
///
|
||||
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5f6d84d988bab3a600e6fbb6db0523acaeef88b3$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
#include "include/capi/cef_callback_capi.h"
|
||||
#include "include/capi/cef_cookie_capi.h"
|
||||
#include "include/capi/cef_extension_capi.h"
|
||||
#include "include/capi/cef_extension_handler_capi.h"
|
||||
#include "include/capi/cef_request_context_handler_capi.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
|
||||
@@ -59,16 +63,15 @@ typedef struct _cef_resolve_callback_t {
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called after the ResolveHost request has completed. |result| will be the
|
||||
// result code. |resolved_ips| will be the list of resolved IP addresses or
|
||||
// NULL if the resolution failed.
|
||||
// Called on the UI thread after the ResolveHost request has completed.
|
||||
// |result| will be the result code. |resolved_ips| will be the list of
|
||||
// resolved IP addresses or NULL if the resolution failed.
|
||||
///
|
||||
void (CEF_CALLBACK *on_resolve_completed)(
|
||||
struct _cef_resolve_callback_t* self, cef_errorcode_t result,
|
||||
void(CEF_CALLBACK* on_resolve_completed)(struct _cef_resolve_callback_t* self,
|
||||
cef_errorcode_t result,
|
||||
cef_string_list_t resolved_ips);
|
||||
} cef_resolve_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// A request context provides request handling for a set of related browser or
|
||||
// URL request objects. A request context can be specified when creating a new
|
||||
@@ -152,7 +155,8 @@ typedef struct _cef_request_context_t {
|
||||
// may be called on any thread in the browser process.
|
||||
///
|
||||
int(CEF_CALLBACK* register_scheme_handler_factory)(
|
||||
struct _cef_request_context_t* self, const cef_string_t* scheme_name,
|
||||
struct _cef_request_context_t* self,
|
||||
const cef_string_t* scheme_name,
|
||||
const cef_string_t* domain_name,
|
||||
struct _cef_scheme_handler_factory_t* factory);
|
||||
|
||||
@@ -171,7 +175,8 @@ typedef struct _cef_request_context_t {
|
||||
// the plugin list cache.
|
||||
///
|
||||
void(CEF_CALLBACK* purge_plugin_list_cache)(
|
||||
struct _cef_request_context_t* self, int reload_pages);
|
||||
struct _cef_request_context_t* self,
|
||||
int reload_pages);
|
||||
|
||||
///
|
||||
// Returns true (1) if a preference with the specified |name| exists. This
|
||||
@@ -188,7 +193,8 @@ typedef struct _cef_request_context_t {
|
||||
// called on the browser process UI thread.
|
||||
///
|
||||
struct _cef_value_t*(CEF_CALLBACK* get_preference)(
|
||||
struct _cef_request_context_t* self, const cef_string_t* name);
|
||||
struct _cef_request_context_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Returns all preferences as a dictionary. If |include_defaults| is true (1)
|
||||
@@ -199,7 +205,8 @@ typedef struct _cef_request_context_t {
|
||||
// thread.
|
||||
///
|
||||
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_all_preferences)(
|
||||
struct _cef_request_context_t* self, int include_defaults);
|
||||
struct _cef_request_context_t* self,
|
||||
int include_defaults);
|
||||
|
||||
///
|
||||
// Returns true (1) if the preference with the specified |name| can be
|
||||
@@ -218,7 +225,8 @@ typedef struct _cef_request_context_t {
|
||||
// problem. This function must be called on the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* set_preference)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* name, struct _cef_value_t* value,
|
||||
const cef_string_t* name,
|
||||
struct _cef_value_t* value,
|
||||
cef_string_t* error);
|
||||
|
||||
///
|
||||
@@ -236,7 +244,7 @@ typedef struct _cef_request_context_t {
|
||||
///
|
||||
// Clears all active and idle connections that Chromium currently has. This is
|
||||
// only recommended if you have released all other CEF objects but don't yet
|
||||
// want to call cef_shutdown(). If |callback| is non-NULL it will be executed
|
||||
// want to call Cefshutdown(). If |callback| is non-NULL it will be executed
|
||||
// on the UI thread after completion.
|
||||
///
|
||||
void(CEF_CALLBACK* close_all_connections)(
|
||||
@@ -248,7 +256,8 @@ typedef struct _cef_request_context_t {
|
||||
// |callback| will be executed on the UI thread after completion.
|
||||
///
|
||||
void(CEF_CALLBACK* resolve_host)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* origin, struct _cef_resolve_callback_t* callback);
|
||||
const cef_string_t* origin,
|
||||
struct _cef_resolve_callback_t* callback);
|
||||
|
||||
///
|
||||
// Attempts to resolve |origin| to a list of associated IP addresses using
|
||||
@@ -257,10 +266,99 @@ typedef struct _cef_request_context_t {
|
||||
// success. This function must be called on the browser process IO thread.
|
||||
///
|
||||
cef_errorcode_t(CEF_CALLBACK* resolve_host_cached)(
|
||||
struct _cef_request_context_t* self, const cef_string_t* origin,
|
||||
struct _cef_request_context_t* self,
|
||||
const cef_string_t* origin,
|
||||
cef_string_list_t resolved_ips);
|
||||
} cef_request_context_t;
|
||||
|
||||
///
|
||||
// Load an extension.
|
||||
//
|
||||
// If extension resources will be read from disk using the default load
|
||||
// implementation then |root_directory| should be the absolute path to the
|
||||
// extension resources directory and |manifest| should be NULL. If extension
|
||||
// resources will be provided by the client (e.g. via cef_request_tHandler
|
||||
// and/or cef_extension_tHandler) then |root_directory| should be a path
|
||||
// component unique to the extension (if not absolute this will be internally
|
||||
// prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the
|
||||
// contents that would otherwise be read from the "manifest.json" file on
|
||||
// disk.
|
||||
//
|
||||
// The loaded extension will be accessible in all contexts sharing the same
|
||||
// storage (HasExtension returns true (1)). However, only the context on which
|
||||
// this function was called is considered the loader (DidLoadExtension returns
|
||||
// true (1)) and only the loader will receive cef_request_tContextHandler
|
||||
// callbacks for the extension.
|
||||
//
|
||||
// cef_extension_tHandler::OnExtensionLoaded will be called on load success or
|
||||
// cef_extension_tHandler::OnExtensionLoadFailed will be called on load
|
||||
// failure.
|
||||
//
|
||||
// If the extension specifies a background script via the "background"
|
||||
// manifest key then cef_extension_tHandler::OnBeforeBackgroundBrowser will be
|
||||
// called to create the background browser. See that function for additional
|
||||
// information about background scripts.
|
||||
//
|
||||
// For visible extension views the client application should evaluate the
|
||||
// manifest to determine the correct extension URL to load and then pass that
|
||||
// URL to the cef_browser_host_t::CreateBrowser* function after the extension
|
||||
// has loaded. For example, the client can look for the "browser_action"
|
||||
// manifest key as documented at
|
||||
// https://developer.chrome.com/extensions/browserAction. Extension URLs take
|
||||
// the form "chrome-extension://<extension_id>/<path>".
|
||||
//
|
||||
// Browsers that host extensions differ from normal browsers as follows:
|
||||
// - Can access chrome.* JavaScript APIs if allowed by the manifest. Visit
|
||||
// chrome://extensions-support for the list of extension APIs currently
|
||||
// supported by CEF.
|
||||
// - Main frame navigation to non-extension content is blocked.
|
||||
// - Pinch-zooming is disabled.
|
||||
// - CefBrowserHost::GetExtension returns the hosted extension.
|
||||
// - CefBrowserHost::IsBackgroundHost returns true for background hosts.
|
||||
//
|
||||
// See https://developer.chrome.com/extensions for extension implementation
|
||||
// and usage documentation.
|
||||
///
|
||||
void(CEF_CALLBACK* load_extension)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* root_directory,
|
||||
struct _cef_dictionary_value_t* manifest,
|
||||
struct _cef_extension_handler_t* handler);
|
||||
|
||||
///
|
||||
// Returns true (1) if this context was used to load the extension identified
|
||||
// by |extension_id|. Other contexts sharing the same storage will also have
|
||||
// access to the extension (see HasExtension). This function must be called on
|
||||
// the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* did_load_extension)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* extension_id);
|
||||
|
||||
///
|
||||
// Returns true (1) if this context has access to the extension identified by
|
||||
// |extension_id|. This may not be the context that was used to load the
|
||||
// extension (see DidLoadExtension). This function must be called on the
|
||||
// browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* has_extension)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* extension_id);
|
||||
|
||||
///
|
||||
// Retrieve the list of all extensions that this context has access to (see
|
||||
// HasExtension). |extension_ids| will be populated with the list of extension
|
||||
// ID values. Returns true (1) on success. This function must be called on the
|
||||
// browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* get_extensions)(struct _cef_request_context_t* self,
|
||||
cef_string_list_t extension_ids);
|
||||
|
||||
///
|
||||
// Returns the extension matching |extension_id| or NULL if no matching
|
||||
// extension is accessible in this context (see HasExtension). This function
|
||||
// must be called on the browser process UI thread.
|
||||
///
|
||||
struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
|
||||
struct _cef_request_context_t* self,
|
||||
const cef_string_t* extension_id);
|
||||
} cef_request_context_t;
|
||||
|
||||
///
|
||||
// Returns the global context object.
|
||||
@@ -283,7 +381,6 @@ CEF_EXPORT cef_request_context_t* cef_create_context_shared(
|
||||
cef_request_context_t* other,
|
||||
struct _cef_request_context_handler_t* handler);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=52978f64fe2a612c05fc42a91ec53df6ff42079d$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
|
||||
@@ -46,6 +48,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_request_context_t;
|
||||
|
||||
///
|
||||
// Implement this structure to provide handler implementations. The handler
|
||||
@@ -58,6 +61,14 @@ typedef struct _cef_request_context_handler_t {
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the browser process UI thread immediately after the request
|
||||
// context has been initialized.
|
||||
///
|
||||
void(CEF_CALLBACK* on_request_context_initialized)(
|
||||
struct _cef_request_context_handler_t* self,
|
||||
struct _cef_request_context_t* request_context);
|
||||
|
||||
///
|
||||
// Called on the browser process IO thread to retrieve the cookie manager. If
|
||||
// this function returns NULL the default cookie manager retrievable via
|
||||
@@ -87,13 +98,14 @@ typedef struct _cef_request_context_handler_t {
|
||||
///
|
||||
int(CEF_CALLBACK* on_before_plugin_load)(
|
||||
struct _cef_request_context_handler_t* self,
|
||||
const cef_string_t* mime_type, const cef_string_t* plugin_url,
|
||||
int is_main_frame, const cef_string_t* top_origin_url,
|
||||
const cef_string_t* mime_type,
|
||||
const cef_string_t* plugin_url,
|
||||
int is_main_frame,
|
||||
const cef_string_t* top_origin_url,
|
||||
struct _cef_web_plugin_info_t* plugin_info,
|
||||
cef_plugin_policy_t* plugin_policy);
|
||||
} cef_request_context_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=95e44047a75693dbae0ab6b07b415d188252bfdf$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||
@@ -53,7 +55,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of url requests.
|
||||
///
|
||||
@@ -75,7 +76,6 @@ typedef struct _cef_request_callback_t {
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_request_callback_t* self);
|
||||
} cef_request_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Callback structure used to select a client certificate for authentication.
|
||||
///
|
||||
@@ -94,7 +94,6 @@ typedef struct _cef_select_client_certificate_callback_t {
|
||||
struct _cef_x509certificate_t* cert);
|
||||
} cef_select_client_certificate_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser requests. The
|
||||
// functions of this structure will be called on the thread indicated.
|
||||
@@ -113,11 +112,16 @@ typedef struct _cef_request_handler_t {
|
||||
// If the navigation is allowed cef_load_handler_t::OnLoadStart and
|
||||
// cef_load_handler_t::OnLoadEnd will be called. If the navigation is canceled
|
||||
// cef_load_handler_t::OnLoadError will be called with an |errorCode| value of
|
||||
// ERR_ABORTED.
|
||||
// ERR_ABORTED. The |user_gesture| value will be true (1) if the browser
|
||||
// navigated via explicit user gesture (e.g. clicking a link) or false (0) if
|
||||
// it navigated automatically (e.g. via the DomContentLoaded event).
|
||||
///
|
||||
int(CEF_CALLBACK* on_before_browse)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request, int is_redirect);
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request,
|
||||
int user_gesture,
|
||||
int is_redirect);
|
||||
|
||||
///
|
||||
// Called on the UI thread before OnBeforeBrowse in certain limited cases
|
||||
@@ -135,10 +139,13 @@ typedef struct _cef_request_handler_t {
|
||||
// true (1) to cancel the navigation or false (0) to allow the navigation to
|
||||
// proceed in the source browser's top-level frame.
|
||||
///
|
||||
int (CEF_CALLBACK *on_open_urlfrom_tab)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
int(CEF_CALLBACK* on_open_urlfrom_tab)(
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
const cef_string_t* target_url,
|
||||
cef_window_open_disposition_t target_disposition, int user_gesture);
|
||||
cef_window_open_disposition_t target_disposition,
|
||||
int user_gesture);
|
||||
|
||||
///
|
||||
// Called on the IO thread before a resource request is loaded. The |request|
|
||||
@@ -149,8 +156,10 @@ typedef struct _cef_request_handler_t {
|
||||
//
|
||||
///
|
||||
cef_return_value_t(CEF_CALLBACK* on_before_resource_load)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_request_t* request,
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request,
|
||||
struct _cef_request_callback_t* callback);
|
||||
|
||||
///
|
||||
@@ -160,8 +169,10 @@ typedef struct _cef_request_handler_t {
|
||||
// modified in this callback.
|
||||
///
|
||||
struct _cef_resource_handler_t*(CEF_CALLBACK* get_resource_handler)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_request_t* request);
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request);
|
||||
|
||||
///
|
||||
// Called on the IO thread when a resource load is redirected. The |request|
|
||||
@@ -172,8 +183,10 @@ typedef struct _cef_request_handler_t {
|
||||
// callback.
|
||||
///
|
||||
void(CEF_CALLBACK* on_resource_redirect)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request, struct _cef_response_t* response,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request,
|
||||
struct _cef_response_t* response,
|
||||
cef_string_t* new_url);
|
||||
|
||||
///
|
||||
@@ -183,8 +196,10 @@ typedef struct _cef_request_handler_t {
|
||||
// The |response| object cannot be modified in this callback.
|
||||
///
|
||||
int(CEF_CALLBACK* on_resource_response)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request, struct _cef_response_t* response);
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request,
|
||||
struct _cef_response_t* response);
|
||||
|
||||
///
|
||||
// Called on the IO thread to optionally filter resource response content.
|
||||
@@ -192,8 +207,10 @@ typedef struct _cef_request_handler_t {
|
||||
// and cannot be modified in this callback.
|
||||
///
|
||||
struct _cef_response_filter_t*(CEF_CALLBACK* get_resource_response_filter)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_request_t* request,
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request,
|
||||
struct _cef_response_t* response);
|
||||
|
||||
///
|
||||
@@ -203,9 +220,12 @@ typedef struct _cef_request_handler_t {
|
||||
// |received_content_length| is the number of response bytes actually read.
|
||||
///
|
||||
void(CEF_CALLBACK* on_resource_load_complete)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_request_t* request,
|
||||
struct _cef_response_t* response, cef_urlrequest_status_t status,
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request,
|
||||
struct _cef_response_t* response,
|
||||
cef_urlrequest_status_t status,
|
||||
int64 received_content_length);
|
||||
|
||||
///
|
||||
@@ -219,10 +239,39 @@ typedef struct _cef_request_handler_t {
|
||||
// the authentication information is available. Return false (0) to cancel the
|
||||
// request immediately.
|
||||
///
|
||||
int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame, int isProxy,
|
||||
const cef_string_t* host, int port, const cef_string_t* realm,
|
||||
const cef_string_t* scheme, struct _cef_auth_callback_t* callback);
|
||||
int(CEF_CALLBACK* get_auth_credentials)(
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
int isProxy,
|
||||
const cef_string_t* host,
|
||||
int port,
|
||||
const cef_string_t* realm,
|
||||
const cef_string_t* scheme,
|
||||
struct _cef_auth_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the IO thread before sending a network request with a "Cookie"
|
||||
// request header. Return true (1) to allow cookies to be included in the
|
||||
// network request or false (0) to block cookies. The |request| object should
|
||||
// not be modified in this callback.
|
||||
///
|
||||
int(CEF_CALLBACK* can_get_cookies)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request);
|
||||
|
||||
///
|
||||
// Called on the IO thread when receiving a network request with a "Set-
|
||||
// Cookie" response header value represented by |cookie|. Return true (1) to
|
||||
// allow the cookie to be stored or false (0) to block the cookie. The
|
||||
// |request| object should not be modified in this callback.
|
||||
///
|
||||
int(CEF_CALLBACK* can_set_cookie)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request,
|
||||
const struct _cef_cookie_t* cookie);
|
||||
|
||||
///
|
||||
// Called on the IO thread when JavaScript requests a specific storage quota
|
||||
@@ -234,8 +283,10 @@ typedef struct _cef_request_handler_t {
|
||||
// immediately.
|
||||
///
|
||||
int(CEF_CALLBACK* on_quota_request)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_string_t* origin_url,
|
||||
int64 new_size, struct _cef_request_callback_t* callback);
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* origin_url,
|
||||
int64 new_size,
|
||||
struct _cef_request_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the UI thread to handle requests for URLs with an unknown
|
||||
@@ -244,9 +295,10 @@ typedef struct _cef_request_handler_t {
|
||||
// YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR
|
||||
// OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.
|
||||
///
|
||||
void (CEF_CALLBACK *on_protocol_execution)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
const cef_string_t* url, int* allow_os_execution);
|
||||
void(CEF_CALLBACK* on_protocol_execution)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* url,
|
||||
int* allow_os_execution);
|
||||
|
||||
///
|
||||
// Called on the UI thread to handle requests for URLs with an invalid SSL
|
||||
@@ -256,9 +308,12 @@ typedef struct _cef_request_handler_t {
|
||||
// CefSettings.ignore_certificate_errors is set all invalid certificates will
|
||||
// be accepted without calling this function.
|
||||
///
|
||||
int (CEF_CALLBACK *on_certificate_error)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, cef_errorcode_t cert_error,
|
||||
const cef_string_t* request_url, struct _cef_sslinfo_t* ssl_info,
|
||||
int(CEF_CALLBACK* on_certificate_error)(
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_errorcode_t cert_error,
|
||||
const cef_string_t* request_url,
|
||||
struct _cef_sslinfo_t* ssl_info,
|
||||
struct _cef_request_callback_t* callback);
|
||||
|
||||
///
|
||||
@@ -275,8 +330,11 @@ typedef struct _cef_request_handler_t {
|
||||
// the server trusts.
|
||||
///
|
||||
int(CEF_CALLBACK* on_select_client_certificate)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
int isProxy, const cef_string_t* host, int port,
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int isProxy,
|
||||
const cef_string_t* host,
|
||||
int port,
|
||||
size_t certificatesCount,
|
||||
struct _cef_x509certificate_t* const* certificates,
|
||||
struct _cef_select_client_certificate_callback_t* callback);
|
||||
@@ -286,7 +344,8 @@ typedef struct _cef_request_handler_t {
|
||||
// |plugin_path| is the path of the plugin that crashed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_plugin_crashed)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser, const cef_string_t* plugin_path);
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* plugin_path);
|
||||
|
||||
///
|
||||
// Called on the browser process UI thread when the render view associated
|
||||
@@ -301,11 +360,11 @@ typedef struct _cef_request_handler_t {
|
||||
// unexpectedly. |status| indicates how the process terminated.
|
||||
///
|
||||
void(CEF_CALLBACK* on_render_process_terminated)(
|
||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_termination_status_t status);
|
||||
} cef_request_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=439cc7c4ac7f2178ab0b445ab91df66b6759335f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used for retrieving resources from the resource bundle (*.pak)
|
||||
// files loaded by CEF during startup or via the cef_resource_bundle_tHandler
|
||||
@@ -65,7 +66,8 @@ typedef struct _cef_resource_bundle_t {
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_localized_string)(
|
||||
struct _cef_resource_bundle_t* self, int string_id);
|
||||
struct _cef_resource_bundle_t* self,
|
||||
int string_id);
|
||||
|
||||
///
|
||||
// Retrieves the contents of the specified scale independent |resource_id|. If
|
||||
@@ -76,7 +78,9 @@ typedef struct _cef_resource_bundle_t {
|
||||
// of valid resource ID values.
|
||||
///
|
||||
int(CEF_CALLBACK* get_data_resource)(struct _cef_resource_bundle_t* self,
|
||||
int resource_id, void** data, size_t* data_size);
|
||||
int resource_id,
|
||||
void** data,
|
||||
size_t* data_size);
|
||||
|
||||
///
|
||||
// Retrieves the contents of the specified |resource_id| nearest the scale
|
||||
@@ -89,17 +93,18 @@ typedef struct _cef_resource_bundle_t {
|
||||
// of valid resource ID values.
|
||||
///
|
||||
int(CEF_CALLBACK* get_data_resource_for_scale)(
|
||||
struct _cef_resource_bundle_t* self, int resource_id,
|
||||
cef_scale_factor_t scale_factor, void** data, size_t* data_size);
|
||||
struct _cef_resource_bundle_t* self,
|
||||
int resource_id,
|
||||
cef_scale_factor_t scale_factor,
|
||||
void** data,
|
||||
size_t* data_size);
|
||||
} cef_resource_bundle_t;
|
||||
|
||||
|
||||
///
|
||||
// Returns the global resource bundle instance.
|
||||
///
|
||||
CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ce250b3a07931595bbf0028fb56c11b6160f836e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used to implement a custom resource bundle structure. See
|
||||
// CefSettings for additional options related to resource bundle loading. The
|
||||
@@ -63,7 +64,8 @@ typedef struct _cef_resource_bundle_handler_t {
|
||||
// cef_pack_strings.h for a listing of valid string ID values.
|
||||
///
|
||||
int(CEF_CALLBACK* get_localized_string)(
|
||||
struct _cef_resource_bundle_handler_t* self, int string_id,
|
||||
struct _cef_resource_bundle_handler_t* self,
|
||||
int string_id,
|
||||
cef_string_t* string);
|
||||
|
||||
///
|
||||
@@ -75,7 +77,9 @@ typedef struct _cef_resource_bundle_handler_t {
|
||||
// resource ID values.
|
||||
///
|
||||
int(CEF_CALLBACK* get_data_resource)(
|
||||
struct _cef_resource_bundle_handler_t* self, int resource_id, void** data,
|
||||
struct _cef_resource_bundle_handler_t* self,
|
||||
int resource_id,
|
||||
void** data,
|
||||
size_t* data_size);
|
||||
|
||||
///
|
||||
@@ -87,11 +91,13 @@ typedef struct _cef_resource_bundle_handler_t {
|
||||
// cef_pack_resources.h for a listing of valid resource ID values.
|
||||
///
|
||||
int(CEF_CALLBACK* get_data_resource_for_scale)(
|
||||
struct _cef_resource_bundle_handler_t* self, int resource_id,
|
||||
cef_scale_factor_t scale_factor, void** data, size_t* data_size);
|
||||
struct _cef_resource_bundle_handler_t* self,
|
||||
int resource_id,
|
||||
cef_scale_factor_t scale_factor,
|
||||
void** data,
|
||||
size_t* data_size);
|
||||
} cef_resource_bundle_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=64a8d248c8c6c5b17a8ce1bdf79b82e791d87a1a$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
||||
@@ -49,7 +51,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used to implement a custom request handler structure. The functions
|
||||
// of this structure will always be called on the IO thread.
|
||||
@@ -68,7 +69,8 @@ typedef struct _cef_resource_handler_t {
|
||||
// request return false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* process_request)(struct _cef_resource_handler_t* self,
|
||||
struct _cef_request_t* request, struct _cef_callback_t* callback);
|
||||
struct _cef_request_t* request,
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Retrieve response header information. If the response length is not known
|
||||
@@ -81,9 +83,10 @@ typedef struct _cef_resource_handler_t {
|
||||
// URL. If an error occured while setting up the request you can call
|
||||
// set_error() on |response| to indicate the error condition.
|
||||
///
|
||||
void (CEF_CALLBACK *get_response_headers)(
|
||||
struct _cef_resource_handler_t* self, struct _cef_response_t* response,
|
||||
int64* response_length, cef_string_t* redirectUrl);
|
||||
void(CEF_CALLBACK* get_response_headers)(struct _cef_resource_handler_t* self,
|
||||
struct _cef_response_t* response,
|
||||
int64* response_length,
|
||||
cef_string_t* redirectUrl);
|
||||
|
||||
///
|
||||
// Read response data. If data is available immediately copy up to
|
||||
@@ -93,7 +96,9 @@ typedef struct _cef_resource_handler_t {
|
||||
// data is available. To indicate response completion return false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* read_response)(struct _cef_resource_handler_t* self,
|
||||
void* data_out, int bytes_to_read, int* bytes_read,
|
||||
void* data_out,
|
||||
int bytes_to_read,
|
||||
int* bytes_read,
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
@@ -117,7 +122,6 @@ typedef struct _cef_resource_handler_t {
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_resource_handler_t* self);
|
||||
} cef_resource_handler_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=fd2cbc427bccf30298e26dd6c3bcef9551433f8b$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent a web response. The functions of this structure
|
||||
// may be called on any thread.
|
||||
@@ -126,15 +127,25 @@ typedef struct _cef_response_t {
|
||||
///
|
||||
void(CEF_CALLBACK* set_header_map)(struct _cef_response_t* self,
|
||||
cef_string_multimap_t headerMap);
|
||||
} cef_response_t;
|
||||
|
||||
///
|
||||
// Get the resolved URL after redirects or changed as a result of HSTS.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_response_t* self);
|
||||
|
||||
///
|
||||
// Set the resolved URL after redirects or changed as a result of HSTS.
|
||||
///
|
||||
void(CEF_CALLBACK* set_url)(struct _cef_response_t* self,
|
||||
const cef_string_t* url);
|
||||
} cef_response_t;
|
||||
|
||||
///
|
||||
// Create a new cef_response_t object.
|
||||
///
|
||||
CEF_EXPORT cef_response_t* cef_response_create();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=a0599caa7b458266ace091657d7024453d7ce37a$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to filter resource response content. The functions
|
||||
// of this structure will be called on the browser process IO thread.
|
||||
@@ -93,12 +94,15 @@ typedef struct _cef_response_filter_t {
|
||||
// Do not keep a reference to the buffers passed to this function.
|
||||
///
|
||||
cef_response_filter_status_t(CEF_CALLBACK* filter)(
|
||||
struct _cef_response_filter_t* self, void* data_in, size_t data_in_size,
|
||||
size_t* data_in_read, void* data_out, size_t data_out_size,
|
||||
struct _cef_response_filter_t* self,
|
||||
void* data_in,
|
||||
size_t data_in_size,
|
||||
size_t* data_in_read,
|
||||
void* data_out,
|
||||
size_t data_out_size,
|
||||
size_t* data_out_written);
|
||||
} cef_response_filter_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=57a50b4c4bee68267ffcf7efebfbe711b62b0f84$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
||||
@@ -108,20 +110,27 @@ typedef struct _cef_scheme_registrar_t {
|
||||
// security rules as those applied to "https" URLs. For example, loading this
|
||||
// scheme from other secure schemes will not trigger mixed content warnings.
|
||||
//
|
||||
// If |is_cors_enabled| is true (1) the scheme that can be sent CORS requests.
|
||||
// This value should be true (1) in most cases where |is_standard| is true
|
||||
// (1).
|
||||
// If |is_cors_enabled| is true (1) the scheme can be sent CORS requests. This
|
||||
// value should be true (1) in most cases where |is_standard| is true (1).
|
||||
//
|
||||
// If |is_csp_bypassing| is true (1) the scheme can bypass Content-Security-
|
||||
// Policy (CSP) checks. This value should be false (0) in most cases where
|
||||
// |is_standard| is true (1).
|
||||
//
|
||||
// This function may be called on any thread. It should only be called once
|
||||
// per unique |scheme_name| value. If |scheme_name| is already registered or
|
||||
// if an error occurs this function will return false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* add_custom_scheme)(struct _cef_scheme_registrar_t* self,
|
||||
const cef_string_t* scheme_name, int is_standard, int is_local,
|
||||
int is_display_isolated, int is_secure, int is_cors_enabled);
|
||||
const cef_string_t* scheme_name,
|
||||
int is_standard,
|
||||
int is_local,
|
||||
int is_display_isolated,
|
||||
int is_secure,
|
||||
int is_cors_enabled,
|
||||
int is_csp_bypassing);
|
||||
} cef_scheme_registrar_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure that creates cef_resource_handler_t instances for handling scheme
|
||||
// requests. The functions of this structure will always be called on the IO
|
||||
@@ -143,11 +152,12 @@ typedef struct _cef_scheme_handler_factory_t {
|
||||
///
|
||||
struct _cef_resource_handler_t*(CEF_CALLBACK* create)(
|
||||
struct _cef_scheme_handler_factory_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
const cef_string_t* scheme_name, struct _cef_request_t* request);
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
const cef_string_t* scheme_name,
|
||||
struct _cef_request_t* request);
|
||||
} cef_scheme_handler_factory_t;
|
||||
|
||||
|
||||
///
|
||||
// Register a scheme handler factory with the global request context. An NULL
|
||||
// |domain_name| value for a standard scheme will cause the factory to match all
|
||||
@@ -164,7 +174,8 @@ typedef struct _cef_scheme_handler_factory_t {
|
||||
// ory().
|
||||
///
|
||||
CEF_EXPORT int cef_register_scheme_handler_factory(
|
||||
const cef_string_t* scheme_name, const cef_string_t* domain_name,
|
||||
const cef_string_t* scheme_name,
|
||||
const cef_string_t* domain_name,
|
||||
cef_scheme_handler_factory_t* factory);
|
||||
|
||||
///
|
||||
|
327
include/capi/cef_server_capi.h
Normal file
327
include/capi/cef_server_capi.h
Normal file
@@ -0,0 +1,327 @@
|
||||
// Copyright (c) 2018 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=0653420628236b2bc16541d65b75742aba4e4613$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_callback_capi.h"
|
||||
#include "include/capi/cef_request_capi.h"
|
||||
#include "include/capi/cef_task_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_server_handler_t;
|
||||
|
||||
///
|
||||
// Structure representing a server that supports HTTP and WebSocket requests.
|
||||
// Server capacity is limited and is intended to handle only a small number of
|
||||
// simultaneous connections (e.g. for communicating between applications on
|
||||
// localhost). The functions of this structure are safe to call from any thread
|
||||
// in the brower process unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_server_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns the task runner for the dedicated server thread.
|
||||
///
|
||||
struct _cef_task_runner_t*(CEF_CALLBACK* get_task_runner)(
|
||||
struct _cef_server_t* self);
|
||||
|
||||
///
|
||||
// Stop the server and shut down the dedicated server thread. See
|
||||
// cef_server_handler_t::OnServerCreated documentation for a description of
|
||||
// server lifespan.
|
||||
///
|
||||
void(CEF_CALLBACK* shutdown)(struct _cef_server_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the server is currently running and accepting incoming
|
||||
// connections. See cef_server_handler_t::OnServerCreated documentation for a
|
||||
// description of server lifespan. This function must be called on the
|
||||
// dedicated server thread.
|
||||
///
|
||||
int(CEF_CALLBACK* is_running)(struct _cef_server_t* self);
|
||||
|
||||
///
|
||||
// Returns the server address including the port number.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_address)(struct _cef_server_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the server currently has a connection. This function
|
||||
// must be called on the dedicated server thread.
|
||||
///
|
||||
int(CEF_CALLBACK* has_connection)(struct _cef_server_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if |connection_id| represents a valid connection. This
|
||||
// function must be called on the dedicated server thread.
|
||||
///
|
||||
int(CEF_CALLBACK* is_valid_connection)(struct _cef_server_t* self,
|
||||
int connection_id);
|
||||
|
||||
///
|
||||
// Send an HTTP 200 "OK" response to the connection identified by
|
||||
// |connection_id|. |content_type| is the response content type (e.g.
|
||||
// "text/html"), |data| is the response content, and |data_size| is the size
|
||||
// of |data| in bytes. The contents of |data| will be copied. The connection
|
||||
// will be closed automatically after the response is sent.
|
||||
///
|
||||
void(CEF_CALLBACK* send_http200response)(struct _cef_server_t* self,
|
||||
int connection_id,
|
||||
const cef_string_t* content_type,
|
||||
const void* data,
|
||||
size_t data_size);
|
||||
|
||||
///
|
||||
// Send an HTTP 404 "Not Found" response to the connection identified by
|
||||
// |connection_id|. The connection will be closed automatically after the
|
||||
// response is sent.
|
||||
///
|
||||
void(CEF_CALLBACK* send_http404response)(struct _cef_server_t* self,
|
||||
int connection_id);
|
||||
|
||||
///
|
||||
// Send an HTTP 500 "Internal Server Error" response to the connection
|
||||
// identified by |connection_id|. |error_message| is the associated error
|
||||
// message. The connection will be closed automatically after the response is
|
||||
// sent.
|
||||
///
|
||||
void(CEF_CALLBACK* send_http500response)(struct _cef_server_t* self,
|
||||
int connection_id,
|
||||
const cef_string_t* error_message);
|
||||
|
||||
///
|
||||
// Send a custom HTTP response to the connection identified by
|
||||
// |connection_id|. |response_code| is the HTTP response code sent in the
|
||||
// status line (e.g. 200), |content_type| is the response content type sent as
|
||||
// the "Content-Type" header (e.g. "text/html"), |content_length| is the
|
||||
// expected content length, and |extra_headers| is the map of extra response
|
||||
// headers. If |content_length| is >= 0 then the "Content-Length" header will
|
||||
// be sent. If |content_length| is 0 then no content is expected and the
|
||||
// connection will be closed automatically after the response is sent. If
|
||||
// |content_length| is < 0 then no "Content-Length" header will be sent and
|
||||
// the client will continue reading until the connection is closed. Use the
|
||||
// SendRawData function to send the content, if applicable, and call
|
||||
// CloseConnection after all content has been sent.
|
||||
///
|
||||
void(CEF_CALLBACK* send_http_response)(struct _cef_server_t* self,
|
||||
int connection_id,
|
||||
int response_code,
|
||||
const cef_string_t* content_type,
|
||||
int64 content_length,
|
||||
cef_string_multimap_t extra_headers);
|
||||
|
||||
///
|
||||
// Send raw data directly to the connection identified by |connection_id|.
|
||||
// |data| is the raw data and |data_size| is the size of |data| in bytes. The
|
||||
// contents of |data| will be copied. No validation of |data| is performed
|
||||
// internally so the client should be careful to send the amount indicated by
|
||||
// the "Content-Length" header, if specified. See SendHttpResponse
|
||||
// documentation for intended usage.
|
||||
///
|
||||
void(CEF_CALLBACK* send_raw_data)(struct _cef_server_t* self,
|
||||
int connection_id,
|
||||
const void* data,
|
||||
size_t data_size);
|
||||
|
||||
///
|
||||
// Close the connection identified by |connection_id|. See SendHttpResponse
|
||||
// documentation for intended usage.
|
||||
///
|
||||
void(CEF_CALLBACK* close_connection)(struct _cef_server_t* self,
|
||||
int connection_id);
|
||||
|
||||
///
|
||||
// Send a WebSocket message to the connection identified by |connection_id|.
|
||||
// |data| is the response content and |data_size| is the size of |data| in
|
||||
// bytes. The contents of |data| will be copied. See
|
||||
// cef_server_handler_t::OnWebSocketRequest documentation for intended usage.
|
||||
///
|
||||
void(CEF_CALLBACK* send_web_socket_message)(struct _cef_server_t* self,
|
||||
int connection_id,
|
||||
const void* data,
|
||||
size_t data_size);
|
||||
} cef_server_t;
|
||||
|
||||
///
|
||||
// Create a new server that binds to |address| and |port|. |address| must be a
|
||||
// valid IPv4 or IPv6 address (e.g. 127.0.0.1 or ::1) and |port| must be a port
|
||||
// number outside of the reserved range (e.g. between 1025 and 65535 on most
|
||||
// platforms). |backlog| is the maximum number of pending connections. A new
|
||||
// thread will be created for each CreateServer call (the "dedicated server
|
||||
// thread"). It is therefore recommended to use a different cef_server_handler_t
|
||||
// instance for each CreateServer call to avoid thread safety issues in the
|
||||
// cef_server_handler_t implementation. The
|
||||
// cef_server_handler_t::OnServerCreated function will be called on the
|
||||
// dedicated server thread to report success or failure. See
|
||||
// cef_server_handler_t::OnServerCreated documentation for a description of
|
||||
// server lifespan.
|
||||
///
|
||||
CEF_EXPORT void cef_server_create(const cef_string_t* address,
|
||||
uint16 port,
|
||||
int backlog,
|
||||
struct _cef_server_handler_t* handler);
|
||||
|
||||
///
|
||||
// Implement this structure to handle HTTP server requests. A new thread will be
|
||||
// created for each cef_server_t::CreateServer call (the "dedicated server
|
||||
// thread"), and the functions of this structure will be called on that thread.
|
||||
// It is therefore recommended to use a different cef_server_handler_t instance
|
||||
// for each cef_server_t::CreateServer call to avoid thread safety issues in the
|
||||
// cef_server_handler_t implementation.
|
||||
///
|
||||
typedef struct _cef_server_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called when |server| is created. If the server was started successfully
|
||||
// then cef_server_t::IsRunning will return true (1). The server will continue
|
||||
// running until cef_server_t::Shutdown is called, after which time
|
||||
// OnServerDestroyed will be called. If the server failed to start then
|
||||
// OnServerDestroyed will be called immediately after this function returns.
|
||||
///
|
||||
void(CEF_CALLBACK* on_server_created)(struct _cef_server_handler_t* self,
|
||||
struct _cef_server_t* server);
|
||||
|
||||
///
|
||||
// Called when |server| is destroyed. The server thread will be stopped after
|
||||
// this function returns. The client should release any references to |server|
|
||||
// when this function is called. See OnServerCreated documentation for a
|
||||
// description of server lifespan.
|
||||
///
|
||||
void(CEF_CALLBACK* on_server_destroyed)(struct _cef_server_handler_t* self,
|
||||
struct _cef_server_t* server);
|
||||
|
||||
///
|
||||
// Called when a client connects to |server|. |connection_id| uniquely
|
||||
// identifies the connection. Each call to this function will have a matching
|
||||
// call to OnClientDisconnected.
|
||||
///
|
||||
void(CEF_CALLBACK* on_client_connected)(struct _cef_server_handler_t* self,
|
||||
struct _cef_server_t* server,
|
||||
int connection_id);
|
||||
|
||||
///
|
||||
// Called when a client disconnects from |server|. |connection_id| uniquely
|
||||
// identifies the connection. The client should release any data associated
|
||||
// with |connection_id| when this function is called and |connection_id|
|
||||
// should no longer be passed to cef_server_t functions. Disconnects can
|
||||
// originate from either the client or the server. For example, the server
|
||||
// will disconnect automatically after a cef_server_t::SendHttpXXXResponse
|
||||
// function is called.
|
||||
///
|
||||
void(CEF_CALLBACK* on_client_disconnected)(struct _cef_server_handler_t* self,
|
||||
struct _cef_server_t* server,
|
||||
int connection_id);
|
||||
|
||||
///
|
||||
// Called when |server| receives an HTTP request. |connection_id| uniquely
|
||||
// identifies the connection, |client_address| is the requesting IPv4 or IPv6
|
||||
// client address including port number, and |request| contains the request
|
||||
// contents (URL, function, headers and optional POST data). Call cef_server_t
|
||||
// functions either synchronously or asynchronusly to send a response.
|
||||
///
|
||||
void(CEF_CALLBACK* on_http_request)(struct _cef_server_handler_t* self,
|
||||
struct _cef_server_t* server,
|
||||
int connection_id,
|
||||
const cef_string_t* client_address,
|
||||
struct _cef_request_t* request);
|
||||
|
||||
///
|
||||
// Called when |server| receives a WebSocket request. |connection_id| uniquely
|
||||
// identifies the connection, |client_address| is the requesting IPv4 or IPv6
|
||||
// client address including port number, and |request| contains the request
|
||||
// contents (URL, function, headers and optional POST data). Execute
|
||||
// |callback| either synchronously or asynchronously to accept or decline the
|
||||
// WebSocket connection. If the request is accepted then OnWebSocketConnected
|
||||
// will be called after the WebSocket has connected and incoming messages will
|
||||
// be delivered to the OnWebSocketMessage callback. If the request is declined
|
||||
// then the client will be disconnected and OnClientDisconnected will be
|
||||
// called. Call the cef_server_t::SendWebSocketMessage function after
|
||||
// receiving the OnWebSocketConnected callback to respond with WebSocket
|
||||
// messages.
|
||||
///
|
||||
void(CEF_CALLBACK* on_web_socket_request)(struct _cef_server_handler_t* self,
|
||||
struct _cef_server_t* server,
|
||||
int connection_id,
|
||||
const cef_string_t* client_address,
|
||||
struct _cef_request_t* request,
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called after the client has accepted the WebSocket connection for |server|
|
||||
// and |connection_id| via the OnWebSocketRequest callback. See
|
||||
// OnWebSocketRequest documentation for intended usage.
|
||||
///
|
||||
void(CEF_CALLBACK* on_web_socket_connected)(
|
||||
struct _cef_server_handler_t* self,
|
||||
struct _cef_server_t* server,
|
||||
int connection_id);
|
||||
|
||||
///
|
||||
// Called when |server| receives an WebSocket message. |connection_id|
|
||||
// uniquely identifies the connection, |data| is the message content and
|
||||
// |data_size| is the size of |data| in bytes. Do not keep a reference to
|
||||
// |data| outside of this function. See OnWebSocketRequest documentation for
|
||||
// intended usage.
|
||||
///
|
||||
void(CEF_CALLBACK* on_web_socket_message)(struct _cef_server_handler_t* self,
|
||||
struct _cef_server_t* server,
|
||||
int connection_id,
|
||||
const void* data,
|
||||
size_t data_size);
|
||||
} cef_server_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=3aae2c2e717093121c6236d799cd4d7334cb153c$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_
|
||||
@@ -46,7 +48,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure representing SSL information.
|
||||
///
|
||||
@@ -60,8 +61,7 @@ typedef struct _cef_sslinfo_t {
|
||||
// Returns a bitmask containing any and all problems verifying the server
|
||||
// certificate.
|
||||
///
|
||||
cef_cert_status_t (CEF_CALLBACK *get_cert_status)(
|
||||
struct _cef_sslinfo_t* self);
|
||||
cef_cert_status_t(CEF_CALLBACK* get_cert_status)(struct _cef_sslinfo_t* self);
|
||||
|
||||
///
|
||||
// Returns the X.509 certificate.
|
||||
@@ -70,7 +70,6 @@ typedef struct _cef_sslinfo_t {
|
||||
struct _cef_sslinfo_t* self);
|
||||
} cef_sslinfo_t;
|
||||
|
||||
|
||||
///
|
||||
// Returns true (1) if the certificate status has any error, major or minor.
|
||||
///
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=4a448fc89af9db6e12499d3284b2b1309f889cfb$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_
|
||||
@@ -46,7 +48,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure representing the SSL information for a navigation entry.
|
||||
///
|
||||
@@ -87,7 +88,6 @@ typedef struct _cef_sslstatus_t {
|
||||
struct _cef_sslstatus_t* self);
|
||||
} cef_sslstatus_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=13955a9608af96bba910c2d10c0050fe98c5d8dd$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Structure the client can implement to provide a custom stream reader. The
|
||||
// functions of this structure may be called on any thread.
|
||||
@@ -58,14 +59,17 @@ typedef struct _cef_read_handler_t {
|
||||
///
|
||||
// Read raw binary data.
|
||||
///
|
||||
size_t (CEF_CALLBACK *read)(struct _cef_read_handler_t* self, void* ptr,
|
||||
size_t size, size_t n);
|
||||
size_t(CEF_CALLBACK* read)(struct _cef_read_handler_t* self,
|
||||
void* ptr,
|
||||
size_t size,
|
||||
size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Return zero on success and non-zero on failure.
|
||||
///
|
||||
int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, int64 offset,
|
||||
int(CEF_CALLBACK* seek)(struct _cef_read_handler_t* self,
|
||||
int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
@@ -86,7 +90,6 @@ typedef struct _cef_read_handler_t {
|
||||
int(CEF_CALLBACK* may_block)(struct _cef_read_handler_t* self);
|
||||
} cef_read_handler_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to read data from a stream. The functions of this structure
|
||||
// may be called on any thread.
|
||||
@@ -100,14 +103,17 @@ typedef struct _cef_stream_reader_t {
|
||||
///
|
||||
// Read raw binary data.
|
||||
///
|
||||
size_t (CEF_CALLBACK *read)(struct _cef_stream_reader_t* self, void* ptr,
|
||||
size_t size, size_t n);
|
||||
size_t(CEF_CALLBACK* read)(struct _cef_stream_reader_t* self,
|
||||
void* ptr,
|
||||
size_t size,
|
||||
size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure.
|
||||
///
|
||||
int (CEF_CALLBACK *seek)(struct _cef_stream_reader_t* self, int64 offset,
|
||||
int(CEF_CALLBACK* seek)(struct _cef_stream_reader_t* self,
|
||||
int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
@@ -128,7 +134,6 @@ typedef struct _cef_stream_reader_t {
|
||||
int(CEF_CALLBACK* may_block)(struct _cef_stream_reader_t* self);
|
||||
} cef_stream_reader_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_stream_reader_t object from a file.
|
||||
///
|
||||
@@ -147,7 +152,6 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data,
|
||||
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler(
|
||||
cef_read_handler_t* handler);
|
||||
|
||||
|
||||
///
|
||||
// Structure the client can implement to provide a custom stream writer. The
|
||||
// functions of this structure may be called on any thread.
|
||||
@@ -162,13 +166,16 @@ typedef struct _cef_write_handler_t {
|
||||
// Write raw binary data.
|
||||
///
|
||||
size_t(CEF_CALLBACK* write)(struct _cef_write_handler_t* self,
|
||||
const void* ptr, size_t size, size_t n);
|
||||
const void* ptr,
|
||||
size_t size,
|
||||
size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Return zero on success and non-zero on failure.
|
||||
///
|
||||
int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, int64 offset,
|
||||
int(CEF_CALLBACK* seek)(struct _cef_write_handler_t* self,
|
||||
int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
@@ -189,7 +196,6 @@ typedef struct _cef_write_handler_t {
|
||||
int(CEF_CALLBACK* may_block)(struct _cef_write_handler_t* self);
|
||||
} cef_write_handler_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to write data to a stream. The functions of this structure may
|
||||
// be called on any thread.
|
||||
@@ -204,13 +210,16 @@ typedef struct _cef_stream_writer_t {
|
||||
// Write raw binary data.
|
||||
///
|
||||
size_t(CEF_CALLBACK* write)(struct _cef_stream_writer_t* self,
|
||||
const void* ptr, size_t size, size_t n);
|
||||
const void* ptr,
|
||||
size_t size,
|
||||
size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure.
|
||||
///
|
||||
int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, int64 offset,
|
||||
int(CEF_CALLBACK* seek)(struct _cef_stream_writer_t* self,
|
||||
int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
@@ -231,7 +240,6 @@ typedef struct _cef_stream_writer_t {
|
||||
int(CEF_CALLBACK* may_block)(struct _cef_stream_writer_t* self);
|
||||
} cef_stream_writer_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_stream_writer_t object for a file.
|
||||
///
|
||||
@@ -244,7 +252,6 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file(
|
||||
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler(
|
||||
cef_write_handler_t* handler);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
|
||||
// Copyright (c) 2018 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
@@ -33,6 +33,8 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=23de3627ff6557115e9a7abaa36dc5932fd7bd57$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_
|
||||
@@ -44,7 +46,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to receive string values asynchronously.
|
||||
///
|
||||
@@ -61,7 +62,6 @@ typedef struct _cef_string_visitor_t {
|
||||
const cef_string_t* string);
|
||||
} cef_string_visitor_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user