mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
248 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96f907e55a | ||
|
|
cd946151e1 | ||
|
|
61bd6b5e3a | ||
|
|
cb6713fd49 | ||
|
|
a42c0eaa34 | ||
|
|
1172b27916 | ||
|
|
435cf4d862 | ||
|
|
1e5b631452 | ||
|
|
8f26fe059b | ||
|
|
9091548f17 | ||
|
|
973997f650 | ||
|
|
fc9a4fa04a | ||
|
|
923cb991ba | ||
|
|
67b06ea44f | ||
|
|
2171fc7dbe | ||
|
|
0e44127ee5 | ||
|
|
c8368c8b13 | ||
|
|
b9ba8a4352 | ||
|
|
acb89916a0 | ||
|
|
cc4d57b920 | ||
|
|
c3dc5f71bb | ||
|
|
1a680363b5 | ||
|
|
8d826cbe8c | ||
|
|
45a037385a | ||
|
|
2de137fabe | ||
|
|
a422efc3e3 | ||
|
|
aac5f8d968 | ||
|
|
080fc0848b | ||
|
|
29c0eb32da | ||
|
|
a92bbdd169 | ||
|
|
642f29baac | ||
|
|
9042f3719b | ||
|
|
e35e95bec3 | ||
|
|
5a8af72a35 | ||
|
|
efd7475bf2 | ||
|
|
08b0314f83 | ||
|
|
ef9531f0af | ||
|
|
d97b3f5e13 | ||
|
|
7eacec0d91 | ||
|
|
7c1bf316b2 | ||
|
|
739f67aa05 | ||
|
|
b34b281f4a | ||
|
|
eca7d18013 | ||
|
|
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 | ||
|
|
18ce862ad8 | ||
|
|
819dcdf461 | ||
|
|
41a02dbe08 | ||
|
|
b7b145fa4f | ||
|
|
9d48a4f80e | ||
|
|
da6f2864c2 | ||
|
|
5f4190ff75 | ||
|
|
3f0c94f7e6 | ||
|
|
914fc6f7af | ||
|
|
7bdfe79e35 | ||
|
|
a834487177 | ||
|
|
c990b5d877 | ||
|
|
9928036f63 | ||
|
|
48908c9195 | ||
|
|
03ed733800 | ||
|
|
c1a1dbdb7d | ||
|
|
12aeeb13f7 | ||
|
|
c6881fe145 | ||
|
|
4ecff1670e | ||
|
|
258c588b44 | ||
|
|
bd9a2c8069 | ||
|
|
8fee8ed05d | ||
|
|
f557d325c1 | ||
|
|
ef6df50bf9 | ||
|
|
0e65f027d2 | ||
|
|
832654689f | ||
|
|
04642e0480 | ||
|
|
a7195c0103 | ||
|
|
9ed17519a9 | ||
|
|
03f3900d75 | ||
|
|
18d56feac0 | ||
|
|
607d420baf | ||
|
|
18763fde50 | ||
|
|
659e5af870 | ||
|
|
cdd2a40469 | ||
|
|
f3a0ff98bb | ||
|
|
d6b17a8fb5 | ||
|
|
e69de63b15 | ||
|
|
7543d16cce | ||
|
|
a87f0975e2 | ||
|
|
efd96f342f | ||
|
|
cea55225f0 | ||
|
|
2149a34d0a | ||
|
|
e39accd266 | ||
|
|
4adaa2b552 | ||
|
|
ffab334e94 | ||
|
|
17c2ecd79d | ||
|
|
29f7953677 | ||
|
|
676cb1f07d | ||
|
|
e006ec0ab5 | ||
|
|
917b4a0de5 | ||
|
|
d8f943cd94 | ||
|
|
0e97c527ae | ||
|
|
f7a4102978 | ||
|
|
be15daa844 | ||
|
|
5ec98243a9 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -46,7 +46,4 @@ Thumbs.db
|
|||||||
/binary_distrib
|
/binary_distrib
|
||||||
/docs
|
/docs
|
||||||
# CEF generated files
|
# CEF generated files
|
||||||
/include/cef_pack_resources.h
|
|
||||||
/include/cef_pack_strings.h
|
|
||||||
/include/cef_version.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
|
||||||
@@ -29,3 +29,5 @@ Felix Bruns <felixbruns@spotify.com>
|
|||||||
YuTeh Shen <shenyute@gmail.com>
|
YuTeh Shen <shenyute@gmail.com>
|
||||||
Andrei Kurushin <ajax16384@gmail.com>
|
Andrei Kurushin <ajax16384@gmail.com>
|
||||||
Gonzo Berman <gberman@factset.com>
|
Gonzo Berman <gberman@factset.com>
|
||||||
|
Jakub Trzebiatowski <kuba.trzebiatowski@gmail.com>
|
||||||
|
Nishant Kaushik <nishantk@adobe.com>
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||||
|
|
||||||
{
|
{
|
||||||
'chromium_checkout': '614d31daee2f61b0180df403a8ad43f20b9f6dd7',
|
'chromium_checkout': 'refs/tags/64.0.3282.119',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
# CMakeLists.txt Bootstrap that sets up the CMake environment.
|
# CMakeLists.txt Bootstrap that sets up the CMake environment.
|
||||||
# cmake/*.cmake CEF configuration files shared by all targets.
|
# cmake/*.cmake CEF configuration files shared by all targets.
|
||||||
# libcef_dll/CMakeLists.txt Defines the libcef_dll_wrapper target.
|
# libcef_dll/CMakeLists.txt Defines the libcef_dll_wrapper target.
|
||||||
# cefclient/CMakeLists.txt Defines the cefclient target.
|
# tests/*/CMakeLists.txt Defines the test application target.
|
||||||
# cefsimple/CMakeLists.txt Defines the cefsimple target.
|
|
||||||
#
|
#
|
||||||
# See the "TODO:" comments below for guidance on how to integrate this CEF
|
# See the "TODO:" comments below for guidance on how to integrate this CEF
|
||||||
# binary distribution into a new or existing CMake project.
|
# binary distribution into a new or existing CMake project.
|
||||||
@@ -49,13 +48,13 @@
|
|||||||
# libgtkglext1-dev (required by the cefclient target only)
|
# libgtkglext1-dev (required by the cefclient target only)
|
||||||
#
|
#
|
||||||
# - Mac OS X requirements:
|
# - Mac OS X requirements:
|
||||||
# Xcode 5 or newer building on Mac OS X 10.9 (Mavericks) or newer. Xcode 7.2
|
# Xcode 5 or newer building on Mac OS X 10.9 (Mavericks) or newer. Xcode 8.3
|
||||||
# and OS X 10.11 are recommended. The Xcode command-line tools must also be
|
# 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.
|
# installed. Only 64-bit builds are supported on OS X.
|
||||||
#
|
#
|
||||||
# - Windows requirements:
|
# - Windows requirements:
|
||||||
# Visual Studio 2010 or newer building on Windows 7 or newer. Visual Studio
|
# 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
|
# BUILD EXAMPLES
|
||||||
#
|
#
|
||||||
@@ -200,8 +199,12 @@ add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
|
|||||||
# Include application targets.
|
# Include application targets.
|
||||||
# Comes from the <target>/CMakeLists.txt file in the current directory.
|
# 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.
|
# TODO: Change these lines to match your project target when you copy this file.
|
||||||
add_subdirectory(cefclient)
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
|
||||||
add_subdirectory(cefsimple)
|
add_subdirectory(tests/cefclient)
|
||||||
|
add_subdirectory(tests/cefsimple)
|
||||||
|
add_subdirectory(tests/gtest)
|
||||||
|
add_subdirectory(tests/ceftests)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Display configuration settings.
|
# Display configuration settings.
|
||||||
PRINT_CEF_CONFIG()
|
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.
|
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 (CEF1) - https://bitbucket.org/fddima/cefglue
|
||||||
* .Net/Mono (CEF3) - https://bitbucket.org/xilium/xilium.cefglue
|
* .Net/Mono (CEF3) - https://bitbucket.org/xilium/xilium.cefglue
|
||||||
* .Net (CEF3) - https://bitbucket.org/chromiumfx/chromiumfx
|
* .Net (CEF3) - https://bitbucket.org/chromiumfx/chromiumfx
|
||||||
* Delphi (CEF1) - http://code.google.com/p/delphichromiumembedded/
|
* 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
|
* Go - https://github.com/CzarekTomczak/cef2go
|
||||||
* Java - https://bitbucket.org/chromiumembedded/java-cef
|
* Java - https://bitbucket.org/chromiumembedded/java-cef
|
||||||
* Java - http://code.google.com/p/javacef/
|
* Java - http://code.google.com/p/javacef/
|
||||||
|
|||||||
126
cef_paths.gypi
126
cef_paths.gypi
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2016 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
|
# reserved. Use of this source code is governed by a BSD-style license that
|
||||||
# can be found in the LICENSE file.
|
# can be found in the LICENSE file.
|
||||||
#
|
#
|
||||||
@@ -8,10 +8,13 @@
|
|||||||
# by hand. See the translator.README.txt file in the tools directory for
|
# by hand. See the translator.README.txt file in the tools directory for
|
||||||
# more information.
|
# more information.
|
||||||
#
|
#
|
||||||
|
# $hash=5f69924ad7517dee8adf933a7c013616ebb94c36$
|
||||||
|
#
|
||||||
|
|
||||||
{
|
{
|
||||||
'variables': {
|
'variables': {
|
||||||
'autogen_cpp_includes': [
|
'autogen_cpp_includes': [
|
||||||
|
'include/cef_accessibility_handler.h',
|
||||||
'include/cef_app.h',
|
'include/cef_app.h',
|
||||||
'include/cef_auth_callback.h',
|
'include/cef_auth_callback.h',
|
||||||
'include/cef_browser.h',
|
'include/cef_browser.h',
|
||||||
@@ -21,6 +24,7 @@
|
|||||||
'include/cef_command_line.h',
|
'include/cef_command_line.h',
|
||||||
'include/cef_context_menu_handler.h',
|
'include/cef_context_menu_handler.h',
|
||||||
'include/cef_cookie.h',
|
'include/cef_cookie.h',
|
||||||
|
'include/cef_crash_util.h',
|
||||||
'include/cef_dialog_handler.h',
|
'include/cef_dialog_handler.h',
|
||||||
'include/cef_display_handler.h',
|
'include/cef_display_handler.h',
|
||||||
'include/cef_dom.h',
|
'include/cef_dom.h',
|
||||||
@@ -28,6 +32,9 @@
|
|||||||
'include/cef_download_item.h',
|
'include/cef_download_item.h',
|
||||||
'include/cef_drag_data.h',
|
'include/cef_drag_data.h',
|
||||||
'include/cef_drag_handler.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_find_handler.h',
|
||||||
'include/cef_focus_handler.h',
|
'include/cef_focus_handler.h',
|
||||||
'include/cef_frame.h',
|
'include/cef_frame.h',
|
||||||
@@ -60,19 +67,23 @@
|
|||||||
'include/cef_response.h',
|
'include/cef_response.h',
|
||||||
'include/cef_response_filter.h',
|
'include/cef_response_filter.h',
|
||||||
'include/cef_scheme.h',
|
'include/cef_scheme.h',
|
||||||
|
'include/cef_server.h',
|
||||||
'include/cef_ssl_info.h',
|
'include/cef_ssl_info.h',
|
||||||
'include/cef_ssl_status.h',
|
'include/cef_ssl_status.h',
|
||||||
'include/cef_stream.h',
|
'include/cef_stream.h',
|
||||||
'include/cef_string_visitor.h',
|
'include/cef_string_visitor.h',
|
||||||
'include/cef_task.h',
|
'include/cef_task.h',
|
||||||
|
'include/cef_thread.h',
|
||||||
'include/cef_trace.h',
|
'include/cef_trace.h',
|
||||||
'include/cef_urlrequest.h',
|
'include/cef_urlrequest.h',
|
||||||
'include/cef_v8.h',
|
'include/cef_v8.h',
|
||||||
'include/cef_values.h',
|
'include/cef_values.h',
|
||||||
|
'include/cef_waitable_event.h',
|
||||||
'include/cef_web_plugin.h',
|
'include/cef_web_plugin.h',
|
||||||
'include/cef_x509_certificate.h',
|
'include/cef_x509_certificate.h',
|
||||||
'include/cef_xml_reader.h',
|
'include/cef_xml_reader.h',
|
||||||
'include/cef_zip_reader.h',
|
'include/cef_zip_reader.h',
|
||||||
|
'include/test/cef_test_helpers.h',
|
||||||
'include/test/cef_translator_test.h',
|
'include/test/cef_translator_test.h',
|
||||||
'include/views/cef_box_layout.h',
|
'include/views/cef_box_layout.h',
|
||||||
'include/views/cef_browser_view.h',
|
'include/views/cef_browser_view.h',
|
||||||
@@ -96,6 +107,7 @@
|
|||||||
'include/views/cef_window_delegate.h',
|
'include/views/cef_window_delegate.h',
|
||||||
],
|
],
|
||||||
'autogen_capi_includes': [
|
'autogen_capi_includes': [
|
||||||
|
'include/capi/cef_accessibility_handler_capi.h',
|
||||||
'include/capi/cef_app_capi.h',
|
'include/capi/cef_app_capi.h',
|
||||||
'include/capi/cef_auth_callback_capi.h',
|
'include/capi/cef_auth_callback_capi.h',
|
||||||
'include/capi/cef_browser_capi.h',
|
'include/capi/cef_browser_capi.h',
|
||||||
@@ -105,6 +117,7 @@
|
|||||||
'include/capi/cef_command_line_capi.h',
|
'include/capi/cef_command_line_capi.h',
|
||||||
'include/capi/cef_context_menu_handler_capi.h',
|
'include/capi/cef_context_menu_handler_capi.h',
|
||||||
'include/capi/cef_cookie_capi.h',
|
'include/capi/cef_cookie_capi.h',
|
||||||
|
'include/capi/cef_crash_util_capi.h',
|
||||||
'include/capi/cef_dialog_handler_capi.h',
|
'include/capi/cef_dialog_handler_capi.h',
|
||||||
'include/capi/cef_display_handler_capi.h',
|
'include/capi/cef_display_handler_capi.h',
|
||||||
'include/capi/cef_dom_capi.h',
|
'include/capi/cef_dom_capi.h',
|
||||||
@@ -112,6 +125,9 @@
|
|||||||
'include/capi/cef_download_item_capi.h',
|
'include/capi/cef_download_item_capi.h',
|
||||||
'include/capi/cef_drag_data_capi.h',
|
'include/capi/cef_drag_data_capi.h',
|
||||||
'include/capi/cef_drag_handler_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_find_handler_capi.h',
|
||||||
'include/capi/cef_focus_handler_capi.h',
|
'include/capi/cef_focus_handler_capi.h',
|
||||||
'include/capi/cef_frame_capi.h',
|
'include/capi/cef_frame_capi.h',
|
||||||
@@ -144,19 +160,23 @@
|
|||||||
'include/capi/cef_response_capi.h',
|
'include/capi/cef_response_capi.h',
|
||||||
'include/capi/cef_response_filter_capi.h',
|
'include/capi/cef_response_filter_capi.h',
|
||||||
'include/capi/cef_scheme_capi.h',
|
'include/capi/cef_scheme_capi.h',
|
||||||
|
'include/capi/cef_server_capi.h',
|
||||||
'include/capi/cef_ssl_info_capi.h',
|
'include/capi/cef_ssl_info_capi.h',
|
||||||
'include/capi/cef_ssl_status_capi.h',
|
'include/capi/cef_ssl_status_capi.h',
|
||||||
'include/capi/cef_stream_capi.h',
|
'include/capi/cef_stream_capi.h',
|
||||||
'include/capi/cef_string_visitor_capi.h',
|
'include/capi/cef_string_visitor_capi.h',
|
||||||
'include/capi/cef_task_capi.h',
|
'include/capi/cef_task_capi.h',
|
||||||
|
'include/capi/cef_thread_capi.h',
|
||||||
'include/capi/cef_trace_capi.h',
|
'include/capi/cef_trace_capi.h',
|
||||||
'include/capi/cef_urlrequest_capi.h',
|
'include/capi/cef_urlrequest_capi.h',
|
||||||
'include/capi/cef_v8_capi.h',
|
'include/capi/cef_v8_capi.h',
|
||||||
'include/capi/cef_values_capi.h',
|
'include/capi/cef_values_capi.h',
|
||||||
|
'include/capi/cef_waitable_event_capi.h',
|
||||||
'include/capi/cef_web_plugin_capi.h',
|
'include/capi/cef_web_plugin_capi.h',
|
||||||
'include/capi/cef_x509_certificate_capi.h',
|
'include/capi/cef_x509_certificate_capi.h',
|
||||||
'include/capi/cef_xml_reader_capi.h',
|
'include/capi/cef_xml_reader_capi.h',
|
||||||
'include/capi/cef_zip_reader_capi.h',
|
'include/capi/cef_zip_reader_capi.h',
|
||||||
|
'include/capi/test/cef_test_helpers_capi.h',
|
||||||
'include/capi/test/cef_translator_test_capi.h',
|
'include/capi/test/cef_translator_test_capi.h',
|
||||||
'include/capi/views/cef_box_layout_capi.h',
|
'include/capi/views/cef_box_layout_capi.h',
|
||||||
'include/capi/views/cef_browser_view_capi.h',
|
'include/capi/views/cef_browser_view_capi.h',
|
||||||
@@ -180,6 +200,8 @@
|
|||||||
'include/capi/views/cef_window_delegate_capi.h',
|
'include/capi/views/cef_window_delegate_capi.h',
|
||||||
],
|
],
|
||||||
'autogen_library_side': [
|
'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.cc',
|
||||||
'libcef_dll/ctocpp/app_ctocpp.h',
|
'libcef_dll/ctocpp/app_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/auth_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/auth_callback_cpptoc.cc',
|
||||||
@@ -250,6 +272,10 @@
|
|||||||
'libcef_dll/ctocpp/drag_handler_ctocpp.h',
|
'libcef_dll/ctocpp/drag_handler_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/end_tracing_callback_ctocpp.h',
|
'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.cc',
|
||||||
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.h',
|
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/views/fill_layout_cpptoc.cc',
|
'libcef_dll/cpptoc/views/fill_layout_cpptoc.cc',
|
||||||
@@ -264,6 +290,8 @@
|
|||||||
'libcef_dll/cpptoc/geolocation_callback_cpptoc.h',
|
'libcef_dll/cpptoc/geolocation_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/geolocation_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/geolocation_handler_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/geolocation_handler_ctocpp.h',
|
'libcef_dll/ctocpp/geolocation_handler_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h',
|
'libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/image_cpptoc.cc',
|
'libcef_dll/cpptoc/image_cpptoc.cc',
|
||||||
@@ -288,6 +316,8 @@
|
|||||||
'libcef_dll/cpptoc/views/menu_button_cpptoc.h',
|
'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.cc',
|
||||||
'libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h',
|
'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.cc',
|
||||||
'libcef_dll/cpptoc/menu_model_cpptoc.h',
|
'libcef_dll/cpptoc/menu_model_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc',
|
'libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc',
|
||||||
@@ -360,6 +390,12 @@
|
|||||||
'libcef_dll/cpptoc/scheme_registrar_cpptoc.h',
|
'libcef_dll/cpptoc/scheme_registrar_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/views/scroll_view_cpptoc.cc',
|
'libcef_dll/cpptoc/views/scroll_view_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/views/scroll_view_cpptoc.h',
|
'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.cc',
|
||||||
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.h',
|
'libcef_dll/ctocpp/set_cookie_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
|
'libcef_dll/cpptoc/stream_reader_cpptoc.cc',
|
||||||
@@ -376,18 +412,30 @@
|
|||||||
'libcef_dll/cpptoc/views/textfield_cpptoc.h',
|
'libcef_dll/cpptoc/views/textfield_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc',
|
'libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h',
|
'libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/thread_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/thread_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/urlrequest_cpptoc.cc',
|
'libcef_dll/cpptoc/urlrequest_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/urlrequest_cpptoc.h',
|
'libcef_dll/cpptoc/urlrequest_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/urlrequest_client_ctocpp.cc',
|
'libcef_dll/ctocpp/urlrequest_client_ctocpp.cc',
|
||||||
@@ -400,6 +448,8 @@
|
|||||||
'libcef_dll/cpptoc/v8exception_cpptoc.h',
|
'libcef_dll/cpptoc/v8exception_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/v8handler_ctocpp.cc',
|
'libcef_dll/ctocpp/v8handler_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/v8handler_ctocpp.h',
|
'libcef_dll/ctocpp/v8handler_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/v8interceptor_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/v8interceptor_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/v8stack_frame_cpptoc.cc',
|
'libcef_dll/cpptoc/v8stack_frame_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/v8stack_frame_cpptoc.h',
|
'libcef_dll/cpptoc/v8stack_frame_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/v8stack_trace_cpptoc.cc',
|
'libcef_dll/cpptoc/v8stack_trace_cpptoc.cc',
|
||||||
@@ -412,6 +462,8 @@
|
|||||||
'libcef_dll/cpptoc/views/view_cpptoc.h',
|
'libcef_dll/cpptoc/views/view_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/views/view_delegate_ctocpp.cc',
|
'libcef_dll/ctocpp/views/view_delegate_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/views/view_delegate_ctocpp.h',
|
'libcef_dll/ctocpp/views/view_delegate_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/waitable_event_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/waitable_event_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/web_plugin_info_cpptoc.cc',
|
'libcef_dll/cpptoc/web_plugin_info_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/web_plugin_info_cpptoc.h',
|
'libcef_dll/cpptoc/web_plugin_info_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc',
|
'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc',
|
||||||
@@ -434,6 +486,8 @@
|
|||||||
'libcef_dll/cpptoc/zip_reader_cpptoc.h',
|
'libcef_dll/cpptoc/zip_reader_cpptoc.h',
|
||||||
],
|
],
|
||||||
'autogen_client_side': [
|
'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.cc',
|
||||||
'libcef_dll/cpptoc/app_cpptoc.h',
|
'libcef_dll/cpptoc/app_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/auth_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/auth_callback_ctocpp.cc',
|
||||||
@@ -504,6 +558,10 @@
|
|||||||
'libcef_dll/cpptoc/drag_handler_cpptoc.h',
|
'libcef_dll/cpptoc/drag_handler_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/end_tracing_callback_cpptoc.h',
|
'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.cc',
|
||||||
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.h',
|
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/views/fill_layout_ctocpp.cc',
|
'libcef_dll/ctocpp/views/fill_layout_ctocpp.cc',
|
||||||
@@ -518,6 +576,8 @@
|
|||||||
'libcef_dll/ctocpp/geolocation_callback_ctocpp.h',
|
'libcef_dll/ctocpp/geolocation_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/geolocation_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/geolocation_handler_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/geolocation_handler_cpptoc.h',
|
'libcef_dll/cpptoc/geolocation_handler_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h',
|
'libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/image_ctocpp.cc',
|
'libcef_dll/ctocpp/image_ctocpp.cc',
|
||||||
@@ -542,6 +602,8 @@
|
|||||||
'libcef_dll/ctocpp/views/menu_button_ctocpp.h',
|
'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.cc',
|
||||||
'libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h',
|
'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.cc',
|
||||||
'libcef_dll/ctocpp/menu_model_ctocpp.h',
|
'libcef_dll/ctocpp/menu_model_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc',
|
'libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc',
|
||||||
@@ -614,6 +676,12 @@
|
|||||||
'libcef_dll/ctocpp/scheme_registrar_ctocpp.h',
|
'libcef_dll/ctocpp/scheme_registrar_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/views/scroll_view_ctocpp.cc',
|
'libcef_dll/ctocpp/views/scroll_view_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/views/scroll_view_ctocpp.h',
|
'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.cc',
|
||||||
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.h',
|
'libcef_dll/cpptoc/set_cookie_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/stream_reader_ctocpp.cc',
|
'libcef_dll/ctocpp/stream_reader_ctocpp.cc',
|
||||||
@@ -630,18 +698,30 @@
|
|||||||
'libcef_dll/ctocpp/views/textfield_ctocpp.h',
|
'libcef_dll/ctocpp/views/textfield_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc',
|
'libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h',
|
'libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/thread_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/thread_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/urlrequest_ctocpp.cc',
|
'libcef_dll/ctocpp/urlrequest_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/urlrequest_ctocpp.h',
|
'libcef_dll/ctocpp/urlrequest_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/urlrequest_client_cpptoc.cc',
|
'libcef_dll/cpptoc/urlrequest_client_cpptoc.cc',
|
||||||
@@ -654,6 +734,8 @@
|
|||||||
'libcef_dll/ctocpp/v8exception_ctocpp.h',
|
'libcef_dll/ctocpp/v8exception_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/v8handler_cpptoc.cc',
|
'libcef_dll/cpptoc/v8handler_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/v8handler_cpptoc.h',
|
'libcef_dll/cpptoc/v8handler_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/v8interceptor_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/v8interceptor_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/v8stack_frame_ctocpp.cc',
|
'libcef_dll/ctocpp/v8stack_frame_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/v8stack_frame_ctocpp.h',
|
'libcef_dll/ctocpp/v8stack_frame_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/v8stack_trace_ctocpp.cc',
|
'libcef_dll/ctocpp/v8stack_trace_ctocpp.cc',
|
||||||
@@ -666,6 +748,8 @@
|
|||||||
'libcef_dll/ctocpp/views/view_ctocpp.h',
|
'libcef_dll/ctocpp/views/view_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/views/view_delegate_cpptoc.cc',
|
'libcef_dll/cpptoc/views/view_delegate_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/views/view_delegate_cpptoc.h',
|
'libcef_dll/cpptoc/views/view_delegate_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/waitable_event_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/waitable_event_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/web_plugin_info_ctocpp.cc',
|
'libcef_dll/ctocpp/web_plugin_info_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/web_plugin_info_ctocpp.h',
|
'libcef_dll/ctocpp/web_plugin_info_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc',
|
'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc',
|
||||||
|
|||||||
291
cef_paths2.gypi
291
cef_paths2.gypi
@@ -61,6 +61,7 @@
|
|||||||
'include/wrapper/cef_helpers.h',
|
'include/wrapper/cef_helpers.h',
|
||||||
'include/wrapper/cef_message_router.h',
|
'include/wrapper/cef_message_router.h',
|
||||||
'include/wrapper/cef_resource_manager.h',
|
'include/wrapper/cef_resource_manager.h',
|
||||||
|
'include/wrapper/cef_scoped_temp_dir.h',
|
||||||
'include/wrapper/cef_stream_resource_handler.h',
|
'include/wrapper/cef_stream_resource_handler.h',
|
||||||
'include/wrapper/cef_xml_object.h',
|
'include/wrapper/cef_xml_object.h',
|
||||||
'include/wrapper/cef_zip_archive.h',
|
'include/wrapper/cef_zip_archive.h',
|
||||||
@@ -87,12 +88,17 @@
|
|||||||
'include/internal/cef_types_linux.h',
|
'include/internal/cef_types_linux.h',
|
||||||
],
|
],
|
||||||
'libcef_sources_common': [
|
'libcef_sources_common': [
|
||||||
'libcef_dll/cpptoc/cpptoc.h',
|
'libcef_dll/cpptoc/cpptoc_ref_counted.h',
|
||||||
'libcef_dll/ctocpp/base_ctocpp.cc',
|
'libcef_dll/cpptoc/cpptoc_scoped.h',
|
||||||
'libcef_dll/ctocpp/base_ctocpp.h',
|
'libcef_dll/ctocpp/base_ref_counted_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/ctocpp.h',
|
'libcef_dll/ctocpp/base_ref_counted_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/base_scoped_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/base_scoped_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/ctocpp_ref_counted.h',
|
||||||
|
'libcef_dll/ctocpp/ctocpp_scoped.h',
|
||||||
'libcef_dll/libcef_dll.cc',
|
'libcef_dll/libcef_dll.cc',
|
||||||
'libcef_dll/libcef_dll2.cc',
|
'libcef_dll/libcef_dll2.cc',
|
||||||
|
'libcef_dll/ptr_util.h',
|
||||||
'libcef_dll/resource.h',
|
'libcef_dll/resource.h',
|
||||||
'libcef_dll/transfer_util.cc',
|
'libcef_dll/transfer_util.cc',
|
||||||
'libcef_dll/transfer_util.h',
|
'libcef_dll/transfer_util.h',
|
||||||
@@ -113,10 +119,15 @@
|
|||||||
'libcef_dll/base/cef_weak_ptr.cc',
|
'libcef_dll/base/cef_weak_ptr.cc',
|
||||||
],
|
],
|
||||||
'libcef_dll_wrapper_sources_common': [
|
'libcef_dll_wrapper_sources_common': [
|
||||||
'libcef_dll/cpptoc/base_cpptoc.cc',
|
'libcef_dll/cpptoc/base_ref_counted_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/base_cpptoc.h',
|
'libcef_dll/cpptoc/base_ref_counted_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/cpptoc.h',
|
'libcef_dll/cpptoc/base_scoped_cpptoc.cc',
|
||||||
'libcef_dll/ctocpp/ctocpp.h',
|
'libcef_dll/cpptoc/base_scoped_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/cpptoc_ref_counted.h',
|
||||||
|
'libcef_dll/cpptoc/cpptoc_scoped.h',
|
||||||
|
'libcef_dll/ctocpp/ctocpp_ref_counted.h',
|
||||||
|
'libcef_dll/ctocpp/ctocpp_scoped.h',
|
||||||
|
'libcef_dll/ptr_util.h',
|
||||||
'libcef_dll/transfer_util.cc',
|
'libcef_dll/transfer_util.cc',
|
||||||
'libcef_dll/transfer_util.h',
|
'libcef_dll/transfer_util.h',
|
||||||
'libcef_dll/wrapper_types.h',
|
'libcef_dll/wrapper_types.h',
|
||||||
@@ -125,12 +136,68 @@
|
|||||||
'libcef_dll/wrapper/cef_closure_task.cc',
|
'libcef_dll/wrapper/cef_closure_task.cc',
|
||||||
'libcef_dll/wrapper/cef_message_router.cc',
|
'libcef_dll/wrapper/cef_message_router.cc',
|
||||||
'libcef_dll/wrapper/cef_resource_manager.cc',
|
'libcef_dll/wrapper/cef_resource_manager.cc',
|
||||||
|
'libcef_dll/wrapper/cef_scoped_temp_dir.cc',
|
||||||
'libcef_dll/wrapper/cef_stream_resource_handler.cc',
|
'libcef_dll/wrapper/cef_stream_resource_handler.cc',
|
||||||
'libcef_dll/wrapper/cef_xml_object.cc',
|
'libcef_dll/wrapper/cef_xml_object.cc',
|
||||||
'libcef_dll/wrapper/cef_zip_archive.cc',
|
'libcef_dll/wrapper/cef_zip_archive.cc',
|
||||||
'libcef_dll/wrapper/libcef_dll_wrapper.cc',
|
'libcef_dll/wrapper/libcef_dll_wrapper.cc',
|
||||||
'libcef_dll/wrapper/libcef_dll_wrapper2.cc',
|
'libcef_dll/wrapper/libcef_dll_wrapper2.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',
|
||||||
|
'tests/shared/browser/main_message_loop.h',
|
||||||
|
'tests/shared/browser/main_message_loop_external_pump.cc',
|
||||||
|
'tests/shared/browser/main_message_loop_external_pump.h',
|
||||||
|
'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.h',
|
||||||
|
],
|
||||||
|
'shared_sources_common': [
|
||||||
|
'tests/shared/common/client_app.cc',
|
||||||
|
'tests/shared/common/client_app.h',
|
||||||
|
'tests/shared/common/client_app_other.cc',
|
||||||
|
'tests/shared/common/client_app_other.h',
|
||||||
|
'tests/shared/common/client_switches.cc',
|
||||||
|
'tests/shared/common/client_switches.h',
|
||||||
|
],
|
||||||
|
'shared_sources_renderer': [
|
||||||
|
'tests/shared/renderer/client_app_renderer.cc',
|
||||||
|
'tests/shared/renderer/client_app_renderer.h',
|
||||||
|
],
|
||||||
|
'shared_sources_resources': [
|
||||||
|
'tests/shared/resources/osr_test.html',
|
||||||
|
'tests/shared/resources/pdf.html',
|
||||||
|
'tests/shared/resources/pdf.pdf',
|
||||||
|
'tests/shared/resources/window_icon.1x.png',
|
||||||
|
'tests/shared/resources/window_icon.2x.png',
|
||||||
|
],
|
||||||
|
'shared_sources_linux': [
|
||||||
|
'tests/shared/browser/main_message_loop_external_pump_linux.cc',
|
||||||
|
'tests/shared/browser/resource_util_posix.cc',
|
||||||
|
],
|
||||||
|
'shared_sources_mac': [
|
||||||
|
'tests/shared/browser/main_message_loop_external_pump_mac.mm',
|
||||||
|
'tests/shared/browser/resource_util_mac.mm',
|
||||||
|
'tests/shared/browser/resource_util_posix.cc',
|
||||||
|
],
|
||||||
|
'shared_sources_mac_helper': [
|
||||||
|
'tests/shared/process_helper_mac.cc',
|
||||||
|
],
|
||||||
|
'shared_sources_win': [
|
||||||
|
'tests/shared/browser/main_message_loop_external_pump_win.cc',
|
||||||
|
'tests/shared/browser/resource_util_win.cc',
|
||||||
|
'tests/shared/browser/util_win.cc',
|
||||||
|
'tests/shared/browser/util_win.h',
|
||||||
|
],
|
||||||
'cefclient_sources_browser': [
|
'cefclient_sources_browser': [
|
||||||
'tests/cefclient/browser/binding_test.cc',
|
'tests/cefclient/browser/binding_test.cc',
|
||||||
'tests/cefclient/browser/binding_test.h',
|
'tests/cefclient/browser/binding_test.h',
|
||||||
@@ -138,9 +205,9 @@
|
|||||||
'tests/cefclient/browser/browser_window.h',
|
'tests/cefclient/browser/browser_window.h',
|
||||||
'tests/cefclient/browser/bytes_write_handler.cc',
|
'tests/cefclient/browser/bytes_write_handler.cc',
|
||||||
'tests/cefclient/browser/bytes_write_handler.h',
|
'tests/cefclient/browser/bytes_write_handler.h',
|
||||||
'tests/cefclient/browser/client_app_browser.cc',
|
|
||||||
'tests/cefclient/browser/client_app_browser.h',
|
|
||||||
'tests/cefclient/browser/client_app_delegates_browser.cc',
|
'tests/cefclient/browser/client_app_delegates_browser.cc',
|
||||||
|
'tests/cefclient/browser/client_browser.cc',
|
||||||
|
'tests/cefclient/browser/client_browser.h',
|
||||||
'tests/cefclient/browser/client_handler.cc',
|
'tests/cefclient/browser/client_handler.cc',
|
||||||
'tests/cefclient/browser/client_handler.h',
|
'tests/cefclient/browser/client_handler.h',
|
||||||
'tests/cefclient/browser/client_handler_osr.cc',
|
'tests/cefclient/browser/client_handler_osr.cc',
|
||||||
@@ -152,26 +219,18 @@
|
|||||||
'tests/cefclient/browser/dialog_test.h',
|
'tests/cefclient/browser/dialog_test.h',
|
||||||
'tests/cefclient/browser/drm_test.cc',
|
'tests/cefclient/browser/drm_test.cc',
|
||||||
'tests/cefclient/browser/drm_test.h',
|
'tests/cefclient/browser/drm_test.h',
|
||||||
'tests/cefclient/browser/geometry_util.cc',
|
'tests/cefclient/browser/image_cache.cc',
|
||||||
'tests/cefclient/browser/geometry_util.h',
|
'tests/cefclient/browser/image_cache.h',
|
||||||
'tests/cefclient/browser/main_context.cc',
|
'tests/cefclient/browser/main_context.cc',
|
||||||
'tests/cefclient/browser/main_context.h',
|
'tests/cefclient/browser/main_context.h',
|
||||||
'tests/cefclient/browser/main_context_impl.cc',
|
'tests/cefclient/browser/main_context_impl.cc',
|
||||||
'tests/cefclient/browser/main_context_impl.h',
|
'tests/cefclient/browser/main_context_impl.h',
|
||||||
'tests/cefclient/browser/main_message_loop.h',
|
|
||||||
'tests/cefclient/browser/main_message_loop.cc',
|
|
||||||
'tests/cefclient/browser/main_message_loop_external_pump.cc',
|
|
||||||
'tests/cefclient/browser/main_message_loop_external_pump.h',
|
|
||||||
'tests/cefclient/browser/main_message_loop_std.h',
|
|
||||||
'tests/cefclient/browser/main_message_loop_std.cc',
|
|
||||||
'tests/cefclient/browser/osr_dragdrop_events.h',
|
'tests/cefclient/browser/osr_dragdrop_events.h',
|
||||||
'tests/cefclient/browser/osr_renderer.h',
|
'tests/cefclient/browser/osr_renderer.h',
|
||||||
'tests/cefclient/browser/osr_renderer.cc',
|
'tests/cefclient/browser/osr_renderer.cc',
|
||||||
'tests/cefclient/browser/preferences_test.cc',
|
'tests/cefclient/browser/preferences_test.cc',
|
||||||
'tests/cefclient/browser/preferences_test.h',
|
'tests/cefclient/browser/preferences_test.h',
|
||||||
'tests/cefclient/browser/resource.h',
|
'tests/cefclient/browser/resource.h',
|
||||||
'tests/cefclient/browser/resource_util.cc',
|
|
||||||
'tests/cefclient/browser/resource_util.h',
|
|
||||||
'tests/cefclient/browser/response_filter_test.cc',
|
'tests/cefclient/browser/response_filter_test.cc',
|
||||||
'tests/cefclient/browser/response_filter_test.h',
|
'tests/cefclient/browser/response_filter_test.h',
|
||||||
'tests/cefclient/browser/root_window.cc',
|
'tests/cefclient/browser/root_window.cc',
|
||||||
@@ -181,6 +240,8 @@
|
|||||||
'tests/cefclient/browser/root_window_manager.h',
|
'tests/cefclient/browser/root_window_manager.h',
|
||||||
'tests/cefclient/browser/scheme_test.cc',
|
'tests/cefclient/browser/scheme_test.cc',
|
||||||
'tests/cefclient/browser/scheme_test.h',
|
'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/temp_window.h',
|
||||||
'tests/cefclient/browser/test_runner.cc',
|
'tests/cefclient/browser/test_runner.cc',
|
||||||
'tests/cefclient/browser/test_runner.h',
|
'tests/cefclient/browser/test_runner.h',
|
||||||
@@ -192,20 +253,12 @@
|
|||||||
'tests/cefclient/browser/window_test_runner.h',
|
'tests/cefclient/browser/window_test_runner.h',
|
||||||
],
|
],
|
||||||
'cefclient_sources_common': [
|
'cefclient_sources_common': [
|
||||||
'tests/cefclient/common/client_app.cc',
|
|
||||||
'tests/cefclient/common/client_app.h',
|
|
||||||
'tests/cefclient/common/client_app_delegates_common.cc',
|
'tests/cefclient/common/client_app_delegates_common.cc',
|
||||||
'tests/cefclient/common/client_app_other.cc',
|
|
||||||
'tests/cefclient/common/client_app_other.h',
|
|
||||||
'tests/cefclient/common/client_switches.cc',
|
|
||||||
'tests/cefclient/common/client_switches.h',
|
|
||||||
'tests/cefclient/common/scheme_test_common.cc',
|
'tests/cefclient/common/scheme_test_common.cc',
|
||||||
'tests/cefclient/common/scheme_test_common.h',
|
'tests/cefclient/common/scheme_test_common.h',
|
||||||
],
|
],
|
||||||
'cefclient_sources_renderer': [
|
'cefclient_sources_renderer': [
|
||||||
'tests/cefclient/renderer/client_app_delegates_renderer.cc',
|
'tests/cefclient/renderer/client_app_delegates_renderer.cc',
|
||||||
'tests/cefclient/renderer/client_app_renderer.cc',
|
|
||||||
'tests/cefclient/renderer/client_app_renderer.h',
|
|
||||||
'tests/cefclient/renderer/client_renderer.cc',
|
'tests/cefclient/renderer/client_renderer.cc',
|
||||||
'tests/cefclient/renderer/client_renderer.h',
|
'tests/cefclient/renderer/client_renderer.h',
|
||||||
'tests/cefclient/renderer/performance_test.cc',
|
'tests/cefclient/renderer/performance_test.cc',
|
||||||
@@ -222,43 +275,55 @@
|
|||||||
'tests/cefclient/resources/logo.png',
|
'tests/cefclient/resources/logo.png',
|
||||||
'tests/cefclient/resources/menu_icon.1x.png',
|
'tests/cefclient/resources/menu_icon.1x.png',
|
||||||
'tests/cefclient/resources/menu_icon.2x.png',
|
'tests/cefclient/resources/menu_icon.2x.png',
|
||||||
'tests/cefclient/resources/osr_test.html',
|
|
||||||
'tests/cefclient/resources/other_tests.html',
|
'tests/cefclient/resources/other_tests.html',
|
||||||
'tests/cefclient/resources/pdf.html',
|
|
||||||
'tests/cefclient/resources/pdf.pdf',
|
|
||||||
'tests/cefclient/resources/performance.html',
|
'tests/cefclient/resources/performance.html',
|
||||||
'tests/cefclient/resources/performance2.html',
|
'tests/cefclient/resources/performance2.html',
|
||||||
'tests/cefclient/resources/preferences.html',
|
'tests/cefclient/resources/preferences.html',
|
||||||
'tests/cefclient/resources/response_filter.html',
|
'tests/cefclient/resources/response_filter.html',
|
||||||
|
'tests/cefclient/resources/server.html',
|
||||||
'tests/cefclient/resources/transparency.html',
|
'tests/cefclient/resources/transparency.html',
|
||||||
'tests/cefclient/resources/urlrequest.html',
|
'tests/cefclient/resources/urlrequest.html',
|
||||||
|
'tests/cefclient/resources/websocket.html',
|
||||||
'tests/cefclient/resources/window.html',
|
'tests/cefclient/resources/window.html',
|
||||||
'tests/cefclient/resources/window_icon.1x.png',
|
|
||||||
'tests/cefclient/resources/window_icon.2x.png',
|
|
||||||
'tests/cefclient/resources/xmlhttprequest.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': [
|
'cefclient_sources_win': [
|
||||||
'tests/cefclient/browser/browser_window_osr_win.cc',
|
'tests/cefclient/browser/browser_window_osr_win.cc',
|
||||||
'tests/cefclient/browser/browser_window_osr_win.h',
|
'tests/cefclient/browser/browser_window_osr_win.h',
|
||||||
'tests/cefclient/browser/browser_window_std_win.cc',
|
'tests/cefclient/browser/browser_window_std_win.cc',
|
||||||
'tests/cefclient/browser/browser_window_std_win.h',
|
'tests/cefclient/browser/browser_window_std_win.h',
|
||||||
'tests/cefclient/browser/main_context_impl_win.cc',
|
'tests/cefclient/browser/main_context_impl_win.cc',
|
||||||
'tests/cefclient/browser/main_message_loop_external_pump_win.cc',
|
|
||||||
'tests/cefclient/browser/main_message_loop_multithreaded_win.cc',
|
'tests/cefclient/browser/main_message_loop_multithreaded_win.cc',
|
||||||
'tests/cefclient/browser/main_message_loop_multithreaded_win.h',
|
'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.cc',
|
||||||
'tests/cefclient/browser/osr_dragdrop_win.h',
|
'tests/cefclient/browser/osr_dragdrop_win.h',
|
||||||
|
'tests/cefclient/browser/osr_ime_handler_win.cc',
|
||||||
|
'tests/cefclient/browser/osr_ime_handler_win.h',
|
||||||
'tests/cefclient/browser/osr_window_win.cc',
|
'tests/cefclient/browser/osr_window_win.cc',
|
||||||
'tests/cefclient/browser/osr_window_win.h',
|
'tests/cefclient/browser/osr_window_win.h',
|
||||||
'tests/cefclient/browser/resource_util_win.cc',
|
'tests/cefclient/browser/resource_util_win_idmap.cc',
|
||||||
'tests/cefclient/browser/root_window_views.cc',
|
'tests/cefclient/browser/root_window_views.cc',
|
||||||
'tests/cefclient/browser/root_window_views.h',
|
'tests/cefclient/browser/root_window_views.h',
|
||||||
'tests/cefclient/browser/root_window_win.cc',
|
'tests/cefclient/browser/root_window_win.cc',
|
||||||
'tests/cefclient/browser/root_window_win.h',
|
'tests/cefclient/browser/root_window_win.h',
|
||||||
'tests/cefclient/browser/temp_window_win.cc',
|
'tests/cefclient/browser/temp_window_win.cc',
|
||||||
'tests/cefclient/browser/temp_window_win.h',
|
'tests/cefclient/browser/temp_window_win.h',
|
||||||
'tests/cefclient/browser/util_win.cc',
|
'tests/cefclient/browser/views_menu_bar.cc',
|
||||||
'tests/cefclient/browser/util_win.h',
|
'tests/cefclient/browser/views_menu_bar.h',
|
||||||
|
'tests/cefclient/browser/views_style.cc',
|
||||||
|
'tests/cefclient/browser/views_style.h',
|
||||||
'tests/cefclient/browser/views_window.cc',
|
'tests/cefclient/browser/views_window.cc',
|
||||||
'tests/cefclient/browser/views_window.h',
|
'tests/cefclient/browser/views_window.h',
|
||||||
'tests/cefclient/browser/window_test_runner_views.cc',
|
'tests/cefclient/browser/window_test_runner_views.cc',
|
||||||
@@ -277,20 +342,21 @@
|
|||||||
'tests/cefclient/browser/browser_window_std_mac.h',
|
'tests/cefclient/browser/browser_window_std_mac.h',
|
||||||
'tests/cefclient/browser/browser_window_std_mac.mm',
|
'tests/cefclient/browser/browser_window_std_mac.mm',
|
||||||
'tests/cefclient/browser/main_context_impl_posix.cc',
|
'tests/cefclient/browser/main_context_impl_posix.cc',
|
||||||
'tests/cefclient/browser/main_message_loop_external_pump_mac.mm',
|
'tests/cefclient/browser/osr_accessibility_helper.cc',
|
||||||
'tests/cefclient/browser/resource_util_mac.mm',
|
'tests/cefclient/browser/osr_accessibility_helper.h',
|
||||||
'tests/cefclient/browser/resource_util_posix.cc',
|
'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.h',
|
||||||
'tests/cefclient/browser/root_window_mac.mm',
|
'tests/cefclient/browser/root_window_mac.mm',
|
||||||
'tests/cefclient/browser/temp_window_mac.h',
|
'tests/cefclient/browser/temp_window_mac.h',
|
||||||
'tests/cefclient/browser/temp_window_mac.mm',
|
'tests/cefclient/browser/temp_window_mac.mm',
|
||||||
|
'tests/cefclient/browser/text_input_client_osr_mac.h',
|
||||||
|
'tests/cefclient/browser/text_input_client_osr_mac.mm',
|
||||||
'tests/cefclient/browser/window_test_runner_mac.h',
|
'tests/cefclient/browser/window_test_runner_mac.h',
|
||||||
'tests/cefclient/browser/window_test_runner_mac.mm',
|
'tests/cefclient/browser/window_test_runner_mac.mm',
|
||||||
'tests/cefclient/cefclient_mac.mm',
|
'tests/cefclient/cefclient_mac.mm',
|
||||||
],
|
],
|
||||||
'cefclient_sources_mac_helper': [
|
|
||||||
'tests/cefclient/process_helper_mac.cc',
|
|
||||||
],
|
|
||||||
'cefclient_bundle_resources_mac': [
|
'cefclient_bundle_resources_mac': [
|
||||||
'tests/cefclient/resources/mac/cefclient.icns',
|
'tests/cefclient/resources/mac/cefclient.icns',
|
||||||
'tests/cefclient/resources/mac/English.lproj/InfoPlist.strings',
|
'tests/cefclient/resources/mac/English.lproj/InfoPlist.strings',
|
||||||
@@ -305,17 +371,19 @@
|
|||||||
'tests/cefclient/browser/dialog_handler_gtk.cc',
|
'tests/cefclient/browser/dialog_handler_gtk.cc',
|
||||||
'tests/cefclient/browser/dialog_handler_gtk.h',
|
'tests/cefclient/browser/dialog_handler_gtk.h',
|
||||||
'tests/cefclient/browser/main_context_impl_posix.cc',
|
'tests/cefclient/browser/main_context_impl_posix.cc',
|
||||||
'tests/cefclient/browser/main_message_loop_external_pump_linux.cc',
|
|
||||||
'tests/cefclient/browser/print_handler_gtk.cc',
|
'tests/cefclient/browser/print_handler_gtk.cc',
|
||||||
'tests/cefclient/browser/print_handler_gtk.h',
|
'tests/cefclient/browser/print_handler_gtk.h',
|
||||||
'tests/cefclient/browser/resource_util_linux.cc',
|
'tests/cefclient/browser/resource_util_linux.cc',
|
||||||
'tests/cefclient/browser/resource_util_posix.cc',
|
|
||||||
'tests/cefclient/browser/root_window_gtk.cc',
|
'tests/cefclient/browser/root_window_gtk.cc',
|
||||||
'tests/cefclient/browser/root_window_gtk.h',
|
'tests/cefclient/browser/root_window_gtk.h',
|
||||||
'tests/cefclient/browser/root_window_views.cc',
|
'tests/cefclient/browser/root_window_views.cc',
|
||||||
'tests/cefclient/browser/root_window_views.h',
|
'tests/cefclient/browser/root_window_views.h',
|
||||||
'tests/cefclient/browser/temp_window_x11.cc',
|
'tests/cefclient/browser/temp_window_x11.cc',
|
||||||
'tests/cefclient/browser/temp_window_x11.h',
|
'tests/cefclient/browser/temp_window_x11.h',
|
||||||
|
'tests/cefclient/browser/views_menu_bar.cc',
|
||||||
|
'tests/cefclient/browser/views_menu_bar.h',
|
||||||
|
'tests/cefclient/browser/views_style.cc',
|
||||||
|
'tests/cefclient/browser/views_style.h',
|
||||||
'tests/cefclient/browser/views_window.cc',
|
'tests/cefclient/browser/views_window.cc',
|
||||||
'tests/cefclient/browser/views_window.h',
|
'tests/cefclient/browser/views_window.h',
|
||||||
'tests/cefclient/browser/window_test_runner_gtk.cc',
|
'tests/cefclient/browser/window_test_runner_gtk.cc',
|
||||||
@@ -356,5 +424,138 @@
|
|||||||
'tests/cefsimple/cefsimple_linux.cc',
|
'tests/cefsimple/cefsimple_linux.cc',
|
||||||
'tests/cefsimple/simple_handler_linux.cc',
|
'tests/cefsimple/simple_handler_linux.cc',
|
||||||
],
|
],
|
||||||
|
'ceftests_sources_common': [
|
||||||
|
'tests/ceftests/browser_info_map_unittest.cc',
|
||||||
|
'tests/ceftests/command_line_unittest.cc',
|
||||||
|
'tests/ceftests/cookie_unittest.cc',
|
||||||
|
'tests/ceftests/dialog_unittest.cc',
|
||||||
|
'tests/ceftests/display_unittest.cc',
|
||||||
|
'tests/ceftests/dom_unittest.cc',
|
||||||
|
'tests/ceftests/download_unittest.cc',
|
||||||
|
'tests/ceftests/draggable_regions_unittest.cc',
|
||||||
|
'tests/ceftests/extensions/background_unittest.cc',
|
||||||
|
'tests/ceftests/extensions/chrome_alarms_unittest.cc',
|
||||||
|
'tests/ceftests/extensions/chrome_storage_unittest.cc',
|
||||||
|
'tests/ceftests/extensions/chrome_tabs_unittest.cc',
|
||||||
|
'tests/ceftests/extensions/extension_test_handler.cc',
|
||||||
|
'tests/ceftests/extensions/extension_test_handler.h',
|
||||||
|
'tests/ceftests/extensions/view_unittest.cc',
|
||||||
|
'tests/ceftests/file_util_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',
|
||||||
|
'tests/ceftests/jsdialog_unittest.cc',
|
||||||
|
'tests/ceftests/life_span_unittest.cc',
|
||||||
|
'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',
|
||||||
|
'tests/ceftests/print_unittest.cc',
|
||||||
|
'tests/ceftests/process_message_unittest.cc',
|
||||||
|
'tests/ceftests/request_context_unittest.cc',
|
||||||
|
'tests/ceftests/request_handler_unittest.cc',
|
||||||
|
'tests/ceftests/request_unittest.cc',
|
||||||
|
'tests/ceftests/resource.h',
|
||||||
|
'tests/ceftests/resource_manager_unittest.cc',
|
||||||
|
'tests/ceftests/routing_test_handler.cc',
|
||||||
|
'tests/ceftests/routing_test_handler.h',
|
||||||
|
'tests/ceftests/run_all_unittests.cc',
|
||||||
|
'tests/ceftests/scheme_handler_unittest.cc',
|
||||||
|
'tests/ceftests/scoped_temp_dir_unittest.cc',
|
||||||
|
'tests/ceftests/server_unittest.cc',
|
||||||
|
'tests/ceftests/stream_unittest.cc',
|
||||||
|
'tests/ceftests/stream_resource_handler_unittest.cc',
|
||||||
|
'tests/ceftests/string_unittest.cc',
|
||||||
|
'tests/ceftests/client_app_delegates.cc',
|
||||||
|
'tests/ceftests/task_unittest.cc',
|
||||||
|
'tests/ceftests/test_handler.cc',
|
||||||
|
'tests/ceftests/test_handler.h',
|
||||||
|
'tests/ceftests/test_suite.cc',
|
||||||
|
'tests/ceftests/test_suite.h',
|
||||||
|
'tests/ceftests/test_util.cc',
|
||||||
|
'tests/ceftests/test_util.h',
|
||||||
|
'tests/ceftests/thread_helper.cc',
|
||||||
|
'tests/ceftests/thread_helper.h',
|
||||||
|
'tests/ceftests/thread_unittest.cc',
|
||||||
|
'tests/ceftests/tracing_unittest.cc',
|
||||||
|
'tests/ceftests/translator_unittest.cc',
|
||||||
|
'tests/ceftests/urlrequest_unittest.cc',
|
||||||
|
'tests/ceftests/v8_unittest.cc',
|
||||||
|
'tests/ceftests/values_unittest.cc',
|
||||||
|
'tests/ceftests/version_unittest.cc',
|
||||||
|
'tests/ceftests/waitable_event_unittest.cc',
|
||||||
|
'tests/ceftests/webui_unittest.cc',
|
||||||
|
'tests/ceftests/xml_reader_unittest.cc',
|
||||||
|
'tests/ceftests/zip_reader_unittest.cc',
|
||||||
|
],
|
||||||
|
'ceftests_sources_views': [
|
||||||
|
'tests/ceftests/views/button_unittest.cc',
|
||||||
|
'tests/ceftests/views/panel_unittest.cc',
|
||||||
|
'tests/ceftests/views/scroll_view_unittest.cc',
|
||||||
|
'tests/ceftests/views/test_window_delegate.cc',
|
||||||
|
'tests/ceftests/views/test_window_delegate.h',
|
||||||
|
'tests/ceftests/views/textfield_unittest.cc',
|
||||||
|
'tests/ceftests/views/window_unittest.cc',
|
||||||
|
],
|
||||||
|
'ceftests_sources_win': [
|
||||||
|
'tests/ceftests/resource_util_win_idmap.cc',
|
||||||
|
'tests/ceftests/resources/win/ceftests.exe.manifest',
|
||||||
|
'tests/ceftests/resources/win/ceftests.ico',
|
||||||
|
'tests/ceftests/resources/win/ceftests.rc',
|
||||||
|
'tests/ceftests/resources/win/small.ico',
|
||||||
|
],
|
||||||
|
'ceftests_sources_mac': [
|
||||||
|
'tests/ceftests/os_rendering_unittest_mac.h',
|
||||||
|
'tests/ceftests/os_rendering_unittest_mac.mm',
|
||||||
|
'tests/ceftests/run_all_unittests_mac.mm',
|
||||||
|
],
|
||||||
|
'ceftests_sources_mac_helper': [
|
||||||
|
'tests/shared/browser/file_util.cc',
|
||||||
|
'tests/shared/browser/file_util.h',
|
||||||
|
'tests/shared/browser/resource_util.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/frame_unittest.cc',
|
||||||
|
'tests/ceftests/message_router_unittest.cc',
|
||||||
|
'tests/ceftests/navigation_unittest.cc',
|
||||||
|
'tests/ceftests/plugin_unittest.cc',
|
||||||
|
'tests/ceftests/preference_unittest.cc',
|
||||||
|
'tests/ceftests/process_message_unittest.cc',
|
||||||
|
'tests/ceftests/request_handler_unittest.cc',
|
||||||
|
'tests/ceftests/request_unittest.cc',
|
||||||
|
'tests/ceftests/routing_test_handler.cc',
|
||||||
|
'tests/ceftests/routing_test_handler.h',
|
||||||
|
'tests/ceftests/scheme_handler_unittest.cc',
|
||||||
|
'tests/ceftests/urlrequest_unittest.cc',
|
||||||
|
'tests/ceftests/test_handler.cc',
|
||||||
|
'tests/ceftests/test_handler.h',
|
||||||
|
'tests/ceftests/test_suite.cc',
|
||||||
|
'tests/ceftests/test_suite.h',
|
||||||
|
'tests/ceftests/test_util.cc',
|
||||||
|
'tests/ceftests/test_util.h',
|
||||||
|
'tests/ceftests/thread_helper.cc',
|
||||||
|
'tests/ceftests/thread_helper.h',
|
||||||
|
'tests/ceftests/thread_unittest.cc',
|
||||||
|
'tests/ceftests/tracing_unittest.cc',
|
||||||
|
'tests/ceftests/v8_unittest.cc',
|
||||||
|
],
|
||||||
|
'ceftests_bundle_resources_mac': [
|
||||||
|
'tests/ceftests/resources/mac/ceftests.icns',
|
||||||
|
'tests/ceftests/resources/mac/English.lproj/InfoPlist.strings',
|
||||||
|
'tests/ceftests/resources/mac/English.lproj/MainMenu.xib',
|
||||||
|
'tests/ceftests/resources/mac/Info.plist',
|
||||||
|
],
|
||||||
|
'ceftests_sources_linux': [
|
||||||
|
'tests/ceftests/resource_util_linux.cc',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,10 @@ template("_repack_one_locale") {
|
|||||||
visibility = invoker.visibility
|
visibility = invoker.visibility
|
||||||
|
|
||||||
# Each input pak file should also have a deps line for completeness.
|
# Each input pak file should also have a deps line for completeness.
|
||||||
|
# Add associated .h files in the make_pack_header("strings") target.
|
||||||
sources = [
|
sources = [
|
||||||
"${root_gen_dir}/cef/cef_strings_${locale}.pak",
|
"${root_gen_dir}/cef/cef_strings_${locale}.pak",
|
||||||
|
"${root_gen_dir}/chrome/chromium_strings_${locale}.pak",
|
||||||
"${root_gen_dir}/chrome/generated_resources_${locale}.pak",
|
"${root_gen_dir}/chrome/generated_resources_${locale}.pak",
|
||||||
"${root_gen_dir}/chrome/locale_settings_${locale}.pak",
|
"${root_gen_dir}/chrome/locale_settings_${locale}.pak",
|
||||||
"${root_gen_dir}/chrome/platform_locale_settings_${locale}.pak",
|
"${root_gen_dir}/chrome/platform_locale_settings_${locale}.pak",
|
||||||
@@ -45,6 +47,7 @@ template("_repack_one_locale") {
|
|||||||
# listed both here and in the libcef_static target.
|
# listed both here and in the libcef_static target.
|
||||||
public_deps = [
|
public_deps = [
|
||||||
":cef_strings",
|
":cef_strings",
|
||||||
|
"//chrome/app:chromium_strings",
|
||||||
"//chrome/app:generated_resources",
|
"//chrome/app:generated_resources",
|
||||||
"//chrome/app/resources:locale_settings",
|
"//chrome/app/resources:locale_settings",
|
||||||
"//chrome/app/resources:platform_locale_settings",
|
"//chrome/app/resources:platform_locale_settings",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ macro(PRINT_CEF_CONFIG)
|
|||||||
message(STATUS "Platform: ${CMAKE_SYSTEM_NAME}")
|
message(STATUS "Platform: ${CMAKE_SYSTEM_NAME}")
|
||||||
message(STATUS "Project architecture: ${PROJECT_ARCH}")
|
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}")
|
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -81,8 +81,7 @@ endmacro()
|
|||||||
|
|
||||||
# Determine the target output directory based on platform and generator.
|
# Determine the target output directory based on platform and generator.
|
||||||
macro(SET_CEF_TARGET_OUT_DIR)
|
macro(SET_CEF_TARGET_OUT_DIR)
|
||||||
if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR
|
if(GEN_NINJA OR GEN_MAKEFILES)
|
||||||
${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
|
||||||
# By default Ninja and Make builds don't create a subdirectory named after
|
# By default Ninja and Make builds don't create a subdirectory named after
|
||||||
# the configuration.
|
# the configuration.
|
||||||
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
|
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
|
||||||
@@ -96,11 +95,25 @@ macro(SET_CEF_TARGET_OUT_DIR)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# Copy a list of files from one directory to another. Relative files paths are maintained.
|
# Copy a list of files from one directory to another. Relative files paths are maintained.
|
||||||
|
# The path component of the source |file_list| will be removed.
|
||||||
macro(COPY_FILES target file_list source_dir target_dir)
|
macro(COPY_FILES target file_list source_dir target_dir)
|
||||||
foreach(FILENAME ${file_list})
|
foreach(FILENAME ${file_list})
|
||||||
set(source_file ${source_dir}/${FILENAME})
|
set(source_file ${source_dir}/${FILENAME})
|
||||||
set(target_file ${target_dir}/${FILENAME})
|
get_filename_component(target_name ${FILENAME} NAME)
|
||||||
if(IS_DIRECTORY ${source_file})
|
set(target_file ${target_dir}/${target_name})
|
||||||
|
|
||||||
|
string(FIND ${source_file} "$<CONFIGURATION>" _pos)
|
||||||
|
if(NOT ${_pos} EQUAL -1)
|
||||||
|
# Must test with an actual configuration directory.
|
||||||
|
string(REPLACE "$<CONFIGURATION>" "Release" existing_source_file ${source_file})
|
||||||
|
if(NOT EXISTS ${existing_source_file})
|
||||||
|
string(REPLACE "$<CONFIGURATION>" "Debug" existing_source_file ${source_file})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(existing_source_file ${source_file})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(IS_DIRECTORY ${existing_source_file})
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${target}
|
TARGET ${target}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
@@ -118,19 +131,6 @@ macro(COPY_FILES target file_list source_dir target_dir)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# Rename a directory replacing the target if it already exists.
|
|
||||||
macro(RENAME_DIRECTORY target source_dir target_dir)
|
|
||||||
add_custom_command(
|
|
||||||
TARGET ${target}
|
|
||||||
POST_BUILD
|
|
||||||
# Remove the target directory if it already exists.
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${target_dir}"
|
|
||||||
# Rename the source directory to target directory.
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E rename "${source_dir}" "${target_dir}"
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Linux macros.
|
# Linux macros.
|
||||||
@@ -287,17 +287,17 @@ endmacro()
|
|||||||
# SET_EXECUTABLE_TARGET_PROPERTIES() instead of calling this macro directly.
|
# SET_EXECUTABLE_TARGET_PROPERTIES() instead of calling this macro directly.
|
||||||
macro(SET_COMMON_TARGET_PROPERTIES target)
|
macro(SET_COMMON_TARGET_PROPERTIES target)
|
||||||
# Compile flags.
|
# Compile flags.
|
||||||
target_compile_options(${target} PUBLIC ${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS})
|
target_compile_options(${target} PRIVATE ${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} PRIVATE $<$<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 $<$<CONFIG:Release>:${CEF_COMPILER_FLAGS_RELEASE} ${CEF_CXX_COMPILER_FLAGS_RELEASE}>)
|
||||||
|
|
||||||
# Compile definitions.
|
# Compile definitions.
|
||||||
target_compile_definitions(${target} PUBLIC ${CEF_COMPILER_DEFINES})
|
target_compile_definitions(${target} PRIVATE ${CEF_COMPILER_DEFINES})
|
||||||
target_compile_definitions(${target} PUBLIC $<$<CONFIG:Debug>:${CEF_COMPILER_DEFINES_DEBUG}>)
|
target_compile_definitions(${target} PRIVATE $<$<CONFIG:Debug>:${CEF_COMPILER_DEFINES_DEBUG}>)
|
||||||
target_compile_definitions(${target} PUBLIC $<$<CONFIG:Release>:${CEF_COMPILER_DEFINES_RELEASE}>)
|
target_compile_definitions(${target} PRIVATE $<$<CONFIG:Release>:${CEF_COMPILER_DEFINES_RELEASE}>)
|
||||||
|
|
||||||
# Include directories.
|
# Include directories.
|
||||||
target_include_directories(${target} PUBLIC ${CEF_INCLUDE_PATH})
|
target_include_directories(${target} PRIVATE ${CEF_INCLUDE_PATH})
|
||||||
|
|
||||||
# Linker flags.
|
# Linker flags.
|
||||||
if(CEF_LINKER_FLAGS)
|
if(CEF_LINKER_FLAGS)
|
||||||
|
|||||||
@@ -37,9 +37,14 @@ if(NOT DEFINED PROJECT_ARCH)
|
|||||||
endif()
|
endif()
|
||||||
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.
|
# Determine the build type.
|
||||||
if(NOT CMAKE_BUILD_TYPE AND
|
if(NOT CMAKE_BUILD_TYPE AND (GEN_NINJA OR GEN_MAKEFILES))
|
||||||
(${CMAKE_GENERATOR} STREQUAL "Ninja" OR ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles"))
|
|
||||||
# CMAKE_BUILD_TYPE should be specified when using Ninja or Unix Makefiles.
|
# CMAKE_BUILD_TYPE should be specified when using Ninja or Unix Makefiles.
|
||||||
set(CMAKE_BUILD_TYPE Release)
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
message(WARNING "No CMAKE_BUILD_TYPE value selected, using ${CMAKE_BUILD_TYPE}")
|
message(WARNING "No CMAKE_BUILD_TYPE value selected, using ${CMAKE_BUILD_TYPE}")
|
||||||
@@ -81,6 +86,7 @@ if(OS_LINUX)
|
|||||||
-Werror # Treat warnings as errors
|
-Werror # Treat warnings as errors
|
||||||
-Wno-missing-field-initializers # Don't warn about missing field initializers
|
-Wno-missing-field-initializers # Don't warn about missing field initializers
|
||||||
-Wno-unused-parameter # Don't warn about unused parameters
|
-Wno-unused-parameter # Don't warn about unused parameters
|
||||||
|
-Wno-error=comment # Don't complain about code in ascii art
|
||||||
)
|
)
|
||||||
list(APPEND CEF_C_COMPILER_FLAGS
|
list(APPEND CEF_C_COMPILER_FLAGS
|
||||||
-std=c99 # Use the C99 language standard
|
-std=c99 # Use the C99 language standard
|
||||||
@@ -192,8 +198,12 @@ if(OS_LINUX)
|
|||||||
set(CEF_BINARY_FILES
|
set(CEF_BINARY_FILES
|
||||||
chrome-sandbox
|
chrome-sandbox
|
||||||
libcef.so
|
libcef.so
|
||||||
|
libEGL.so
|
||||||
|
libGLESv2.so
|
||||||
natives_blob.bin
|
natives_blob.bin
|
||||||
snapshot_blob.bin
|
snapshot_blob.bin
|
||||||
|
v8_context_snapshot.bin
|
||||||
|
swiftshader
|
||||||
)
|
)
|
||||||
|
|
||||||
# List of CEF resource files.
|
# List of CEF resource files.
|
||||||
@@ -215,7 +225,7 @@ endif()
|
|||||||
|
|
||||||
if(OS_MACOSX)
|
if(OS_MACOSX)
|
||||||
# Platform-specific compiler/linker flags.
|
# Platform-specific compiler/linker flags.
|
||||||
# See also Xcode target properties in macros.cmake.
|
# See also Xcode target properties in cef_macros.cmake.
|
||||||
set(CEF_LIBTYPE SHARED)
|
set(CEF_LIBTYPE SHARED)
|
||||||
list(APPEND CEF_COMPILER_FLAGS
|
list(APPEND CEF_COMPILER_FLAGS
|
||||||
-fno-strict-aliasing # Avoid assumptions regarding non-aliasing of objects of different types
|
-fno-strict-aliasing # Avoid assumptions regarding non-aliasing of objects of different types
|
||||||
@@ -259,6 +269,15 @@ if(OS_MACOSX)
|
|||||||
-Wl,-dead_strip # Strip dead code
|
-Wl,-dead_strip # Strip dead code
|
||||||
)
|
)
|
||||||
|
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
|
CHECK_CXX_COMPILER_FLAG(-Wno-undefined-var-template COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
|
||||||
|
if(COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
|
||||||
|
list(APPEND CEF_CXX_COMPILER_FLAGS
|
||||||
|
-Wno-undefined-var-template # Don't warn about potentially uninstantiated static members
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Standard libraries.
|
# Standard libraries.
|
||||||
set(CEF_STANDARD_LIBS
|
set(CEF_STANDARD_LIBS
|
||||||
-lpthread
|
-lpthread
|
||||||
@@ -268,7 +287,7 @@ if(OS_MACOSX)
|
|||||||
|
|
||||||
# Find the newest available base SDK.
|
# Find the newest available base SDK.
|
||||||
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
foreach(OS_VERSION 10.10 10.9 10.8 10.7)
|
foreach(OS_VERSION 10.11 10.10 10.9)
|
||||||
set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
|
set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
|
||||||
if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
|
if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
|
||||||
set(CMAKE_OSX_SYSROOT ${SDK})
|
set(CMAKE_OSX_SYSROOT ${SDK})
|
||||||
@@ -276,7 +295,7 @@ if(OS_MACOSX)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Target SDK.
|
# Target SDK.
|
||||||
set(CEF_TARGET_SDK "10.7")
|
set(CEF_TARGET_SDK "10.9")
|
||||||
list(APPEND CEF_COMPILER_FLAGS
|
list(APPEND CEF_COMPILER_FLAGS
|
||||||
-mmacosx-version-min=${CEF_TARGET_SDK}
|
-mmacosx-version-min=${CEF_TARGET_SDK}
|
||||||
)
|
)
|
||||||
@@ -305,27 +324,42 @@ endif()
|
|||||||
#
|
#
|
||||||
|
|
||||||
if(OS_WINDOWS)
|
if(OS_WINDOWS)
|
||||||
# Configure use of the sandbox.
|
if (GEN_NINJA)
|
||||||
option(USE_SANDBOX "Enable or disable use of the sandbox." ON)
|
# When using the Ninja generator clear the CMake defaults to avoid excessive
|
||||||
if(USE_SANDBOX AND NOT MSVC_VERSION EQUAL 1900)
|
# console warnings (see issue #2120).
|
||||||
# The cef_sandbox.lib static library is currently built with VS2015. It will
|
set(CMAKE_CXX_FLAGS "")
|
||||||
# not link successfully with other VS versions.
|
set(CMAKE_CXX_FLAGS_DEBUG "")
|
||||||
set(USE_SANDBOX OFF)
|
set(CMAKE_CXX_FLAGS_RELEASE "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Configure use of official build compiler settings.
|
# Configure use of the sandbox.
|
||||||
# When using an official build the "Debug" build is actually a Release build
|
option(USE_SANDBOX "Enable or disable use of the sandbox." ON)
|
||||||
# with DCHECKs enabled. In order to link the sandbox the Debug build must
|
if(USE_SANDBOX)
|
||||||
# be configured with some Release-related compiler settings.
|
# Check if the current MSVC version is compatible with the cef_sandbox.lib
|
||||||
option(USE_OFFICIAL_BUILD_SANDBOX "Enable or disable use of an official build sandbox." ON)
|
# static library.
|
||||||
if(NOT USE_SANDBOX)
|
list(APPEND supported_msvc_versions
|
||||||
# Don't need official build settings when the sandbox is off.
|
1900 # VS2015 and updates 1, 2, & 3
|
||||||
set(USE_OFFICIAL_BUILD_SANDBOX OFF)
|
1910 # VS2017 version 15.1 & 15.2
|
||||||
|
1911 # VS2017 version 15.3 & 15.4
|
||||||
|
1912 # VS2017 version 15.5
|
||||||
|
)
|
||||||
|
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()
|
endif()
|
||||||
|
|
||||||
# Consumers who run into LNK4099 warnings can pass /Z7 instead (see issue #385).
|
# 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")
|
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.
|
# Platform-specific compiler/linker flags.
|
||||||
set(CEF_LIBTYPE STATIC)
|
set(CEF_LIBTYPE STATIC)
|
||||||
list(APPEND CEF_COMPILER_FLAGS
|
list(APPEND CEF_COMPILER_FLAGS
|
||||||
@@ -344,24 +378,11 @@ if(OS_WINDOWS)
|
|||||||
/wd4996 # Ignore "function or variable may be unsafe" warning
|
/wd4996 # Ignore "function or variable may be unsafe" warning
|
||||||
${CEF_DEBUG_INFO_FLAG}
|
${CEF_DEBUG_INFO_FLAG}
|
||||||
)
|
)
|
||||||
if(USE_OFFICIAL_BUILD_SANDBOX)
|
list(APPEND CEF_COMPILER_FLAGS_DEBUG
|
||||||
# CMake adds /RTC1, /D"_DEBUG" and a few other values by default for Debug
|
/RTC1 # Disable optimizations
|
||||||
# builds. We can't link the sandbox with those values so clear the CMake
|
/Od # Enable basic run-time checks
|
||||||
# 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
|
list(APPEND CEF_COMPILER_FLAGS_RELEASE
|
||||||
/MT # Multithreaded release runtime
|
|
||||||
/O2 # Optimize for maximum speed
|
/O2 # Optimize for maximum speed
|
||||||
/Ob2 # Inline any suitable function
|
/Ob2 # Inline any suitable function
|
||||||
/GF # Enable string pooling
|
/GF # Enable string pooling
|
||||||
@@ -376,17 +397,11 @@ if(OS_WINDOWS)
|
|||||||
list(APPEND CEF_COMPILER_DEFINES
|
list(APPEND CEF_COMPILER_DEFINES
|
||||||
WIN32 _WIN32 _WINDOWS # Windows platform
|
WIN32 _WIN32 _WINDOWS # Windows platform
|
||||||
UNICODE _UNICODE # Unicode build
|
UNICODE _UNICODE # Unicode build
|
||||||
WINVER=0x0602 _WIN32_WINNT=0x602 # Targeting Windows 8
|
WINVER=0x0601 _WIN32_WINNT=0x601 # Targeting Windows 7
|
||||||
NOMINMAX # Use the standard's templated min/max
|
NOMINMAX # Use the standard's templated min/max
|
||||||
WIN32_LEAN_AND_MEAN # Exclude less common API declarations
|
WIN32_LEAN_AND_MEAN # Exclude less common API declarations
|
||||||
_HAS_EXCEPTIONS=0 # Disable exceptions
|
_HAS_EXCEPTIONS=0 # Disable exceptions
|
||||||
)
|
)
|
||||||
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
|
list(APPEND CEF_COMPILER_DEFINES_RELEASE
|
||||||
NDEBUG _NDEBUG # Not a debug build
|
NDEBUG _NDEBUG # Not a debug build
|
||||||
)
|
)
|
||||||
@@ -411,6 +426,7 @@ if(OS_WINDOWS)
|
|||||||
|
|
||||||
# List of CEF binary files.
|
# List of CEF binary files.
|
||||||
set(CEF_BINARY_FILES
|
set(CEF_BINARY_FILES
|
||||||
|
chrome_elf.dll
|
||||||
d3dcompiler_43.dll
|
d3dcompiler_43.dll
|
||||||
d3dcompiler_47.dll
|
d3dcompiler_47.dll
|
||||||
libcef.dll
|
libcef.dll
|
||||||
@@ -418,6 +434,8 @@ if(OS_WINDOWS)
|
|||||||
libGLESv2.dll
|
libGLESv2.dll
|
||||||
natives_blob.bin
|
natives_blob.bin
|
||||||
snapshot_blob.bin
|
snapshot_blob.bin
|
||||||
|
v8_context_snapshot.bin
|
||||||
|
swiftshader
|
||||||
)
|
)
|
||||||
|
|
||||||
# List of CEF resource files.
|
# List of CEF resource files.
|
||||||
@@ -453,10 +471,26 @@ if(OS_WINDOWS)
|
|||||||
# Configure use of ATL.
|
# Configure use of ATL.
|
||||||
option(USE_ATL "Enable or disable use of ATL." ON)
|
option(USE_ATL "Enable or disable use of ATL." ON)
|
||||||
if(USE_ATL)
|
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.
|
# Determine if the Visual Studio install supports ATL.
|
||||||
get_filename_component(VC_BIN_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
|
if(NOT HAS_ATLMFC)
|
||||||
get_filename_component(VC_DIR ${VC_BIN_DIR} DIRECTORY)
|
message(WARNING "ATL is not supported by your VC installation.")
|
||||||
if(NOT IS_DIRECTORY "${VC_DIR}/atlmfc")
|
|
||||||
set(USE_ATL OFF)
|
set(USE_ATL OFF)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -39,14 +39,49 @@
|
|||||||
#define CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
|
#define CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(BASE_ATOMIC_REF_COUNT_H_)
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
// Do nothing if the Chromium header has already been included.
|
|
||||||
// This can happen in cases where Chromium code is used directly by the
|
|
||||||
// client application. When using Chromium code directly always include
|
|
||||||
// the Chromium header first to avoid type conflicts.
|
|
||||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
|
||||||
// When building CEF include the Chromium header directly.
|
// When building CEF include the Chromium header directly.
|
||||||
#include "base/atomic_ref_count.h"
|
#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
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
// The following is substantially similar to the Chromium implementation.
|
// The following is substantially similar to the Chromium implementation.
|
||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
@@ -56,14 +91,18 @@
|
|||||||
|
|
||||||
// Annotations are not currently supported.
|
// Annotations are not currently supported.
|
||||||
#define ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
|
#define ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
|
||||||
#define ANNOTATE_HAPPENS_AFTER(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 {
|
namespace base {
|
||||||
|
|
||||||
typedef subtle::Atomic32 AtomicRefCount;
|
typedef subtle::Atomic32 AtomicRefCount;
|
||||||
|
|
||||||
// Increment a reference count by "increment", which must exceed 0.
|
// Increment a reference count by "increment", which must exceed 0.
|
||||||
inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr,
|
inline void AtomicRefCountIncN(volatile AtomicRefCount* ptr,
|
||||||
AtomicRefCount increment) {
|
AtomicRefCount increment) {
|
||||||
subtle::NoBarrier_AtomicIncrement(ptr, increment);
|
subtle::NoBarrier_AtomicIncrement(ptr, increment);
|
||||||
}
|
}
|
||||||
@@ -72,7 +111,7 @@ inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr,
|
|||||||
// and return whether the result is non-zero.
|
// and return whether the result is non-zero.
|
||||||
// Insert barriers to ensure that state written before the reference count
|
// Insert barriers to ensure that state written before the reference count
|
||||||
// became zero will be visible to a thread that has just made the count zero.
|
// became zero will be visible to a thread that has just made the count zero.
|
||||||
inline bool AtomicRefCountDecN(volatile AtomicRefCount *ptr,
|
inline bool AtomicRefCountDecN(volatile AtomicRefCount* ptr,
|
||||||
AtomicRefCount decrement) {
|
AtomicRefCount decrement) {
|
||||||
ANNOTATE_HAPPENS_BEFORE(ptr);
|
ANNOTATE_HAPPENS_BEFORE(ptr);
|
||||||
bool res = (subtle::Barrier_AtomicIncrement(ptr, -decrement) != 0);
|
bool res = (subtle::Barrier_AtomicIncrement(ptr, -decrement) != 0);
|
||||||
@@ -83,14 +122,14 @@ inline bool AtomicRefCountDecN(volatile AtomicRefCount *ptr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Increment a reference count by 1.
|
// Increment a reference count by 1.
|
||||||
inline void AtomicRefCountInc(volatile AtomicRefCount *ptr) {
|
inline void AtomicRefCountInc(volatile AtomicRefCount* ptr) {
|
||||||
base::AtomicRefCountIncN(ptr, 1);
|
base::AtomicRefCountIncN(ptr, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decrement a reference count by 1 and return whether the result is non-zero.
|
// 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
|
// Insert barriers to ensure that state written before the reference count
|
||||||
// became zero will be visible to a thread that has just made the count zero.
|
// became zero will be visible to a thread that has just made the count zero.
|
||||||
inline bool AtomicRefCountDec(volatile AtomicRefCount *ptr) {
|
inline bool AtomicRefCountDec(volatile AtomicRefCount* ptr) {
|
||||||
return base::AtomicRefCountDecN(ptr, 1);
|
return base::AtomicRefCountDecN(ptr, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +139,7 @@ inline bool AtomicRefCountDec(volatile AtomicRefCount *ptr) {
|
|||||||
// the test for a reference count of one, and performs the memory barrier
|
// 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
|
// needed for the owning thread to act on the object, knowing that it has
|
||||||
// exclusive access to the object.
|
// exclusive access to the object.
|
||||||
inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) {
|
inline bool AtomicRefCountIsOne(volatile AtomicRefCount* ptr) {
|
||||||
bool res = (subtle::Acquire_Load(ptr) == 1);
|
bool res = (subtle::Acquire_Load(ptr) == 1);
|
||||||
if (res) {
|
if (res) {
|
||||||
ANNOTATE_HAPPENS_AFTER(ptr);
|
ANNOTATE_HAPPENS_AFTER(ptr);
|
||||||
@@ -111,7 +150,7 @@ inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) {
|
|||||||
// Return whether the reference count is zero. With conventional object
|
// Return whether the reference count is zero. With conventional object
|
||||||
// referencing counting, the object will be destroyed, so the reference count
|
// referencing counting, the object will be destroyed, so the reference count
|
||||||
// should never be zero. Hence this is generally used for a debug check.
|
// should never be zero. Hence this is generally used for a debug check.
|
||||||
inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
|
inline bool AtomicRefCountIsZero(volatile AtomicRefCount* ptr) {
|
||||||
bool res = (subtle::Acquire_Load(ptr) == 0);
|
bool res = (subtle::Acquire_Load(ptr) == 0);
|
||||||
if (res) {
|
if (res) {
|
||||||
ANNOTATE_HAPPENS_AFTER(ptr);
|
ANNOTATE_HAPPENS_AFTER(ptr);
|
||||||
|
|||||||
@@ -122,8 +122,7 @@ Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value);
|
|||||||
// *ptr with the increment applied. This routine implies no memory barriers.
|
// *ptr with the increment applied. This routine implies no memory barriers.
|
||||||
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
|
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
|
||||||
|
|
||||||
Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
|
||||||
Atomic32 increment);
|
|
||||||
|
|
||||||
// These following lower-level operations are typically useful only to people
|
// These following lower-level operations are typically useful only to people
|
||||||
// implementing higher-level synchronization operations like spinlocks,
|
// implementing higher-level synchronization operations like spinlocks,
|
||||||
|
|||||||
@@ -32,8 +32,8 @@
|
|||||||
#define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
|
#define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <limits.h> // For UINT_MAX
|
#include <limits.h> // For UINT_MAX
|
||||||
#include <stddef.h> // For size_t
|
#include <stddef.h> // For size_t
|
||||||
|
|
||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
|
|
||||||
@@ -43,34 +43,44 @@
|
|||||||
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
|
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
|
||||||
// <inttypes.h> format macros even in the LP64 model.
|
// <inttypes.h> format macros even in the LP64 model.
|
||||||
#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
|
#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
|
||||||
typedef long int64; // NOLINT(runtime/int)
|
typedef long int64;
|
||||||
typedef unsigned long uint64; // NOLINT(runtime/int)
|
typedef unsigned long uint64;
|
||||||
#else
|
#else
|
||||||
typedef long long int64; // NOLINT(runtime/int)
|
typedef long long int64;
|
||||||
typedef unsigned long long uint64; // NOLINT(runtime/int)
|
typedef unsigned long long uint64;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Remove these type guards. These are to avoid conflicts with
|
// TODO: Remove these type guards. These are to avoid conflicts with
|
||||||
// obsolete/protypes.h in the Gecko SDK.
|
// obsolete/protypes.h in the Gecko SDK.
|
||||||
#ifndef _INT32
|
#ifndef _INT32
|
||||||
#define _INT32
|
#define _INT32
|
||||||
typedef int int32;
|
typedef int int32;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Remove these type guards. These are to avoid conflicts with
|
// TODO: Remove these type guards. These are to avoid conflicts with
|
||||||
// obsolete/protypes.h in the Gecko SDK.
|
// obsolete/protypes.h in the Gecko SDK.
|
||||||
#ifndef _UINT32
|
#ifndef _UINT32
|
||||||
#define _UINT32
|
#define _UINT32
|
||||||
typedef unsigned int uint32;
|
typedef unsigned int uint32;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _INT16
|
||||||
|
#define _INT16
|
||||||
|
typedef short int16;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _UINT16
|
||||||
|
#define _UINT16
|
||||||
|
typedef unsigned short uint16;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UTF-16 character type.
|
// UTF-16 character type.
|
||||||
// This should be kept synchronized with base/strings/string16.h
|
// This should be kept synchronized with base/strings/string16.h
|
||||||
#ifndef char16
|
#ifndef char16
|
||||||
#if defined(WCHAR_T_IS_UTF16)
|
#if defined(WCHAR_T_IS_UTF16)
|
||||||
typedef wchar_t char16;
|
typedef wchar_t char16;
|
||||||
#elif defined(WCHAR_T_IS_UTF32)
|
#elif defined(WCHAR_T_IS_UTF32)
|
||||||
typedef unsigned short char16;
|
typedef unsigned short char16;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -89,34 +89,32 @@
|
|||||||
namespace base {
|
namespace base {
|
||||||
|
|
||||||
template <typename Functor>
|
template <typename Functor>
|
||||||
base::Callback<
|
base::Callback<typename cef_internal::BindState<
|
||||||
typename cef_internal::BindState<
|
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
void()>::UnboundRunType>
|
||||||
void()>
|
|
||||||
::UnboundRunType>
|
|
||||||
Bind(Functor functor) {
|
Bind(Functor functor) {
|
||||||
// Typedefs for how to store and run the 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 typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||||
|
|
||||||
typedef cef_internal::BindState<RunnableType, RunType, void()> BindState;
|
typedef cef_internal::BindState<RunnableType, RunType, void()> BindState;
|
||||||
|
|
||||||
|
|
||||||
return Callback<typename BindState::UnboundRunType>(
|
return Callback<typename BindState::UnboundRunType>(
|
||||||
new BindState(cef_internal::MakeRunnable(functor)));
|
new BindState(cef_internal::MakeRunnable(functor)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Functor, typename P1>
|
template <typename Functor, typename P1>
|
||||||
base::Callback<
|
base::Callback<typename cef_internal::BindState<
|
||||||
typename cef_internal::BindState<
|
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>::
|
||||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>
|
UnboundRunType>
|
||||||
::UnboundRunType>
|
|
||||||
Bind(Functor functor, const P1& p1) {
|
Bind(Functor functor, const P1& p1) {
|
||||||
// Typedefs for how to store and run the 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 typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||||
|
|
||||||
// Use RunnableType::RunType instead of RunType above because our
|
// Use RunnableType::RunType instead of RunType above because our
|
||||||
@@ -131,39 +129,39 @@ Bind(Functor functor, const P1& p1) {
|
|||||||
// invoked function will receive a reference to the stored copy of the
|
// invoked function will receive a reference to the stored copy of the
|
||||||
// argument and not the original.
|
// argument and not the original.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(
|
||||||
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ),
|
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value),
|
||||||
do_not_bind_functions_with_nonconst_ref);
|
do_not_bind_functions_with_nonconst_ref);
|
||||||
|
|
||||||
// For methods, we need to be careful for parameter 1. We do not require
|
// For methods, we need to be careful for parameter 1. We do not require
|
||||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||||
// methods. We also disallow binding of an array as the method's target
|
// methods. We also disallow binding of an array as the method's target
|
||||||
// object.
|
// object.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
|
||||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
!is_array<P1>::value,
|
!is_array<P1>::value,
|
||||||
first_bound_argument_to_method_cannot_be_array);
|
first_bound_argument_to_method_cannot_be_array);
|
||||||
typedef cef_internal::BindState<RunnableType, RunType,
|
typedef cef_internal::BindState<
|
||||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)> BindState;
|
RunnableType, RunType,
|
||||||
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>
|
||||||
|
BindState;
|
||||||
|
|
||||||
return Callback<typename BindState::UnboundRunType>(
|
return Callback<typename BindState::UnboundRunType>(
|
||||||
new BindState(cef_internal::MakeRunnable(functor), p1));
|
new BindState(cef_internal::MakeRunnable(functor), p1));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Functor, typename P1, typename P2>
|
template <typename Functor, typename P1, typename P2>
|
||||||
base::Callback<
|
base::Callback<typename cef_internal::BindState<
|
||||||
typename cef_internal::BindState<
|
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
typename cef_internal::CallbackParamTraits<P2>::StorageType)>::
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType)>
|
UnboundRunType>
|
||||||
::UnboundRunType>
|
|
||||||
Bind(Functor functor, const P1& p1, const P2& p2) {
|
Bind(Functor functor, const P1& p1, const P2& p2) {
|
||||||
// Typedefs for how to store and run the 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 typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||||
|
|
||||||
// Use RunnableType::RunType instead of RunType above because our
|
// Use RunnableType::RunType instead of RunType above because our
|
||||||
@@ -179,43 +177,43 @@ Bind(Functor functor, const P1& p1, const P2& p2) {
|
|||||||
// argument and not the original.
|
// argument and not the original.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(
|
||||||
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ),
|
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value),
|
||||||
do_not_bind_functions_with_nonconst_ref);
|
do_not_bind_functions_with_nonconst_ref);
|
||||||
|
|
||||||
// For methods, we need to be careful for parameter 1. We do not require
|
// For methods, we need to be careful for parameter 1. We do not require
|
||||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||||
// methods. We also disallow binding of an array as the method's target
|
// methods. We also disallow binding of an array as the method's target
|
||||||
// object.
|
// object.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
|
||||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
!is_array<P1>::value,
|
!is_array<P1>::value,
|
||||||
first_bound_argument_to_method_cannot_be_array);
|
first_bound_argument_to_method_cannot_be_array);
|
||||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
|
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
|
||||||
p2_is_refcounted_type_and_needs_scoped_refptr);
|
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,
|
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>(
|
return Callback<typename BindState::UnboundRunType>(
|
||||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2));
|
new BindState(cef_internal::MakeRunnable(functor), p1, p2));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Functor, typename P1, typename P2, typename P3>
|
template <typename Functor, typename P1, typename P2, typename P3>
|
||||||
base::Callback<
|
base::Callback<typename cef_internal::BindState<
|
||||||
typename cef_internal::BindState<
|
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
typename cef_internal::CallbackParamTraits<P3>::StorageType)>::
|
||||||
typename cef_internal::CallbackParamTraits<P3>::StorageType)>
|
UnboundRunType>
|
||||||
::UnboundRunType>
|
|
||||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
|
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
|
||||||
// Typedefs for how to store and run the 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 typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||||
|
|
||||||
// Use RunnableType::RunType instead of RunType above because our
|
// Use RunnableType::RunType instead of RunType above because our
|
||||||
@@ -231,18 +229,17 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
|
|||||||
// argument and not the original.
|
// argument and not the original.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(
|
||||||
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ),
|
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value),
|
||||||
do_not_bind_functions_with_nonconst_ref);
|
do_not_bind_functions_with_nonconst_ref);
|
||||||
|
|
||||||
// For methods, we need to be careful for parameter 1. We do not require
|
// For methods, we need to be careful for parameter 1. We do not require
|
||||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||||
// methods. We also disallow binding of an array as the method's target
|
// methods. We also disallow binding of an array as the method's target
|
||||||
// object.
|
// object.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
|
||||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
!is_array<P1>::value,
|
!is_array<P1>::value,
|
||||||
first_bound_argument_to_method_cannot_be_array);
|
first_bound_argument_to_method_cannot_be_array);
|
||||||
@@ -250,29 +247,30 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
|
|||||||
p2_is_refcounted_type_and_needs_scoped_refptr);
|
p2_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
|
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
|
||||||
p3_is_refcounted_type_and_needs_scoped_refptr);
|
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,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P2>::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>(
|
return Callback<typename BindState::UnboundRunType>(
|
||||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3));
|
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Functor, typename P1, typename P2, typename P3, typename P4>
|
template <typename Functor, typename P1, typename P2, typename P3, typename P4>
|
||||||
base::Callback<
|
base::Callback<typename cef_internal::BindState<
|
||||||
typename cef_internal::BindState<
|
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
typename cef_internal::CallbackParamTraits<P4>::StorageType)>::
|
||||||
typename cef_internal::CallbackParamTraits<P4>::StorageType)>
|
UnboundRunType>
|
||||||
::UnboundRunType>
|
|
||||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
|
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
|
||||||
// Typedefs for how to store and run the 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 typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||||
|
|
||||||
// Use RunnableType::RunType instead of RunType above because our
|
// Use RunnableType::RunType instead of RunType above because our
|
||||||
@@ -288,19 +286,18 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
|
|||||||
// argument and not the original.
|
// argument and not the original.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(
|
||||||
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ),
|
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value),
|
||||||
do_not_bind_functions_with_nonconst_ref);
|
do_not_bind_functions_with_nonconst_ref);
|
||||||
|
|
||||||
// For methods, we need to be careful for parameter 1. We do not require
|
// For methods, we need to be careful for parameter 1. We do not require
|
||||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||||
// methods. We also disallow binding of an array as the method's target
|
// methods. We also disallow binding of an array as the method's target
|
||||||
// object.
|
// object.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
|
||||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
!is_array<P1>::value,
|
!is_array<P1>::value,
|
||||||
first_bound_argument_to_method_cannot_be_array);
|
first_bound_argument_to_method_cannot_be_array);
|
||||||
@@ -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);
|
p3_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
|
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
|
||||||
p4_is_refcounted_type_and_needs_scoped_refptr);
|
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,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P3>::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>(
|
return Callback<typename BindState::UnboundRunType>(
|
||||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4));
|
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 P5>
|
typename P1,
|
||||||
base::Callback<
|
typename P2,
|
||||||
typename cef_internal::BindState<
|
typename P3,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
typename P4,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
typename P5>
|
||||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
base::Callback<typename cef_internal::BindState<
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P5>::StorageType)>
|
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||||
::UnboundRunType>
|
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||||
const P5& p5) {
|
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.
|
// 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 typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||||
|
|
||||||
// Use RunnableType::RunType instead of RunType above because our
|
// Use RunnableType::RunType instead of RunType above because our
|
||||||
@@ -352,20 +358,19 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
|||||||
// argument and not the original.
|
// argument and not the original.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(
|
||||||
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ),
|
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value),
|
||||||
do_not_bind_functions_with_nonconst_ref);
|
do_not_bind_functions_with_nonconst_ref);
|
||||||
|
|
||||||
// For methods, we need to be careful for parameter 1. We do not require
|
// For methods, we need to be careful for parameter 1. We do not require
|
||||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||||
// methods. We also disallow binding of an array as the method's target
|
// methods. We also disallow binding of an array as the method's target
|
||||||
// object.
|
// object.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
|
||||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
!is_array<P1>::value,
|
!is_array<P1>::value,
|
||||||
first_bound_argument_to_method_cannot_be_array);
|
first_bound_argument_to_method_cannot_be_array);
|
||||||
@@ -377,35 +382,46 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
|||||||
p4_is_refcounted_type_and_needs_scoped_refptr);
|
p4_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
|
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
|
||||||
p5_is_refcounted_type_and_needs_scoped_refptr);
|
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,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P4>::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>(
|
return Callback<typename BindState::UnboundRunType>(
|
||||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5));
|
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
|
template <typename Functor,
|
||||||
typename P5, typename P6>
|
typename P1,
|
||||||
base::Callback<
|
typename P2,
|
||||||
typename cef_internal::BindState<
|
typename P3,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
typename P4,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
typename P5,
|
||||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
typename P6>
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
base::Callback<typename cef_internal::BindState<
|
||||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||||
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P6>::StorageType)>
|
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||||
::UnboundRunType>
|
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||||
const P5& p5, const P6& p6) {
|
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
||||||
|
typename cef_internal::CallbackParamTraits<P6>::StorageType)>::
|
||||||
|
UnboundRunType>
|
||||||
|
Bind(Functor functor,
|
||||||
|
const P1& p1,
|
||||||
|
const P2& p2,
|
||||||
|
const P3& p3,
|
||||||
|
const P4& p4,
|
||||||
|
const P5& p5,
|
||||||
|
const P6& p6) {
|
||||||
// Typedefs for how to store and run the functor.
|
// 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 typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||||
|
|
||||||
// Use RunnableType::RunType instead of RunType above because our
|
// Use RunnableType::RunType instead of RunType above because our
|
||||||
@@ -421,21 +437,20 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
|||||||
// argument and not the original.
|
// argument and not the original.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(
|
||||||
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A6Type>::value ),
|
is_non_const_reference<typename BoundFunctorTraits::A6Type>::value),
|
||||||
do_not_bind_functions_with_nonconst_ref);
|
do_not_bind_functions_with_nonconst_ref);
|
||||||
|
|
||||||
// For methods, we need to be careful for parameter 1. We do not require
|
// For methods, we need to be careful for parameter 1. We do not require
|
||||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||||
// methods. We also disallow binding of an array as the method's target
|
// methods. We also disallow binding of an array as the method's target
|
||||||
// object.
|
// object.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
|
||||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
!is_array<P1>::value,
|
!is_array<P1>::value,
|
||||||
first_bound_argument_to_method_cannot_be_array);
|
first_bound_argument_to_method_cannot_be_array);
|
||||||
@@ -449,37 +464,50 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
|||||||
p5_is_refcounted_type_and_needs_scoped_refptr);
|
p5_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
|
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
|
||||||
p6_is_refcounted_type_and_needs_scoped_refptr);
|
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,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P5>::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(
|
||||||
return Callback<typename BindState::UnboundRunType>(
|
cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6));
|
||||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
|
template <typename Functor,
|
||||||
typename P5, typename P6, typename P7>
|
typename P1,
|
||||||
base::Callback<
|
typename P2,
|
||||||
typename cef_internal::BindState<
|
typename P3,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
typename P4,
|
||||||
typename cef_internal::FunctorTraits<Functor>::RunType,
|
typename P5,
|
||||||
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
typename P6,
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
typename P7>
|
||||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
base::Callback<typename cef_internal::BindState<
|
||||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
typename cef_internal::FunctorTraits<Functor>::RunnableType,
|
||||||
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
typename cef_internal::FunctorTraits<Functor>::RunType,
|
||||||
typename cef_internal::CallbackParamTraits<P6>::StorageType,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P7>::StorageType)>
|
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||||
::UnboundRunType>
|
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||||
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||||
const P5& p5, const P6& p6, const P7& p7) {
|
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
||||||
|
typename cef_internal::CallbackParamTraits<P6>::StorageType,
|
||||||
|
typename cef_internal::CallbackParamTraits<P7>::StorageType)>::
|
||||||
|
UnboundRunType>
|
||||||
|
Bind(Functor functor,
|
||||||
|
const P1& p1,
|
||||||
|
const P2& p2,
|
||||||
|
const P3& p3,
|
||||||
|
const P4& p4,
|
||||||
|
const P5& p5,
|
||||||
|
const P6& p6,
|
||||||
|
const P7& p7) {
|
||||||
// Typedefs for how to store and run the functor.
|
// 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 typename cef_internal::FunctorTraits<Functor>::RunType RunType;
|
||||||
|
|
||||||
// Use RunnableType::RunType instead of RunType above because our
|
// Use RunnableType::RunType instead of RunType above because our
|
||||||
@@ -495,22 +523,21 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
|||||||
// argument and not the original.
|
// argument and not the original.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(
|
||||||
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
!(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A6Type>::value ||
|
is_non_const_reference<typename BoundFunctorTraits::A6Type>::value ||
|
||||||
is_non_const_reference<typename BoundFunctorTraits::A7Type>::value ),
|
is_non_const_reference<typename BoundFunctorTraits::A7Type>::value),
|
||||||
do_not_bind_functions_with_nonconst_ref);
|
do_not_bind_functions_with_nonconst_ref);
|
||||||
|
|
||||||
// For methods, we need to be careful for parameter 1. We do not require
|
// For methods, we need to be careful for parameter 1. We do not require
|
||||||
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
// a scoped_refptr because BindState<> itself takes care of AddRef() for
|
||||||
// methods. We also disallow binding of an array as the method's target
|
// methods. We also disallow binding of an array as the method's target
|
||||||
// object.
|
// object.
|
||||||
COMPILE_ASSERT(
|
COMPILE_ASSERT(cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
cef_internal::HasIsMethodTag<RunnableType>::value ||
|
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
||||||
!cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
|
p1_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
p1_is_refcounted_type_and_needs_scoped_refptr);
|
|
||||||
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
|
||||||
!is_array<P1>::value,
|
!is_array<P1>::value,
|
||||||
first_bound_argument_to_method_cannot_be_array);
|
first_bound_argument_to_method_cannot_be_array);
|
||||||
@@ -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);
|
p6_is_refcounted_type_and_needs_scoped_refptr);
|
||||||
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P7>::value,
|
COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P7>::value,
|
||||||
p7_is_refcounted_type_and_needs_scoped_refptr);
|
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,
|
void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
typename cef_internal::CallbackParamTraits<P2>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
typename cef_internal::CallbackParamTraits<P3>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
typename cef_internal::CallbackParamTraits<P4>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
typename cef_internal::CallbackParamTraits<P5>::StorageType,
|
||||||
typename cef_internal::CallbackParamTraits<P6>::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(
|
||||||
return Callback<typename BindState::UnboundRunType>(
|
cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7));
|
||||||
new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6,
|
|
||||||
p7));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|||||||
@@ -274,20 +274,20 @@ class SupportsAddRefAndRelease {
|
|||||||
// instantiate Base is made. We disable the warning for this definition.
|
// instantiate Base is made. We disable the warning for this definition.
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4624)
|
#pragma warning(disable : 4624)
|
||||||
#endif
|
#endif
|
||||||
struct Base : public T, public BaseMixin {
|
struct Base : public T, public BaseMixin {};
|
||||||
};
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <void(BaseMixin::*)(void)> struct Helper {};
|
template <void (BaseMixin::*)(void)>
|
||||||
|
struct Helper {};
|
||||||
|
|
||||||
template <typename C>
|
template <typename C>
|
||||||
static No& Check(Helper<&C::AddRef>*);
|
static No& Check(Helper<&C::AddRef>*);
|
||||||
|
|
||||||
template <typename >
|
template <typename>
|
||||||
static Yes& Check(...);
|
static Yes& Check(...);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -297,22 +297,18 @@ class SupportsAddRefAndRelease {
|
|||||||
// Helpers to assert that arguments of a recounted type are bound with a
|
// Helpers to assert that arguments of a recounted type are bound with a
|
||||||
// scoped_refptr.
|
// scoped_refptr.
|
||||||
template <bool IsClasstype, typename T>
|
template <bool IsClasstype, typename T>
|
||||||
struct UnsafeBindtoRefCountedArgHelper : false_type {
|
struct UnsafeBindtoRefCountedArgHelper : false_type {};
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UnsafeBindtoRefCountedArgHelper<true, T>
|
struct UnsafeBindtoRefCountedArgHelper<true, T>
|
||||||
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {
|
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {};
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UnsafeBindtoRefCountedArg : false_type {
|
struct UnsafeBindtoRefCountedArg : false_type {};
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UnsafeBindtoRefCountedArg<T*>
|
struct UnsafeBindtoRefCountedArg<T*>
|
||||||
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {
|
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {};
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class HasIsMethodTag {
|
class HasIsMethodTag {
|
||||||
@@ -334,6 +330,7 @@ class UnretainedWrapper {
|
|||||||
public:
|
public:
|
||||||
explicit UnretainedWrapper(T* o) : ptr_(o) {}
|
explicit UnretainedWrapper(T* o) : ptr_(o) {}
|
||||||
T* get() const { return ptr_; }
|
T* get() const { return ptr_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T* ptr_;
|
T* ptr_;
|
||||||
};
|
};
|
||||||
@@ -343,6 +340,7 @@ class ConstRefWrapper {
|
|||||||
public:
|
public:
|
||||||
explicit ConstRefWrapper(const T& o) : ptr_(&o) {}
|
explicit ConstRefWrapper(const T& o) : ptr_(&o) {}
|
||||||
const T& get() const { return *ptr_; }
|
const T& get() const { return *ptr_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const T* ptr_;
|
const T* ptr_;
|
||||||
};
|
};
|
||||||
@@ -355,7 +353,7 @@ struct IgnoreResultHelper {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct IgnoreResultHelper<Callback<T> > {
|
struct IgnoreResultHelper<Callback<T>> {
|
||||||
explicit IgnoreResultHelper(const Callback<T>& functor) : functor_(functor) {}
|
explicit IgnoreResultHelper(const Callback<T>& functor) : functor_(functor) {}
|
||||||
|
|
||||||
const Callback<T>& functor_;
|
const Callback<T>& functor_;
|
||||||
@@ -409,8 +407,7 @@ class PassedWrapper {
|
|||||||
public:
|
public:
|
||||||
explicit PassedWrapper(T scoper) : is_valid_(true), scoper_(scoper.Pass()) {}
|
explicit PassedWrapper(T scoper) : is_valid_(true), scoper_(scoper.Pass()) {}
|
||||||
PassedWrapper(const PassedWrapper& other)
|
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 {
|
T Pass() const {
|
||||||
CHECK(is_valid_);
|
CHECK(is_valid_);
|
||||||
is_valid_ = false;
|
is_valid_ = false;
|
||||||
@@ -430,7 +427,7 @@ struct UnwrapTraits {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UnwrapTraits<UnretainedWrapper<T> > {
|
struct UnwrapTraits<UnretainedWrapper<T>> {
|
||||||
typedef T* ForwardType;
|
typedef T* ForwardType;
|
||||||
static ForwardType Unwrap(UnretainedWrapper<T> unretained) {
|
static ForwardType Unwrap(UnretainedWrapper<T> unretained) {
|
||||||
return unretained.get();
|
return unretained.get();
|
||||||
@@ -438,7 +435,7 @@ struct UnwrapTraits<UnretainedWrapper<T> > {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UnwrapTraits<ConstRefWrapper<T> > {
|
struct UnwrapTraits<ConstRefWrapper<T>> {
|
||||||
typedef const T& ForwardType;
|
typedef const T& ForwardType;
|
||||||
static ForwardType Unwrap(ConstRefWrapper<T> const_ref) {
|
static ForwardType Unwrap(ConstRefWrapper<T> const_ref) {
|
||||||
return const_ref.get();
|
return const_ref.get();
|
||||||
@@ -446,31 +443,27 @@ struct UnwrapTraits<ConstRefWrapper<T> > {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UnwrapTraits<scoped_refptr<T> > {
|
struct UnwrapTraits<scoped_refptr<T>> {
|
||||||
typedef T* ForwardType;
|
typedef T* ForwardType;
|
||||||
static ForwardType Unwrap(const scoped_refptr<T>& o) { return o.get(); }
|
static ForwardType Unwrap(const scoped_refptr<T>& o) { return o.get(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UnwrapTraits<WeakPtr<T> > {
|
struct UnwrapTraits<WeakPtr<T>> {
|
||||||
typedef const WeakPtr<T>& ForwardType;
|
typedef const WeakPtr<T>& ForwardType;
|
||||||
static ForwardType Unwrap(const WeakPtr<T>& o) { return o; }
|
static ForwardType Unwrap(const WeakPtr<T>& o) { return o; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UnwrapTraits<OwnedWrapper<T> > {
|
struct UnwrapTraits<OwnedWrapper<T>> {
|
||||||
typedef T* ForwardType;
|
typedef T* ForwardType;
|
||||||
static ForwardType Unwrap(const OwnedWrapper<T>& o) {
|
static ForwardType Unwrap(const OwnedWrapper<T>& o) { return o.get(); }
|
||||||
return o.get();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct UnwrapTraits<PassedWrapper<T> > {
|
struct UnwrapTraits<PassedWrapper<T>> {
|
||||||
typedef T ForwardType;
|
typedef T ForwardType;
|
||||||
static T Unwrap(PassedWrapper<T>& o) {
|
static T Unwrap(PassedWrapper<T>& o) { return o.Pass(); }
|
||||||
return o.Pass();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Utility for handling different refcounting semantics in the Bind()
|
// Utility for handling different refcounting semantics in the Bind()
|
||||||
@@ -505,7 +498,7 @@ struct MaybeRefcount<true, T*> {
|
|||||||
// No need to additionally AddRef() and Release() since we are storing a
|
// No need to additionally AddRef() and Release() since we are storing a
|
||||||
// scoped_refptr<> inside the storage object already.
|
// scoped_refptr<> inside the storage object already.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct MaybeRefcount<true, scoped_refptr<T> > {
|
struct MaybeRefcount<true, scoped_refptr<T>> {
|
||||||
static void AddRef(const scoped_refptr<T>& o) {}
|
static void AddRef(const scoped_refptr<T>& o) {}
|
||||||
static void Release(const scoped_refptr<T>& o) {}
|
static void Release(const scoped_refptr<T>& o) {}
|
||||||
};
|
};
|
||||||
@@ -526,10 +519,10 @@ template <bool IsMethod, typename P1>
|
|||||||
struct IsWeakMethod : public false_type {};
|
struct IsWeakMethod : public false_type {};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct IsWeakMethod<true, WeakPtr<T> > : public true_type {};
|
struct IsWeakMethod<true, WeakPtr<T>> : public true_type {};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct IsWeakMethod<true, ConstRefWrapper<WeakPtr<T> > > : public true_type {};
|
struct IsWeakMethod<true, ConstRefWrapper<WeakPtr<T>>> : public true_type {};
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace cef_internal
|
||||||
|
|
||||||
@@ -567,14 +560,14 @@ static inline cef_internal::IgnoreResultHelper<T> IgnoreResult(T data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static inline cef_internal::IgnoreResultHelper<Callback<T> >
|
static inline cef_internal::IgnoreResultHelper<Callback<T>> IgnoreResult(
|
||||||
IgnoreResult(const Callback<T>& data) {
|
const Callback<T>& data) {
|
||||||
return cef_internal::IgnoreResultHelper<Callback<T> >(data);
|
return cef_internal::IgnoreResultHelper<Callback<T>>(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoNothing();
|
void DoNothing();
|
||||||
|
|
||||||
template<typename T>
|
template <typename T>
|
||||||
void DeletePointer(T* obj) {
|
void DeletePointer(T* obj) {
|
||||||
delete obj;
|
delete obj;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_
|
#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||||
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
|
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
@@ -116,12 +115,10 @@
|
|||||||
// Type detection for wchar_t.
|
// Type detection for wchar_t.
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#define WCHAR_T_IS_UTF16
|
#define WCHAR_T_IS_UTF16
|
||||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
|
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
|
||||||
defined(__WCHAR_MAX__) && \
|
|
||||||
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
|
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
|
||||||
#define WCHAR_T_IS_UTF32
|
#define WCHAR_T_IS_UTF32
|
||||||
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
|
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
|
||||||
defined(__WCHAR_MAX__) && \
|
|
||||||
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
|
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
|
||||||
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
|
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
|
||||||
// compile in this mode (in particular, Chrome doesn't). This is intended for
|
// compile in this mode (in particular, Chrome doesn't). This is intended for
|
||||||
@@ -181,7 +178,7 @@
|
|||||||
// Visual Studio 2010 and later support override.
|
// Visual Studio 2010 and later support override.
|
||||||
#define OVERRIDE override
|
#define OVERRIDE override
|
||||||
#elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \
|
#elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \
|
||||||
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700
|
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700
|
||||||
// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
|
// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
|
||||||
#define OVERRIDE override
|
#define OVERRIDE override
|
||||||
#else
|
#else
|
||||||
@@ -189,4 +186,12 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif // OVERRIDE
|
#endif // OVERRIDE
|
||||||
|
|
||||||
|
// Check for C++11 template alias support which was added in VS2013 and GCC4.7.
|
||||||
|
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
|
||||||
|
#if __cplusplus > 199711L || (defined(_MSC_VER) && _MSC_VER >= 1800) || \
|
||||||
|
(defined(__GNUC__) && \
|
||||||
|
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ >= 40700))
|
||||||
|
#define HAS_CPP11_TEMPLATE_ALIAS_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_
|
#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||||
|
|||||||
@@ -45,9 +45,9 @@
|
|||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
// updated to match.
|
// updated to match.
|
||||||
|
|
||||||
#include "include/base/internal/cef_callback_internal.h"
|
|
||||||
#include "include/base/cef_callback_forward.h"
|
#include "include/base/cef_callback_forward.h"
|
||||||
#include "include/base/cef_template_util.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
|
// 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.
|
// Closure should #include "base/cef_callback_forward.h" instead of this file.
|
||||||
@@ -407,21 +407,20 @@ class Callback<R(void)> : public cef_internal::CallbackBase {
|
|||||||
public:
|
public:
|
||||||
typedef R(RunType)();
|
typedef R(RunType)();
|
||||||
|
|
||||||
Callback() : CallbackBase(NULL) { }
|
Callback() : CallbackBase(NULL) {}
|
||||||
|
|
||||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||||
// return the exact Callback<> type. See base/bind.h for details.
|
// return the exact Callback<> type. See base/bind.h for details.
|
||||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
Callback(
|
||||||
BoundArgsType>* bind_state)
|
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||||
: CallbackBase(bind_state) {
|
: CallbackBase(bind_state) {
|
||||||
|
|
||||||
// Force the assignment to a local variable of PolymorphicInvoke
|
// Force the assignment to a local variable of PolymorphicInvoke
|
||||||
// so the compiler will typecheck that the passed in Run() method has
|
// so the compiler will typecheck that the passed in Run() method has
|
||||||
// the correct type.
|
// the correct type.
|
||||||
PolymorphicInvoke invoke_func =
|
PolymorphicInvoke invoke_func =
|
||||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
&cef_internal::BindState<Runnable, BindRunType,
|
||||||
::InvokerType::Run;
|
BoundArgsType>::InvokerType::Run;
|
||||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,9 +436,7 @@ class Callback<R(void)> : public cef_internal::CallbackBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef R(*PolymorphicInvoke)(
|
typedef R (*PolymorphicInvoke)(cef_internal::BindStateBase*);
|
||||||
cef_internal::BindStateBase*);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1>
|
template <typename R, typename A1>
|
||||||
@@ -447,21 +444,20 @@ class Callback<R(A1)> : public cef_internal::CallbackBase {
|
|||||||
public:
|
public:
|
||||||
typedef R(RunType)(A1);
|
typedef R(RunType)(A1);
|
||||||
|
|
||||||
Callback() : CallbackBase(NULL) { }
|
Callback() : CallbackBase(NULL) {}
|
||||||
|
|
||||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||||
// return the exact Callback<> type. See base/bind.h for details.
|
// return the exact Callback<> type. See base/bind.h for details.
|
||||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
Callback(
|
||||||
BoundArgsType>* bind_state)
|
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||||
: CallbackBase(bind_state) {
|
: CallbackBase(bind_state) {
|
||||||
|
|
||||||
// Force the assignment to a local variable of PolymorphicInvoke
|
// Force the assignment to a local variable of PolymorphicInvoke
|
||||||
// so the compiler will typecheck that the passed in Run() method has
|
// so the compiler will typecheck that the passed in Run() method has
|
||||||
// the correct type.
|
// the correct type.
|
||||||
PolymorphicInvoke invoke_func =
|
PolymorphicInvoke invoke_func =
|
||||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
&cef_internal::BindState<Runnable, BindRunType,
|
||||||
::InvokerType::Run;
|
BoundArgsType>::InvokerType::Run;
|
||||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,10 +473,9 @@ class Callback<R(A1)> : public cef_internal::CallbackBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef R(*PolymorphicInvoke)(
|
typedef R (*PolymorphicInvoke)(
|
||||||
cef_internal::BindStateBase*,
|
cef_internal::BindStateBase*,
|
||||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType);
|
typename cef_internal::CallbackParamTraits<A1>::ForwardType);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2>
|
template <typename R, typename A1, typename A2>
|
||||||
@@ -488,21 +483,20 @@ class Callback<R(A1, A2)> : public cef_internal::CallbackBase {
|
|||||||
public:
|
public:
|
||||||
typedef R(RunType)(A1, A2);
|
typedef R(RunType)(A1, A2);
|
||||||
|
|
||||||
Callback() : CallbackBase(NULL) { }
|
Callback() : CallbackBase(NULL) {}
|
||||||
|
|
||||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||||
// return the exact Callback<> type. See base/bind.h for details.
|
// return the exact Callback<> type. See base/bind.h for details.
|
||||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
Callback(
|
||||||
BoundArgsType>* bind_state)
|
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||||
: CallbackBase(bind_state) {
|
: CallbackBase(bind_state) {
|
||||||
|
|
||||||
// Force the assignment to a local variable of PolymorphicInvoke
|
// Force the assignment to a local variable of PolymorphicInvoke
|
||||||
// so the compiler will typecheck that the passed in Run() method has
|
// so the compiler will typecheck that the passed in Run() method has
|
||||||
// the correct type.
|
// the correct type.
|
||||||
PolymorphicInvoke invoke_func =
|
PolymorphicInvoke invoke_func =
|
||||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
&cef_internal::BindState<Runnable, BindRunType,
|
||||||
::InvokerType::Run;
|
BoundArgsType>::InvokerType::Run;
|
||||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,11 +514,10 @@ class Callback<R(A1, A2)> : public cef_internal::CallbackBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef R(*PolymorphicInvoke)(
|
typedef R (*PolymorphicInvoke)(
|
||||||
cef_internal::BindStateBase*,
|
cef_internal::BindStateBase*,
|
||||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A2>::ForwardType);
|
typename cef_internal::CallbackParamTraits<A2>::ForwardType);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2, typename A3>
|
template <typename R, typename A1, typename A2, typename A3>
|
||||||
@@ -532,21 +525,20 @@ class Callback<R(A1, A2, A3)> : public cef_internal::CallbackBase {
|
|||||||
public:
|
public:
|
||||||
typedef R(RunType)(A1, A2, A3);
|
typedef R(RunType)(A1, A2, A3);
|
||||||
|
|
||||||
Callback() : CallbackBase(NULL) { }
|
Callback() : CallbackBase(NULL) {}
|
||||||
|
|
||||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||||
// return the exact Callback<> type. See base/bind.h for details.
|
// return the exact Callback<> type. See base/bind.h for details.
|
||||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
Callback(
|
||||||
BoundArgsType>* bind_state)
|
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||||
: CallbackBase(bind_state) {
|
: CallbackBase(bind_state) {
|
||||||
|
|
||||||
// Force the assignment to a local variable of PolymorphicInvoke
|
// Force the assignment to a local variable of PolymorphicInvoke
|
||||||
// so the compiler will typecheck that the passed in Run() method has
|
// so the compiler will typecheck that the passed in Run() method has
|
||||||
// the correct type.
|
// the correct type.
|
||||||
PolymorphicInvoke invoke_func =
|
PolymorphicInvoke invoke_func =
|
||||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
&cef_internal::BindState<Runnable, BindRunType,
|
||||||
::InvokerType::Run;
|
BoundArgsType>::InvokerType::Run;
|
||||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,12 +558,11 @@ class Callback<R(A1, A2, A3)> : public cef_internal::CallbackBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef R(*PolymorphicInvoke)(
|
typedef R (*PolymorphicInvoke)(
|
||||||
cef_internal::BindStateBase*,
|
cef_internal::BindStateBase*,
|
||||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A3>::ForwardType);
|
typename cef_internal::CallbackParamTraits<A3>::ForwardType);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4>
|
template <typename R, typename A1, typename A2, typename A3, typename A4>
|
||||||
@@ -579,21 +570,20 @@ class Callback<R(A1, A2, A3, A4)> : public cef_internal::CallbackBase {
|
|||||||
public:
|
public:
|
||||||
typedef R(RunType)(A1, A2, A3, A4);
|
typedef R(RunType)(A1, A2, A3, A4);
|
||||||
|
|
||||||
Callback() : CallbackBase(NULL) { }
|
Callback() : CallbackBase(NULL) {}
|
||||||
|
|
||||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||||
// return the exact Callback<> type. See base/bind.h for details.
|
// return the exact Callback<> type. See base/bind.h for details.
|
||||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
Callback(
|
||||||
BoundArgsType>* bind_state)
|
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||||
: CallbackBase(bind_state) {
|
: CallbackBase(bind_state) {
|
||||||
|
|
||||||
// Force the assignment to a local variable of PolymorphicInvoke
|
// Force the assignment to a local variable of PolymorphicInvoke
|
||||||
// so the compiler will typecheck that the passed in Run() method has
|
// so the compiler will typecheck that the passed in Run() method has
|
||||||
// the correct type.
|
// the correct type.
|
||||||
PolymorphicInvoke invoke_func =
|
PolymorphicInvoke invoke_func =
|
||||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
&cef_internal::BindState<Runnable, BindRunType,
|
||||||
::InvokerType::Run;
|
BoundArgsType>::InvokerType::Run;
|
||||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -615,36 +605,38 @@ class Callback<R(A1, A2, A3, A4)> : public cef_internal::CallbackBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef R(*PolymorphicInvoke)(
|
typedef R (*PolymorphicInvoke)(
|
||||||
cef_internal::BindStateBase*,
|
cef_internal::BindStateBase*,
|
||||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A4>::ForwardType);
|
typename cef_internal::CallbackParamTraits<A4>::ForwardType);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R,
|
||||||
typename A5>
|
typename A1,
|
||||||
|
typename A2,
|
||||||
|
typename A3,
|
||||||
|
typename A4,
|
||||||
|
typename A5>
|
||||||
class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
|
class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
|
||||||
public:
|
public:
|
||||||
typedef R(RunType)(A1, A2, A3, A4, A5);
|
typedef R(RunType)(A1, A2, A3, A4, A5);
|
||||||
|
|
||||||
Callback() : CallbackBase(NULL) { }
|
Callback() : CallbackBase(NULL) {}
|
||||||
|
|
||||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||||
// return the exact Callback<> type. See base/bind.h for details.
|
// return the exact Callback<> type. See base/bind.h for details.
|
||||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
Callback(
|
||||||
BoundArgsType>* bind_state)
|
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||||
: CallbackBase(bind_state) {
|
: CallbackBase(bind_state) {
|
||||||
|
|
||||||
// Force the assignment to a local variable of PolymorphicInvoke
|
// Force the assignment to a local variable of PolymorphicInvoke
|
||||||
// so the compiler will typecheck that the passed in Run() method has
|
// so the compiler will typecheck that the passed in Run() method has
|
||||||
// the correct type.
|
// the correct type.
|
||||||
PolymorphicInvoke invoke_func =
|
PolymorphicInvoke invoke_func =
|
||||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
&cef_internal::BindState<Runnable, BindRunType,
|
||||||
::InvokerType::Run;
|
BoundArgsType>::InvokerType::Run;
|
||||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -660,45 +652,47 @@ class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
|
|||||||
PolymorphicInvoke f =
|
PolymorphicInvoke f =
|
||||||
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
|
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
|
||||||
|
|
||||||
return f(bind_state_.get(), cef_internal::CallbackForward(a1),
|
return f(
|
||||||
cef_internal::CallbackForward(a2),
|
bind_state_.get(), cef_internal::CallbackForward(a1),
|
||||||
cef_internal::CallbackForward(a3),
|
cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3),
|
||||||
cef_internal::CallbackForward(a4),
|
cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5));
|
||||||
cef_internal::CallbackForward(a5));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef R(*PolymorphicInvoke)(
|
typedef R (*PolymorphicInvoke)(
|
||||||
cef_internal::BindStateBase*,
|
cef_internal::BindStateBase*,
|
||||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A5>::ForwardType);
|
typename cef_internal::CallbackParamTraits<A5>::ForwardType);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R,
|
||||||
typename A5, typename A6>
|
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 {
|
class Callback<R(A1, A2, A3, A4, A5, A6)> : public cef_internal::CallbackBase {
|
||||||
public:
|
public:
|
||||||
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
|
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
|
||||||
|
|
||||||
Callback() : CallbackBase(NULL) { }
|
Callback() : CallbackBase(NULL) {}
|
||||||
|
|
||||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||||
// return the exact Callback<> type. See base/bind.h for details.
|
// return the exact Callback<> type. See base/bind.h for details.
|
||||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
Callback(
|
||||||
BoundArgsType>* bind_state)
|
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||||
: CallbackBase(bind_state) {
|
: CallbackBase(bind_state) {
|
||||||
|
|
||||||
// Force the assignment to a local variable of PolymorphicInvoke
|
// Force the assignment to a local variable of PolymorphicInvoke
|
||||||
// so the compiler will typecheck that the passed in Run() method has
|
// so the compiler will typecheck that the passed in Run() method has
|
||||||
// the correct type.
|
// the correct type.
|
||||||
PolymorphicInvoke invoke_func =
|
PolymorphicInvoke invoke_func =
|
||||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
&cef_internal::BindState<Runnable, BindRunType,
|
||||||
::InvokerType::Run;
|
BoundArgsType>::InvokerType::Run;
|
||||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -715,47 +709,51 @@ class Callback<R(A1, A2, A3, A4, A5, A6)> : public cef_internal::CallbackBase {
|
|||||||
PolymorphicInvoke f =
|
PolymorphicInvoke f =
|
||||||
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
|
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
|
||||||
|
|
||||||
return f(bind_state_.get(), cef_internal::CallbackForward(a1),
|
return f(
|
||||||
cef_internal::CallbackForward(a2),
|
bind_state_.get(), cef_internal::CallbackForward(a1),
|
||||||
cef_internal::CallbackForward(a3),
|
cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3),
|
||||||
cef_internal::CallbackForward(a4),
|
cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5),
|
||||||
cef_internal::CallbackForward(a5),
|
cef_internal::CallbackForward(a6));
|
||||||
cef_internal::CallbackForward(a6));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef R(*PolymorphicInvoke)(
|
typedef R (*PolymorphicInvoke)(
|
||||||
cef_internal::BindStateBase*,
|
cef_internal::BindStateBase*,
|
||||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A6>::ForwardType);
|
typename cef_internal::CallbackParamTraits<A6>::ForwardType);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R,
|
||||||
typename A5, typename A6, typename A7>
|
typename A1,
|
||||||
class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : public cef_internal::CallbackBase {
|
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:
|
public:
|
||||||
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
|
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
|
||||||
|
|
||||||
Callback() : CallbackBase(NULL) { }
|
Callback() : CallbackBase(NULL) {}
|
||||||
|
|
||||||
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
|
||||||
// return the exact Callback<> type. See base/bind.h for details.
|
// return the exact Callback<> type. See base/bind.h for details.
|
||||||
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
template <typename Runnable, typename BindRunType, typename BoundArgsType>
|
||||||
Callback(cef_internal::BindState<Runnable, BindRunType,
|
Callback(
|
||||||
BoundArgsType>* bind_state)
|
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
|
||||||
: CallbackBase(bind_state) {
|
: CallbackBase(bind_state) {
|
||||||
|
|
||||||
// Force the assignment to a local variable of PolymorphicInvoke
|
// Force the assignment to a local variable of PolymorphicInvoke
|
||||||
// so the compiler will typecheck that the passed in Run() method has
|
// so the compiler will typecheck that the passed in Run() method has
|
||||||
// the correct type.
|
// the correct type.
|
||||||
PolymorphicInvoke invoke_func =
|
PolymorphicInvoke invoke_func =
|
||||||
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
|
&cef_internal::BindState<Runnable, BindRunType,
|
||||||
::InvokerType::Run;
|
BoundArgsType>::InvokerType::Run;
|
||||||
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -773,29 +771,25 @@ class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : public cef_internal::CallbackBas
|
|||||||
PolymorphicInvoke f =
|
PolymorphicInvoke f =
|
||||||
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
|
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
|
||||||
|
|
||||||
return f(bind_state_.get(), cef_internal::CallbackForward(a1),
|
return f(
|
||||||
cef_internal::CallbackForward(a2),
|
bind_state_.get(), cef_internal::CallbackForward(a1),
|
||||||
cef_internal::CallbackForward(a3),
|
cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3),
|
||||||
cef_internal::CallbackForward(a4),
|
cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5),
|
||||||
cef_internal::CallbackForward(a5),
|
cef_internal::CallbackForward(a6), cef_internal::CallbackForward(a7));
|
||||||
cef_internal::CallbackForward(a6),
|
|
||||||
cef_internal::CallbackForward(a7));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef R(*PolymorphicInvoke)(
|
typedef R (*PolymorphicInvoke)(
|
||||||
cef_internal::BindStateBase*,
|
cef_internal::BindStateBase*,
|
||||||
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A4>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A5>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A6>::ForwardType,
|
typename cef_internal::CallbackParamTraits<A6>::ForwardType,
|
||||||
typename cef_internal::CallbackParamTraits<A7>::ForwardType);
|
typename cef_internal::CallbackParamTraits<A7>::ForwardType);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Syntactic sugar to make Callbacks<void(void)> easier to declare since it
|
// Syntactic sugar to make Callbacks<void(void)> easier to declare since it
|
||||||
// will be used in a lot of APIs with delayed execution.
|
// will be used in a lot of APIs with delayed execution.
|
||||||
typedef Callback<void(void)> Closure;
|
typedef Callback<void(void)> Closure;
|
||||||
|
|||||||
@@ -48,12 +48,12 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include "include/base/cef_basictypes.h"
|
#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_build.h"
|
||||||
|
#include "include/base/cef_callback.h"
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
#include "include/base/cef_macros.h"
|
#include "include/base/cef_macros.h"
|
||||||
#include "include/base/cef_scoped_ptr.h"
|
#include "include/base/cef_scoped_ptr.h"
|
||||||
|
#include "include/base/internal/cef_callback_internal.h"
|
||||||
|
|
||||||
// OVERVIEW:
|
// OVERVIEW:
|
||||||
//
|
//
|
||||||
@@ -120,9 +120,7 @@ class CallbackListBase {
|
|||||||
public:
|
public:
|
||||||
Subscription(CallbackListBase<CallbackType>* list,
|
Subscription(CallbackListBase<CallbackType>* list,
|
||||||
typename std::list<CallbackType>::iterator iter)
|
typename std::list<CallbackType>::iterator iter)
|
||||||
: list_(list),
|
: list_(list), iter_(iter) {}
|
||||||
iter_(iter) {
|
|
||||||
}
|
|
||||||
|
|
||||||
~Subscription() {
|
~Subscription() {
|
||||||
if (list_->active_iterator_count_) {
|
if (list_->active_iterator_count_) {
|
||||||
@@ -167,14 +165,12 @@ class CallbackListBase {
|
|||||||
class Iterator {
|
class Iterator {
|
||||||
public:
|
public:
|
||||||
explicit Iterator(CallbackListBase<CallbackType>* list)
|
explicit Iterator(CallbackListBase<CallbackType>* list)
|
||||||
: list_(list),
|
: list_(list), list_iter_(list_->callbacks_.begin()) {
|
||||||
list_iter_(list_->callbacks_.begin()) {
|
|
||||||
++list_->active_iterator_count_;
|
++list_->active_iterator_count_;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator(const Iterator& iter)
|
Iterator(const Iterator& iter)
|
||||||
: list_(iter.list_),
|
: list_(iter.list_), list_iter_(iter.list_iter_) {
|
||||||
list_iter_(iter.list_iter_) {
|
|
||||||
++list_->active_iterator_count_;
|
++list_->active_iterator_count_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,9 +206,7 @@ class CallbackListBase {
|
|||||||
|
|
||||||
// Returns an instance of a CallbackListBase::Iterator which can be used
|
// Returns an instance of a CallbackListBase::Iterator which can be used
|
||||||
// to run callbacks.
|
// to run callbacks.
|
||||||
Iterator GetIterator() {
|
Iterator GetIterator() { return Iterator(this); }
|
||||||
return Iterator(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compact the list: remove any entries which were NULLed out during
|
// Compact the list: remove any entries which were NULLed out during
|
||||||
// iteration.
|
// iteration.
|
||||||
@@ -242,11 +236,12 @@ class CallbackListBase {
|
|||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace cef_internal
|
||||||
|
|
||||||
template <typename Sig> class CallbackList;
|
template <typename Sig>
|
||||||
|
class CallbackList;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class CallbackList<void(void)>
|
class CallbackList<void(void)>
|
||||||
: public cef_internal::CallbackListBase<Callback<void(void)> > {
|
: public cef_internal::CallbackListBase<Callback<void(void)>> {
|
||||||
public:
|
public:
|
||||||
typedef Callback<void(void)> CallbackType;
|
typedef Callback<void(void)> CallbackType;
|
||||||
|
|
||||||
@@ -267,7 +262,7 @@ class CallbackList<void(void)>
|
|||||||
|
|
||||||
template <typename A1>
|
template <typename A1>
|
||||||
class CallbackList<void(A1)>
|
class CallbackList<void(A1)>
|
||||||
: public cef_internal::CallbackListBase<Callback<void(A1)> > {
|
: public cef_internal::CallbackListBase<Callback<void(A1)>> {
|
||||||
public:
|
public:
|
||||||
typedef Callback<void(A1)> CallbackType;
|
typedef Callback<void(A1)> CallbackType;
|
||||||
|
|
||||||
@@ -288,7 +283,7 @@ class CallbackList<void(A1)>
|
|||||||
|
|
||||||
template <typename A1, typename A2>
|
template <typename A1, typename A2>
|
||||||
class CallbackList<void(A1, A2)>
|
class CallbackList<void(A1, A2)>
|
||||||
: public cef_internal::CallbackListBase<Callback<void(A1, A2)> > {
|
: public cef_internal::CallbackListBase<Callback<void(A1, A2)>> {
|
||||||
public:
|
public:
|
||||||
typedef Callback<void(A1, A2)> CallbackType;
|
typedef Callback<void(A1, A2)> CallbackType;
|
||||||
|
|
||||||
@@ -310,7 +305,7 @@ class CallbackList<void(A1, A2)>
|
|||||||
|
|
||||||
template <typename A1, typename A2, typename A3>
|
template <typename A1, typename A2, typename A3>
|
||||||
class CallbackList<void(A1, A2, A3)>
|
class CallbackList<void(A1, A2, A3)>
|
||||||
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3)> > {
|
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3)>> {
|
||||||
public:
|
public:
|
||||||
typedef Callback<void(A1, A2, A3)> CallbackType;
|
typedef Callback<void(A1, A2, A3)> CallbackType;
|
||||||
|
|
||||||
@@ -333,7 +328,7 @@ class CallbackList<void(A1, A2, A3)>
|
|||||||
|
|
||||||
template <typename A1, typename A2, typename A3, typename A4>
|
template <typename A1, typename A2, typename A3, typename A4>
|
||||||
class CallbackList<void(A1, A2, A3, A4)>
|
class CallbackList<void(A1, A2, A3, A4)>
|
||||||
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4)> > {
|
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4)>> {
|
||||||
public:
|
public:
|
||||||
typedef Callback<void(A1, A2, A3, A4)> CallbackType;
|
typedef Callback<void(A1, A2, A3, A4)> CallbackType;
|
||||||
|
|
||||||
@@ -357,7 +352,8 @@ class CallbackList<void(A1, A2, A3, A4)>
|
|||||||
|
|
||||||
template <typename A1, typename A2, typename A3, typename A4, typename A5>
|
template <typename A1, typename A2, typename A3, typename A4, typename A5>
|
||||||
class CallbackList<void(A1, A2, A3, A4, 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:
|
public:
|
||||||
typedef Callback<void(A1, A2, A3, A4, A5)> CallbackType;
|
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);
|
DISALLOW_COPY_AND_ASSIGN(CallbackList);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A1, typename A2, typename A3, typename A4, typename A5,
|
template <typename A1,
|
||||||
typename A6>
|
typename A2,
|
||||||
|
typename A3,
|
||||||
|
typename A4,
|
||||||
|
typename A5,
|
||||||
|
typename A6>
|
||||||
class CallbackList<void(A1, A2, A3, A4, A5, A6)>
|
class CallbackList<void(A1, A2, A3, A4, A5, A6)>
|
||||||
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5,
|
: public cef_internal::CallbackListBase<
|
||||||
A6)> > {
|
Callback<void(A1, A2, A3, A4, A5, A6)>> {
|
||||||
public:
|
public:
|
||||||
typedef Callback<void(A1, A2, A3, A4, A5, A6)> CallbackType;
|
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);
|
DISALLOW_COPY_AND_ASSIGN(CallbackList);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A1, typename A2, typename A3, typename A4, typename A5,
|
template <typename A1,
|
||||||
typename A6, typename A7>
|
typename A2,
|
||||||
|
typename A3,
|
||||||
|
typename A4,
|
||||||
|
typename A5,
|
||||||
|
typename A6,
|
||||||
|
typename A7>
|
||||||
class CallbackList<void(A1, A2, A3, A4, A5, A6, A7)>
|
class CallbackList<void(A1, A2, A3, A4, A5, A6, A7)>
|
||||||
: public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5, A6,
|
: public cef_internal::CallbackListBase<
|
||||||
A7)> > {
|
Callback<void(A1, A2, A3, A4, A5, A6, A7)>> {
|
||||||
public:
|
public:
|
||||||
typedef Callback<void(A1, A2, A3, A4, A5, A6, A7)> CallbackType;
|
typedef Callback<void(A1, A2, A3, A4, A5, A6, A7)> CallbackType;
|
||||||
|
|
||||||
|
|||||||
@@ -83,8 +83,8 @@
|
|||||||
// updated to match.
|
// updated to match.
|
||||||
|
|
||||||
#include "include/base/cef_bind.h"
|
#include "include/base/cef_bind.h"
|
||||||
#include "include/base/cef_callback.h"
|
|
||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
|
#include "include/base/cef_callback.h"
|
||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
#include "include/base/cef_macros.h"
|
#include "include/base/cef_macros.h"
|
||||||
#include "include/base/cef_weak_ptr.h"
|
#include "include/base/cef_weak_ptr.h"
|
||||||
@@ -102,8 +102,7 @@ class CancelableCallback<void(void)> {
|
|||||||
|
|
||||||
// |callback| must not be null.
|
// |callback| must not be null.
|
||||||
explicit CancelableCallback(const base::Callback<void(void)>& callback)
|
explicit CancelableCallback(const base::Callback<void(void)>& callback)
|
||||||
: weak_factory_(this),
|
: weak_factory_(this), callback_(callback) {
|
||||||
callback_(callback) {
|
|
||||||
DCHECK(!callback.is_null());
|
DCHECK(!callback.is_null());
|
||||||
InitializeForwarder();
|
InitializeForwarder();
|
||||||
}
|
}
|
||||||
@@ -118,9 +117,7 @@ class CancelableCallback<void(void)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the wrapped callback has been cancelled.
|
// Returns true if the wrapped callback has been cancelled.
|
||||||
bool IsCancelled() const {
|
bool IsCancelled() const { return callback_.is_null(); }
|
||||||
return callback_.is_null();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
||||||
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
||||||
@@ -137,14 +134,10 @@ class CancelableCallback<void(void)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns a callback that can be disabled by calling Cancel().
|
// Returns a callback that can be disabled by calling Cancel().
|
||||||
const base::Callback<void(void)>& callback() const {
|
const base::Callback<void(void)>& callback() const { return forwarder_; }
|
||||||
return forwarder_;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Forward() {
|
void Forward() { callback_.Run(); }
|
||||||
callback_.Run();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method to bind |forwarder_| using a weak pointer from
|
// Helper method to bind |forwarder_| using a weak pointer from
|
||||||
// |weak_factory_|.
|
// |weak_factory_|.
|
||||||
@@ -154,7 +147,7 @@ class CancelableCallback<void(void)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Used to ensure Forward() is not run when this object is destroyed.
|
// Used to ensure Forward() is not run when this object is destroyed.
|
||||||
base::WeakPtrFactory<CancelableCallback<void(void)> > weak_factory_;
|
base::WeakPtrFactory<CancelableCallback<void(void)>> weak_factory_;
|
||||||
|
|
||||||
// The wrapper closure.
|
// The wrapper closure.
|
||||||
base::Callback<void(void)> forwarder_;
|
base::Callback<void(void)> forwarder_;
|
||||||
@@ -172,8 +165,7 @@ class CancelableCallback<void(A1)> {
|
|||||||
|
|
||||||
// |callback| must not be null.
|
// |callback| must not be null.
|
||||||
explicit CancelableCallback(const base::Callback<void(A1)>& callback)
|
explicit CancelableCallback(const base::Callback<void(A1)>& callback)
|
||||||
: weak_factory_(this),
|
: weak_factory_(this), callback_(callback) {
|
||||||
callback_(callback) {
|
|
||||||
DCHECK(!callback.is_null());
|
DCHECK(!callback.is_null());
|
||||||
InitializeForwarder();
|
InitializeForwarder();
|
||||||
}
|
}
|
||||||
@@ -188,9 +180,7 @@ class CancelableCallback<void(A1)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the wrapped callback has been cancelled.
|
// Returns true if the wrapped callback has been cancelled.
|
||||||
bool IsCancelled() const {
|
bool IsCancelled() const { return callback_.is_null(); }
|
||||||
return callback_.is_null();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
||||||
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
||||||
@@ -207,14 +197,10 @@ class CancelableCallback<void(A1)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns a callback that can be disabled by calling Cancel().
|
// Returns a callback that can be disabled by calling Cancel().
|
||||||
const base::Callback<void(A1)>& callback() const {
|
const base::Callback<void(A1)>& callback() const { return forwarder_; }
|
||||||
return forwarder_;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Forward(A1 a1) const {
|
void Forward(A1 a1) const { callback_.Run(a1); }
|
||||||
callback_.Run(a1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method to bind |forwarder_| using a weak pointer from
|
// Helper method to bind |forwarder_| using a weak pointer from
|
||||||
// |weak_factory_|.
|
// |weak_factory_|.
|
||||||
@@ -224,7 +210,7 @@ class CancelableCallback<void(A1)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Used to ensure Forward() is not run when this object is destroyed.
|
// Used to ensure Forward() is not run when this object is destroyed.
|
||||||
base::WeakPtrFactory<CancelableCallback<void(A1)> > weak_factory_;
|
base::WeakPtrFactory<CancelableCallback<void(A1)>> weak_factory_;
|
||||||
|
|
||||||
// The wrapper closure.
|
// The wrapper closure.
|
||||||
base::Callback<void(A1)> forwarder_;
|
base::Callback<void(A1)> forwarder_;
|
||||||
@@ -242,8 +228,7 @@ class CancelableCallback<void(A1, A2)> {
|
|||||||
|
|
||||||
// |callback| must not be null.
|
// |callback| must not be null.
|
||||||
explicit CancelableCallback(const base::Callback<void(A1, A2)>& callback)
|
explicit CancelableCallback(const base::Callback<void(A1, A2)>& callback)
|
||||||
: weak_factory_(this),
|
: weak_factory_(this), callback_(callback) {
|
||||||
callback_(callback) {
|
|
||||||
DCHECK(!callback.is_null());
|
DCHECK(!callback.is_null());
|
||||||
InitializeForwarder();
|
InitializeForwarder();
|
||||||
}
|
}
|
||||||
@@ -258,9 +243,7 @@ class CancelableCallback<void(A1, A2)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the wrapped callback has been cancelled.
|
// Returns true if the wrapped callback has been cancelled.
|
||||||
bool IsCancelled() const {
|
bool IsCancelled() const { return callback_.is_null(); }
|
||||||
return callback_.is_null();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
// Sets |callback| as the closure that may be cancelled. |callback| may not
|
||||||
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
// be null. Outstanding and any previously wrapped callbacks are cancelled.
|
||||||
@@ -277,14 +260,10 @@ class CancelableCallback<void(A1, A2)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns a callback that can be disabled by calling Cancel().
|
// Returns a callback that can be disabled by calling Cancel().
|
||||||
const base::Callback<void(A1, A2)>& callback() const {
|
const base::Callback<void(A1, A2)>& callback() const { return forwarder_; }
|
||||||
return forwarder_;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Forward(A1 a1, A2 a2) const {
|
void Forward(A1 a1, A2 a2) const { callback_.Run(a1, a2); }
|
||||||
callback_.Run(a1, a2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method to bind |forwarder_| using a weak pointer from
|
// Helper method to bind |forwarder_| using a weak pointer from
|
||||||
// |weak_factory_|.
|
// |weak_factory_|.
|
||||||
@@ -294,7 +273,7 @@ class CancelableCallback<void(A1, A2)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Used to ensure Forward() is not run when this object is destroyed.
|
// Used to ensure Forward() is not run when this object is destroyed.
|
||||||
base::WeakPtrFactory<CancelableCallback<void(A1, A2)> > weak_factory_;
|
base::WeakPtrFactory<CancelableCallback<void(A1, A2)>> weak_factory_;
|
||||||
|
|
||||||
// The wrapper closure.
|
// The wrapper closure.
|
||||||
base::Callback<void(A1, A2)> forwarder_;
|
base::Callback<void(A1, A2)> forwarder_;
|
||||||
|
|||||||
@@ -125,9 +125,7 @@ class AutoLock {
|
|||||||
public:
|
public:
|
||||||
struct AlreadyAcquired {};
|
struct AlreadyAcquired {};
|
||||||
|
|
||||||
explicit AutoLock(Lock& lock) : lock_(lock) {
|
explicit AutoLock(Lock& lock) : lock_(lock) { lock_.Acquire(); }
|
||||||
lock_.Acquire();
|
|
||||||
}
|
|
||||||
|
|
||||||
AutoLock(Lock& lock, const AlreadyAcquired&) : lock_(lock) {
|
AutoLock(Lock& lock, const AlreadyAcquired&) : lock_(lock) {
|
||||||
lock_.AssertAcquired();
|
lock_.AssertAcquired();
|
||||||
@@ -153,9 +151,7 @@ class AutoUnlock {
|
|||||||
lock_.Release();
|
lock_.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
~AutoUnlock() {
|
~AutoUnlock() { lock_.Acquire(); }
|
||||||
lock_.Acquire();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Lock& lock_;
|
Lock& lock_;
|
||||||
|
|||||||
@@ -158,9 +158,9 @@
|
|||||||
// updated to match.
|
// updated to match.
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <string>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "include/base/cef_build.h"
|
#include "include/base/cef_build.h"
|
||||||
#include "include/base/cef_macros.h"
|
#include "include/base/cef_macros.h"
|
||||||
@@ -201,32 +201,27 @@ const LogSeverity LOG_DFATAL = LOG_FATAL;
|
|||||||
// A few definitions of macros that don't generate much code. These are used
|
// A few definitions of macros that don't generate much code. These are used
|
||||||
// by LOG() and LOG_IF, etc. Since these are used all over our code, it's
|
// by LOG() and LOG_IF, etc. Since these are used all over our code, it's
|
||||||
// better to have compact code for these operations.
|
// better to have compact code for these operations.
|
||||||
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
|
||||||
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_INFO , \
|
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_INFO, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \
|
||||||
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_WARNING , \
|
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_WARNING, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \
|
||||||
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_ERROR , \
|
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_ERROR, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \
|
||||||
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_FATAL , \
|
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_FATAL, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \
|
||||||
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_DFATAL , \
|
cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_DFATAL, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
|
|
||||||
#define COMPACT_GOOGLE_LOG_INFO \
|
#define COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(LogMessage)
|
||||||
COMPACT_GOOGLE_LOG_EX_INFO(LogMessage)
|
#define COMPACT_GOOGLE_LOG_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
|
||||||
#define COMPACT_GOOGLE_LOG_WARNING \
|
#define COMPACT_GOOGLE_LOG_ERROR COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage)
|
||||||
COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
|
#define COMPACT_GOOGLE_LOG_FATAL COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage)
|
||||||
#define COMPACT_GOOGLE_LOG_ERROR \
|
#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage)
|
||||||
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)
|
#if defined(OS_WIN)
|
||||||
// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets
|
// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets
|
||||||
@@ -236,7 +231,7 @@ const LogSeverity LOG_DFATAL = LOG_FATAL;
|
|||||||
// the Windows SDK does for consistency.
|
// the Windows SDK does for consistency.
|
||||||
#define ERROR 0
|
#define ERROR 0
|
||||||
#define COMPACT_GOOGLE_LOG_EX_0(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_0(ClassName, ...) \
|
||||||
COMPACT_GOOGLE_LOG_EX_ERROR(ClassName , ##__VA_ARGS__)
|
COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR
|
#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR
|
||||||
// Needed for LOG_IS_ON(ERROR).
|
// Needed for LOG_IS_ON(ERROR).
|
||||||
const LogSeverity LOG_0 = LOG_ERROR;
|
const LogSeverity LOG_0 = LOG_ERROR;
|
||||||
@@ -246,7 +241,7 @@ const LogSeverity LOG_0 = LOG_ERROR;
|
|||||||
// LOG_IS_ON(DFATAL) always holds in debug mode. In particular, CHECK()s will
|
// LOG_IS_ON(DFATAL) always holds in debug mode. In particular, CHECK()s will
|
||||||
// always fire if they fail.
|
// always fire if they fail.
|
||||||
#define LOG_IS_ON(severity) \
|
#define LOG_IS_ON(severity) \
|
||||||
((::cef::logging::LOG_ ## severity) >= ::cef::logging::GetMinLogLevel())
|
((::cef::logging::LOG_##severity) >= ::cef::logging::GetMinLogLevel())
|
||||||
|
|
||||||
// We can't do any caching tricks with VLOG_IS_ON() like the
|
// We can't do any caching tricks with VLOG_IS_ON() like the
|
||||||
// google-glog version since it requires GCC extensions. This means
|
// google-glog version since it requires GCC extensions. This means
|
||||||
@@ -257,8 +252,8 @@ const LogSeverity LOG_0 = LOG_ERROR;
|
|||||||
|
|
||||||
// Helper macro which avoids evaluating the arguments to a stream if
|
// Helper macro which avoids evaluating the arguments to a stream if
|
||||||
// the condition doesn't hold.
|
// the condition doesn't hold.
|
||||||
#define LAZY_STREAM(stream, condition) \
|
#define LAZY_STREAM(stream, condition) \
|
||||||
!(condition) ? (void) 0 : ::cef::logging::LogMessageVoidify() & (stream)
|
!(condition) ? (void)0 : ::cef::logging::LogMessageVoidify() & (stream)
|
||||||
|
|
||||||
// We use the preprocessor's merging operator, "##", so that, e.g.,
|
// We use the preprocessor's merging operator, "##", so that, e.g.,
|
||||||
// LOG(INFO) becomes the token COMPACT_GOOGLE_LOG_INFO. There's some funny
|
// LOG(INFO) becomes the token COMPACT_GOOGLE_LOG_INFO. There's some funny
|
||||||
@@ -268,7 +263,7 @@ const LogSeverity LOG_0 = LOG_ERROR;
|
|||||||
// impossible to stream something like a string directly to an unnamed
|
// impossible to stream something like a string directly to an unnamed
|
||||||
// ostream. We employ a neat hack by calling the stream() member
|
// ostream. We employ a neat hack by calling the stream() member
|
||||||
// function of LogMessage which seems to avoid the problem.
|
// function of LogMessage which seems to avoid the problem.
|
||||||
#define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_ ## severity.stream()
|
#define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_##severity.stream()
|
||||||
|
|
||||||
#define LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
|
#define LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
|
||||||
#define LOG_IF(severity, condition) \
|
#define LOG_IF(severity, condition) \
|
||||||
@@ -286,16 +281,18 @@ const LogSeverity LOG_0 = LOG_ERROR;
|
|||||||
|
|
||||||
#define VLOG_IF(verbose_level, condition) \
|
#define VLOG_IF(verbose_level, condition) \
|
||||||
LAZY_STREAM(VLOG_STREAM(verbose_level), \
|
LAZY_STREAM(VLOG_STREAM(verbose_level), \
|
||||||
VLOG_IS_ON(verbose_level) && (condition))
|
VLOG_IS_ON(verbose_level) && (condition))
|
||||||
|
|
||||||
#if defined (OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#define VPLOG_STREAM(verbose_level) \
|
#define VPLOG_STREAM(verbose_level) \
|
||||||
cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \
|
cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \
|
||||||
::cef::logging::GetLastSystemErrorCode()).stream()
|
::cef::logging::GetLastSystemErrorCode()) \
|
||||||
|
.stream()
|
||||||
#elif defined(OS_POSIX)
|
#elif defined(OS_POSIX)
|
||||||
#define VPLOG_STREAM(verbose_level) \
|
#define VPLOG_STREAM(verbose_level) \
|
||||||
cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \
|
cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \
|
||||||
::cef::logging::GetLastSystemErrorCode()).stream()
|
::cef::logging::GetLastSystemErrorCode()) \
|
||||||
|
.stream()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VPLOG(verbose_level) \
|
#define VPLOG(verbose_level) \
|
||||||
@@ -303,34 +300,35 @@ const LogSeverity LOG_0 = LOG_ERROR;
|
|||||||
|
|
||||||
#define VPLOG_IF(verbose_level, condition) \
|
#define VPLOG_IF(verbose_level, condition) \
|
||||||
LAZY_STREAM(VPLOG_STREAM(verbose_level), \
|
LAZY_STREAM(VPLOG_STREAM(verbose_level), \
|
||||||
VLOG_IS_ON(verbose_level) && (condition))
|
VLOG_IS_ON(verbose_level) && (condition))
|
||||||
|
|
||||||
// TODO(akalin): Add more VLOG variants, e.g. VPLOG.
|
// TODO(akalin): Add more VLOG variants, e.g. VPLOG.
|
||||||
|
|
||||||
#define LOG_ASSERT(condition) \
|
#define LOG_ASSERT(condition) \
|
||||||
LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". "
|
LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". "
|
||||||
#define SYSLOG_ASSERT(condition) \
|
#define SYSLOG_ASSERT(condition) \
|
||||||
SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". "
|
SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". "
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#define PLOG_STREAM(severity) \
|
#define PLOG_STREAM(severity) \
|
||||||
COMPACT_GOOGLE_LOG_EX_ ## severity(Win32ErrorLogMessage, \
|
COMPACT_GOOGLE_LOG_EX_##severity(Win32ErrorLogMessage, \
|
||||||
::cef::logging::GetLastSystemErrorCode()).stream()
|
::cef::logging::GetLastSystemErrorCode()) \
|
||||||
|
.stream()
|
||||||
#elif defined(OS_POSIX)
|
#elif defined(OS_POSIX)
|
||||||
#define PLOG_STREAM(severity) \
|
#define PLOG_STREAM(severity) \
|
||||||
COMPACT_GOOGLE_LOG_EX_ ## severity(ErrnoLogMessage, \
|
COMPACT_GOOGLE_LOG_EX_##severity(ErrnoLogMessage, \
|
||||||
::cef::logging::GetLastSystemErrorCode()).stream()
|
::cef::logging::GetLastSystemErrorCode()) \
|
||||||
|
.stream()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PLOG(severity) \
|
#define PLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
|
||||||
LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
|
|
||||||
|
|
||||||
#define PLOG_IF(severity, condition) \
|
#define PLOG_IF(severity, condition) \
|
||||||
LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition))
|
LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition))
|
||||||
|
|
||||||
// The actual stream used isn't important.
|
// The actual stream used isn't important.
|
||||||
#define EAT_STREAM_PARAMETERS \
|
#define EAT_STREAM_PARAMETERS \
|
||||||
true ? (void) 0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL)
|
true ? (void)0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL)
|
||||||
|
|
||||||
// CHECK dies with a fatal error if condition is not true. It is *not*
|
// CHECK dies with a fatal error if condition is not true. It is *not*
|
||||||
// controlled by NDEBUG, so the check will be executed regardless of
|
// controlled by NDEBUG, so the check will be executed regardless of
|
||||||
@@ -341,28 +339,27 @@ const LogSeverity LOG_0 = LOG_ERROR;
|
|||||||
|
|
||||||
#define CHECK(condition) \
|
#define CHECK(condition) \
|
||||||
LAZY_STREAM(LOG_STREAM(FATAL), !(condition)) \
|
LAZY_STREAM(LOG_STREAM(FATAL), !(condition)) \
|
||||||
<< "Check failed: " #condition ". "
|
<< "Check failed: " #condition ". "
|
||||||
|
|
||||||
#define PCHECK(condition) \
|
#define PCHECK(condition) \
|
||||||
LAZY_STREAM(PLOG_STREAM(FATAL), !(condition)) \
|
LAZY_STREAM(PLOG_STREAM(FATAL), !(condition)) \
|
||||||
<< "Check failed: " #condition ". "
|
<< "Check failed: " #condition ". "
|
||||||
|
|
||||||
// Helper macro for binary operators.
|
// Helper macro for binary operators.
|
||||||
// Don't use this macro directly in your code, use CHECK_EQ et al below.
|
// Don't use this macro directly in your code, use CHECK_EQ et al below.
|
||||||
//
|
//
|
||||||
// TODO(akalin): Rewrite this so that constructs like if (...)
|
// TODO(akalin): Rewrite this so that constructs like if (...)
|
||||||
// CHECK_EQ(...) else { ... } work properly.
|
// CHECK_EQ(...) else { ... } work properly.
|
||||||
#define CHECK_OP(name, op, val1, val2) \
|
#define CHECK_OP(name, op, val1, val2) \
|
||||||
if (std::string* _result = \
|
if (std::string* _result = cef::logging::Check##name##Impl( \
|
||||||
cef::logging::Check##name##Impl((val1), (val2), \
|
(val1), (val2), #val1 " " #op " " #val2)) \
|
||||||
#val1 " " #op " " #val2)) \
|
cef::logging::LogMessage(__FILE__, __LINE__, _result).stream()
|
||||||
cef::logging::LogMessage(__FILE__, __LINE__, _result).stream()
|
|
||||||
|
|
||||||
// Build the error message string. This is separate from the "Impl"
|
// Build the error message string. This is separate from the "Impl"
|
||||||
// function template because it is not performance critical and so can
|
// function template because it is not performance critical and so can
|
||||||
// be out of line, while the "Impl" code should be inline. Caller
|
// be out of line, while the "Impl" code should be inline. Caller
|
||||||
// takes ownership of the returned string.
|
// takes ownership of the returned string.
|
||||||
template<class t1, class t2>
|
template <class t1, class t2>
|
||||||
std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
|
std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
ss << names << " (" << v1 << " vs. " << v2 << ")";
|
ss << names << " (" << v1 << " vs. " << v2 << ")";
|
||||||
@@ -374,51 +371,60 @@ std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
|
|||||||
#if !defined(COMPILER_MSVC)
|
#if !defined(COMPILER_MSVC)
|
||||||
// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated
|
// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated
|
||||||
// in logging.cc.
|
// in logging.cc.
|
||||||
extern template std::string* MakeCheckOpString<int, int>(
|
extern template std::string* MakeCheckOpString<int, int>(const int&,
|
||||||
const int&, const int&, const char* names);
|
const int&,
|
||||||
extern template
|
const char* names);
|
||||||
std::string* MakeCheckOpString<unsigned long, unsigned long>(
|
extern template std::string* MakeCheckOpString<unsigned long, unsigned long>(
|
||||||
const unsigned long&, const unsigned long&, const char* names);
|
const unsigned long&,
|
||||||
extern template
|
const unsigned long&,
|
||||||
std::string* MakeCheckOpString<unsigned long, unsigned int>(
|
const char* names);
|
||||||
const unsigned long&, const unsigned int&, const char* names);
|
extern template std::string* MakeCheckOpString<unsigned long, unsigned int>(
|
||||||
extern template
|
const unsigned long&,
|
||||||
std::string* MakeCheckOpString<unsigned int, unsigned long>(
|
const unsigned int&,
|
||||||
const unsigned int&, const unsigned long&, const char* names);
|
const char* names);
|
||||||
extern template
|
extern template std::string* MakeCheckOpString<unsigned int, unsigned long>(
|
||||||
std::string* MakeCheckOpString<std::string, std::string>(
|
const unsigned int&,
|
||||||
const std::string&, const std::string&, const char* name);
|
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
|
#endif
|
||||||
|
|
||||||
// Helper functions for CHECK_OP macro.
|
// Helper functions for CHECK_OP macro.
|
||||||
// The (int, int) specialization works around the issue that the compiler
|
// The (int, int) specialization works around the issue that the compiler
|
||||||
// will not instantiate the template version of the function on values of
|
// will not instantiate the template version of the function on values of
|
||||||
// unnamed enum type - see comment below.
|
// unnamed enum type - see comment below.
|
||||||
#define DEFINE_CHECK_OP_IMPL(name, op) \
|
#define DEFINE_CHECK_OP_IMPL(name, op) \
|
||||||
template <class t1, class t2> \
|
template <class t1, class t2> \
|
||||||
inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \
|
inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \
|
||||||
const char* names) { \
|
const char* names) { \
|
||||||
if (v1 op v2) return NULL; \
|
if (v1 op v2) \
|
||||||
else return MakeCheckOpString(v1, v2, names); \
|
return NULL; \
|
||||||
} \
|
else \
|
||||||
|
return MakeCheckOpString(v1, v2, names); \
|
||||||
|
} \
|
||||||
inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \
|
inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \
|
||||||
if (v1 op v2) return NULL; \
|
if (v1 op v2) \
|
||||||
else return MakeCheckOpString(v1, v2, names); \
|
return NULL; \
|
||||||
|
else \
|
||||||
|
return MakeCheckOpString(v1, v2, names); \
|
||||||
}
|
}
|
||||||
DEFINE_CHECK_OP_IMPL(EQ, ==)
|
DEFINE_CHECK_OP_IMPL(EQ, ==)
|
||||||
DEFINE_CHECK_OP_IMPL(NE, !=)
|
DEFINE_CHECK_OP_IMPL(NE, !=)
|
||||||
DEFINE_CHECK_OP_IMPL(LE, <=)
|
DEFINE_CHECK_OP_IMPL(LE, <=)
|
||||||
DEFINE_CHECK_OP_IMPL(LT, < )
|
DEFINE_CHECK_OP_IMPL(LT, <)
|
||||||
DEFINE_CHECK_OP_IMPL(GE, >=)
|
DEFINE_CHECK_OP_IMPL(GE, >=)
|
||||||
DEFINE_CHECK_OP_IMPL(GT, > )
|
DEFINE_CHECK_OP_IMPL(GT, >)
|
||||||
#undef DEFINE_CHECK_OP_IMPL
|
#undef DEFINE_CHECK_OP_IMPL
|
||||||
|
|
||||||
#define CHECK_EQ(val1, val2) CHECK_OP(EQ, ==, val1, val2)
|
#define CHECK_EQ(val1, val2) CHECK_OP(EQ, ==, val1, val2)
|
||||||
#define CHECK_NE(val1, val2) CHECK_OP(NE, !=, val1, val2)
|
#define CHECK_NE(val1, val2) CHECK_OP(NE, !=, val1, val2)
|
||||||
#define CHECK_LE(val1, val2) CHECK_OP(LE, <=, val1, val2)
|
#define CHECK_LE(val1, val2) CHECK_OP(LE, <=, val1, val2)
|
||||||
#define CHECK_LT(val1, val2) CHECK_OP(LT, < , val1, val2)
|
#define CHECK_LT(val1, val2) CHECK_OP(LT, <, val1, val2)
|
||||||
#define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2)
|
#define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2)
|
||||||
#define CHECK_GT(val1, val2) CHECK_OP(GT, > , val1, val2)
|
#define CHECK_GT(val1, val2) CHECK_OP(GT, >, val1, val2)
|
||||||
|
|
||||||
#if defined(NDEBUG)
|
#if defined(NDEBUG)
|
||||||
#define ENABLE_DLOG 0
|
#define ENABLE_DLOG 0
|
||||||
@@ -471,11 +477,9 @@ enum { DEBUG_MODE = ENABLE_DLOG };
|
|||||||
|
|
||||||
#undef ENABLE_DLOG
|
#undef ENABLE_DLOG
|
||||||
|
|
||||||
#define DLOG(severity) \
|
#define DLOG(severity) LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity))
|
||||||
LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity))
|
|
||||||
|
|
||||||
#define DPLOG(severity) \
|
#define DPLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
|
||||||
LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
|
|
||||||
|
|
||||||
#define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel))
|
#define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel))
|
||||||
|
|
||||||
@@ -486,7 +490,7 @@ enum { DEBUG_MODE = ENABLE_DLOG };
|
|||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
|
|
||||||
#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \
|
||||||
COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__)
|
COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL
|
#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL
|
||||||
const LogSeverity LOG_DCHECK = LOG_FATAL;
|
const LogSeverity LOG_DCHECK = LOG_FATAL;
|
||||||
|
|
||||||
@@ -494,7 +498,7 @@ const LogSeverity LOG_DCHECK = LOG_FATAL;
|
|||||||
|
|
||||||
// These are just dummy values.
|
// These are just dummy values.
|
||||||
#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \
|
#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \
|
||||||
COMPACT_GOOGLE_LOG_EX_INFO(ClassName , ##__VA_ARGS__)
|
COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ##__VA_ARGS__)
|
||||||
#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_INFO
|
#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_INFO
|
||||||
const LogSeverity LOG_DCHECK = LOG_INFO;
|
const LogSeverity LOG_DCHECK = LOG_INFO;
|
||||||
|
|
||||||
@@ -505,22 +509,23 @@ const LogSeverity LOG_DCHECK = LOG_INFO;
|
|||||||
// variable warnings if the only use of a variable is in a DCHECK.
|
// variable warnings if the only use of a variable is in a DCHECK.
|
||||||
// This behavior is different from DLOG_IF et al.
|
// This behavior is different from DLOG_IF et al.
|
||||||
|
|
||||||
#define DCHECK(condition) \
|
#define DCHECK(condition) \
|
||||||
LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
|
LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
|
||||||
<< "Check failed: " #condition ". "
|
<< "Check failed: " #condition ". "
|
||||||
|
|
||||||
#define DPCHECK(condition) \
|
#define DPCHECK(condition) \
|
||||||
LAZY_STREAM(PLOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
|
LAZY_STREAM(PLOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
|
||||||
<< "Check failed: " #condition ". "
|
<< "Check failed: " #condition ". "
|
||||||
|
|
||||||
// Helper macro for binary operators.
|
// Helper macro for binary operators.
|
||||||
// Don't use this macro directly in your code, use DCHECK_EQ et al below.
|
// Don't use this macro directly in your code, use DCHECK_EQ et al below.
|
||||||
#define DCHECK_OP(name, op, val1, val2) \
|
#define DCHECK_OP(name, op, val1, val2) \
|
||||||
if (DCHECK_IS_ON()) \
|
if (DCHECK_IS_ON()) \
|
||||||
if (std::string* _result = cef::logging::Check##name##Impl( \
|
if (std::string* _result = cef::logging::Check##name##Impl( \
|
||||||
(val1), (val2), #val1 " " #op " " #val2)) \
|
(val1), (val2), #val1 " " #op " " #val2)) \
|
||||||
cef::logging::LogMessage(__FILE__, __LINE__, \
|
cef::logging::LogMessage(__FILE__, __LINE__, ::cef::logging::LOG_DCHECK, \
|
||||||
::cef::logging::LOG_DCHECK, _result).stream()
|
_result) \
|
||||||
|
.stream()
|
||||||
|
|
||||||
// Equality/Inequality checks - compare two values, and log a
|
// Equality/Inequality checks - compare two values, and log a
|
||||||
// LOG_DCHECK message including the two values when the result is not
|
// LOG_DCHECK message including the two values when the result is not
|
||||||
@@ -544,13 +549,13 @@ const LogSeverity LOG_DCHECK = LOG_INFO;
|
|||||||
#define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2)
|
#define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2)
|
||||||
#define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2)
|
#define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2)
|
||||||
#define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2)
|
#define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2)
|
||||||
#define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2)
|
#define DCHECK_LT(val1, val2) DCHECK_OP(LT, <, val1, val2)
|
||||||
#define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2)
|
#define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2)
|
||||||
#define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2)
|
#define DCHECK_GT(val1, val2) DCHECK_OP(GT, >, val1, val2)
|
||||||
|
|
||||||
#if defined(NDEBUG) && defined(OS_CHROMEOS)
|
#if defined(NDEBUG) && defined(OS_CHROMEOS)
|
||||||
#define NOTREACHED() LOG(ERROR) << "NOTREACHED() hit in " << \
|
#define NOTREACHED() \
|
||||||
__FUNCTION__ << ". "
|
LOG(ERROR) << "NOTREACHED() hit in " << __FUNCTION__ << ". "
|
||||||
#else
|
#else
|
||||||
#define NOTREACHED() DCHECK(false)
|
#define NOTREACHED() DCHECK(false)
|
||||||
#endif
|
#endif
|
||||||
@@ -577,7 +582,9 @@ class LogMessage {
|
|||||||
LogMessage(const char* file, int line, std::string* result);
|
LogMessage(const char* file, int line, std::string* result);
|
||||||
|
|
||||||
// Used for DCHECK_EQ(), etc. Takes ownership of the given string.
|
// 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);
|
std::string* result);
|
||||||
|
|
||||||
~LogMessage();
|
~LogMessage();
|
||||||
@@ -617,7 +624,7 @@ class LogMessage {
|
|||||||
|
|
||||||
// A non-macro interface to the log facility; (useful
|
// A non-macro interface to the log facility; (useful
|
||||||
// when the logging level is not a compile-time constant).
|
// when the logging level is not a compile-time constant).
|
||||||
inline void LogAtLevel(int const log_level, std::string const &msg) {
|
inline void LogAtLevel(int const log_level, std::string const& msg) {
|
||||||
LogMessage(__FILE__, __LINE__, log_level).stream() << msg;
|
LogMessage(__FILE__, __LINE__, log_level).stream() << msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -626,10 +633,10 @@ inline void LogAtLevel(int const log_level, std::string const &msg) {
|
|||||||
// is not used" and "statement has no effect".
|
// is not used" and "statement has no effect".
|
||||||
class LogMessageVoidify {
|
class LogMessageVoidify {
|
||||||
public:
|
public:
|
||||||
LogMessageVoidify() { }
|
LogMessageVoidify() {}
|
||||||
// This has to be an operator with a precedence lower than << but
|
// This has to be an operator with a precedence lower than << but
|
||||||
// higher than ?:
|
// higher than ?:
|
||||||
void operator&(std::ostream&) { }
|
void operator&(std::ostream&) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
@@ -739,12 +746,13 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
|
|||||||
#elif NOTIMPLEMENTED_POLICY == 4
|
#elif NOTIMPLEMENTED_POLICY == 4
|
||||||
#define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG
|
#define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG
|
||||||
#elif NOTIMPLEMENTED_POLICY == 5
|
#elif NOTIMPLEMENTED_POLICY == 5
|
||||||
#define NOTIMPLEMENTED() do {\
|
#define NOTIMPLEMENTED() \
|
||||||
static bool logged_once = false;\
|
do { \
|
||||||
LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
|
static bool logged_once = false; \
|
||||||
logged_once = true;\
|
LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG; \
|
||||||
} while(0);\
|
logged_once = true; \
|
||||||
EAT_STREAM_PARAMETERS
|
} while (0); \
|
||||||
|
EAT_STREAM_PARAMETERS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // !USING_CHROMIUM_INCLUDES
|
#endif // !USING_CHROMIUM_INCLUDES
|
||||||
|
|||||||
@@ -36,28 +36,14 @@
|
|||||||
// When building CEF include the Chromium header directly.
|
// When building CEF include the Chromium header directly.
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
|
|
||||||
// Chromium uses movable types.
|
|
||||||
#define MOVE_SCOPED_PTR(var) std::move(var)
|
|
||||||
|
|
||||||
// Chromium uses std types.
|
|
||||||
#define SCOPED_PTR(type) std::unique_ptr<type>
|
|
||||||
#define DEFAULT_DELETER(type) std::default_delete<type>
|
|
||||||
|
|
||||||
#else // !USING_CHROMIUM_INCLUDES
|
#else // !USING_CHROMIUM_INCLUDES
|
||||||
// The following is substantially similar to the Chromium implementation.
|
// The following is substantially similar to the Chromium implementation.
|
||||||
// If the Chromium implementation diverges the below implementation should be
|
// If the Chromium implementation diverges the below implementation should be
|
||||||
// updated to match.
|
// updated to match.
|
||||||
|
|
||||||
#include <stddef.h> // For size_t.
|
#include <stddef.h> // For size_t.
|
||||||
#include "include/base/cef_build.h" // For COMPILER_MSVC
|
#include "include/base/cef_build.h" // For COMPILER_MSVC
|
||||||
|
|
||||||
// CEF does not use movable types.
|
|
||||||
#define MOVE_SCOPED_PTR(var) var.Pass()
|
|
||||||
|
|
||||||
// CEF uses base types.
|
|
||||||
#define SCOPED_PTR(type) scoped_ptr<type>
|
|
||||||
#define DEFAULT_DELETER(type) struct base::DefaultDeleter<type>
|
|
||||||
|
|
||||||
#if !defined(arraysize)
|
#if !defined(arraysize)
|
||||||
|
|
||||||
// The arraysize(arr) macro returns the # of elements in an array arr.
|
// The arraysize(arr) macro returns the # of elements in an array arr.
|
||||||
@@ -140,14 +126,13 @@ char (&ArraySizeHelper(const T (&array)[N]))[N];
|
|||||||
namespace cef {
|
namespace cef {
|
||||||
|
|
||||||
template <bool>
|
template <bool>
|
||||||
struct CompileAssert {
|
struct CompileAssert {};
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace cef
|
} // namespace cef
|
||||||
|
|
||||||
#define COMPILE_ASSERT(expr, msg) \
|
#define COMPILE_ASSERT(expr, msg) \
|
||||||
typedef cef::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] \
|
typedef cef::CompileAssert<(bool(expr))> \
|
||||||
ALLOW_UNUSED_TYPE
|
msg[bool(expr) ? 1 : -1] ALLOW_UNUSED_TYPE
|
||||||
|
|
||||||
// Implementation details of COMPILE_ASSERT:
|
// Implementation details of COMPILE_ASSERT:
|
||||||
//
|
//
|
||||||
@@ -196,13 +181,12 @@ struct CompileAssert {
|
|||||||
|
|
||||||
#endif // !USING_CHROMIUM_INCLUDES
|
#endif // !USING_CHROMIUM_INCLUDES
|
||||||
|
|
||||||
#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST)
|
#if !defined(MSVC_PUSH_DISABLE_WARNING) && defined(COMPILER_MSVC)
|
||||||
#if defined(COMPILER_MSVC)
|
|
||||||
|
|
||||||
// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled.
|
// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled.
|
||||||
// The warning remains disabled until popped by MSVC_POP_WARNING.
|
// The warning remains disabled until popped by MSVC_POP_WARNING.
|
||||||
#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \
|
#define MSVC_PUSH_DISABLE_WARNING(n) \
|
||||||
__pragma(warning(disable:n))
|
__pragma(warning(push)) __pragma(warning(disable : n))
|
||||||
|
|
||||||
// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level
|
// 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
|
// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all
|
||||||
@@ -212,6 +196,10 @@ struct CompileAssert {
|
|||||||
// Pop effects of innermost MSVC_PUSH_* macro.
|
// Pop effects of innermost MSVC_PUSH_* macro.
|
||||||
#define MSVC_POP_WARNING() __pragma(warning(pop))
|
#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.
|
// 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
|
// This uses push/pop instead of the seemingly simpler suppress feature to avoid
|
||||||
// having the warning be disabled for more than just |code|.
|
// having the warning be disabled for more than just |code|.
|
||||||
@@ -221,13 +209,11 @@ struct CompileAssert {
|
|||||||
//
|
//
|
||||||
// Compiler warning C4355: 'this': used in base member initializer list:
|
// Compiler warning C4355: 'this': used in base member initializer list:
|
||||||
// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
|
// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
|
||||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \
|
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) \
|
||||||
code \
|
MSVC_PUSH_DISABLE_WARNING(4355) \
|
||||||
MSVC_POP_WARNING()
|
code MSVC_POP_WARNING()
|
||||||
#else // !COMPILER_MSVC
|
#else // !COMPILER_MSVC
|
||||||
|
|
||||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
|
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
|
||||||
|
|
||||||
#endif // !COMPILER_MSVC
|
#endif // !COMPILER_MSVC
|
||||||
#endif // !ALLOW_THIS_IN_INITIALIZER_LIST
|
#endif // !ALLOW_THIS_IN_INITIALIZER_LIST
|
||||||
|
|
||||||
|
|||||||
@@ -240,18 +240,20 @@
|
|||||||
//
|
//
|
||||||
// The workaround is to explicitly declare your copy constructor.
|
// The workaround is to explicitly declare your copy constructor.
|
||||||
//
|
//
|
||||||
#define MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \
|
#define MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \
|
||||||
private: \
|
private: \
|
||||||
struct rvalue_type { \
|
struct rvalue_type { \
|
||||||
explicit rvalue_type(type* object) : object(object) {} \
|
explicit rvalue_type(type* object) : object(object) {} \
|
||||||
type* object; \
|
type* object; \
|
||||||
}; \
|
}; \
|
||||||
type(type&); \
|
type(type&); \
|
||||||
void operator=(type&); \
|
void operator=(type&); \
|
||||||
public: \
|
\
|
||||||
operator rvalue_type() { return rvalue_type(this); } \
|
public: \
|
||||||
type Pass() { return type(rvalue_type(this)); } \
|
operator rvalue_type() { return rvalue_type(this); } \
|
||||||
typedef void MoveOnlyTypeForCPP03; \
|
type Pass() { return type(rvalue_type(this)); } \
|
||||||
|
typedef void MoveOnlyTypeForCPP03; \
|
||||||
|
\
|
||||||
private:
|
private:
|
||||||
|
|
||||||
#endif // !USING_CHROMIUM_INCLUDES
|
#endif // !USING_CHROMIUM_INCLUDES
|
||||||
|
|||||||
@@ -69,21 +69,14 @@ class PlatformThreadRef {
|
|||||||
public:
|
public:
|
||||||
typedef cef_platform_thread_handle_t RefType;
|
typedef cef_platform_thread_handle_t RefType;
|
||||||
|
|
||||||
PlatformThreadRef()
|
PlatformThreadRef() : id_(0) {}
|
||||||
: id_(0) {
|
|
||||||
}
|
|
||||||
|
|
||||||
explicit PlatformThreadRef(RefType id)
|
explicit PlatformThreadRef(RefType id) : id_(id) {}
|
||||||
: id_(id) {
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==(PlatformThreadRef other) const {
|
bool operator==(PlatformThreadRef other) const { return id_ == other.id_; }
|
||||||
return id_ == other.id_;
|
|
||||||
}
|
bool is_null() const { return id_ == 0; }
|
||||||
|
|
||||||
bool is_null() const {
|
|
||||||
return id_ == 0;
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
RefType id_;
|
RefType id_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -64,43 +64,43 @@ class RefCountedBase {
|
|||||||
protected:
|
protected:
|
||||||
RefCountedBase()
|
RefCountedBase()
|
||||||
: ref_count_(0)
|
: ref_count_(0)
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
, in_dtor_(false)
|
,
|
||||||
#endif
|
in_dtor_(false)
|
||||||
{
|
#endif
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~RefCountedBase() {
|
~RefCountedBase() {
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()";
|
DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AddRef() const {
|
void AddRef() const {
|
||||||
// TODO(maruel): Add back once it doesn't assert 500 times/sec.
|
// TODO(maruel): Add back once it doesn't assert 500 times/sec.
|
||||||
// Current thread books the critical section "AddRelease"
|
// Current thread books the critical section "AddRelease"
|
||||||
// without release it.
|
// without release it.
|
||||||
// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
|
// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
DCHECK(!in_dtor_);
|
DCHECK(!in_dtor_);
|
||||||
#endif
|
#endif
|
||||||
++ref_count_;
|
++ref_count_;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the object should self-delete.
|
// Returns true if the object should self-delete.
|
||||||
bool Release() const {
|
bool Release() const {
|
||||||
// TODO(maruel): Add back once it doesn't assert 500 times/sec.
|
// TODO(maruel): Add back once it doesn't assert 500 times/sec.
|
||||||
// Current thread books the critical section "AddRelease"
|
// Current thread books the critical section "AddRelease"
|
||||||
// without release it.
|
// without release it.
|
||||||
// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
|
// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
DCHECK(!in_dtor_);
|
DCHECK(!in_dtor_);
|
||||||
#endif
|
#endif
|
||||||
if (--ref_count_ == 0) {
|
if (--ref_count_ == 0) {
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
in_dtor_ = true;
|
in_dtor_ = true;
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -160,9 +160,7 @@ class RefCounted : public cef_subtle::RefCountedBase {
|
|||||||
public:
|
public:
|
||||||
RefCounted() {}
|
RefCounted() {}
|
||||||
|
|
||||||
void AddRef() const {
|
void AddRef() const { cef_subtle::RefCountedBase::AddRef(); }
|
||||||
cef_subtle::RefCountedBase::AddRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Release() const {
|
void Release() const {
|
||||||
if (cef_subtle::RefCountedBase::Release()) {
|
if (cef_subtle::RefCountedBase::Release()) {
|
||||||
@@ -178,18 +176,19 @@ class RefCounted : public cef_subtle::RefCountedBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Forward declaration.
|
// 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
|
// Default traits for RefCountedThreadSafe<T>. Deletes the object when its ref
|
||||||
// count reaches 0. Overload to delete it on a different thread etc.
|
// count reaches 0. Overload to delete it on a different thread etc.
|
||||||
template<typename T>
|
template <typename T>
|
||||||
struct DefaultRefCountedThreadSafeTraits {
|
struct DefaultRefCountedThreadSafeTraits {
|
||||||
static void Destruct(const T* x) {
|
static void Destruct(const T* x) {
|
||||||
// Delete through RefCountedThreadSafe to make child classes only need to be
|
// Delete through RefCountedThreadSafe to make child classes only need to be
|
||||||
// friend with RefCountedThreadSafe instead of this struct, which is an
|
// friend with RefCountedThreadSafe instead of this struct, which is an
|
||||||
// implementation detail.
|
// implementation detail.
|
||||||
RefCountedThreadSafe<T,
|
RefCountedThreadSafe<T, DefaultRefCountedThreadSafeTraits>::DeleteInternal(
|
||||||
DefaultRefCountedThreadSafeTraits>::DeleteInternal(x);
|
x);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -205,14 +204,12 @@ struct DefaultRefCountedThreadSafeTraits {
|
|||||||
// private:
|
// private:
|
||||||
// friend class base::RefCountedThreadSafe<MyFoo>;
|
// friend class base::RefCountedThreadSafe<MyFoo>;
|
||||||
// ~MyFoo();
|
// ~MyFoo();
|
||||||
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T> >
|
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T>>
|
||||||
class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
||||||
public:
|
public:
|
||||||
RefCountedThreadSafe() {}
|
RefCountedThreadSafe() {}
|
||||||
|
|
||||||
void AddRef() const {
|
void AddRef() const { cef_subtle::RefCountedThreadSafeBase::AddRef(); }
|
||||||
cef_subtle::RefCountedThreadSafeBase::AddRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Release() const {
|
void Release() const {
|
||||||
if (cef_subtle::RefCountedThreadSafeBase::Release()) {
|
if (cef_subtle::RefCountedThreadSafeBase::Release()) {
|
||||||
@@ -234,9 +231,9 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
|||||||
// A thread-safe wrapper for some piece of data so we can place other
|
// A thread-safe wrapper for some piece of data so we can place other
|
||||||
// things in scoped_refptrs<>.
|
// things in scoped_refptrs<>.
|
||||||
//
|
//
|
||||||
template<typename T>
|
template <typename T>
|
||||||
class RefCountedData
|
class RefCountedData
|
||||||
: public base::RefCountedThreadSafe< base::RefCountedData<T> > {
|
: public base::RefCountedThreadSafe<base::RefCountedData<T>> {
|
||||||
public:
|
public:
|
||||||
RefCountedData() : data() {}
|
RefCountedData() : data() {}
|
||||||
RefCountedData(const T& in_value) : data(in_value) {}
|
RefCountedData(const T& in_value) : data(in_value) {}
|
||||||
@@ -244,7 +241,7 @@ class RefCountedData
|
|||||||
T data;
|
T data;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class base::RefCountedThreadSafe<base::RefCountedData<T> >;
|
friend class base::RefCountedThreadSafe<base::RefCountedData<T>>;
|
||||||
~RefCountedData() {}
|
~RefCountedData() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -303,8 +300,7 @@ class scoped_refptr {
|
|||||||
public:
|
public:
|
||||||
typedef T element_type;
|
typedef T element_type;
|
||||||
|
|
||||||
scoped_refptr() : ptr_(NULL) {
|
scoped_refptr() : ptr_(NULL) {}
|
||||||
}
|
|
||||||
|
|
||||||
scoped_refptr(T* p) : ptr_(p) {
|
scoped_refptr(T* p) : ptr_(p) {
|
||||||
if (ptr_)
|
if (ptr_)
|
||||||
@@ -364,9 +360,7 @@ class scoped_refptr {
|
|||||||
*pp = p;
|
*pp = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void swap(scoped_refptr<T>& r) {
|
void swap(scoped_refptr<T>& r) { swap(&r.ptr_); }
|
||||||
swap(&r.ptr_);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
T* ptr_;
|
T* ptr_;
|
||||||
|
|||||||
@@ -154,7 +154,8 @@ class RefCountedThreadSafeBase;
|
|||||||
template <class T>
|
template <class T>
|
||||||
struct DefaultDeleter {
|
struct DefaultDeleter {
|
||||||
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
|
// 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.
|
// if U* is implicitly convertible to T* and U is not an array type.
|
||||||
//
|
//
|
||||||
@@ -194,7 +195,8 @@ struct DefaultDeleter<T[]> {
|
|||||||
// References:
|
// References:
|
||||||
// C++98 [expr.delete]p3
|
// C++98 [expr.delete]p3
|
||||||
// http://cplusplus.github.com/LWG/lwg-defects.html#938
|
// 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>
|
template <class T, int n>
|
||||||
@@ -209,18 +211,18 @@ struct DefaultDeleter<T[n]> {
|
|||||||
// scoped_ptr<int, base::FreeDeleter> foo_ptr(
|
// scoped_ptr<int, base::FreeDeleter> foo_ptr(
|
||||||
// static_cast<int*>(malloc(sizeof(int))));
|
// static_cast<int*>(malloc(sizeof(int))));
|
||||||
struct FreeDeleter {
|
struct FreeDeleter {
|
||||||
inline void operator()(void* ptr) const {
|
inline void operator()(void* ptr) const { free(ptr); }
|
||||||
free(ptr);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace cef_internal {
|
namespace cef_internal {
|
||||||
|
|
||||||
template <typename T> struct IsNotRefCounted {
|
template <typename T>
|
||||||
|
struct IsNotRefCounted {
|
||||||
enum {
|
enum {
|
||||||
value = !base::is_convertible<T*, base::subtle::RefCountedBase*>::value &&
|
value =
|
||||||
!base::is_convertible<T*, base::subtle::RefCountedThreadSafeBase*>::
|
!base::is_convertible<T*, base::subtle::RefCountedBase*>::value &&
|
||||||
value
|
!base::is_convertible<T*,
|
||||||
|
base::subtle::RefCountedThreadSafeBase*>::value
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -229,7 +231,7 @@ template <typename T> struct IsNotRefCounted {
|
|||||||
template <class T, class D>
|
template <class T, class D>
|
||||||
class scoped_ptr_impl {
|
class scoped_ptr_impl {
|
||||||
public:
|
public:
|
||||||
explicit scoped_ptr_impl(T* p) : data_(p) { }
|
explicit scoped_ptr_impl(T* p) : data_(p) {}
|
||||||
|
|
||||||
// Initializer for deleters that have data parameters.
|
// Initializer for deleters that have data parameters.
|
||||||
scoped_ptr_impl(T* p, const D& d) : data_(p, d) {}
|
scoped_ptr_impl(T* p, const D& d) : data_(p, d) {}
|
||||||
@@ -309,7 +311,8 @@ class scoped_ptr_impl {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// Needed to allow type-converting constructor.
|
// 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
|
// 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
|
// member, while avoiding any space overhead for it when D is an
|
||||||
@@ -346,7 +349,7 @@ class scoped_ptr_impl {
|
|||||||
// unique_ptr<> features. Known deficiencies include not supporting move-only
|
// unique_ptr<> features. Known deficiencies include not supporting move-only
|
||||||
// deleteres, function pointers as deleters, and deleters with reference
|
// deleteres, function pointers as deleters, and deleters with reference
|
||||||
// types.
|
// types.
|
||||||
template <class T, class D = base::DefaultDeleter<T> >
|
template <class T, class D = base::DefaultDeleter<T>>
|
||||||
class scoped_ptr {
|
class scoped_ptr {
|
||||||
MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue)
|
MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue)
|
||||||
|
|
||||||
@@ -359,13 +362,13 @@ class scoped_ptr {
|
|||||||
typedef D deleter_type;
|
typedef D deleter_type;
|
||||||
|
|
||||||
// Constructor. Defaults to initializing with NULL.
|
// Constructor. Defaults to initializing with NULL.
|
||||||
scoped_ptr() : impl_(NULL) { }
|
scoped_ptr() : impl_(NULL) {}
|
||||||
|
|
||||||
// Constructor. Takes ownership of p.
|
// Constructor. Takes ownership of p.
|
||||||
explicit scoped_ptr(element_type* p) : impl_(p) { }
|
explicit scoped_ptr(element_type* p) : impl_(p) {}
|
||||||
|
|
||||||
// Constructor. Allows initialization of a stateful deleter.
|
// Constructor. Allows initialization of a stateful deleter.
|
||||||
scoped_ptr(element_type* p, const D& d) : impl_(p, d) { }
|
scoped_ptr(element_type* p, const D& d) : impl_(p, d) {}
|
||||||
|
|
||||||
// Constructor. Allows construction from a scoped_ptr rvalue for a
|
// Constructor. Allows construction from a scoped_ptr rvalue for a
|
||||||
// convertible type and deleter.
|
// convertible type and deleter.
|
||||||
@@ -383,7 +386,7 @@ class scoped_ptr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Constructor. Move constructor for C++03 move emulation of this type.
|
// Constructor. Move constructor for C++03 move emulation of this type.
|
||||||
scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { }
|
scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) {}
|
||||||
|
|
||||||
// operator=. Allows assignment from a scoped_ptr rvalue for a convertible
|
// operator=. Allows assignment from a scoped_ptr rvalue for a convertible
|
||||||
// type and deleter.
|
// type and deleter.
|
||||||
@@ -412,7 +415,7 @@ class scoped_ptr {
|
|||||||
assert(impl_.get() != NULL);
|
assert(impl_.get() != NULL);
|
||||||
return *impl_.get();
|
return *impl_.get();
|
||||||
}
|
}
|
||||||
element_type* operator->() const {
|
element_type* operator->() const {
|
||||||
assert(impl_.get() != NULL);
|
assert(impl_.get() != NULL);
|
||||||
return impl_.get();
|
return impl_.get();
|
||||||
}
|
}
|
||||||
@@ -443,18 +446,14 @@ class scoped_ptr {
|
|||||||
bool operator!=(const element_type* p) const { return impl_.get() != p; }
|
bool operator!=(const element_type* p) const { return impl_.get() != p; }
|
||||||
|
|
||||||
// Swap two scoped pointers.
|
// Swap two scoped pointers.
|
||||||
void swap(scoped_ptr& p2) {
|
void swap(scoped_ptr& p2) { impl_.swap(p2.impl_); }
|
||||||
impl_.swap(p2.impl_);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release a pointer.
|
// Release a pointer.
|
||||||
// The return value is the current pointer held by this object.
|
// The return value is the current pointer held by this object.
|
||||||
// If this object holds a NULL pointer, the return value is NULL.
|
// If this object holds a NULL pointer, the return value is NULL.
|
||||||
// After this operation, this object will hold a NULL pointer,
|
// After this operation, this object will hold a NULL pointer,
|
||||||
// and will not own the object any more.
|
// and will not own the object any more.
|
||||||
element_type* release() WARN_UNUSED_RESULT {
|
element_type* release() WARN_UNUSED_RESULT { return impl_.release(); }
|
||||||
return impl_.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
// C++98 doesn't support functions templates with default parameters which
|
// C++98 doesn't support functions templates with default parameters which
|
||||||
// makes it hard to write a PassAs() that understands converting the deleter
|
// makes it hard to write a PassAs() that understands converting the deleter
|
||||||
@@ -469,7 +468,8 @@ class scoped_ptr {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// Needed to reach into |impl_| in the constructor.
|
// 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_;
|
base::cef_internal::scoped_ptr_impl<element_type, deleter_type> impl_;
|
||||||
|
|
||||||
// Forbidden for API compatibility with std::unique_ptr.
|
// 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
|
// 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
|
// because you should never have the same object owned by two different
|
||||||
// scoped_ptrs.
|
// scoped_ptrs.
|
||||||
template <class U> bool operator==(scoped_ptr<U> const& p2) const;
|
template <class U>
|
||||||
template <class U> bool operator!=(scoped_ptr<U> const& p2) const;
|
bool operator==(scoped_ptr<U> const& p2) const;
|
||||||
|
template <class U>
|
||||||
|
bool operator!=(scoped_ptr<U> const& p2) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class D>
|
template <class T, class D>
|
||||||
@@ -493,7 +495,7 @@ class scoped_ptr<T[], D> {
|
|||||||
typedef D deleter_type;
|
typedef D deleter_type;
|
||||||
|
|
||||||
// Constructor. Defaults to initializing with NULL.
|
// Constructor. Defaults to initializing with NULL.
|
||||||
scoped_ptr() : impl_(NULL) { }
|
scoped_ptr() : impl_(NULL) {}
|
||||||
|
|
||||||
// Constructor. Stores the given array. Note that the argument's type
|
// Constructor. Stores the given array. Note that the argument's type
|
||||||
// must exactly match T*. In particular:
|
// must exactly match T*. In particular:
|
||||||
@@ -511,10 +513,10 @@ class scoped_ptr<T[], D> {
|
|||||||
// to work around this may use implicit_cast<const T*>().
|
// to work around this may use implicit_cast<const T*>().
|
||||||
// However, because of the first bullet in this comment, users MUST
|
// However, because of the first bullet in this comment, users MUST
|
||||||
// NOT use implicit_cast<Base*>() to upcast the static type of the array.
|
// NOT use implicit_cast<Base*>() to upcast the static type of the array.
|
||||||
explicit scoped_ptr(element_type* array) : impl_(array) { }
|
explicit scoped_ptr(element_type* array) : impl_(array) {}
|
||||||
|
|
||||||
// Constructor. Move constructor for C++03 move emulation of this type.
|
// Constructor. Move constructor for C++03 move emulation of this type.
|
||||||
scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { }
|
scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) {}
|
||||||
|
|
||||||
// operator=. Move operator= for C++03 move emulation of this type.
|
// operator=. Move operator= for C++03 move emulation of this type.
|
||||||
scoped_ptr& operator=(RValue rhs) {
|
scoped_ptr& operator=(RValue rhs) {
|
||||||
@@ -553,18 +555,14 @@ class scoped_ptr<T[], D> {
|
|||||||
bool operator!=(element_type* array) const { return impl_.get() != array; }
|
bool operator!=(element_type* array) const { return impl_.get() != array; }
|
||||||
|
|
||||||
// Swap two scoped pointers.
|
// Swap two scoped pointers.
|
||||||
void swap(scoped_ptr& p2) {
|
void swap(scoped_ptr& p2) { impl_.swap(p2.impl_); }
|
||||||
impl_.swap(p2.impl_);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release a pointer.
|
// Release a pointer.
|
||||||
// The return value is the current pointer held by this object.
|
// The return value is the current pointer held by this object.
|
||||||
// If this object holds a NULL pointer, the return value is NULL.
|
// If this object holds a NULL pointer, the return value is NULL.
|
||||||
// After this operation, this object will hold a NULL pointer,
|
// After this operation, this object will hold a NULL pointer,
|
||||||
// and will not own the object any more.
|
// and will not own the object any more.
|
||||||
element_type* release() WARN_UNUSED_RESULT {
|
element_type* release() WARN_UNUSED_RESULT { return impl_.release(); }
|
||||||
return impl_.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Force element_type to be a complete type.
|
// 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
|
// 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
|
// call delete[] on an array whose static type does not match its dynamic
|
||||||
// type.
|
// 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);
|
explicit scoped_ptr(int disallow_construction_from_null);
|
||||||
|
|
||||||
// Disable reset() from any type other than element_type*, for the same
|
// Disable reset() from any type other than element_type*, for the same
|
||||||
// reasons as the constructor above.
|
// 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);
|
void reset(int disallow_reset_from_null);
|
||||||
|
|
||||||
// Forbid comparison of scoped_ptr types. If U != T, it totally
|
// 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
|
// 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
|
// because you should never have the same object owned by two different
|
||||||
// scoped_ptrs.
|
// scoped_ptrs.
|
||||||
template <class U> bool operator==(scoped_ptr<U> const& p2) const;
|
template <class U>
|
||||||
template <class U> bool operator!=(scoped_ptr<U> const& p2) const;
|
bool operator==(scoped_ptr<U> const& p2) const;
|
||||||
|
template <class U>
|
||||||
|
bool operator!=(scoped_ptr<U> const& p2) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Free functions
|
// Free functions
|
||||||
|
|||||||
@@ -112,26 +112,19 @@ struct string16_char_traits {
|
|||||||
typedef mbstate_t state_type;
|
typedef mbstate_t state_type;
|
||||||
typedef std::fpos<state_type> pos_type;
|
typedef std::fpos<state_type> pos_type;
|
||||||
|
|
||||||
static void assign(char_type& c1, const char_type& c2) {
|
static void assign(char_type& c1, const char_type& c2) { c1 = c2; }
|
||||||
c1 = c2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool eq(const char_type& c1, const char_type& c2) {
|
static bool eq(const char_type& c1, const char_type& c2) { return c1 == c2; }
|
||||||
return c1 == c2;
|
static bool lt(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) {
|
static int compare(const char_type* s1, const char_type* s2, size_t n) {
|
||||||
return c16memcmp(s1, s2, n);
|
return c16memcmp(s1, s2, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t length(const char_type* s) {
|
static size_t length(const char_type* s) { return c16len(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) {
|
const char_type& a) {
|
||||||
return c16memchr(s, a, n);
|
return c16memchr(s, a, n);
|
||||||
}
|
}
|
||||||
@@ -152,21 +145,15 @@ struct string16_char_traits {
|
|||||||
return eq_int_type(c, eof()) ? 0 : c;
|
return eq_int_type(c, eof()) ? 0 : c;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char_type to_char_type(const int_type& c) {
|
static char_type to_char_type(const int_type& c) { return char_type(c); }
|
||||||
return char_type(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int_type to_int_type(const char_type& c) {
|
static int_type to_int_type(const char_type& c) { return int_type(c); }
|
||||||
return int_type(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool eq_int_type(const int_type& c1, const int_type& c2) {
|
static bool eq_int_type(const int_type& c1, const int_type& c2) {
|
||||||
return c1 == c2;
|
return c1 == c2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int_type eof() {
|
static int_type eof() { return static_cast<int_type>(EOF); }
|
||||||
return static_cast<int_type>(EOF);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::basic_string<char16, base::string16_char_traits> string16;
|
typedef std::basic_string<char16, base::string16_char_traits> string16;
|
||||||
@@ -217,8 +204,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.
|
// TODO(mark): File this bug with Apple and update this note with a bug number.
|
||||||
|
|
||||||
extern template
|
extern template class std::basic_string<base::char16,
|
||||||
class std::basic_string<base::char16, base::string16_char_traits>;
|
base::string16_char_traits>;
|
||||||
|
|
||||||
#endif // WCHAR_T_IS_UTF32
|
#endif // WCHAR_T_IS_UTF32
|
||||||
|
|
||||||
|
|||||||
@@ -53,70 +53,92 @@ namespace base {
|
|||||||
|
|
||||||
// template definitions from tr1
|
// template definitions from tr1
|
||||||
|
|
||||||
template<class T, T v>
|
template <class T, T v>
|
||||||
struct integral_constant {
|
struct integral_constant {
|
||||||
static const T value = v;
|
static const T value = v;
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef integral_constant<T, v> type;
|
typedef integral_constant<T, v> type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, T v> const T integral_constant<T, v>::value;
|
template <class T, T v>
|
||||||
|
const T integral_constant<T, v>::value;
|
||||||
|
|
||||||
typedef integral_constant<bool, true> true_type;
|
typedef integral_constant<bool, true> true_type;
|
||||||
typedef integral_constant<bool, false> false_type;
|
typedef integral_constant<bool, false> false_type;
|
||||||
|
|
||||||
template <class T> struct is_pointer : false_type {};
|
template <class T>
|
||||||
template <class T> struct is_pointer<T*> : true_type {};
|
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
|
// 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.
|
// below. This is built-in to C++ 11, and we can remove this when we switch.
|
||||||
template<typename T>
|
template <typename T>
|
||||||
struct is_member_function_pointer : false_type {};
|
struct is_member_function_pointer : false_type {};
|
||||||
|
|
||||||
template <typename R, typename Z>
|
template <typename R, typename Z>
|
||||||
struct is_member_function_pointer<R(Z::*)()> : true_type {};
|
struct is_member_function_pointer<R (Z::*)()> : true_type {};
|
||||||
template <typename R, typename Z>
|
template <typename R, typename Z>
|
||||||
struct is_member_function_pointer<R(Z::*)() const> : true_type {};
|
struct is_member_function_pointer<R (Z::*)() const> : true_type {};
|
||||||
|
|
||||||
template <typename R, typename Z, typename A>
|
template <typename R, typename Z, typename A>
|
||||||
struct is_member_function_pointer<R(Z::*)(A)> : true_type {};
|
struct is_member_function_pointer<R (Z::*)(A)> : true_type {};
|
||||||
template <typename R, typename Z, typename A>
|
template <typename R, typename Z, typename A>
|
||||||
struct is_member_function_pointer<R(Z::*)(A) const> : true_type {};
|
struct is_member_function_pointer<R (Z::*)(A) const> : true_type {};
|
||||||
|
|
||||||
template <typename R, typename Z, typename A, typename B>
|
template <typename R, typename Z, typename A, typename B>
|
||||||
struct is_member_function_pointer<R(Z::*)(A, B)> : true_type {};
|
struct is_member_function_pointer<R (Z::*)(A, B)> : true_type {};
|
||||||
template <typename R, typename Z, typename A, typename B>
|
template <typename R, typename Z, typename A, typename B>
|
||||||
struct is_member_function_pointer<R(Z::*)(A, B) const> : true_type {};
|
struct is_member_function_pointer<R (Z::*)(A, B) const> : true_type {};
|
||||||
|
|
||||||
template <typename R, typename Z, typename A, typename B, typename C>
|
template <typename R, typename Z, typename A, typename B, typename C>
|
||||||
struct is_member_function_pointer<R(Z::*)(A, B, C)> : true_type {};
|
struct is_member_function_pointer<R (Z::*)(A, B, C)> : true_type {};
|
||||||
template <typename R, typename Z, typename A, typename B, typename C>
|
template <typename R, typename Z, typename A, typename B, typename C>
|
||||||
struct is_member_function_pointer<R(Z::*)(A, B, C) const> : true_type {};
|
struct is_member_function_pointer<R (Z::*)(A, B, C) const> : true_type {};
|
||||||
|
|
||||||
template <typename R, typename Z, typename A, typename B, typename C,
|
template <typename R,
|
||||||
|
typename Z,
|
||||||
|
typename A,
|
||||||
|
typename B,
|
||||||
|
typename C,
|
||||||
typename D>
|
typename D>
|
||||||
struct is_member_function_pointer<R(Z::*)(A, B, C, D)> : true_type {};
|
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>
|
typename D>
|
||||||
struct is_member_function_pointer<R(Z::*)(A, B, C, D) const> : true_type {};
|
struct is_member_function_pointer<R (Z::*)(A, B, C, D) const> : true_type {};
|
||||||
|
|
||||||
|
template <class T, class U>
|
||||||
|
struct is_same : public false_type {};
|
||||||
|
template <class T>
|
||||||
|
struct is_same<T, T> : true_type {};
|
||||||
|
|
||||||
template <class T, class U> struct is_same : public false_type {};
|
template <class>
|
||||||
template <class T> struct is_same<T,T> : true_type {};
|
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>
|
||||||
template<class T, size_t n> struct is_array<T[n]> : public true_type {};
|
struct is_non_const_reference : false_type {};
|
||||||
template<class T> struct is_array<T[]> : public true_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>
|
||||||
template <class T> struct is_non_const_reference<T&> : true_type {};
|
struct is_const : false_type {};
|
||||||
template <class T> struct is_non_const_reference<const T&> : false_type {};
|
template <class T>
|
||||||
|
struct is_const<const T> : true_type {};
|
||||||
|
|
||||||
template <class T> struct is_const : false_type {};
|
template <class T>
|
||||||
template <class T> struct is_const<const T> : true_type {};
|
struct is_void : false_type {};
|
||||||
|
template <>
|
||||||
template <class T> struct is_void : false_type {};
|
struct is_void<void> : true_type {};
|
||||||
template <> struct is_void<void> : true_type {};
|
|
||||||
|
|
||||||
namespace cef_internal {
|
namespace cef_internal {
|
||||||
|
|
||||||
@@ -152,7 +174,7 @@ struct ConvertHelper {
|
|||||||
// is_class type_trait implementation.
|
// is_class type_trait implementation.
|
||||||
struct IsClassHelper {
|
struct IsClassHelper {
|
||||||
template <typename C>
|
template <typename C>
|
||||||
static YesType Test(void(C::*)(void));
|
static YesType Test(void (C::*)(void));
|
||||||
|
|
||||||
template <typename C>
|
template <typename C>
|
||||||
static NoType Test(...);
|
static NoType Test(...);
|
||||||
@@ -168,22 +190,22 @@ template <typename From, typename To>
|
|||||||
struct is_convertible
|
struct is_convertible
|
||||||
: integral_constant<bool,
|
: integral_constant<bool,
|
||||||
sizeof(cef_internal::ConvertHelper::Test<To>(
|
sizeof(cef_internal::ConvertHelper::Test<To>(
|
||||||
cef_internal::ConvertHelper::Create<From>())) ==
|
cef_internal::ConvertHelper::Create<From>())) ==
|
||||||
sizeof(cef_internal::YesType)> {
|
sizeof(cef_internal::YesType)> {};
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct is_class
|
struct is_class
|
||||||
: integral_constant<bool,
|
: integral_constant<bool,
|
||||||
sizeof(cef_internal::IsClassHelper::Test<T>(0)) ==
|
sizeof(cef_internal::IsClassHelper::Test<T>(0)) ==
|
||||||
sizeof(cef_internal::YesType)> {
|
sizeof(cef_internal::YesType)> {};
|
||||||
};
|
|
||||||
|
|
||||||
template<bool B, class T = void>
|
template <bool B, class T = void>
|
||||||
struct enable_if {};
|
struct enable_if {};
|
||||||
|
|
||||||
template<class T>
|
template <class T>
|
||||||
struct enable_if<true, T> { typedef T type; };
|
struct enable_if<true, T> {
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,6 @@
|
|||||||
#define ENABLE_THREAD_CHECKER 0
|
#define ENABLE_THREAD_CHECKER 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
|
|
||||||
namespace cef_internal {
|
namespace cef_internal {
|
||||||
@@ -69,9 +68,7 @@ namespace cef_internal {
|
|||||||
// right version for your build configuration.
|
// right version for your build configuration.
|
||||||
class ThreadCheckerDoNothing {
|
class ThreadCheckerDoNothing {
|
||||||
public:
|
public:
|
||||||
bool CalledOnValidThread() const {
|
bool CalledOnValidThread() const { return true; }
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DetachFromThread() {}
|
void DetachFromThread() {}
|
||||||
};
|
};
|
||||||
@@ -110,11 +107,9 @@ class ThreadCheckerDoNothing {
|
|||||||
//
|
//
|
||||||
// In Release mode, CalledOnValidThread will always return true.
|
// In Release mode, CalledOnValidThread will always return true.
|
||||||
#if ENABLE_THREAD_CHECKER
|
#if ENABLE_THREAD_CHECKER
|
||||||
class ThreadChecker : public cef_internal::ThreadCheckerImpl {
|
class ThreadChecker : public cef_internal::ThreadCheckerImpl {};
|
||||||
};
|
|
||||||
#else
|
#else
|
||||||
class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {
|
class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {};
|
||||||
};
|
|
||||||
#endif // ENABLE_THREAD_CHECKER
|
#endif // ENABLE_THREAD_CHECKER
|
||||||
|
|
||||||
#undef ENABLE_THREAD_CHECKER
|
#undef ENABLE_THREAD_CHECKER
|
||||||
|
|||||||
@@ -139,24 +139,22 @@
|
|||||||
// DFAKE_MUTEX(shareable_section_);
|
// DFAKE_MUTEX(shareable_section_);
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
|
|
||||||
// Defines a class member that acts like a mutex. It is used only as a
|
// Defines a class member that acts like a mutex. It is used only as a
|
||||||
// verification tool.
|
// verification tool.
|
||||||
#define DFAKE_MUTEX(obj) \
|
#define DFAKE_MUTEX(obj) mutable base::ThreadCollisionWarner obj
|
||||||
mutable base::ThreadCollisionWarner obj
|
|
||||||
// Asserts the call is never called simultaneously in two threads. Used at
|
// Asserts the call is never called simultaneously in two threads. Used at
|
||||||
// member function scope.
|
// member function scope.
|
||||||
#define DFAKE_SCOPED_LOCK(obj) \
|
#define DFAKE_SCOPED_LOCK(obj) \
|
||||||
base::ThreadCollisionWarner::ScopedCheck s_check_##obj(&obj)
|
base::ThreadCollisionWarner::ScopedCheck s_check_##obj(&obj)
|
||||||
// Asserts the call is never called simultaneously in two threads. Used at
|
// Asserts the call is never called simultaneously in two threads. Used at
|
||||||
// member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks.
|
// member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks.
|
||||||
#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \
|
#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \
|
||||||
base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj)
|
base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj)
|
||||||
// Asserts the code is always executed in the same thread.
|
// Asserts the code is always executed in the same thread.
|
||||||
#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \
|
#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \
|
||||||
base::ThreadCollisionWarner::Check check_##obj(&obj)
|
base::ThreadCollisionWarner::Check check_##obj(&obj)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -187,13 +185,9 @@ class ThreadCollisionWarner {
|
|||||||
public:
|
public:
|
||||||
// The parameter asserter is there only for test purpose
|
// The parameter asserter is there only for test purpose
|
||||||
explicit ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter())
|
explicit ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter())
|
||||||
: valid_thread_id_(0),
|
: valid_thread_id_(0), counter_(0), asserter_(asserter) {}
|
||||||
counter_(0),
|
|
||||||
asserter_(asserter) {}
|
|
||||||
|
|
||||||
~ThreadCollisionWarner() {
|
~ThreadCollisionWarner() { delete asserter_; }
|
||||||
delete asserter_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This class is meant to be used through the macro
|
// This class is meant to be used through the macro
|
||||||
// DFAKE_SCOPED_LOCK_THREAD_LOCKED
|
// DFAKE_SCOPED_LOCK_THREAD_LOCKED
|
||||||
@@ -202,8 +196,7 @@ class ThreadCollisionWarner {
|
|||||||
// from one thread
|
// from one thread
|
||||||
class Check {
|
class Check {
|
||||||
public:
|
public:
|
||||||
explicit Check(ThreadCollisionWarner* warner)
|
explicit Check(ThreadCollisionWarner* warner) : warner_(warner) {
|
||||||
: warner_(warner) {
|
|
||||||
warner_->EnterSelf();
|
warner_->EnterSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,14 +212,11 @@ class ThreadCollisionWarner {
|
|||||||
// DFAKE_SCOPED_LOCK
|
// DFAKE_SCOPED_LOCK
|
||||||
class ScopedCheck {
|
class ScopedCheck {
|
||||||
public:
|
public:
|
||||||
explicit ScopedCheck(ThreadCollisionWarner* warner)
|
explicit ScopedCheck(ThreadCollisionWarner* warner) : warner_(warner) {
|
||||||
: warner_(warner) {
|
|
||||||
warner_->Enter();
|
warner_->Enter();
|
||||||
}
|
}
|
||||||
|
|
||||||
~ScopedCheck() {
|
~ScopedCheck() { warner_->Leave(); }
|
||||||
warner_->Leave();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ThreadCollisionWarner* warner_;
|
ThreadCollisionWarner* warner_;
|
||||||
@@ -243,9 +233,7 @@ class ThreadCollisionWarner {
|
|||||||
warner_->EnterSelf();
|
warner_->EnterSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
~ScopedRecursiveCheck() {
|
~ScopedRecursiveCheck() { warner_->Leave(); }
|
||||||
warner_->Leave();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ThreadCollisionWarner* warner_;
|
ThreadCollisionWarner* warner_;
|
||||||
|
|||||||
@@ -160,32 +160,29 @@
|
|||||||
// enabled, then this does nothing.
|
// enabled, then this does nothing.
|
||||||
// - category and name strings must have application lifetime (statics or
|
// - category and name strings must have application lifetime (statics or
|
||||||
// literals). They may not include " chars.
|
// literals). They may not include " chars.
|
||||||
#define TRACE_EVENT0(category, name) \
|
#define TRACE_EVENT0(category, name) \
|
||||||
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false); \
|
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false); \
|
||||||
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
||||||
#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false); \
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false); \
|
||||||
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
||||||
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, \
|
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \
|
||||||
arg2_val) \
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, \
|
arg2_val, false); \
|
||||||
arg2_name, arg2_val, false); \
|
|
||||||
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
||||||
|
|
||||||
// Implementation detail: trace event macros create temporary variable names.
|
// Implementation detail: trace event macros create temporary variable names.
|
||||||
// These macros give each temporary variable a unique name based on the line
|
// These macros give each temporary variable a unique name based on the line
|
||||||
// number to prevent name collisions.
|
// number to prevent name collisions.
|
||||||
#define CEF_INTERNAL_TRACE_EVENT_UID3(a,b) \
|
#define CEF_INTERNAL_TRACE_EVENT_UID3(a, b) cef_trace_event_unique_##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_UID2(a,b) \
|
|
||||||
CEF_INTERNAL_TRACE_EVENT_UID3(a,b)
|
|
||||||
#define CEF_INTERNAL_TRACE_EVENT_UID(name_prefix) \
|
#define CEF_INTERNAL_TRACE_EVENT_UID(name_prefix) \
|
||||||
CEF_INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__)
|
CEF_INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__)
|
||||||
|
|
||||||
// Implementation detail: internal macro to end end event when the scope ends.
|
// Implementation detail: internal macro to end end event when the scope ends.
|
||||||
#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \
|
#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \
|
||||||
cef_trace_event::CefTraceEndOnScopeClose \
|
cef_trace_event::CefTraceEndOnScopeClose CEF_INTERNAL_TRACE_EVENT_UID( \
|
||||||
CEF_INTERNAL_TRACE_EVENT_UID(profileScope)(category, name)
|
profileScope)(category, name)
|
||||||
|
|
||||||
// Records a single event called "name" immediately, with 0, 1 or 2
|
// Records a single event called "name" immediately, with 0, 1 or 2
|
||||||
// associated arguments. If the category is not enabled, then this
|
// associated arguments. If the category is not enabled, then this
|
||||||
@@ -196,18 +193,18 @@
|
|||||||
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false)
|
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false)
|
||||||
#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, false)
|
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, false)
|
||||||
#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \
|
#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_name, arg2_val) \
|
arg2_val) \
|
||||||
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
|
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val, false)
|
arg2_val, false)
|
||||||
#define TRACE_EVENT_COPY_INSTANT0(category, name) \
|
#define TRACE_EVENT_COPY_INSTANT0(category, name) \
|
||||||
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, true)
|
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, true)
|
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \
|
#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_val) \
|
arg2_name, arg2_val) \
|
||||||
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
|
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val, true)
|
arg2_val, true)
|
||||||
|
|
||||||
// Records a single BEGIN event called "name" immediately, with 0, 1 or 2
|
// Records a single BEGIN event called "name" immediately, with 0, 1 or 2
|
||||||
// associated arguments. If the category is not enabled, then this
|
// associated arguments. If the category is not enabled, then this
|
||||||
@@ -218,18 +215,18 @@
|
|||||||
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false)
|
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false)
|
||||||
#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false)
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false)
|
||||||
#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, \
|
#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_name, arg2_val) \
|
arg2_val) \
|
||||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val, false)
|
arg2_val, false)
|
||||||
#define TRACE_EVENT_COPY_BEGIN0(category, name) \
|
#define TRACE_EVENT_COPY_BEGIN0(category, name) \
|
||||||
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, true)
|
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, true)
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \
|
#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_val) \
|
arg2_name, arg2_val) \
|
||||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val, true)
|
arg2_val, true)
|
||||||
|
|
||||||
// Records a single END event for "name" immediately. If the category
|
// Records a single END event for "name" immediately. If the category
|
||||||
// is not enabled, then this does nothing.
|
// is not enabled, then this does nothing.
|
||||||
@@ -239,18 +236,18 @@
|
|||||||
cef_trace_event_end(category, name, NULL, 0, NULL, 0, false)
|
cef_trace_event_end(category, name, NULL, 0, NULL, 0, false)
|
||||||
#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, false)
|
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, false)
|
||||||
#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, \
|
#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_name, arg2_val) \
|
arg2_val) \
|
||||||
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
|
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val, false)
|
arg2_val, false)
|
||||||
#define TRACE_EVENT_COPY_END0(category, name) \
|
#define TRACE_EVENT_COPY_END0(category, name) \
|
||||||
cef_trace_event_end(category, name, NULL, 0, NULL, 0, true)
|
cef_trace_event_end(category, name, NULL, 0, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \
|
#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \
|
||||||
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, true)
|
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, \
|
#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_name, arg2_val) \
|
arg2_val) \
|
||||||
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
|
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
|
||||||
arg2_val, true)
|
arg2_val, true)
|
||||||
|
|
||||||
// Records the value of a counter called "name" immediately. Value
|
// Records the value of a counter called "name" immediately. Value
|
||||||
// must be representable as a 32 bit integer.
|
// must be representable as a 32 bit integer.
|
||||||
@@ -266,14 +263,14 @@
|
|||||||
// values as a stacked-bar chart.
|
// values as a stacked-bar chart.
|
||||||
// - category and name strings must have application lifetime (statics or
|
// - category and name strings must have application lifetime (statics or
|
||||||
// literals). They may not include " chars.
|
// literals). They may not include " chars.
|
||||||
#define TRACE_COUNTER2(category, name, value1_name, value1_val, \
|
#define TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, \
|
||||||
value2_name, value2_val) \
|
value2_val) \
|
||||||
|
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
|
||||||
|
value2_val, false)
|
||||||
|
#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \
|
||||||
|
value2_name, value2_val) \
|
||||||
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
|
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
|
||||||
value2_val, false)
|
value2_val, true)
|
||||||
#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \
|
|
||||||
value2_name, value2_val) \
|
|
||||||
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
|
|
||||||
value2_val, true)
|
|
||||||
|
|
||||||
// Records the value of a counter called "name" immediately. Value
|
// Records the value of a counter called "name" immediately. Value
|
||||||
// must be representable as a 32 bit integer.
|
// must be representable as a 32 bit integer.
|
||||||
@@ -298,14 +295,13 @@
|
|||||||
// bits will be xored with a hash of the process ID so that the same pointer
|
// bits will be xored with a hash of the process ID so that the same pointer
|
||||||
// on two different processes will not collide.
|
// on two different processes will not collide.
|
||||||
#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \
|
#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \
|
||||||
value2_name, value2_val) \
|
value2_name, value2_val) \
|
||||||
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
||||||
value2_name, value2_val, false)
|
value2_name, value2_val, false)
|
||||||
#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, \
|
#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val, \
|
||||||
value1_val, value2_name, value2_val) \
|
value2_name, value2_val) \
|
||||||
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
||||||
value2_name, value2_val, true)
|
value2_name, value2_val, true)
|
||||||
|
|
||||||
|
|
||||||
// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
|
// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
|
||||||
// associated arguments. If the category is not enabled, then this
|
// associated arguments. If the category is not enabled, then this
|
||||||
@@ -325,23 +321,22 @@
|
|||||||
// args.
|
// args.
|
||||||
#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
|
#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
|
||||||
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, false)
|
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, false)
|
||||||
#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
|
#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
|
||||||
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
|
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
|
||||||
0, false)
|
0, false)
|
||||||
#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
|
#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_val) \
|
arg2_name, arg2_val) \
|
||||||
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
|
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_val, false)
|
arg2_name, arg2_val, false)
|
||||||
#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \
|
#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \
|
||||||
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, true)
|
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, \
|
#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
|
||||||
arg1_val) \
|
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
|
||||||
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
|
0, true)
|
||||||
0, true)
|
#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
|
||||||
#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, \
|
arg2_name, arg2_val) \
|
||||||
arg1_val, arg2_name, arg2_val) \
|
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
|
||||||
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
|
arg2_name, arg2_val, true)
|
||||||
arg2_name, arg2_val, true)
|
|
||||||
|
|
||||||
// Records a single ASYNC_STEP_INTO event for |step| immediately. If the
|
// Records a single ASYNC_STEP_INTO event for |step| immediately. If the
|
||||||
// category is not enabled, then this does nothing. The |name| and |id| must
|
// category is not enabled, then this does nothing. The |name| and |id| must
|
||||||
@@ -351,16 +346,16 @@
|
|||||||
// ASYNC_STEP_PAST events.
|
// ASYNC_STEP_PAST events.
|
||||||
#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \
|
#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \
|
||||||
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false)
|
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false)
|
||||||
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, \
|
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
|
||||||
arg1_name, arg1_val) \
|
arg1_val) \
|
||||||
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
|
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
|
||||||
arg1_val, false)
|
arg1_val, false)
|
||||||
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO0(category, name, id, step) \
|
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO0(category, name, id, step) \
|
||||||
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, true)
|
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, \
|
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
|
||||||
arg1_name, arg1_val) \
|
arg1_val) \
|
||||||
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
|
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
|
||||||
arg1_val, true)
|
arg1_val, true)
|
||||||
|
|
||||||
// Records a single ASYNC_STEP_PAST event for |step| immediately. If the
|
// Records a single ASYNC_STEP_PAST event for |step| immediately. If the
|
||||||
// category is not enabled, then this does nothing. The |name| and |id| must
|
// category is not enabled, then this does nothing. The |name| and |id| must
|
||||||
@@ -370,38 +365,37 @@
|
|||||||
// ASYNC_STEP_INTO events.
|
// ASYNC_STEP_INTO events.
|
||||||
#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \
|
#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \
|
||||||
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false)
|
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false)
|
||||||
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, \
|
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
|
||||||
arg1_name, arg1_val) \
|
arg1_val) \
|
||||||
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
|
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
|
||||||
arg1_val, false)
|
arg1_val, false)
|
||||||
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST0(category, name, id, step) \
|
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST0(category, name, id, step) \
|
||||||
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, true)
|
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, \
|
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
|
||||||
arg1_name, arg1_val) \
|
arg1_val) \
|
||||||
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
|
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
|
||||||
arg1_val, true)
|
arg1_val, true)
|
||||||
|
|
||||||
// Records a single ASYNC_END event for "name" immediately. If the category
|
// Records a single ASYNC_END event for "name" immediately. If the category
|
||||||
// is not enabled, then this does nothing.
|
// is not enabled, then this does nothing.
|
||||||
#define TRACE_EVENT_ASYNC_END0(category, name, id) \
|
#define TRACE_EVENT_ASYNC_END0(category, name, id) \
|
||||||
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, false)
|
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, false)
|
||||||
#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
|
#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
|
||||||
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
|
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
|
||||||
false)
|
false)
|
||||||
#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
|
#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_val) \
|
arg2_name, arg2_val) \
|
||||||
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
|
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_val, false)
|
arg2_name, arg2_val, false)
|
||||||
#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \
|
#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \
|
||||||
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, true)
|
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, true)
|
||||||
#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, \
|
#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
|
||||||
arg1_val) \
|
|
||||||
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
|
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
|
||||||
true)
|
true)
|
||||||
#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, \
|
#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
|
||||||
arg1_val, arg2_name, arg2_val) \
|
arg2_name, arg2_val) \
|
||||||
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
|
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
|
||||||
arg2_name, arg2_val, true)
|
arg2_name, arg2_val, true)
|
||||||
|
|
||||||
namespace cef_trace_event {
|
namespace cef_trace_event {
|
||||||
|
|
||||||
@@ -409,8 +403,7 @@ namespace cef_trace_event {
|
|||||||
class CefTraceEndOnScopeClose {
|
class CefTraceEndOnScopeClose {
|
||||||
public:
|
public:
|
||||||
CefTraceEndOnScopeClose(const char* category, const char* name)
|
CefTraceEndOnScopeClose(const char* category, const char* name)
|
||||||
: category_(category), name_(name) {
|
: category_(category), name_(name) {}
|
||||||
}
|
|
||||||
~CefTraceEndOnScopeClose() {
|
~CefTraceEndOnScopeClose() {
|
||||||
cef_trace_event_end(category_, name_, NULL, 0, NULL, 0, false);
|
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 {
|
namespace base {
|
||||||
|
|
||||||
template <typename T> class SupportsWeakPtr;
|
template <typename T>
|
||||||
template <typename T> class WeakPtr;
|
class SupportsWeakPtr;
|
||||||
|
template <typename T>
|
||||||
|
class WeakPtr;
|
||||||
|
|
||||||
namespace cef_internal {
|
namespace cef_internal {
|
||||||
// These classes are part of the WeakPtr implementation.
|
// These classes are part of the WeakPtr implementation.
|
||||||
@@ -164,9 +166,7 @@ class WeakReferenceOwner {
|
|||||||
|
|
||||||
WeakReference GetRef() const;
|
WeakReference GetRef() const;
|
||||||
|
|
||||||
bool HasRefs() const {
|
bool HasRefs() const { return flag_.get() && !flag_->HasOneRef(); }
|
||||||
return flag_.get() && !flag_->HasOneRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Invalidate();
|
void Invalidate();
|
||||||
|
|
||||||
@@ -198,10 +198,10 @@ class SupportsWeakPtrBase {
|
|||||||
// conversion will only compile if there is exists a Base which inherits
|
// conversion will only compile if there is exists a Base which inherits
|
||||||
// from SupportsWeakPtr<Base>. See base::AsWeakPtr() below for a helper
|
// from SupportsWeakPtr<Base>. See base::AsWeakPtr() below for a helper
|
||||||
// function that makes calling this easier.
|
// function that makes calling this easier.
|
||||||
template<typename Derived>
|
template <typename Derived>
|
||||||
static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
|
static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
|
||||||
typedef
|
typedef is_convertible<Derived, cef_internal::SupportsWeakPtrBase&>
|
||||||
is_convertible<Derived, cef_internal::SupportsWeakPtrBase&> convertible;
|
convertible;
|
||||||
COMPILE_ASSERT(convertible::value,
|
COMPILE_ASSERT(convertible::value,
|
||||||
AsWeakPtr_argument_inherits_from_SupportsWeakPtr);
|
AsWeakPtr_argument_inherits_from_SupportsWeakPtr);
|
||||||
return AsWeakPtrImpl<Derived>(t, *t);
|
return AsWeakPtrImpl<Derived>(t, *t);
|
||||||
@@ -212,8 +212,8 @@ class SupportsWeakPtrBase {
|
|||||||
// which is an instance of SupportsWeakPtr<Base>. We can then safely
|
// which is an instance of SupportsWeakPtr<Base>. We can then safely
|
||||||
// static_cast the Base* to a Derived*.
|
// static_cast the Base* to a Derived*.
|
||||||
template <typename Derived, typename Base>
|
template <typename Derived, typename Base>
|
||||||
static WeakPtr<Derived> AsWeakPtrImpl(
|
static WeakPtr<Derived> AsWeakPtrImpl(Derived* t,
|
||||||
Derived* t, const SupportsWeakPtr<Base>&) {
|
const SupportsWeakPtr<Base>&) {
|
||||||
WeakPtr<Base> ptr = t->Base::AsWeakPtr();
|
WeakPtr<Base> ptr = t->Base::AsWeakPtr();
|
||||||
return WeakPtr<Derived>(ptr.ref_, static_cast<Derived*>(ptr.ptr_));
|
return WeakPtr<Derived>(ptr.ref_, static_cast<Derived*>(ptr.ptr_));
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,8 @@ class SupportsWeakPtrBase {
|
|||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace cef_internal
|
||||||
|
|
||||||
template <typename T> class WeakPtrFactory;
|
template <typename T>
|
||||||
|
class WeakPtrFactory;
|
||||||
|
|
||||||
// The WeakPtr class holds a weak reference to |T*|.
|
// The WeakPtr class holds a weak reference to |T*|.
|
||||||
//
|
//
|
||||||
@@ -239,14 +240,12 @@ template <typename T> class WeakPtrFactory;
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
class WeakPtr : public cef_internal::WeakPtrBase {
|
class WeakPtr : public cef_internal::WeakPtrBase {
|
||||||
public:
|
public:
|
||||||
WeakPtr() : ptr_(NULL) {
|
WeakPtr() : ptr_(NULL) {}
|
||||||
}
|
|
||||||
|
|
||||||
// Allow conversion from U to T provided U "is a" T. Note that this
|
// Allow conversion from U to T provided U "is a" T. Note that this
|
||||||
// is separate from the (implicit) copy constructor.
|
// is separate from the (implicit) copy constructor.
|
||||||
template <typename U>
|
template <typename U>
|
||||||
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other), ptr_(other.ptr_) {
|
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other), ptr_(other.ptr_) {}
|
||||||
}
|
|
||||||
|
|
||||||
T* get() const { return ref_.is_valid() ? ptr_ : NULL; }
|
T* get() const { return ref_.is_valid() ? ptr_ : NULL; }
|
||||||
|
|
||||||
@@ -280,18 +279,19 @@ class WeakPtr : public cef_internal::WeakPtrBase {
|
|||||||
private:
|
private:
|
||||||
// Explicitly declare comparison operators as required by the bool
|
// Explicitly declare comparison operators as required by the bool
|
||||||
// trick, but keep them private.
|
// trick, but keep them private.
|
||||||
template <class U> bool operator==(WeakPtr<U> const&) const;
|
template <class U>
|
||||||
template <class U> bool operator!=(WeakPtr<U> const&) const;
|
bool operator==(WeakPtr<U> const&) const;
|
||||||
|
template <class U>
|
||||||
|
bool operator!=(WeakPtr<U> const&) const;
|
||||||
|
|
||||||
friend class cef_internal::SupportsWeakPtrBase;
|
friend class cef_internal::SupportsWeakPtrBase;
|
||||||
template <typename U> friend class WeakPtr;
|
template <typename U>
|
||||||
|
friend class WeakPtr;
|
||||||
friend class SupportsWeakPtr<T>;
|
friend class SupportsWeakPtr<T>;
|
||||||
friend class WeakPtrFactory<T>;
|
friend class WeakPtrFactory<T>;
|
||||||
|
|
||||||
WeakPtr(const cef_internal::WeakReference& ref, T* ptr)
|
WeakPtr(const cef_internal::WeakReference& ref, T* ptr)
|
||||||
: WeakPtrBase(ref),
|
: WeakPtrBase(ref), ptr_(ptr) {}
|
||||||
ptr_(ptr) {
|
|
||||||
}
|
|
||||||
|
|
||||||
// This pointer is only valid when ref_.is_valid() is true. Otherwise, its
|
// This pointer is only valid when ref_.is_valid() is true. Otherwise, its
|
||||||
// value is undefined (as opposed to NULL).
|
// value is undefined (as opposed to NULL).
|
||||||
@@ -306,12 +306,9 @@ class WeakPtr : public cef_internal::WeakPtrBase {
|
|||||||
template <class T>
|
template <class T>
|
||||||
class WeakPtrFactory {
|
class WeakPtrFactory {
|
||||||
public:
|
public:
|
||||||
explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {
|
explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {}
|
||||||
}
|
|
||||||
|
|
||||||
~WeakPtrFactory() {
|
~WeakPtrFactory() { ptr_ = NULL; }
|
||||||
ptr_ = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
WeakPtr<T> GetWeakPtr() {
|
WeakPtr<T> GetWeakPtr() {
|
||||||
DCHECK(ptr_);
|
DCHECK(ptr_);
|
||||||
|
|||||||
@@ -85,9 +85,9 @@ inline void MemoryBarrier() {
|
|||||||
// variant of the target architecture is being used. This tests against
|
// variant of the target architecture is being used. This tests against
|
||||||
// any known ARMv6 or ARMv7 variant, where it is possible to directly
|
// any known ARMv6 or ARMv7 variant, where it is possible to directly
|
||||||
// use ldrex/strex instructions to implement fast atomic operations.
|
// use ldrex/strex instructions to implement fast atomic operations.
|
||||||
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
|
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
|
||||||
defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || \
|
defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || \
|
||||||
defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
|
defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
|
||||||
defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
|
defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
|
||||||
defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__)
|
defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__)
|
||||||
|
|
||||||
@@ -103,16 +103,17 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
|
|||||||
// reloop = 0
|
// reloop = 0
|
||||||
// if (prev_value != old_value)
|
// if (prev_value != old_value)
|
||||||
// reloop = STREX(ptr, new_value)
|
// reloop = STREX(ptr, new_value)
|
||||||
__asm__ __volatile__(" ldrex %0, [%3]\n"
|
__asm__ __volatile__(
|
||||||
" mov %1, #0\n"
|
" ldrex %0, [%3]\n"
|
||||||
" cmp %0, %4\n"
|
" mov %1, #0\n"
|
||||||
|
" cmp %0, %4\n"
|
||||||
#ifdef __thumb2__
|
#ifdef __thumb2__
|
||||||
" it eq\n"
|
" it eq\n"
|
||||||
#endif
|
#endif
|
||||||
" strexeq %1, %5, [%3]\n"
|
" strexeq %1, %5, [%3]\n"
|
||||||
: "=&r"(prev_value), "=&r"(reloop), "+m"(*ptr)
|
: "=&r"(prev_value), "=&r"(reloop), "+m"(*ptr)
|
||||||
: "r"(ptr), "r"(old_value), "r"(new_value)
|
: "r"(ptr), "r"(old_value), "r"(new_value)
|
||||||
: "cc", "memory");
|
: "cc", "memory");
|
||||||
} while (reloop != 0);
|
} while (reloop != 0);
|
||||||
return prev_value;
|
return prev_value;
|
||||||
}
|
}
|
||||||
@@ -143,12 +144,13 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
|||||||
// value += increment
|
// value += increment
|
||||||
// reloop = STREX(ptr, value)
|
// reloop = STREX(ptr, value)
|
||||||
//
|
//
|
||||||
__asm__ __volatile__(" ldrex %0, [%3]\n"
|
__asm__ __volatile__(
|
||||||
" add %0, %0, %4\n"
|
" ldrex %0, [%3]\n"
|
||||||
" strex %1, %0, [%3]\n"
|
" add %0, %0, %4\n"
|
||||||
: "=&r"(value), "=&r"(reloop), "+m"(*ptr)
|
" strex %1, %0, [%3]\n"
|
||||||
: "r"(ptr), "r"(increment)
|
: "=&r"(value), "=&r"(reloop), "+m"(*ptr)
|
||||||
: "cc", "memory");
|
: "r"(ptr), "r"(increment)
|
||||||
|
: "cc", "memory");
|
||||||
} while (reloop);
|
} while (reloop);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -171,18 +173,19 @@ inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
|
|||||||
do {
|
do {
|
||||||
// old_value = LDREX(ptr)
|
// old_value = LDREX(ptr)
|
||||||
// reloop = STREX(ptr, new_value)
|
// reloop = STREX(ptr, new_value)
|
||||||
__asm__ __volatile__(" ldrex %0, [%3]\n"
|
__asm__ __volatile__(
|
||||||
" strex %1, %4, [%3]\n"
|
" ldrex %0, [%3]\n"
|
||||||
: "=&r"(old_value), "=&r"(reloop), "+m"(*ptr)
|
" strex %1, %4, [%3]\n"
|
||||||
: "r"(ptr), "r"(new_value)
|
: "=&r"(old_value), "=&r"(reloop), "+m"(*ptr)
|
||||||
: "cc", "memory");
|
: "r"(ptr), "r"(new_value)
|
||||||
|
: "cc", "memory");
|
||||||
} while (reloop != 0);
|
} while (reloop != 0);
|
||||||
return old_value;
|
return old_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This tests against any known ARMv5 variant.
|
// This tests against any known ARMv5 variant.
|
||||||
#elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
|
#elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
|
||||||
defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__)
|
defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__)
|
||||||
|
|
||||||
// The kernel also provides a helper function to perform an atomic
|
// The kernel also provides a helper function to perform an atomic
|
||||||
// compare-and-swap operation at the hard-wired address 0xffff0fc0.
|
// compare-and-swap operation at the hard-wired address 0xffff0fc0.
|
||||||
@@ -281,7 +284,7 @@ inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# error "Your CPU's ARM architecture is not supported yet"
|
#error "Your CPU's ARM architecture is not supported yet"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NOTE: Atomicity of the following load and store operations is only
|
// NOTE: Atomicity of the following load and store operations is only
|
||||||
@@ -301,7 +304,9 @@ inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
|
|||||||
*ptr = 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) {
|
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
|
||||||
Atomic32 value = *ptr;
|
Atomic32 value = *ptr;
|
||||||
|
|||||||
@@ -52,26 +52,26 @@ namespace subtle {
|
|||||||
inline AtomicWord NoBarrier_CompareAndSwap(volatile AtomicWord* ptr,
|
inline AtomicWord NoBarrier_CompareAndSwap(volatile AtomicWord* ptr,
|
||||||
AtomicWord old_value,
|
AtomicWord old_value,
|
||||||
AtomicWord new_value) {
|
AtomicWord new_value) {
|
||||||
return NoBarrier_CompareAndSwap(
|
return NoBarrier_CompareAndSwap(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||||
reinterpret_cast<volatile Atomic32*>(ptr), old_value, new_value);
|
old_value, new_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline AtomicWord NoBarrier_AtomicExchange(volatile AtomicWord* ptr,
|
inline AtomicWord NoBarrier_AtomicExchange(volatile AtomicWord* ptr,
|
||||||
AtomicWord new_value) {
|
AtomicWord new_value) {
|
||||||
return NoBarrier_AtomicExchange(
|
return NoBarrier_AtomicExchange(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||||
reinterpret_cast<volatile Atomic32*>(ptr), new_value);
|
new_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline AtomicWord NoBarrier_AtomicIncrement(volatile AtomicWord* ptr,
|
inline AtomicWord NoBarrier_AtomicIncrement(volatile AtomicWord* ptr,
|
||||||
AtomicWord increment) {
|
AtomicWord increment) {
|
||||||
return NoBarrier_AtomicIncrement(
|
return NoBarrier_AtomicIncrement(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||||
reinterpret_cast<volatile Atomic32*>(ptr), increment);
|
increment);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline AtomicWord Barrier_AtomicIncrement(volatile AtomicWord* ptr,
|
inline AtomicWord Barrier_AtomicIncrement(volatile AtomicWord* ptr,
|
||||||
AtomicWord increment) {
|
AtomicWord increment) {
|
||||||
return Barrier_AtomicIncrement(
|
return Barrier_AtomicIncrement(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||||
reinterpret_cast<volatile Atomic32*>(ptr), increment);
|
increment);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline AtomicWord Acquire_CompareAndSwap(volatile AtomicWord* ptr,
|
inline AtomicWord Acquire_CompareAndSwap(volatile AtomicWord* ptr,
|
||||||
@@ -88,24 +88,22 @@ inline AtomicWord Release_CompareAndSwap(volatile AtomicWord* ptr,
|
|||||||
reinterpret_cast<volatile Atomic32*>(ptr), old_value, new_value);
|
reinterpret_cast<volatile Atomic32*>(ptr), old_value, new_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void NoBarrier_Store(volatile AtomicWord *ptr, AtomicWord value) {
|
inline void NoBarrier_Store(volatile AtomicWord* ptr, AtomicWord value) {
|
||||||
NoBarrier_Store(
|
NoBarrier_Store(reinterpret_cast<volatile Atomic32*>(ptr), value);
|
||||||
reinterpret_cast<volatile Atomic32*>(ptr), value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Acquire_Store(volatile AtomicWord* ptr, AtomicWord value) {
|
inline void Acquire_Store(volatile AtomicWord* ptr, AtomicWord value) {
|
||||||
return base::subtle::Acquire_Store(
|
return base::subtle::Acquire_Store(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||||
reinterpret_cast<volatile Atomic32*>(ptr), value);
|
value);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Release_Store(volatile AtomicWord* ptr, AtomicWord value) {
|
inline void Release_Store(volatile AtomicWord* ptr, AtomicWord value) {
|
||||||
return base::subtle::Release_Store(
|
return base::subtle::Release_Store(reinterpret_cast<volatile Atomic32*>(ptr),
|
||||||
reinterpret_cast<volatile Atomic32*>(ptr), value);
|
value);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline AtomicWord NoBarrier_Load(volatile const AtomicWord *ptr) {
|
inline AtomicWord NoBarrier_Load(volatile const AtomicWord* ptr) {
|
||||||
return NoBarrier_Load(
|
return NoBarrier_Load(reinterpret_cast<volatile const Atomic32*>(ptr));
|
||||||
reinterpret_cast<volatile const Atomic32*>(ptr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline AtomicWord Acquire_Load(volatile const AtomicWord* ptr) {
|
inline AtomicWord Acquire_Load(volatile const AtomicWord* ptr) {
|
||||||
@@ -118,8 +116,8 @@ inline AtomicWord Release_Load(volatile const AtomicWord* ptr) {
|
|||||||
reinterpret_cast<volatile const Atomic32*>(ptr));
|
reinterpret_cast<volatile const Atomic32*>(ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace base::subtle
|
} // namespace base::subtle
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
#endif // !defined(ARCH_CPU_64_BITS)
|
#endif // !defined(ARCH_CPU_64_BITS)
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
|
|||||||
Atomic64 prev_value;
|
Atomic64 prev_value;
|
||||||
do {
|
do {
|
||||||
if (OSAtomicCompareAndSwap64Barrier(
|
if (OSAtomicCompareAndSwap64Barrier(
|
||||||
old_value, new_value, reinterpret_cast<volatile int64_t*>(ptr))) {
|
old_value, new_value, reinterpret_cast<volatile int64_t*>(ptr))) {
|
||||||
return old_value;
|
return old_value;
|
||||||
}
|
}
|
||||||
prev_value = *ptr;
|
prev_value = *ptr;
|
||||||
@@ -217,7 +217,7 @@ inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
|
|||||||
|
|
||||||
#endif // defined(__LP64__)
|
#endif // defined(__LP64__)
|
||||||
|
|
||||||
} // namespace base::subtle
|
} // namespace base::subtle
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_MAC_H_
|
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_MAC_H_
|
||||||
|
|||||||
@@ -38,11 +38,10 @@
|
|||||||
// Features of this x86. Values may not be correct before main() is run,
|
// Features of this x86. Values may not be correct before main() is run,
|
||||||
// but are set conservatively.
|
// but are set conservatively.
|
||||||
struct AtomicOps_x86CPUFeatureStruct {
|
struct AtomicOps_x86CPUFeatureStruct {
|
||||||
bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
|
bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
|
||||||
// after acquire compare-and-swap.
|
// after acquire compare-and-swap.
|
||||||
};
|
};
|
||||||
extern struct AtomicOps_x86CPUFeatureStruct
|
extern struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures;
|
||||||
AtomicOps_Internalx86CPUFeatures;
|
|
||||||
|
|
||||||
#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
|
#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
|
||||||
|
|
||||||
@@ -56,8 +55,8 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
|
|||||||
Atomic32 new_value) {
|
Atomic32 new_value) {
|
||||||
Atomic32 prev;
|
Atomic32 prev;
|
||||||
__asm__ __volatile__("lock; cmpxchgl %1,%2"
|
__asm__ __volatile__("lock; cmpxchgl %1,%2"
|
||||||
: "=a" (prev)
|
: "=a"(prev)
|
||||||
: "q" (new_value), "m" (*ptr), "0" (old_value)
|
: "q"(new_value), "m"(*ptr), "0"(old_value)
|
||||||
: "memory");
|
: "memory");
|
||||||
return prev;
|
return prev;
|
||||||
}
|
}
|
||||||
@@ -65,8 +64,8 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
|
|||||||
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
|
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
|
||||||
Atomic32 new_value) {
|
Atomic32 new_value) {
|
||||||
__asm__ __volatile__("xchgl %1,%0" // The lock prefix is implicit for xchg.
|
__asm__ __volatile__("xchgl %1,%0" // The lock prefix is implicit for xchg.
|
||||||
: "=r" (new_value)
|
: "=r"(new_value)
|
||||||
: "m" (*ptr), "0" (new_value)
|
: "m"(*ptr), "0"(new_value)
|
||||||
: "memory");
|
: "memory");
|
||||||
return new_value; // Now it's the previous value.
|
return new_value; // Now it's the previous value.
|
||||||
}
|
}
|
||||||
@@ -75,8 +74,9 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
|||||||
Atomic32 increment) {
|
Atomic32 increment) {
|
||||||
Atomic32 temp = increment;
|
Atomic32 temp = increment;
|
||||||
__asm__ __volatile__("lock; xaddl %0,%1"
|
__asm__ __volatile__("lock; xaddl %0,%1"
|
||||||
: "+r" (temp), "+m" (*ptr)
|
: "+r"(temp), "+m"(*ptr)
|
||||||
: : "memory");
|
:
|
||||||
|
: "memory");
|
||||||
// temp now holds the old value of *ptr
|
// temp now holds the old value of *ptr
|
||||||
return temp + increment;
|
return temp + increment;
|
||||||
}
|
}
|
||||||
@@ -85,8 +85,9 @@ inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
|||||||
Atomic32 increment) {
|
Atomic32 increment) {
|
||||||
Atomic32 temp = increment;
|
Atomic32 temp = increment;
|
||||||
__asm__ __volatile__("lock; xaddl %0,%1"
|
__asm__ __volatile__("lock; xaddl %0,%1"
|
||||||
: "+r" (temp), "+m" (*ptr)
|
: "+r"(temp), "+m"(*ptr)
|
||||||
: : "memory");
|
:
|
||||||
|
: "memory");
|
||||||
// temp now holds the old value of *ptr
|
// temp now holds the old value of *ptr
|
||||||
if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
|
if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
|
||||||
__asm__ __volatile__("lfence" : : : "memory");
|
__asm__ __volatile__("lfence" : : : "memory");
|
||||||
@@ -125,7 +126,7 @@ inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
|
|||||||
|
|
||||||
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
|
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
|
||||||
ATOMICOPS_COMPILER_BARRIER();
|
ATOMICOPS_COMPILER_BARRIER();
|
||||||
*ptr = value; // An x86 store acts as a release barrier.
|
*ptr = value; // An x86 store acts as a release barrier.
|
||||||
// See comments in Atomic64 version of Release_Store(), below.
|
// See comments in Atomic64 version of Release_Store(), below.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,7 +135,7 @@ inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
|
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
|
||||||
Atomic32 value = *ptr; // An x86 load acts as a acquire barrier.
|
Atomic32 value = *ptr; // An x86 load acts as a acquire barrier.
|
||||||
// See comments in Atomic64 version of Release_Store(), below.
|
// See comments in Atomic64 version of Release_Store(), below.
|
||||||
ATOMICOPS_COMPILER_BARRIER();
|
ATOMICOPS_COMPILER_BARRIER();
|
||||||
return value;
|
return value;
|
||||||
@@ -154,8 +155,8 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
|
|||||||
Atomic64 new_value) {
|
Atomic64 new_value) {
|
||||||
Atomic64 prev;
|
Atomic64 prev;
|
||||||
__asm__ __volatile__("lock; cmpxchgq %1,%2"
|
__asm__ __volatile__("lock; cmpxchgq %1,%2"
|
||||||
: "=a" (prev)
|
: "=a"(prev)
|
||||||
: "q" (new_value), "m" (*ptr), "0" (old_value)
|
: "q"(new_value), "m"(*ptr), "0"(old_value)
|
||||||
: "memory");
|
: "memory");
|
||||||
return prev;
|
return prev;
|
||||||
}
|
}
|
||||||
@@ -163,8 +164,8 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
|
|||||||
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
|
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
|
||||||
Atomic64 new_value) {
|
Atomic64 new_value) {
|
||||||
__asm__ __volatile__("xchgq %1,%0" // The lock prefix is implicit for xchg.
|
__asm__ __volatile__("xchgq %1,%0" // The lock prefix is implicit for xchg.
|
||||||
: "=r" (new_value)
|
: "=r"(new_value)
|
||||||
: "m" (*ptr), "0" (new_value)
|
: "m"(*ptr), "0"(new_value)
|
||||||
: "memory");
|
: "memory");
|
||||||
return new_value; // Now it's the previous value.
|
return new_value; // Now it's the previous value.
|
||||||
}
|
}
|
||||||
@@ -173,8 +174,9 @@ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
|
|||||||
Atomic64 increment) {
|
Atomic64 increment) {
|
||||||
Atomic64 temp = increment;
|
Atomic64 temp = increment;
|
||||||
__asm__ __volatile__("lock; xaddq %0,%1"
|
__asm__ __volatile__("lock; xaddq %0,%1"
|
||||||
: "+r" (temp), "+m" (*ptr)
|
: "+r"(temp), "+m"(*ptr)
|
||||||
: : "memory");
|
:
|
||||||
|
: "memory");
|
||||||
// temp now contains the previous value of *ptr
|
// temp now contains the previous value of *ptr
|
||||||
return temp + increment;
|
return temp + increment;
|
||||||
}
|
}
|
||||||
@@ -183,8 +185,9 @@ inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
|
|||||||
Atomic64 increment) {
|
Atomic64 increment) {
|
||||||
Atomic64 temp = increment;
|
Atomic64 temp = increment;
|
||||||
__asm__ __volatile__("lock; xaddq %0,%1"
|
__asm__ __volatile__("lock; xaddq %0,%1"
|
||||||
: "+r" (temp), "+m" (*ptr)
|
: "+r"(temp), "+m"(*ptr)
|
||||||
: : "memory");
|
:
|
||||||
|
: "memory");
|
||||||
// temp now contains the previous value of *ptr
|
// temp now contains the previous value of *ptr
|
||||||
if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
|
if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
|
||||||
__asm__ __volatile__("lfence" : : : "memory");
|
__asm__ __volatile__("lfence" : : : "memory");
|
||||||
@@ -204,9 +207,9 @@ inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
|
|||||||
inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
|
inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
|
||||||
ATOMICOPS_COMPILER_BARRIER();
|
ATOMICOPS_COMPILER_BARRIER();
|
||||||
|
|
||||||
*ptr = value; // An x86 store acts as a release barrier
|
*ptr = value; // An x86 store acts as a release barrier
|
||||||
// for current AMD/Intel chips as of Jan 2008.
|
// for current AMD/Intel chips as of Jan 2008.
|
||||||
// See also Acquire_Load(), below.
|
// See also Acquire_Load(), below.
|
||||||
|
|
||||||
// When new chips come out, check:
|
// When new chips come out, check:
|
||||||
// IA-32 Intel Architecture Software Developer's Manual, Volume 3:
|
// IA-32 Intel Architecture Software Developer's Manual, Volume 3:
|
||||||
@@ -227,9 +230,9 @@ inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
|
inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
|
||||||
Atomic64 value = *ptr; // An x86 load acts as a acquire barrier,
|
Atomic64 value = *ptr; // An x86 load acts as a acquire barrier,
|
||||||
// for current AMD/Intel chips as of Jan 2008.
|
// for current AMD/Intel chips as of Jan 2008.
|
||||||
// See also Release_Store(), above.
|
// See also Release_Store(), above.
|
||||||
ATOMICOPS_COMPILER_BARRIER();
|
ATOMICOPS_COMPILER_BARRIER();
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -257,8 +260,8 @@ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
|
|||||||
|
|
||||||
#endif // defined(__x86_64__)
|
#endif // defined(__x86_64__)
|
||||||
|
|
||||||
} // namespace base::subtle
|
} // namespace base::subtle
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
#undef ATOMICOPS_COMPILER_BARRIER
|
#undef ATOMICOPS_COMPILER_BARRIER
|
||||||
|
|
||||||
|
|||||||
@@ -55,25 +55,23 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
|
|||||||
Atomic32 old_value,
|
Atomic32 old_value,
|
||||||
Atomic32 new_value) {
|
Atomic32 new_value) {
|
||||||
LONG result = _InterlockedCompareExchange(
|
LONG result = _InterlockedCompareExchange(
|
||||||
reinterpret_cast<volatile LONG*>(ptr),
|
reinterpret_cast<volatile LONG*>(ptr), static_cast<LONG>(new_value),
|
||||||
static_cast<LONG>(new_value),
|
|
||||||
static_cast<LONG>(old_value));
|
static_cast<LONG>(old_value));
|
||||||
return static_cast<Atomic32>(result);
|
return static_cast<Atomic32>(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
|
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
|
||||||
Atomic32 new_value) {
|
Atomic32 new_value) {
|
||||||
LONG result = _InterlockedExchange(
|
LONG result = _InterlockedExchange(reinterpret_cast<volatile LONG*>(ptr),
|
||||||
reinterpret_cast<volatile LONG*>(ptr),
|
static_cast<LONG>(new_value));
|
||||||
static_cast<LONG>(new_value));
|
|
||||||
return static_cast<Atomic32>(result);
|
return static_cast<Atomic32>(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||||
Atomic32 increment) {
|
Atomic32 increment) {
|
||||||
return _InterlockedExchangeAdd(
|
return _InterlockedExchangeAdd(reinterpret_cast<volatile LONG*>(ptr),
|
||||||
reinterpret_cast<volatile LONG*>(ptr),
|
static_cast<LONG>(increment)) +
|
||||||
static_cast<LONG>(increment)) + increment;
|
increment;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
||||||
@@ -112,11 +110,11 @@ inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
|
|||||||
|
|
||||||
inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
|
inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
|
||||||
NoBarrier_AtomicExchange(ptr, value);
|
NoBarrier_AtomicExchange(ptr, value);
|
||||||
// acts as a barrier in this implementation
|
// acts as a barrier in this implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
|
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
|
||||||
*ptr = value; // works w/o barrier for current Intel chips as of June 2005
|
*ptr = value; // works w/o barrier for current Intel chips as of June 2005
|
||||||
// See comments in Atomic64 version of Release_Store() below.
|
// See comments in Atomic64 version of Release_Store() below.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,24 +142,24 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
|
|||||||
Atomic64 old_value,
|
Atomic64 old_value,
|
||||||
Atomic64 new_value) {
|
Atomic64 new_value) {
|
||||||
PVOID result = InterlockedCompareExchangePointer(
|
PVOID result = InterlockedCompareExchangePointer(
|
||||||
reinterpret_cast<volatile PVOID*>(ptr),
|
reinterpret_cast<volatile PVOID*>(ptr),
|
||||||
reinterpret_cast<PVOID>(new_value), reinterpret_cast<PVOID>(old_value));
|
reinterpret_cast<PVOID>(new_value), reinterpret_cast<PVOID>(old_value));
|
||||||
return reinterpret_cast<Atomic64>(result);
|
return reinterpret_cast<Atomic64>(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
|
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
|
||||||
Atomic64 new_value) {
|
Atomic64 new_value) {
|
||||||
PVOID result = InterlockedExchangePointer(
|
PVOID result =
|
||||||
reinterpret_cast<volatile PVOID*>(ptr),
|
InterlockedExchangePointer(reinterpret_cast<volatile PVOID*>(ptr),
|
||||||
reinterpret_cast<PVOID>(new_value));
|
reinterpret_cast<PVOID>(new_value));
|
||||||
return reinterpret_cast<Atomic64>(result);
|
return reinterpret_cast<Atomic64>(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
|
inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
|
||||||
Atomic64 increment) {
|
Atomic64 increment) {
|
||||||
return InterlockedExchangeAdd64(
|
return InterlockedExchangeAdd64(reinterpret_cast<volatile LONGLONG*>(ptr),
|
||||||
reinterpret_cast<volatile LONGLONG*>(ptr),
|
static_cast<LONGLONG>(increment)) +
|
||||||
static_cast<LONGLONG>(increment)) + increment;
|
increment;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
|
inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
|
||||||
@@ -175,11 +173,11 @@ inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
|
|||||||
|
|
||||||
inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
|
inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
|
||||||
NoBarrier_AtomicExchange(ptr, value);
|
NoBarrier_AtomicExchange(ptr, value);
|
||||||
// acts as a barrier in this implementation
|
// acts as a barrier in this implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
|
inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
|
||||||
*ptr = value; // works w/o barrier for current Intel chips as of June 2005
|
*ptr = value; // works w/o barrier for current Intel chips as of June 2005
|
||||||
|
|
||||||
// When new chips come out, check:
|
// When new chips come out, check:
|
||||||
// IA-32 Intel Architecture Software Developer's Manual, Volume 3:
|
// IA-32 Intel Architecture Software Developer's Manual, Volume 3:
|
||||||
@@ -215,7 +213,6 @@ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
|
|||||||
return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
|
return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // defined(_WIN64)
|
#endif // defined(_WIN64)
|
||||||
|
|
||||||
} // namespace base::subtle
|
} // namespace base::subtle
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -48,338 +48,344 @@ class RunnableAdapter;
|
|||||||
|
|
||||||
// __stdcall Function: Arity 0.
|
// __stdcall Function: Arity 0.
|
||||||
template <typename R>
|
template <typename R>
|
||||||
class RunnableAdapter<R(__stdcall *)()> {
|
class RunnableAdapter<R(__stdcall*)()> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)();
|
typedef R(RunType)();
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__stdcall *function)())
|
explicit RunnableAdapter(R(__stdcall* function)()) : function_(function) {}
|
||||||
: function_(function) {
|
|
||||||
}
|
|
||||||
|
|
||||||
R Run() {
|
R Run() { return function_(); }
|
||||||
return function_();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__stdcall *function_)();
|
R(__stdcall* function_)();
|
||||||
};
|
};
|
||||||
|
|
||||||
// __fastcall Function: Arity 0.
|
// __fastcall Function: Arity 0.
|
||||||
template <typename R>
|
template <typename R>
|
||||||
class RunnableAdapter<R(__fastcall *)()> {
|
class RunnableAdapter<R(__fastcall*)()> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)();
|
typedef R(RunType)();
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__fastcall *function)())
|
explicit RunnableAdapter(R(__fastcall* function)()) : function_(function) {}
|
||||||
: function_(function) {
|
|
||||||
}
|
|
||||||
|
|
||||||
R Run() {
|
R Run() { return function_(); }
|
||||||
return function_();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__fastcall *function_)();
|
R(__fastcall* function_)();
|
||||||
};
|
};
|
||||||
|
|
||||||
// __stdcall Function: Arity 1.
|
// __stdcall Function: Arity 1.
|
||||||
template <typename R, typename A1>
|
template <typename R, typename A1>
|
||||||
class RunnableAdapter<R(__stdcall *)(A1)> {
|
class RunnableAdapter<R(__stdcall*)(A1)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1);
|
typedef R(RunType)(A1);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__stdcall *function)(A1))
|
explicit RunnableAdapter(R(__stdcall* function)(A1)) : function_(function) {}
|
||||||
: function_(function) {
|
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
|
||||||
return function_(a1);
|
return function_(a1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__stdcall *function_)(A1);
|
R(__stdcall* function_)(A1);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __fastcall Function: Arity 1.
|
// __fastcall Function: Arity 1.
|
||||||
template <typename R, typename A1>
|
template <typename R, typename A1>
|
||||||
class RunnableAdapter<R(__fastcall *)(A1)> {
|
class RunnableAdapter<R(__fastcall*)(A1)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1);
|
typedef R(RunType)(A1);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__fastcall *function)(A1))
|
explicit RunnableAdapter(R(__fastcall* function)(A1)) : function_(function) {}
|
||||||
: function_(function) {
|
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
|
||||||
return function_(a1);
|
return function_(a1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__fastcall *function_)(A1);
|
R(__fastcall* function_)(A1);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __stdcall Function: Arity 2.
|
// __stdcall Function: Arity 2.
|
||||||
template <typename R, typename A1, typename A2>
|
template <typename R, typename A1, typename A2>
|
||||||
class RunnableAdapter<R(__stdcall *)(A1, A2)> {
|
class RunnableAdapter<R(__stdcall*)(A1, A2)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2);
|
typedef R(RunType)(A1, A2);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__stdcall *function)(A1, A2))
|
explicit RunnableAdapter(R(__stdcall* function)(A1, A2))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2) {
|
typename CallbackParamTraits<A2>::ForwardType a2) {
|
||||||
return function_(a1, a2);
|
return function_(a1, a2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__stdcall *function_)(A1, A2);
|
R(__stdcall* function_)(A1, A2);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __fastcall Function: Arity 2.
|
// __fastcall Function: Arity 2.
|
||||||
template <typename R, typename A1, typename A2>
|
template <typename R, typename A1, typename A2>
|
||||||
class RunnableAdapter<R(__fastcall *)(A1, A2)> {
|
class RunnableAdapter<R(__fastcall*)(A1, A2)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2);
|
typedef R(RunType)(A1, A2);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__fastcall *function)(A1, A2))
|
explicit RunnableAdapter(R(__fastcall* function)(A1, A2))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2) {
|
typename CallbackParamTraits<A2>::ForwardType a2) {
|
||||||
return function_(a1, a2);
|
return function_(a1, a2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__fastcall *function_)(A1, A2);
|
R(__fastcall* function_)(A1, A2);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __stdcall Function: Arity 3.
|
// __stdcall Function: Arity 3.
|
||||||
template <typename R, typename A1, typename A2, typename A3>
|
template <typename R, typename A1, typename A2, typename A3>
|
||||||
class RunnableAdapter<R(__stdcall *)(A1, A2, A3)> {
|
class RunnableAdapter<R(__stdcall*)(A1, A2, A3)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3);
|
typedef R(RunType)(A1, A2, A3);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3))
|
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3) {
|
typename CallbackParamTraits<A3>::ForwardType a3) {
|
||||||
return function_(a1, a2, a3);
|
return function_(a1, a2, a3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__stdcall *function_)(A1, A2, A3);
|
R(__stdcall* function_)(A1, A2, A3);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __fastcall Function: Arity 3.
|
// __fastcall Function: Arity 3.
|
||||||
template <typename R, typename A1, typename A2, typename A3>
|
template <typename R, typename A1, typename A2, typename A3>
|
||||||
class RunnableAdapter<R(__fastcall *)(A1, A2, A3)> {
|
class RunnableAdapter<R(__fastcall*)(A1, A2, A3)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3);
|
typedef R(RunType)(A1, A2, A3);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3))
|
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3) {
|
typename CallbackParamTraits<A3>::ForwardType a3) {
|
||||||
return function_(a1, a2, a3);
|
return function_(a1, a2, a3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__fastcall *function_)(A1, A2, A3);
|
R(__fastcall* function_)(A1, A2, A3);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __stdcall Function: Arity 4.
|
// __stdcall Function: Arity 4.
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4>
|
template <typename R, typename A1, typename A2, typename A3, typename A4>
|
||||||
class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4)> {
|
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3, A4);
|
typedef R(RunType)(A1, A2, A3, A4);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4))
|
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3,
|
typename CallbackParamTraits<A3>::ForwardType a3,
|
||||||
typename CallbackParamTraits<A4>::ForwardType a4) {
|
typename CallbackParamTraits<A4>::ForwardType a4) {
|
||||||
return function_(a1, a2, a3, a4);
|
return function_(a1, a2, a3, a4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__stdcall *function_)(A1, A2, A3, A4);
|
R(__stdcall* function_)(A1, A2, A3, A4);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __fastcall Function: Arity 4.
|
// __fastcall Function: Arity 4.
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4>
|
template <typename R, typename A1, typename A2, typename A3, typename A4>
|
||||||
class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4)> {
|
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3, A4);
|
typedef R(RunType)(A1, A2, A3, A4);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4))
|
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3,
|
typename CallbackParamTraits<A3>::ForwardType a3,
|
||||||
typename CallbackParamTraits<A4>::ForwardType a4) {
|
typename CallbackParamTraits<A4>::ForwardType a4) {
|
||||||
return function_(a1, a2, a3, a4);
|
return function_(a1, a2, a3, a4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__fastcall *function_)(A1, A2, A3, A4);
|
R(__fastcall* function_)(A1, A2, A3, A4);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __stdcall Function: Arity 5.
|
// __stdcall Function: Arity 5.
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R,
|
||||||
typename A5>
|
typename A1,
|
||||||
class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5)> {
|
typename A2,
|
||||||
|
typename A3,
|
||||||
|
typename A4,
|
||||||
|
typename A5>
|
||||||
|
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4, A5)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3, A4, A5);
|
typedef R(RunType)(A1, A2, A3, A4, A5);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5))
|
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3,
|
typename CallbackParamTraits<A3>::ForwardType a3,
|
||||||
typename CallbackParamTraits<A4>::ForwardType a4,
|
typename CallbackParamTraits<A4>::ForwardType a4,
|
||||||
typename CallbackParamTraits<A5>::ForwardType a5) {
|
typename CallbackParamTraits<A5>::ForwardType a5) {
|
||||||
return function_(a1, a2, a3, a4, a5);
|
return function_(a1, a2, a3, a4, a5);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__stdcall *function_)(A1, A2, A3, A4, A5);
|
R(__stdcall* function_)(A1, A2, A3, A4, A5);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __fastcall Function: Arity 5.
|
// __fastcall Function: Arity 5.
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R,
|
||||||
typename A5>
|
typename A1,
|
||||||
class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5)> {
|
typename A2,
|
||||||
|
typename A3,
|
||||||
|
typename A4,
|
||||||
|
typename A5>
|
||||||
|
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4, A5)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3, A4, A5);
|
typedef R(RunType)(A1, A2, A3, A4, A5);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5))
|
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3,
|
typename CallbackParamTraits<A3>::ForwardType a3,
|
||||||
typename CallbackParamTraits<A4>::ForwardType a4,
|
typename CallbackParamTraits<A4>::ForwardType a4,
|
||||||
typename CallbackParamTraits<A5>::ForwardType a5) {
|
typename CallbackParamTraits<A5>::ForwardType a5) {
|
||||||
return function_(a1, a2, a3, a4, a5);
|
return function_(a1, a2, a3, a4, a5);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__fastcall *function_)(A1, A2, A3, A4, A5);
|
R(__fastcall* function_)(A1, A2, A3, A4, A5);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __stdcall Function: Arity 6.
|
// __stdcall Function: Arity 6.
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R,
|
||||||
typename A5, typename A6>
|
typename A1,
|
||||||
class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6)> {
|
typename A2,
|
||||||
|
typename A3,
|
||||||
|
typename A4,
|
||||||
|
typename A5,
|
||||||
|
typename A6>
|
||||||
|
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4, A5, A6)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3, A4, A5, A6);
|
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6))
|
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5, A6))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3,
|
typename CallbackParamTraits<A3>::ForwardType a3,
|
||||||
typename CallbackParamTraits<A4>::ForwardType a4,
|
typename CallbackParamTraits<A4>::ForwardType a4,
|
||||||
typename CallbackParamTraits<A5>::ForwardType a5,
|
typename CallbackParamTraits<A5>::ForwardType a5,
|
||||||
typename CallbackParamTraits<A6>::ForwardType a6) {
|
typename CallbackParamTraits<A6>::ForwardType a6) {
|
||||||
return function_(a1, a2, a3, a4, a5, a6);
|
return function_(a1, a2, a3, a4, a5, a6);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__stdcall *function_)(A1, A2, A3, A4, A5, A6);
|
R(__stdcall* function_)(A1, A2, A3, A4, A5, A6);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __fastcall Function: Arity 6.
|
// __fastcall Function: Arity 6.
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R,
|
||||||
typename A5, typename A6>
|
typename A1,
|
||||||
class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6)> {
|
typename A2,
|
||||||
|
typename A3,
|
||||||
|
typename A4,
|
||||||
|
typename A5,
|
||||||
|
typename A6>
|
||||||
|
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4, A5, A6)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3, A4, A5, A6);
|
typedef R(RunType)(A1, A2, A3, A4, A5, A6);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6))
|
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5, A6))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3,
|
typename CallbackParamTraits<A3>::ForwardType a3,
|
||||||
typename CallbackParamTraits<A4>::ForwardType a4,
|
typename CallbackParamTraits<A4>::ForwardType a4,
|
||||||
typename CallbackParamTraits<A5>::ForwardType a5,
|
typename CallbackParamTraits<A5>::ForwardType a5,
|
||||||
typename CallbackParamTraits<A6>::ForwardType a6) {
|
typename CallbackParamTraits<A6>::ForwardType a6) {
|
||||||
return function_(a1, a2, a3, a4, a5, a6);
|
return function_(a1, a2, a3, a4, a5, a6);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__fastcall *function_)(A1, A2, A3, A4, A5, A6);
|
R(__fastcall* function_)(A1, A2, A3, A4, A5, A6);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __stdcall Function: Arity 7.
|
// __stdcall Function: Arity 7.
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R,
|
||||||
typename A5, typename A6, typename A7>
|
typename A1,
|
||||||
class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7)> {
|
typename A2,
|
||||||
|
typename A3,
|
||||||
|
typename A4,
|
||||||
|
typename A5,
|
||||||
|
typename A6,
|
||||||
|
typename A7>
|
||||||
|
class RunnableAdapter<R(__stdcall*)(A1, A2, A3, A4, A5, A6, A7)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
|
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7))
|
explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5, A6, A7))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3,
|
typename CallbackParamTraits<A3>::ForwardType a3,
|
||||||
typename CallbackParamTraits<A4>::ForwardType a4,
|
typename CallbackParamTraits<A4>::ForwardType a4,
|
||||||
typename CallbackParamTraits<A5>::ForwardType a5,
|
typename CallbackParamTraits<A5>::ForwardType a5,
|
||||||
typename CallbackParamTraits<A6>::ForwardType a6,
|
typename CallbackParamTraits<A6>::ForwardType a6,
|
||||||
typename CallbackParamTraits<A7>::ForwardType a7) {
|
typename CallbackParamTraits<A7>::ForwardType a7) {
|
||||||
return function_(a1, a2, a3, a4, a5, a6, a7);
|
return function_(a1, a2, a3, a4, a5, a6, a7);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7);
|
R(__stdcall* function_)(A1, A2, A3, A4, A5, A6, A7);
|
||||||
};
|
};
|
||||||
|
|
||||||
// __fastcall Function: Arity 7.
|
// __fastcall Function: Arity 7.
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R,
|
||||||
typename A5, typename A6, typename A7>
|
typename A1,
|
||||||
class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7)> {
|
typename A2,
|
||||||
|
typename A3,
|
||||||
|
typename A4,
|
||||||
|
typename A5,
|
||||||
|
typename A6,
|
||||||
|
typename A7>
|
||||||
|
class RunnableAdapter<R(__fastcall*)(A1, A2, A3, A4, A5, A6, A7)> {
|
||||||
public:
|
public:
|
||||||
typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
|
typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7);
|
||||||
|
|
||||||
explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7))
|
explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5, A6, A7))
|
||||||
: function_(function) {
|
: function_(function) {}
|
||||||
}
|
|
||||||
|
|
||||||
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
R Run(typename CallbackParamTraits<A1>::ForwardType a1,
|
||||||
typename CallbackParamTraits<A2>::ForwardType a2,
|
typename CallbackParamTraits<A2>::ForwardType a2,
|
||||||
typename CallbackParamTraits<A3>::ForwardType a3,
|
typename CallbackParamTraits<A3>::ForwardType a3,
|
||||||
typename CallbackParamTraits<A4>::ForwardType a4,
|
typename CallbackParamTraits<A4>::ForwardType a4,
|
||||||
typename CallbackParamTraits<A5>::ForwardType a5,
|
typename CallbackParamTraits<A5>::ForwardType a5,
|
||||||
typename CallbackParamTraits<A6>::ForwardType a6,
|
typename CallbackParamTraits<A6>::ForwardType a6,
|
||||||
typename CallbackParamTraits<A7>::ForwardType a7) {
|
typename CallbackParamTraits<A7>::ForwardType a7) {
|
||||||
return function_(a1, a2, a3, a4, a5, a6, a7);
|
return function_(a1, a2, a3, a4, a5, a6, a7);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7);
|
R(__fastcall* function_)(A1, A2, A3, A4, A5, A6, A7);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace cef_internal
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class CallbackBase {
|
|||||||
// another type. It is not okay to use void*. We create a InvokeFuncStorage
|
// another type. It is not okay to use void*. We create a InvokeFuncStorage
|
||||||
// that that can store our function pointer, and then cast it back to
|
// that that can store our function pointer, and then cast it back to
|
||||||
// the original type on usage.
|
// the original type on usage.
|
||||||
typedef void(*InvokeFuncStorage)(void);
|
typedef void (*InvokeFuncStorage)(void);
|
||||||
|
|
||||||
// Returns true if this callback equals |other|. |other| may be null.
|
// Returns true if this callback equals |other|. |other| may be null.
|
||||||
bool Equals(const CallbackBase& other) const;
|
bool Equals(const CallbackBase& other) const;
|
||||||
@@ -115,15 +115,16 @@ class CallbackBase {
|
|||||||
// A helper template to determine if given type is non-const move-only-type,
|
// 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
|
// i.e. if a value of the given type should be passed via .Pass() in a
|
||||||
// destructive way.
|
// destructive way.
|
||||||
template <typename T> struct IsMoveOnlyType {
|
template <typename T>
|
||||||
|
struct IsMoveOnlyType {
|
||||||
template <typename U>
|
template <typename U>
|
||||||
static YesType Test(const typename U::MoveOnlyTypeForCPP03*);
|
static YesType Test(const typename U::MoveOnlyTypeForCPP03*);
|
||||||
|
|
||||||
template <typename U>
|
template <typename U>
|
||||||
static NoType Test(...);
|
static NoType Test(...);
|
||||||
|
|
||||||
static const bool value = sizeof(Test<T>(0)) == sizeof(YesType) &&
|
static const bool value =
|
||||||
!is_const<T>::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
|
// This is a typetraits object that's used to take an argument type, and
|
||||||
|
|||||||
@@ -51,9 +51,7 @@ namespace cef_internal {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
struct NeedsScopedRefptrButGetsRawPtr {
|
struct NeedsScopedRefptrButGetsRawPtr {
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
enum {
|
enum { value = base::false_type::value };
|
||||||
value = base::false_type::value
|
|
||||||
};
|
|
||||||
#else
|
#else
|
||||||
enum {
|
enum {
|
||||||
// Human readable translation: you needed to be a scoped_refptr if you are a
|
// Human readable translation: you needed to be a scoped_refptr if you are a
|
||||||
@@ -77,74 +75,103 @@ struct ParamsUseScopedRefptrCorrectly<Tuple0> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename A>
|
template <typename A>
|
||||||
struct ParamsUseScopedRefptrCorrectly<Tuple1<A> > {
|
struct ParamsUseScopedRefptrCorrectly<Tuple1<A>> {
|
||||||
enum { value = !NeedsScopedRefptrButGetsRawPtr<A>::value };
|
enum { value = !NeedsScopedRefptrButGetsRawPtr<A>::value };
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
struct ParamsUseScopedRefptrCorrectly<Tuple2<A, B> > {
|
struct ParamsUseScopedRefptrCorrectly<Tuple2<A, B>> {
|
||||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
enum {
|
||||||
NeedsScopedRefptrButGetsRawPtr<B>::value) };
|
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<B>::value)
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename B, typename C>
|
template <typename A, typename B, typename C>
|
||||||
struct ParamsUseScopedRefptrCorrectly<Tuple3<A, B, C> > {
|
struct ParamsUseScopedRefptrCorrectly<Tuple3<A, B, C>> {
|
||||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
enum {
|
||||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<C>::value) };
|
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<C>::value)
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename B, typename C, typename D>
|
template <typename A, typename B, typename C, typename D>
|
||||||
struct ParamsUseScopedRefptrCorrectly<Tuple4<A, B, C, D> > {
|
struct ParamsUseScopedRefptrCorrectly<Tuple4<A, B, C, D>> {
|
||||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
enum {
|
||||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<D>::value) };
|
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<D>::value)
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename B, typename C, typename D, typename E>
|
template <typename A, typename B, typename C, typename D, typename E>
|
||||||
struct ParamsUseScopedRefptrCorrectly<Tuple5<A, B, C, D, E> > {
|
struct ParamsUseScopedRefptrCorrectly<Tuple5<A, B, C, D, E>> {
|
||||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
enum {
|
||||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<E>::value) };
|
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<E>::value)
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename B, typename C, typename D, typename E,
|
template <typename A,
|
||||||
|
typename B,
|
||||||
|
typename C,
|
||||||
|
typename D,
|
||||||
|
typename E,
|
||||||
typename F>
|
typename F>
|
||||||
struct ParamsUseScopedRefptrCorrectly<Tuple6<A, B, C, D, E, F> > {
|
struct ParamsUseScopedRefptrCorrectly<Tuple6<A, B, C, D, E, F>> {
|
||||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
enum {
|
||||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
|
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
||||||
NeedsScopedRefptrButGetsRawPtr<F>::value) };
|
NeedsScopedRefptrButGetsRawPtr<E>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<F>::value)
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename B, typename C, typename D, typename E,
|
template <typename A,
|
||||||
typename F, typename G>
|
typename B,
|
||||||
struct ParamsUseScopedRefptrCorrectly<Tuple7<A, B, C, D, E, F, G> > {
|
typename C,
|
||||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
typename D,
|
||||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
typename E,
|
||||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
typename F,
|
||||||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
typename G>
|
||||||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
|
struct ParamsUseScopedRefptrCorrectly<Tuple7<A, B, C, D, E, F, G>> {
|
||||||
NeedsScopedRefptrButGetsRawPtr<F>::value ||
|
enum {
|
||||||
NeedsScopedRefptrButGetsRawPtr<G>::value) };
|
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<E>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<F>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<G>::value)
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename B, typename C, typename D, typename E,
|
template <typename A,
|
||||||
typename F, typename G, typename H>
|
typename B,
|
||||||
struct ParamsUseScopedRefptrCorrectly<Tuple8<A, B, C, D, E, F, G, H> > {
|
typename C,
|
||||||
enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
typename D,
|
||||||
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
typename E,
|
||||||
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
typename F,
|
||||||
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
typename G,
|
||||||
NeedsScopedRefptrButGetsRawPtr<E>::value ||
|
typename H>
|
||||||
NeedsScopedRefptrButGetsRawPtr<F>::value ||
|
struct ParamsUseScopedRefptrCorrectly<Tuple8<A, B, C, D, E, F, G, H>> {
|
||||||
NeedsScopedRefptrButGetsRawPtr<G>::value ||
|
enum {
|
||||||
NeedsScopedRefptrButGetsRawPtr<H>::value) };
|
value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<B>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<C>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<D>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<E>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<F>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<G>::value ||
|
||||||
|
NeedsScopedRefptrButGetsRawPtr<H>::value)
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cef_internal
|
} // namespace cef_internal
|
||||||
|
|||||||
81
include/capi/cef_accessibility_handler_capi.h
Normal file
81
include/capi/cef_accessibility_handler_capi.h
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
// 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=3e20b926af7550a1dc4000bfdf261332222a64b8$
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
|
||||||
|
#define CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/capi/cef_values_capi.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
///
|
||||||
|
// Implement this structure to receive accessibility notification when
|
||||||
|
// accessibility events have been registered. The functions of this structure
|
||||||
|
// will be called on the UI thread.
|
||||||
|
///
|
||||||
|
typedef struct _cef_accessibility_handler_t {
|
||||||
|
///
|
||||||
|
// Base structure.
|
||||||
|
///
|
||||||
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called after renderer process sends accessibility tree changes to the
|
||||||
|
// browser process.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* on_accessibility_tree_change)(
|
||||||
|
struct _cef_accessibility_handler_t* self,
|
||||||
|
struct _cef_value_t* value);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called after renderer process sends accessibility location changes to the
|
||||||
|
// browser process.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* on_accessibility_location_change)(
|
||||||
|
struct _cef_accessibility_handler_t* self,
|
||||||
|
struct _cef_value_t* value);
|
||||||
|
} cef_accessibility_handler_t;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=ca069c86d9b09fb6f939ce72682e15ce95571ead$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
||||||
@@ -59,7 +61,7 @@ typedef struct _cef_app_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Provides an opportunity to view and/or modify command-line arguments before
|
// Provides an opportunity to view and/or modify command-line arguments before
|
||||||
@@ -72,8 +74,9 @@ typedef struct _cef_app_t {
|
|||||||
// modify command-line arguments for non-browser processes as this may result
|
// modify command-line arguments for non-browser processes as this may result
|
||||||
// in undefined behavior including crashes.
|
// in undefined behavior including crashes.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_before_command_line_processing)(
|
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);
|
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
|
// each process and the registered schemes should be the same across all
|
||||||
// processes.
|
// 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);
|
struct _cef_scheme_registrar_t* registrar);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -91,25 +95,24 @@ typedef struct _cef_app_t {
|
|||||||
// If no handler is returned resources will be loaded from pack files. This
|
// If no handler is returned resources will be loaded from pack files. This
|
||||||
// function is called by the browser and render processes on multiple threads.
|
// function is called by the browser and render processes on multiple threads.
|
||||||
///
|
///
|
||||||
struct _cef_resource_bundle_handler_t* (
|
struct _cef_resource_bundle_handler_t*(
|
||||||
CEF_CALLBACK *get_resource_bundle_handler)(struct _cef_app_t* self);
|
CEF_CALLBACK* get_resource_bundle_handler)(struct _cef_app_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for functionality specific to the browser process. This
|
// Return the handler for functionality specific to the browser process. This
|
||||||
// function is called on multiple threads in the browser process.
|
// function is called on multiple threads in the browser process.
|
||||||
///
|
///
|
||||||
struct _cef_browser_process_handler_t* (
|
struct _cef_browser_process_handler_t*(
|
||||||
CEF_CALLBACK *get_browser_process_handler)(struct _cef_app_t* self);
|
CEF_CALLBACK* get_browser_process_handler)(struct _cef_app_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for functionality specific to the render process. This
|
// Return the handler for functionality specific to the render process. This
|
||||||
// function is called on the render process main thread.
|
// function is called on the render process main thread.
|
||||||
///
|
///
|
||||||
struct _cef_render_process_handler_t* (
|
struct _cef_render_process_handler_t*(
|
||||||
CEF_CALLBACK *get_render_process_handler)(struct _cef_app_t* self);
|
CEF_CALLBACK* get_render_process_handler)(struct _cef_app_t* self);
|
||||||
} cef_app_t;
|
} cef_app_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// This function should be called from the application entry point function to
|
// This function should be called from the application entry point function to
|
||||||
// execute a secondary process. It can be used to run secondary processes from
|
// execute a secondary process. It can be used to run secondary processes from
|
||||||
@@ -123,7 +126,8 @@ typedef struct _cef_app_t {
|
|||||||
// cef_sandbox_win.h for details).
|
// cef_sandbox_win.h for details).
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
|
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
|
// This function should be called on the main application thread to initialize
|
||||||
@@ -133,8 +137,9 @@ CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args,
|
|||||||
// be NULL (see cef_sandbox_win.h for details).
|
// be NULL (see cef_sandbox_win.h for details).
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
|
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,
|
||||||
void* windows_sandbox_info);
|
cef_app_t* application,
|
||||||
|
void* windows_sandbox_info);
|
||||||
|
|
||||||
///
|
///
|
||||||
// This function should be called on the main application thread to shut down
|
// This function should be called on the main application thread to shut down
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=899e57614c5810d61b61d182ed823cfbd193b4d4$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure used for asynchronous continuation of authentication
|
// Callback structure used for asynchronous continuation of authentication
|
||||||
// requests.
|
// requests.
|
||||||
@@ -53,21 +54,21 @@ typedef struct _cef_auth_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Continue the authentication request.
|
// Continue the authentication request.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cont)(struct _cef_auth_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_auth_callback_t* self,
|
||||||
const cef_string_t* username, const cef_string_t* password);
|
const cef_string_t* username,
|
||||||
|
const cef_string_t* password);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Cancel the authentication request.
|
// Cancel the authentication request.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cancel)(struct _cef_auth_callback_t* self);
|
void(CEF_CALLBACK* cancel)(struct _cef_auth_callback_t* self);
|
||||||
} cef_auth_callback_t;
|
} cef_auth_callback_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
|
||||||
|
|
||||||
@@ -45,10 +44,9 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure defining the reference count implementation functions. All
|
// All ref-counted framework structures must include this structure first.
|
||||||
// framework structures must include the cef_base_t structure first.
|
|
||||||
///
|
///
|
||||||
typedef struct _cef_base_t {
|
typedef struct _cef_base_ref_counted_t {
|
||||||
///
|
///
|
||||||
// Size of the data structure.
|
// Size of the data structure.
|
||||||
///
|
///
|
||||||
@@ -58,30 +56,44 @@ typedef struct _cef_base_t {
|
|||||||
// Called to increment the reference count for the object. Should be called
|
// Called to increment the reference count for the object. Should be called
|
||||||
// for every new copy of a pointer to a given object.
|
// for every new copy of a pointer to a given object.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *add_ref)(struct _cef_base_t* self);
|
void(CEF_CALLBACK* add_ref)(struct _cef_base_ref_counted_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called to decrement the reference count for the object. If the reference
|
// Called to decrement the reference count for the object. If the reference
|
||||||
// count falls to 0 the object should self-delete. Returns true (1) if the
|
// count falls to 0 the object should self-delete. Returns true (1) if the
|
||||||
// resulting reference count is 0.
|
// resulting reference count is 0.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *release)(struct _cef_base_t* self);
|
int(CEF_CALLBACK* release)(struct _cef_base_ref_counted_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the current reference count is 1.
|
// Returns true (1) if the current reference count is 1.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_one_ref)(struct _cef_base_t* self);
|
int(CEF_CALLBACK* has_one_ref)(struct _cef_base_ref_counted_t* self);
|
||||||
} cef_base_t;
|
} cef_base_ref_counted_t;
|
||||||
|
|
||||||
|
///
|
||||||
|
// All scoped framework structures must include this structure first.
|
||||||
|
///
|
||||||
|
typedef struct _cef_base_scoped_t {
|
||||||
|
///
|
||||||
|
// Size of the data structure.
|
||||||
|
///
|
||||||
|
size_t size;
|
||||||
|
|
||||||
// Check that the structure |s|, which is defined with a cef_base_t member named
|
///
|
||||||
// |base|, is large enough to contain the specified member |f|.
|
// Called to delete this object. May be NULL if the object is not owned.
|
||||||
#define CEF_MEMBER_EXISTS(s, f) \
|
///
|
||||||
((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= \
|
void(CEF_CALLBACK* del)(struct _cef_base_scoped_t* self);
|
||||||
reinterpret_cast<cef_base_t*>(s)->size)
|
|
||||||
|
|
||||||
#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))
|
} cef_base_scoped_t;
|
||||||
|
|
||||||
|
// Check that the structure |s|, which is defined with a size_t member at the
|
||||||
|
// top, is large enough to contain the specified member |f|.
|
||||||
|
#define CEF_MEMBER_EXISTS(s, f) \
|
||||||
|
((intptr_t) & \
|
||||||
|
((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= *reinterpret_cast<size_t*>(s))
|
||||||
|
|
||||||
|
#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=ff3ebc51ed5743aabac0be94caf2edeedbd413b7$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
|
||||||
@@ -63,128 +65,131 @@ typedef struct _cef_browser_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the browser host object. This function can only be called in the
|
// Returns the browser host object. This function can only be called in the
|
||||||
// browser process.
|
// browser process.
|
||||||
///
|
///
|
||||||
struct _cef_browser_host_t* (CEF_CALLBACK *get_host)(
|
struct _cef_browser_host_t*(CEF_CALLBACK* get_host)(
|
||||||
struct _cef_browser_t* self);
|
struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the browser can navigate backwards.
|
// Returns true (1) if the browser can navigate backwards.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *can_go_back)(struct _cef_browser_t* self);
|
int(CEF_CALLBACK* can_go_back)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Navigate backwards.
|
// Navigate backwards.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *go_back)(struct _cef_browser_t* self);
|
void(CEF_CALLBACK* go_back)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the browser can navigate forwards.
|
// Returns true (1) if the browser can navigate forwards.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *can_go_forward)(struct _cef_browser_t* self);
|
int(CEF_CALLBACK* can_go_forward)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Navigate forwards.
|
// Navigate forwards.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *go_forward)(struct _cef_browser_t* self);
|
void(CEF_CALLBACK* go_forward)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the browser is currently loading.
|
// Returns true (1) if the browser is currently loading.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_loading)(struct _cef_browser_t* self);
|
int(CEF_CALLBACK* is_loading)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Reload the current page.
|
// Reload the current page.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *reload)(struct _cef_browser_t* self);
|
void(CEF_CALLBACK* reload)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Reload the current page ignoring any cached data.
|
// Reload the current page ignoring any cached data.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *reload_ignore_cache)(struct _cef_browser_t* self);
|
void(CEF_CALLBACK* reload_ignore_cache)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Stop loading the page.
|
// Stop loading the page.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *stop_load)(struct _cef_browser_t* self);
|
void(CEF_CALLBACK* stop_load)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the globally unique identifier for this browser.
|
// 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);
|
int(CEF_CALLBACK* get_identifier)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is pointing to the same handle as |that|
|
// Returns true (1) if this object is pointing to the same handle as |that|
|
||||||
// object.
|
// object.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_same)(struct _cef_browser_t* self,
|
int(CEF_CALLBACK* is_same)(struct _cef_browser_t* self,
|
||||||
struct _cef_browser_t* that);
|
struct _cef_browser_t* that);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the window is a popup window.
|
// Returns true (1) if the window is a popup window.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_popup)(struct _cef_browser_t* self);
|
int(CEF_CALLBACK* is_popup)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if a document has been loaded in the browser.
|
// Returns true (1) if a document has been loaded in the browser.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_document)(struct _cef_browser_t* self);
|
int(CEF_CALLBACK* has_document)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the main (top-level) frame for the browser window.
|
// Returns the main (top-level) frame for the browser window.
|
||||||
///
|
///
|
||||||
struct _cef_frame_t* (CEF_CALLBACK *get_main_frame)(
|
struct _cef_frame_t*(CEF_CALLBACK* get_main_frame)(
|
||||||
struct _cef_browser_t* self);
|
struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the focused frame for the browser window.
|
// Returns the focused frame for the browser window.
|
||||||
///
|
///
|
||||||
struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)(
|
struct _cef_frame_t*(CEF_CALLBACK* get_focused_frame)(
|
||||||
struct _cef_browser_t* self);
|
struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the frame with the specified identifier, or NULL if not found.
|
// Returns the frame with the specified identifier, or NULL if not found.
|
||||||
///
|
///
|
||||||
struct _cef_frame_t* (CEF_CALLBACK *get_frame_byident)(
|
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.
|
// Returns the frame with the specified name, or NULL if not found.
|
||||||
///
|
///
|
||||||
struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self,
|
struct _cef_frame_t*(CEF_CALLBACK* get_frame)(struct _cef_browser_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the number of frames that currently exist.
|
// Returns the number of frames that currently exist.
|
||||||
///
|
///
|
||||||
size_t (CEF_CALLBACK *get_frame_count)(struct _cef_browser_t* self);
|
size_t(CEF_CALLBACK* get_frame_count)(struct _cef_browser_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the identifiers of all existing frames.
|
// Returns the identifiers of all existing frames.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_frame_identifiers)(struct _cef_browser_t* self,
|
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.
|
// Returns the names of all existing frames.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self,
|
void(CEF_CALLBACK* get_frame_names)(struct _cef_browser_t* self,
|
||||||
cef_string_list_t names);
|
cef_string_list_t names);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Send a message to the specified |target_process|. Returns true (1) if the
|
// Send a message to the specified |target_process|. Returns true (1) if the
|
||||||
// message was sent successfully.
|
// 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,
|
cef_process_id_t target_process,
|
||||||
struct _cef_process_message_t* message);
|
struct _cef_process_message_t* message);
|
||||||
} cef_browser_t;
|
} cef_browser_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure for cef_browser_host_t::RunFileDialog. The functions of
|
// Callback structure for cef_browser_host_t::RunFileDialog. The functions of
|
||||||
// this structure will be called on the browser process UI thread.
|
// this structure will be called on the browser process UI thread.
|
||||||
@@ -193,7 +198,7 @@ typedef struct _cef_run_file_dialog_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called asynchronously after the file dialog is dismissed.
|
// Called asynchronously after the file dialog is dismissed.
|
||||||
@@ -202,12 +207,12 @@ typedef struct _cef_run_file_dialog_callback_t {
|
|||||||
// |file_paths| will be a single value or a list of values depending on the
|
// |file_paths| will be a single value or a list of values depending on the
|
||||||
// dialog mode. If the selection was cancelled |file_paths| will be NULL.
|
// dialog mode. If the selection was cancelled |file_paths| will be NULL.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_file_dialog_dismissed)(
|
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_string_list_t file_paths);
|
||||||
} cef_run_file_dialog_callback_t;
|
} cef_run_file_dialog_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure for cef_browser_host_t::GetNavigationEntries. The
|
// Callback structure for cef_browser_host_t::GetNavigationEntries. The
|
||||||
// functions of this structure will be called on the browser process UI thread.
|
// functions of this structure will be called on the browser process UI thread.
|
||||||
@@ -216,7 +221,7 @@ typedef struct _cef_navigation_entry_visitor_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Method that will be executed. Do not keep a reference to |entry| outside of
|
// Method that will be executed. Do not keep a reference to |entry| outside of
|
||||||
@@ -225,12 +230,13 @@ typedef struct _cef_navigation_entry_visitor_t {
|
|||||||
// navigation entry. |index| is the 0-based index of this entry and |total| is
|
// navigation entry. |index| is the 0-based index of this entry and |total| is
|
||||||
// the total number of entries.
|
// the total number of entries.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *visit)(struct _cef_navigation_entry_visitor_t* self,
|
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 total);
|
int current,
|
||||||
|
int index,
|
||||||
|
int total);
|
||||||
} cef_navigation_entry_visitor_t;
|
} cef_navigation_entry_visitor_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
|
// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
|
||||||
// structure will be called on the browser process UI thread.
|
// structure will be called on the browser process UI thread.
|
||||||
@@ -239,19 +245,19 @@ typedef struct _cef_pdf_print_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Method that will be executed when the PDF printing has completed. |path| is
|
// Method that will be executed when the PDF printing has completed. |path| is
|
||||||
// the output path. |ok| will be true (1) if the printing completed
|
// the output path. |ok| will be true (1) if the printing completed
|
||||||
// successfully or false (0) otherwise.
|
// successfully or false (0) otherwise.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_pdf_print_finished)(
|
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);
|
int ok);
|
||||||
} cef_pdf_print_callback_t;
|
} cef_pdf_print_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure for cef_browser_host_t::DownloadImage. The functions of
|
// Callback structure for cef_browser_host_t::DownloadImage. The functions of
|
||||||
// this structure will be called on the browser process UI thread.
|
// this structure will be called on the browser process UI thread.
|
||||||
@@ -260,7 +266,7 @@ typedef struct _cef_download_image_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Method that will be executed when the image download has completed.
|
// Method that will be executed when the image download has completed.
|
||||||
@@ -268,13 +274,13 @@ typedef struct _cef_download_image_callback_t {
|
|||||||
// resulting HTTP status code. |image| is the resulting image, possibly at
|
// resulting HTTP status code. |image| is the resulting image, possibly at
|
||||||
// multiple scale factors, or NULL if the download failed.
|
// multiple scale factors, or NULL if the download failed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_download_image_finished)(
|
void(CEF_CALLBACK* on_download_image_finished)(
|
||||||
struct _cef_download_image_callback_t* self,
|
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);
|
struct _cef_image_t* image);
|
||||||
} cef_download_image_callback_t;
|
} cef_download_image_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent the browser process aspects of a browser window.
|
// 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.
|
// The functions of this structure can only be called in the browser process.
|
||||||
@@ -285,12 +291,12 @@ typedef struct _cef_browser_host_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the hosted browser object.
|
// Returns the hosted browser object.
|
||||||
///
|
///
|
||||||
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(
|
struct _cef_browser_t*(CEF_CALLBACK* get_browser)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -303,8 +309,8 @@ typedef struct _cef_browser_host_t {
|
|||||||
// cef_life_span_handler_t::do_close() documentation for additional usage
|
// cef_life_span_handler_t::do_close() documentation for additional usage
|
||||||
// information.
|
// information.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *close_browser)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* close_browser)(struct _cef_browser_host_t* self,
|
||||||
int force_close);
|
int force_close);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Helper for closing a browser. Call this function from the top-level window
|
// Helper for closing a browser. Call this function from the top-level window
|
||||||
@@ -314,19 +320,19 @@ typedef struct _cef_browser_host_t {
|
|||||||
// and cef_life_span_handler_t::do_close() documentation for additional usage
|
// and cef_life_span_handler_t::do_close() documentation for additional usage
|
||||||
// information. This function must be called on the browser process UI thread.
|
// information. This function must be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *try_close_browser)(struct _cef_browser_host_t* self);
|
int(CEF_CALLBACK* try_close_browser)(struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set whether the browser is focused.
|
// Set whether the browser is focused.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_focus)(struct _cef_browser_host_t* self, int focus);
|
void(CEF_CALLBACK* set_focus)(struct _cef_browser_host_t* self, int focus);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieve the window handle for this browser. If this browser is wrapped in
|
// Retrieve the window handle for this browser. If this browser is wrapped in
|
||||||
// a cef_browser_view_t this function should be called on the browser process
|
// a cef_browser_view_t this function should be called on the browser process
|
||||||
// UI thread and it will return the handle for the top-level native window.
|
// UI thread and it will return the handle for the top-level native window.
|
||||||
///
|
///
|
||||||
cef_window_handle_t (CEF_CALLBACK *get_window_handle)(
|
cef_window_handle_t(CEF_CALLBACK* get_window_handle)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -335,39 +341,39 @@ typedef struct _cef_browser_host_t {
|
|||||||
// cef_browser_view_t. This function can be used in combination with custom
|
// cef_browser_view_t. This function can be used in combination with custom
|
||||||
// handling of modal windows.
|
// handling of modal windows.
|
||||||
///
|
///
|
||||||
cef_window_handle_t (CEF_CALLBACK *get_opener_window_handle)(
|
cef_window_handle_t(CEF_CALLBACK* get_opener_window_handle)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this browser is wrapped in a cef_browser_view_t.
|
// Returns true (1) if this browser is wrapped in a cef_browser_view_t.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_view)(struct _cef_browser_host_t* self);
|
int(CEF_CALLBACK* has_view)(struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the client for this browser.
|
// Returns the client for this browser.
|
||||||
///
|
///
|
||||||
struct _cef_client_t* (CEF_CALLBACK *get_client)(
|
struct _cef_client_t*(CEF_CALLBACK* get_client)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the request context for this browser.
|
// Returns the request context for this browser.
|
||||||
///
|
///
|
||||||
struct _cef_request_context_t* (CEF_CALLBACK *get_request_context)(
|
struct _cef_request_context_t*(CEF_CALLBACK* get_request_context)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the current zoom level. The default zoom level is 0.0. This function
|
// Get the current zoom level. The default zoom level is 0.0. This function
|
||||||
// can only be called on the UI thread.
|
// can only be called on the UI thread.
|
||||||
///
|
///
|
||||||
double (CEF_CALLBACK *get_zoom_level)(struct _cef_browser_host_t* self);
|
double(CEF_CALLBACK* get_zoom_level)(struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Change the zoom level to the specified value. Specify 0.0 to reset the zoom
|
// Change the zoom level to the specified value. Specify 0.0 to reset the zoom
|
||||||
// level. If called on the UI thread the change will be applied immediately.
|
// level. If called on the UI thread the change will be applied immediately.
|
||||||
// Otherwise, the change will be applied asynchronously on the UI thread.
|
// Otherwise, the change will be applied asynchronously on the UI thread.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_zoom_level)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* set_zoom_level)(struct _cef_browser_host_t* self,
|
||||||
double zoomLevel);
|
double zoomLevel);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Call to run a file chooser dialog. Only a single file chooser dialog may be
|
// Call to run a file chooser dialog. Only a single file chooser dialog may be
|
||||||
@@ -385,17 +391,20 @@ typedef struct _cef_browser_host_t {
|
|||||||
// dismissed or immediately if another dialog is already pending. The dialog
|
// dismissed or immediately if another dialog is already pending. The dialog
|
||||||
// will be initiated asynchronously on the UI thread.
|
// will be initiated asynchronously on the UI thread.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *run_file_dialog)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* run_file_dialog)(
|
||||||
cef_file_dialog_mode_t mode, const cef_string_t* title,
|
struct _cef_browser_host_t* self,
|
||||||
const cef_string_t* default_file_path, cef_string_list_t accept_filters,
|
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 selected_accept_filter,
|
||||||
struct _cef_run_file_dialog_callback_t* callback);
|
struct _cef_run_file_dialog_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Download the file at |url| using cef_download_handler_t.
|
// Download the file at |url| using cef_download_handler_t.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *start_download)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* start_download)(struct _cef_browser_host_t* self,
|
||||||
const cef_string_t* url);
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Download |image_url| and execute |callback| on completion with the images
|
// Download |image_url| and execute |callback| on completion with the images
|
||||||
@@ -409,14 +418,18 @@ typedef struct _cef_browser_host_t {
|
|||||||
// unlimited. If |bypass_cache| is true (1) then |image_url| is requested from
|
// unlimited. If |bypass_cache| is true (1) then |image_url| is requested from
|
||||||
// the server even if it is present in the browser cache.
|
// the server even if it is present in the browser cache.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *download_image)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* download_image)(
|
||||||
const cef_string_t* image_url, int is_favicon, uint32 max_image_size,
|
struct _cef_browser_host_t* self,
|
||||||
int bypass_cache, struct _cef_download_image_callback_t* callback);
|
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.
|
// Print the current browser contents.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *print)(struct _cef_browser_host_t* self);
|
void(CEF_CALLBACK* print)(struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Print the current browser contents to the PDF file specified by |path| and
|
// Print the current browser contents to the PDF file specified by |path| and
|
||||||
@@ -424,28 +437,35 @@ typedef struct _cef_browser_host_t {
|
|||||||
// |path| when done. For PDF printing to work on Linux you must implement the
|
// |path| when done. For PDF printing to work on Linux you must implement the
|
||||||
// cef_print_handler_t::GetPdfPaperSize function.
|
// 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 cef_string_t* path,
|
||||||
const struct _cef_pdf_print_settings_t* settings,
|
const struct _cef_pdf_print_settings_t* settings,
|
||||||
struct _cef_pdf_print_callback_t* callback);
|
struct _cef_pdf_print_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Search for |searchText|. |identifier| can be used to have multiple searches
|
// Search for |searchText|. |identifier| must be a unique ID and these IDs
|
||||||
// running simultaniously. |forward| indicates whether to search forward or
|
// must strictly increase so that newer requests always have greater IDs than
|
||||||
// backward within the page. |matchCase| indicates whether the search should
|
// older requests. If |identifier| is zero or less than the previous ID value
|
||||||
// be case-sensitive. |findNext| indicates whether this is the first request
|
// then it will be automatically assigned a new valid ID. |forward| indicates
|
||||||
// or a follow-up. The cef_find_handler_t instance, if any, returned via
|
// whether to search forward or backward within the page. |matchCase|
|
||||||
// cef_client_t::GetFindHandler will be called to report find results.
|
// 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,
|
void(CEF_CALLBACK* find)(struct _cef_browser_host_t* self,
|
||||||
const cef_string_t* searchText, int forward, int matchCase,
|
int identifier,
|
||||||
int findNext);
|
const cef_string_t* searchText,
|
||||||
|
int forward,
|
||||||
|
int matchCase,
|
||||||
|
int findNext);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Cancel all searches that are currently going on.
|
// Cancel all searches that are currently going on.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *stop_finding)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* stop_finding)(struct _cef_browser_host_t* self,
|
||||||
int clearSelection);
|
int clearSelection);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Open developer tools (DevTools) in its own browser. The DevTools browser
|
// Open developer tools (DevTools) in its own browser. The DevTools browser
|
||||||
@@ -456,7 +476,8 @@ typedef struct _cef_browser_host_t {
|
|||||||
// inspected. The |windowInfo| parameter will be ignored if this browser is
|
// inspected. The |windowInfo| parameter will be ignored if this browser is
|
||||||
// wrapped in a cef_browser_view_t.
|
// 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,
|
const struct _cef_window_info_t* windowInfo,
|
||||||
struct _cef_client_t* client,
|
struct _cef_client_t* client,
|
||||||
const struct _cef_browser_settings_t* settings,
|
const struct _cef_browser_settings_t* settings,
|
||||||
@@ -465,13 +486,13 @@ typedef struct _cef_browser_host_t {
|
|||||||
///
|
///
|
||||||
// Explicitly close the associated DevTools browser, if any.
|
// Explicitly close the associated DevTools browser, if any.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_host_t* self);
|
void(CEF_CALLBACK* close_dev_tools)(struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this browser currently has an associated DevTools
|
// Returns true (1) if this browser currently has an associated DevTools
|
||||||
// browser. Must be called on the browser process UI thread.
|
// browser. Must be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_dev_tools)(struct _cef_browser_host_t* self);
|
int(CEF_CALLBACK* has_dev_tools)(struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieve a snapshot of current navigation entries as values sent to the
|
// Retrieve a snapshot of current navigation entries as values sent to the
|
||||||
@@ -479,38 +500,41 @@ typedef struct _cef_browser_host_t {
|
|||||||
// navigation entry will be sent, otherwise all navigation entries will be
|
// navigation entry will be sent, otherwise all navigation entries will be
|
||||||
// sent.
|
// sent.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_navigation_entries)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* get_navigation_entries)(
|
||||||
struct _cef_navigation_entry_visitor_t* visitor, int current_only);
|
struct _cef_browser_host_t* self,
|
||||||
|
struct _cef_navigation_entry_visitor_t* visitor,
|
||||||
|
int current_only);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set whether mouse cursor change is disabled.
|
// Set whether mouse cursor change is disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_mouse_cursor_change_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.
|
// Returns true (1) if mouse cursor change is disabled.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_mouse_cursor_change_disabled)(
|
int(CEF_CALLBACK* is_mouse_cursor_change_disabled)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// If a misspelled word is currently selected in an editable node calling this
|
// If a misspelled word is currently selected in an editable node calling this
|
||||||
// function will replace it with the specified |word|.
|
// function will replace it with the specified |word|.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *replace_misspelling)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* replace_misspelling)(struct _cef_browser_host_t* self,
|
||||||
const cef_string_t* word);
|
const cef_string_t* word);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add the specified |word| to the spelling dictionary.
|
// Add the specified |word| to the spelling dictionary.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *add_word_to_dictionary)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* add_word_to_dictionary)(struct _cef_browser_host_t* self,
|
||||||
const cef_string_t* word);
|
const cef_string_t* word);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if window rendering is disabled.
|
// Returns true (1) if window rendering is disabled.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_window_rendering_disabled)(
|
int(CEF_CALLBACK* is_window_rendering_disabled)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -519,14 +543,14 @@ typedef struct _cef_browser_host_t {
|
|||||||
// cef_render_handler_t::OnPaint asynchronously with the updated regions. This
|
// cef_render_handler_t::OnPaint asynchronously with the updated regions. This
|
||||||
// function is only used when window rendering is disabled.
|
// function is only used when window rendering is disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *was_resized)(struct _cef_browser_host_t* self);
|
void(CEF_CALLBACK* was_resized)(struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Notify the browser that it has been hidden or shown. Layouting and
|
// Notify the browser that it has been hidden or shown. Layouting and
|
||||||
// cef_render_handler_t::OnPaint notification will stop when the browser is
|
// cef_render_handler_t::OnPaint notification will stop when the browser is
|
||||||
// hidden. This function is only used when window rendering is disabled.
|
// hidden. This function is only used when window rendering is disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *was_hidden)(struct _cef_browser_host_t* self, int hidden);
|
void(CEF_CALLBACK* was_hidden)(struct _cef_browser_host_t* self, int hidden);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Send a notification to the browser that the screen info has changed. The
|
// Send a notification to the browser that the screen info has changed. The
|
||||||
@@ -536,7 +560,7 @@ typedef struct _cef_browser_host_t {
|
|||||||
// current display. This function is only used when window rendering is
|
// current display. This function is only used when window rendering is
|
||||||
// disabled.
|
// disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *notify_screen_info_changed)(
|
void(CEF_CALLBACK* notify_screen_info_changed)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -544,29 +568,34 @@ typedef struct _cef_browser_host_t {
|
|||||||
// asynchronously. This function is only used when window rendering is
|
// asynchronously. This function is only used when window rendering is
|
||||||
// disabled.
|
// disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *invalidate)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* invalidate)(struct _cef_browser_host_t* self,
|
||||||
cef_paint_element_type_t type);
|
cef_paint_element_type_t type);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Send a key event to the browser.
|
// Send a key event to the browser.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *send_key_event)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* send_key_event)(struct _cef_browser_host_t* self,
|
||||||
const struct _cef_key_event_t* event);
|
const struct _cef_key_event_t* event);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Send a mouse click event to the browser. The |x| and |y| coordinates are
|
// Send a mouse click event to the browser. The |x| and |y| coordinates are
|
||||||
// relative to the upper-left corner of the view.
|
// relative to the upper-left corner of the view.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* send_mouse_click_event)(
|
||||||
const struct _cef_mouse_event_t* event, cef_mouse_button_type_t type,
|
struct _cef_browser_host_t* self,
|
||||||
int mouseUp, int clickCount);
|
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
|
// Send a mouse move event to the browser. The |x| and |y| coordinates are
|
||||||
// relative to the upper-left corner of the view.
|
// relative to the upper-left corner of the view.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* send_mouse_move_event)(
|
||||||
const struct _cef_mouse_event_t* event, int mouseLeave);
|
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
|
// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
|
||||||
@@ -575,26 +604,28 @@ typedef struct _cef_browser_host_t {
|
|||||||
// In order to scroll inside select popups with window rendering disabled
|
// In order to scroll inside select popups with window rendering disabled
|
||||||
// cef_render_handler_t::GetScreenPoint should be implemented properly.
|
// cef_render_handler_t::GetScreenPoint should be implemented properly.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* send_mouse_wheel_event)(
|
||||||
const struct _cef_mouse_event_t* event, int deltaX, int deltaY);
|
struct _cef_browser_host_t* self,
|
||||||
|
const struct _cef_mouse_event_t* event,
|
||||||
|
int deltaX,
|
||||||
|
int deltaY);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Send a focus event to the browser.
|
// Send a focus event to the browser.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *send_focus_event)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* send_focus_event)(struct _cef_browser_host_t* self,
|
||||||
int setFocus);
|
int setFocus);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Send a capture lost event to the browser.
|
// Send a capture lost event to the browser.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *send_capture_lost_event)(
|
void(CEF_CALLBACK* send_capture_lost_event)(struct _cef_browser_host_t* self);
|
||||||
struct _cef_browser_host_t* self);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Notify the browser that the window hosting it is about to be moved or
|
// Notify the browser that the window hosting it is about to be moved or
|
||||||
// resized. This function is only used on Windows and Linux.
|
// resized. This function is only used on Windows and Linux.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *notify_move_or_resize_started)(
|
void(CEF_CALLBACK* notify_move_or_resize_started)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -604,7 +635,7 @@ typedef struct _cef_browser_host_t {
|
|||||||
// requested rate. The minimum value is 1 and the maximum value is 60 (default
|
// requested rate. The minimum value is 1 and the maximum value is 60 (default
|
||||||
// 30). This function can only be called on the UI thread.
|
// 30). This function can only be called on the UI thread.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_windowless_frame_rate)(
|
int(CEF_CALLBACK* get_windowless_frame_rate)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -614,28 +645,71 @@ typedef struct _cef_browser_host_t {
|
|||||||
// minimum value is 1 and the maximum value is 60 (default 30). Can also be
|
// minimum value is 1 and the maximum value is 60 (default 30). Can also be
|
||||||
// set at browser creation via cef_browser_tSettings.windowless_frame_rate.
|
// set at browser creation via cef_browser_tSettings.windowless_frame_rate.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_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);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the NSTextInputContext implementation for enabling IME on Mac when
|
// Begins a new composition or updates the existing composition. Blink has a
|
||||||
// window rendering is disabled.
|
// special node (a composition node) that allows the input function to change
|
||||||
|
// text without affecting other DOM nodes. |text| is the optional text that
|
||||||
|
// will be inserted into the composition node. |underlines| is an optional set
|
||||||
|
// of ranges that will be underlined in the resulting text.
|
||||||
|
// |replacement_range| is an optional range of the existing text that will be
|
||||||
|
// replaced. |selection_range| is an optional range of the resulting text that
|
||||||
|
// will be selected after insertion or replacement. The |replacement_range|
|
||||||
|
// value is only used on OS X.
|
||||||
|
//
|
||||||
|
// This function may be called multiple times as the composition changes. When
|
||||||
|
// the client is done making changes the composition should either be canceled
|
||||||
|
// or completed. To cancel the composition call ImeCancelComposition. To
|
||||||
|
// complete the composition call either ImeCommitText or
|
||||||
|
// ImeFinishComposingText. Completion is usually signaled when:
|
||||||
|
// A. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR
|
||||||
|
// flag (on Windows), or;
|
||||||
|
// B. The client receives a "commit" signal of GtkIMContext (on Linux), or;
|
||||||
|
// C. insertText of NSTextInput is called (on Mac).
|
||||||
|
//
|
||||||
|
// This function is only used when window rendering is disabled.
|
||||||
///
|
///
|
||||||
cef_text_input_context_t (CEF_CALLBACK *get_nstext_input_context)(
|
void(CEF_CALLBACK* ime_set_composition)(
|
||||||
struct _cef_browser_host_t* self);
|
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);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Handles a keyDown event prior to passing it through the NSTextInputClient
|
// Completes the existing composition by optionally inserting the specified
|
||||||
// machinery.
|
// |text| into the composition node. |replacement_range| is an optional range
|
||||||
|
// of the existing text that will be replaced. |relative_cursor_pos| is where
|
||||||
|
// the cursor will be positioned relative to the current cursor position. See
|
||||||
|
// comments on ImeSetComposition for usage. The |replacement_range| and
|
||||||
|
// |relative_cursor_pos| values are only used on OS X. This function is only
|
||||||
|
// used when window rendering is disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *handle_key_event_before_text_input_client)(
|
void(CEF_CALLBACK* ime_commit_text)(struct _cef_browser_host_t* self,
|
||||||
struct _cef_browser_host_t* self, cef_event_handle_t keyEvent);
|
const cef_string_t* text,
|
||||||
|
const cef_range_t* replacement_range,
|
||||||
|
int relative_cursor_pos);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Performs any additional actions after NSTextInputClient handles the event.
|
// Completes the existing composition by applying the current composition node
|
||||||
|
// contents. If |keep_selection| is false (0) the current selection, if any,
|
||||||
|
// will be discarded. See comments on ImeSetComposition for usage. This
|
||||||
|
// function is only used when window rendering is disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *handle_key_event_after_text_input_client)(
|
void(CEF_CALLBACK* ime_finish_composing_text)(
|
||||||
struct _cef_browser_host_t* self, cef_event_handle_t keyEvent);
|
struct _cef_browser_host_t* self,
|
||||||
|
int keep_selection);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Cancels the existing composition and discards the composition node contents
|
||||||
|
// without applying them. See comments on ImeSetComposition for usage. This
|
||||||
|
// function is only used when window rendering is disabled.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* ime_cancel_composition)(struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Call this function when the user drags the mouse into the web view (before
|
// Call this function when the user drags the mouse into the web view (before
|
||||||
@@ -646,7 +720,8 @@ typedef struct _cef_browser_host_t {
|
|||||||
// cef_render_handler_t::StartDragging). This function is only used when
|
// cef_render_handler_t::StartDragging). This function is only used when
|
||||||
// window rendering is disabled.
|
// 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,
|
struct _cef_drag_data_t* drag_data,
|
||||||
const struct _cef_mouse_event_t* event,
|
const struct _cef_mouse_event_t* event,
|
||||||
cef_drag_operations_mask_t allowed_ops);
|
cef_drag_operations_mask_t allowed_ops);
|
||||||
@@ -657,7 +732,8 @@ typedef struct _cef_browser_host_t {
|
|||||||
// DragTargetDragLeave/DragTargetDrop). This function is only used when window
|
// DragTargetDragLeave/DragTargetDrop). This function is only used when window
|
||||||
// rendering is disabled.
|
// 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,
|
const struct _cef_mouse_event_t* event,
|
||||||
cef_drag_operations_mask_t allowed_ops);
|
cef_drag_operations_mask_t allowed_ops);
|
||||||
|
|
||||||
@@ -666,7 +742,7 @@ typedef struct _cef_browser_host_t {
|
|||||||
// calling DragTargetDragEnter). This function is only used when window
|
// calling DragTargetDragEnter). This function is only used when window
|
||||||
// rendering is disabled.
|
// rendering is disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *drag_target_drag_leave)(struct _cef_browser_host_t* self);
|
void(CEF_CALLBACK* drag_target_drag_leave)(struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Call this function when the user completes the drag operation by dropping
|
// Call this function when the user completes the drag operation by dropping
|
||||||
@@ -675,8 +751,8 @@ typedef struct _cef_browser_host_t {
|
|||||||
// DragTargetDragEnter call. This function is only used when window rendering
|
// DragTargetDragEnter call. This function is only used when window rendering
|
||||||
// is disabled.
|
// is disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *drag_target_drop)(struct _cef_browser_host_t* self,
|
void(CEF_CALLBACK* drag_target_drop)(struct _cef_browser_host_t* self,
|
||||||
const struct _cef_mouse_event_t* event);
|
const struct _cef_mouse_event_t* event);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Call this function when the drag operation started by a
|
// Call this function when the drag operation started by a
|
||||||
@@ -687,8 +763,10 @@ typedef struct _cef_browser_host_t {
|
|||||||
// DragSource* mthods. This function is only used when window rendering is
|
// DragSource* mthods. This function is only used when window rendering is
|
||||||
// disabled.
|
// disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *drag_source_ended_at)(struct _cef_browser_host_t* self,
|
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
|
// Call this function when the drag operation started by a
|
||||||
@@ -698,17 +776,68 @@ typedef struct _cef_browser_host_t {
|
|||||||
// then all DragTarget* functions should be called before DragSource* mthods.
|
// then all DragTarget* functions should be called before DragSource* mthods.
|
||||||
// This function is only used when window rendering is disabled.
|
// This function is only used when window rendering is disabled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *drag_source_system_drag_ended)(
|
void(CEF_CALLBACK* drag_source_system_drag_ended)(
|
||||||
struct _cef_browser_host_t* self);
|
struct _cef_browser_host_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the current visible navigation entry for this browser. This
|
// Returns the current visible navigation entry for this browser. This
|
||||||
// function can only be called on the UI thread.
|
// function can only be called on the UI thread.
|
||||||
///
|
///
|
||||||
struct _cef_navigation_entry_t* (CEF_CALLBACK *get_visible_navigation_entry)(
|
struct _cef_navigation_entry_t*(CEF_CALLBACK* get_visible_navigation_entry)(
|
||||||
struct _cef_browser_host_t* self);
|
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
|
// Create a new browser window using the window parameters specified by
|
||||||
@@ -718,8 +847,10 @@ typedef struct _cef_browser_host_t {
|
|||||||
// thread and will not block.
|
// thread and will not block.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_browser_host_create_browser(
|
CEF_EXPORT int cef_browser_host_create_browser(
|
||||||
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
|
const cef_window_info_t* windowInfo,
|
||||||
const cef_string_t* url, const struct _cef_browser_settings_t* settings,
|
struct _cef_client_t* client,
|
||||||
|
const cef_string_t* url,
|
||||||
|
const struct _cef_browser_settings_t* settings,
|
||||||
struct _cef_request_context_t* request_context);
|
struct _cef_request_context_t* request_context);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -728,11 +859,12 @@ CEF_EXPORT int cef_browser_host_create_browser(
|
|||||||
// used. This function can only be called on the browser process UI thread.
|
// used. This function can only be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync(
|
CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync(
|
||||||
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
|
const cef_window_info_t* windowInfo,
|
||||||
const cef_string_t* url, const struct _cef_browser_settings_t* settings,
|
struct _cef_client_t* client,
|
||||||
|
const cef_string_t* url,
|
||||||
|
const struct _cef_browser_settings_t* settings,
|
||||||
struct _cef_request_context_t* request_context);
|
struct _cef_request_context_t* request_context);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=437eae6454931ccf2687f60f8050fcf216966e09$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
|
||||||
#define 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" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to implement browser process callbacks. The functions of this
|
// Structure used to implement browser process callbacks. The functions of this
|
||||||
// structure will be called on the browser process main thread unless otherwise
|
// structure will be called on the browser process main thread unless otherwise
|
||||||
@@ -57,13 +58,13 @@ typedef struct _cef_browser_process_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the browser process UI thread immediately after the CEF context
|
// Called on the browser process UI thread immediately after the CEF context
|
||||||
// has been initialized.
|
// has been initialized.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_context_initialized)(
|
void(CEF_CALLBACK* on_context_initialized)(
|
||||||
struct _cef_browser_process_handler_t* self);
|
struct _cef_browser_process_handler_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -73,7 +74,7 @@ typedef struct _cef_browser_process_handler_t {
|
|||||||
// opportunity to modify the child process command line. Do not keep a
|
// opportunity to modify the child process command line. Do not keep a
|
||||||
// reference to |command_line| outside of this function.
|
// reference to |command_line| outside of this function.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_before_child_process_launch)(
|
void(CEF_CALLBACK* on_before_child_process_launch)(
|
||||||
struct _cef_browser_process_handler_t* self,
|
struct _cef_browser_process_handler_t* self,
|
||||||
struct _cef_command_line_t* command_line);
|
struct _cef_command_line_t* command_line);
|
||||||
|
|
||||||
@@ -84,7 +85,7 @@ typedef struct _cef_browser_process_handler_t {
|
|||||||
// cef_render_process_handler_t::on_render_thread_created() in the render
|
// cef_render_process_handler_t::on_render_thread_created() in the render
|
||||||
// process. Do not keep a reference to |extra_info| outside of this function.
|
// process. Do not keep a reference to |extra_info| outside of this function.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_render_process_thread_created)(
|
void(CEF_CALLBACK* on_render_process_thread_created)(
|
||||||
struct _cef_browser_process_handler_t* self,
|
struct _cef_browser_process_handler_t* self,
|
||||||
struct _cef_list_value_t* extra_info);
|
struct _cef_list_value_t* extra_info);
|
||||||
|
|
||||||
@@ -92,7 +93,7 @@ typedef struct _cef_browser_process_handler_t {
|
|||||||
// Return the handler for printing on Linux. If a print handler is not
|
// Return the handler for printing on Linux. If a print handler is not
|
||||||
// provided then printing will not be supported on the Linux platform.
|
// provided then printing will not be supported on the Linux platform.
|
||||||
///
|
///
|
||||||
struct _cef_print_handler_t* (CEF_CALLBACK *get_print_handler)(
|
struct _cef_print_handler_t*(CEF_CALLBACK* get_print_handler)(
|
||||||
struct _cef_browser_process_handler_t* self);
|
struct _cef_browser_process_handler_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -108,11 +109,11 @@ typedef struct _cef_browser_process_handler_t {
|
|||||||
// specified delay and any currently pending scheduled call should be
|
// specified delay and any currently pending scheduled call should be
|
||||||
// cancelled.
|
// cancelled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_schedule_message_pump_work)(
|
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;
|
} cef_browser_process_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=41c1f253d23f062f96debd7184f3b5e5dac03a89$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Generic callback structure used for asynchronous continuation.
|
// Generic callback structure used for asynchronous continuation.
|
||||||
///
|
///
|
||||||
@@ -52,20 +53,19 @@ typedef struct _cef_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Continue processing.
|
// Continue processing.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cont)(struct _cef_callback_t* self);
|
void(CEF_CALLBACK* cont)(struct _cef_callback_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Cancel processing.
|
// Cancel processing.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cancel)(struct _cef_callback_t* self);
|
void(CEF_CALLBACK* cancel)(struct _cef_callback_t* self);
|
||||||
} cef_callback_t;
|
} cef_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Generic callback structure used for asynchronous completion.
|
// Generic callback structure used for asynchronous completion.
|
||||||
///
|
///
|
||||||
@@ -73,15 +73,14 @@ typedef struct _cef_completion_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Method that will be called once the task is complete.
|
// Method that will be called once the task is complete.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_complete)(struct _cef_completion_callback_t* self);
|
void(CEF_CALLBACK* on_complete)(struct _cef_completion_callback_t* self);
|
||||||
} cef_completion_callback_t;
|
} cef_completion_callback_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=2a93a2e7a17c81d39ad1b8c1c1aa93d5d90b1100$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||||
@@ -59,7 +61,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to provide handler implementations.
|
// Implement this structure to provide handler implementations.
|
||||||
///
|
///
|
||||||
@@ -67,95 +68,95 @@ typedef struct _cef_client_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for context menus. If no handler is provided the default
|
// Return the handler for context menus. If no handler is provided the default
|
||||||
// implementation will be used.
|
// implementation will be used.
|
||||||
///
|
///
|
||||||
struct _cef_context_menu_handler_t* (CEF_CALLBACK *get_context_menu_handler)(
|
struct _cef_context_menu_handler_t*(CEF_CALLBACK* get_context_menu_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for dialogs. If no handler is provided the default
|
// Return the handler for dialogs. If no handler is provided the default
|
||||||
// implementation will be used.
|
// implementation will be used.
|
||||||
///
|
///
|
||||||
struct _cef_dialog_handler_t* (CEF_CALLBACK *get_dialog_handler)(
|
struct _cef_dialog_handler_t*(CEF_CALLBACK* get_dialog_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for browser display state events.
|
// Return the handler for browser display state events.
|
||||||
///
|
///
|
||||||
struct _cef_display_handler_t* (CEF_CALLBACK *get_display_handler)(
|
struct _cef_display_handler_t*(CEF_CALLBACK* get_display_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for download events. If no handler is returned downloads
|
// Return the handler for download events. If no handler is returned downloads
|
||||||
// will not be allowed.
|
// will not be allowed.
|
||||||
///
|
///
|
||||||
struct _cef_download_handler_t* (CEF_CALLBACK *get_download_handler)(
|
struct _cef_download_handler_t*(CEF_CALLBACK* get_download_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for drag events.
|
// Return the handler for drag events.
|
||||||
///
|
///
|
||||||
struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)(
|
struct _cef_drag_handler_t*(CEF_CALLBACK* get_drag_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for find result events.
|
// Return the handler for find result events.
|
||||||
///
|
///
|
||||||
struct _cef_find_handler_t* (CEF_CALLBACK *get_find_handler)(
|
struct _cef_find_handler_t*(CEF_CALLBACK* get_find_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for focus events.
|
// Return the handler for focus events.
|
||||||
///
|
///
|
||||||
struct _cef_focus_handler_t* (CEF_CALLBACK *get_focus_handler)(
|
struct _cef_focus_handler_t*(CEF_CALLBACK* get_focus_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for geolocation permissions requests. If no handler is
|
// Return the handler for geolocation permissions requests. If no handler is
|
||||||
// provided geolocation access will be denied by default.
|
// provided geolocation access will be denied by default.
|
||||||
///
|
///
|
||||||
struct _cef_geolocation_handler_t* (CEF_CALLBACK *get_geolocation_handler)(
|
struct _cef_geolocation_handler_t*(CEF_CALLBACK* get_geolocation_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for JavaScript dialogs. If no handler is provided the
|
// Return the handler for JavaScript dialogs. If no handler is provided the
|
||||||
// default implementation will be used.
|
// default implementation will be used.
|
||||||
///
|
///
|
||||||
struct _cef_jsdialog_handler_t* (CEF_CALLBACK *get_jsdialog_handler)(
|
struct _cef_jsdialog_handler_t*(CEF_CALLBACK* get_jsdialog_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for keyboard events.
|
// Return the handler for keyboard events.
|
||||||
///
|
///
|
||||||
struct _cef_keyboard_handler_t* (CEF_CALLBACK *get_keyboard_handler)(
|
struct _cef_keyboard_handler_t*(CEF_CALLBACK* get_keyboard_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for browser life span events.
|
// Return the handler for browser life span events.
|
||||||
///
|
///
|
||||||
struct _cef_life_span_handler_t* (CEF_CALLBACK *get_life_span_handler)(
|
struct _cef_life_span_handler_t*(CEF_CALLBACK* get_life_span_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for browser load status events.
|
// Return the handler for browser load status events.
|
||||||
///
|
///
|
||||||
struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)(
|
struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for off-screen rendering events.
|
// Return the handler for off-screen rendering events.
|
||||||
///
|
///
|
||||||
struct _cef_render_handler_t* (CEF_CALLBACK *get_render_handler)(
|
struct _cef_render_handler_t*(CEF_CALLBACK* get_render_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for browser request events.
|
// Return the handler for browser request events.
|
||||||
///
|
///
|
||||||
struct _cef_request_handler_t* (CEF_CALLBACK *get_request_handler)(
|
struct _cef_request_handler_t*(CEF_CALLBACK* get_request_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -163,12 +164,13 @@ typedef struct _cef_client_t {
|
|||||||
// (1) if the message was handled or false (0) otherwise. Do not keep a
|
// (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.
|
// reference to or attempt to access the message outside of this callback.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_process_message_received)(struct _cef_client_t* self,
|
int(CEF_CALLBACK* on_process_message_received)(
|
||||||
struct _cef_browser_t* browser, cef_process_id_t source_process,
|
struct _cef_client_t* self,
|
||||||
|
struct _cef_browser_t* browser,
|
||||||
|
cef_process_id_t source_process,
|
||||||
struct _cef_process_message_t* message);
|
struct _cef_process_message_t* message);
|
||||||
} cef_client_t;
|
} cef_client_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=4e9afcf5b6d90535ea4b98c3493e242244373f9e$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to create and/or parse command line arguments. Arguments with
|
// Structure used to create and/or parse command line arguments. Arguments with
|
||||||
// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
|
// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
|
||||||
@@ -59,24 +60,24 @@ typedef struct _cef_command_line_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
// if this function returns false (0).
|
// if this function returns false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_valid)(struct _cef_command_line_t* self);
|
int(CEF_CALLBACK* is_valid)(struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||||
// expose read-only objects.
|
// expose read-only objects.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_read_only)(struct _cef_command_line_t* self);
|
int(CEF_CALLBACK* is_read_only)(struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns a writable copy of this object.
|
// Returns a writable copy of this object.
|
||||||
///
|
///
|
||||||
struct _cef_command_line_t* (CEF_CALLBACK *copy)(
|
struct _cef_command_line_t*(CEF_CALLBACK* copy)(
|
||||||
struct _cef_command_line_t* self);
|
struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -84,116 +85,117 @@ typedef struct _cef_command_line_t {
|
|||||||
// The first argument must be the name of the program. This function is only
|
// The first argument must be the name of the program. This function is only
|
||||||
// supported on non-Windows platforms.
|
// supported on non-Windows platforms.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *init_from_argv)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* init_from_argv)(struct _cef_command_line_t* self,
|
||||||
int argc, const char* const* argv);
|
int argc,
|
||||||
|
const char* const* argv);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Initialize the command line with the string returned by calling
|
// Initialize the command line with the string returned by calling
|
||||||
// GetCommandLineW(). This function is only supported on Windows.
|
// GetCommandLineW(). This function is only supported on Windows.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *init_from_string)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* init_from_string)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* command_line);
|
const cef_string_t* command_line);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Reset the command-line switches and arguments but leave the program
|
// Reset the command-line switches and arguments but leave the program
|
||||||
// component unchanged.
|
// component unchanged.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *reset)(struct _cef_command_line_t* self);
|
void(CEF_CALLBACK* reset)(struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieve the original command line string as a vector of strings. The argv
|
// Retrieve the original command line string as a vector of strings. The argv
|
||||||
// array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* }
|
// array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* }
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_argv)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* get_argv)(struct _cef_command_line_t* self,
|
||||||
cef_string_list_t argv);
|
cef_string_list_t argv);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Constructs and returns the represented command line string. Use this
|
// Constructs and returns the represented command line string. Use this
|
||||||
// function cautiously because quoting behavior is unclear.
|
// function cautiously because quoting behavior is unclear.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_command_line_string)(
|
cef_string_userfree_t(CEF_CALLBACK* get_command_line_string)(
|
||||||
struct _cef_command_line_t* self);
|
struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the program part of the command line string (the first item).
|
// Get the program part of the command line string (the first item).
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_program)(
|
cef_string_userfree_t(CEF_CALLBACK* get_program)(
|
||||||
struct _cef_command_line_t* self);
|
struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the program part of the command line string (the first item).
|
// Set the program part of the command line string (the first item).
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_program)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* set_program)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* program);
|
const cef_string_t* program);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the command line has switches.
|
// Returns true (1) if the command line has switches.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_switches)(struct _cef_command_line_t* self);
|
int(CEF_CALLBACK* has_switches)(struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the command line contains the given switch.
|
// Returns true (1) if the command line contains the given switch.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_switch)(struct _cef_command_line_t* self,
|
int(CEF_CALLBACK* has_switch)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the value associated with the given switch. If the switch has no
|
// Returns the value associated with the given switch. If the switch has no
|
||||||
// value or isn't present this function returns the NULL string.
|
// value or isn't present this function returns the NULL string.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_switch_value)(
|
cef_string_userfree_t(CEF_CALLBACK* get_switch_value)(
|
||||||
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
|
// Returns the map of switch names and values. If a switch has no value an
|
||||||
// NULL string is returned.
|
// NULL string is returned.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_switches)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* get_switches)(struct _cef_command_line_t* self,
|
||||||
cef_string_map_t switches);
|
cef_string_map_t switches);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add a switch to the end of the command line. If the switch has no value
|
// Add a switch to the end of the command line. If the switch has no value
|
||||||
// pass an NULL value string.
|
// pass an NULL value string.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *append_switch)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* append_switch)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add a switch with the specified value to the end of the command line.
|
// Add a switch with the specified value to the end of the command line.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *append_switch_with_value)(
|
void(CEF_CALLBACK* append_switch_with_value)(struct _cef_command_line_t* self,
|
||||||
struct _cef_command_line_t* self, const cef_string_t* name,
|
const cef_string_t* name,
|
||||||
const cef_string_t* value);
|
const cef_string_t* value);
|
||||||
|
|
||||||
///
|
///
|
||||||
// True if there are remaining command line arguments.
|
// True if there are remaining command line arguments.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_arguments)(struct _cef_command_line_t* self);
|
int(CEF_CALLBACK* has_arguments)(struct _cef_command_line_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the remaining command line arguments.
|
// Get the remaining command line arguments.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_arguments)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* get_arguments)(struct _cef_command_line_t* self,
|
||||||
cef_string_list_t arguments);
|
cef_string_list_t arguments);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add an argument to the end of the command line.
|
// Add an argument to the end of the command line.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *append_argument)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* append_argument)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* argument);
|
const cef_string_t* argument);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Insert a command before the current command. Common for debuggers, like
|
// Insert a command before the current command. Common for debuggers, like
|
||||||
// "valgrind" or "gdb --args".
|
// "valgrind" or "gdb --args".
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *prepend_wrapper)(struct _cef_command_line_t* self,
|
void(CEF_CALLBACK* prepend_wrapper)(struct _cef_command_line_t* self,
|
||||||
const cef_string_t* wrapper);
|
const cef_string_t* wrapper);
|
||||||
} cef_command_line_t;
|
} cef_command_line_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_command_line_t instance.
|
// Create a new cef_command_line_t instance.
|
||||||
///
|
///
|
||||||
@@ -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();
|
CEF_EXPORT cef_command_line_t* cef_command_line_get_global();
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=fdd4de9c81a7b01a94aee020b2c314e519cd8e55$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
|
||||||
@@ -56,22 +58,22 @@ typedef struct _cef_run_context_menu_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Complete context menu display by selecting the specified |command_id| and
|
// Complete context menu display by selecting the specified |command_id| and
|
||||||
// |event_flags|.
|
// |event_flags|.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cont)(struct _cef_run_context_menu_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_run_context_menu_callback_t* self,
|
||||||
int command_id, cef_event_flags_t event_flags);
|
int command_id,
|
||||||
|
cef_event_flags_t event_flags);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Cancel context menu display.
|
// Cancel context menu display.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cancel)(struct _cef_run_context_menu_callback_t* self);
|
void(CEF_CALLBACK* cancel)(struct _cef_run_context_menu_callback_t* self);
|
||||||
} cef_run_context_menu_callback_t;
|
} cef_run_context_menu_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle context menu events. The functions of this
|
// Implement this structure to handle context menu events. The functions of this
|
||||||
// structure will be called on the UI thread.
|
// structure will be called on the UI thread.
|
||||||
@@ -80,7 +82,7 @@ typedef struct _cef_context_menu_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called before a context menu is displayed. |params| provides information
|
// Called before a context menu is displayed. |params| provides information
|
||||||
@@ -89,9 +91,11 @@ typedef struct _cef_context_menu_handler_t {
|
|||||||
// modified to show a custom menu. Do not keep references to |params| or
|
// modified to show a custom menu. Do not keep references to |params| or
|
||||||
// |model| outside of this callback.
|
// |model| outside of this callback.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_before_context_menu)(
|
void(CEF_CALLBACK* on_before_context_menu)(
|
||||||
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_context_menu_handler_t* self,
|
||||||
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
|
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_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
|
// selected command ID. For default display return false (0). Do not keep
|
||||||
// references to |params| or |model| outside of this callback.
|
// references to |params| or |model| outside of this callback.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *run_context_menu)(struct _cef_context_menu_handler_t* self,
|
int(CEF_CALLBACK* run_context_menu)(
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
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_params_t* params,
|
||||||
struct _cef_menu_model_t* model,
|
struct _cef_menu_model_t* model,
|
||||||
struct _cef_run_context_menu_callback_t* callback);
|
struct _cef_run_context_menu_callback_t* callback);
|
||||||
@@ -117,21 +123,24 @@ typedef struct _cef_context_menu_handler_t {
|
|||||||
// on_before_context_menu(). Do not keep a reference to |params| outside of
|
// on_before_context_menu(). Do not keep a reference to |params| outside of
|
||||||
// this callback.
|
// this callback.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_context_menu_command)(
|
int(CEF_CALLBACK* on_context_menu_command)(
|
||||||
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_context_menu_handler_t* self,
|
||||||
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
|
struct _cef_browser_t* browser,
|
||||||
int command_id, cef_event_flags_t event_flags);
|
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
|
// Called when the context menu is dismissed irregardless of whether the menu
|
||||||
// was NULL or a command was selected.
|
// was NULL or a command was selected.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_context_menu_dismissed)(
|
void(CEF_CALLBACK* on_context_menu_dismissed)(
|
||||||
struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_context_menu_handler_t* self,
|
||||||
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_frame_t* frame);
|
struct _cef_frame_t* frame);
|
||||||
} cef_context_menu_handler_t;
|
} cef_context_menu_handler_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Provides information about the context menu state. The ethods of this
|
// Provides information about the context menu state. The ethods of this
|
||||||
// structure can only be accessed on browser process the UI thread.
|
// structure can only be accessed on browser process the UI thread.
|
||||||
@@ -140,25 +149,25 @@ typedef struct _cef_context_menu_params_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the X coordinate of the mouse where the context menu was invoked.
|
// Returns the X coordinate of the mouse where the context menu was invoked.
|
||||||
// Coords are relative to the associated RenderView's origin.
|
// Coords are relative to the associated RenderView's origin.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_xcoord)(struct _cef_context_menu_params_t* self);
|
int(CEF_CALLBACK* get_xcoord)(struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the Y coordinate of the mouse where the context menu was invoked.
|
// Returns the Y coordinate of the mouse where the context menu was invoked.
|
||||||
// Coords are relative to the associated RenderView's origin.
|
// Coords are relative to the associated RenderView's origin.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_ycoord)(struct _cef_context_menu_params_t* self);
|
int(CEF_CALLBACK* get_ycoord)(struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns flags representing the type of node that the context menu was
|
// Returns flags representing the type of node that the context menu was
|
||||||
// invoked on.
|
// invoked on.
|
||||||
///
|
///
|
||||||
cef_context_menu_type_flags_t (CEF_CALLBACK *get_type_flags)(
|
cef_context_menu_type_flags_t(CEF_CALLBACK* get_type_flags)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -166,7 +175,7 @@ typedef struct _cef_context_menu_params_t {
|
|||||||
// context menu was invoked on.
|
// context menu was invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_link_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_link_url)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -174,7 +183,7 @@ typedef struct _cef_context_menu_params_t {
|
|||||||
// don't validate this field in the frontend process.
|
// don't validate this field in the frontend process.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_unfiltered_link_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_unfiltered_link_url)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -182,28 +191,36 @@ typedef struct _cef_context_menu_params_t {
|
|||||||
// invoked on. Example of elements with source URLs are img, audio, and video.
|
// invoked on. Example of elements with source URLs are img, audio, and video.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_source_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_source_url)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the context menu was invoked on an image which has non-
|
// Returns true (1) if the context menu was invoked on an image which has non-
|
||||||
// NULL contents.
|
// NULL contents.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_image_contents)(
|
int(CEF_CALLBACK* has_image_contents)(
|
||||||
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the title text or the alt text if the context menu was invoked on
|
||||||
|
// an image.
|
||||||
|
///
|
||||||
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
|
cef_string_userfree_t(CEF_CALLBACK* get_title_text)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the URL of the top level page that the context menu was invoked on.
|
// Returns the URL of the top level page that the context menu was invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_page_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_page_url)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the URL of the subframe that the context menu was invoked on.
|
// Returns the URL of the subframe that the context menu was invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_frame_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_frame_url)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -211,20 +228,20 @@ typedef struct _cef_context_menu_params_t {
|
|||||||
// invoked on.
|
// invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_frame_charset)(
|
cef_string_userfree_t(CEF_CALLBACK* get_frame_charset)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the type of context node that the context menu was invoked on.
|
// Returns the type of context node that the context menu was invoked on.
|
||||||
///
|
///
|
||||||
cef_context_menu_media_type_t (CEF_CALLBACK *get_media_type)(
|
cef_context_menu_media_type_t(CEF_CALLBACK* get_media_type)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns flags representing the actions supported by the media element, if
|
// Returns flags representing the actions supported by the media element, if
|
||||||
// any, that the context menu was invoked on.
|
// any, that the context menu was invoked on.
|
||||||
///
|
///
|
||||||
cef_context_menu_media_state_flags_t (CEF_CALLBACK *get_media_state_flags)(
|
cef_context_menu_media_state_flags_t(CEF_CALLBACK* get_media_state_flags)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -232,7 +249,7 @@ typedef struct _cef_context_menu_params_t {
|
|||||||
// invoked on.
|
// invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_selection_text)(
|
cef_string_userfree_t(CEF_CALLBACK* get_selection_text)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -240,7 +257,7 @@ typedef struct _cef_context_menu_params_t {
|
|||||||
// invoked on.
|
// invoked on.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_misspelled_word)(
|
cef_string_userfree_t(CEF_CALLBACK* get_misspelled_word)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -248,26 +265,27 @@ typedef struct _cef_context_menu_params_t {
|
|||||||
// |suggestions| from the spell check service for the misspelled word if there
|
// |suggestions| from the spell check service for the misspelled word if there
|
||||||
// is one.
|
// is one.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_dictionary_suggestions)(
|
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.
|
// Returns true (1) if the context menu was invoked on an editable node.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_editable)(struct _cef_context_menu_params_t* self);
|
int(CEF_CALLBACK* is_editable)(struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the context menu was invoked on an editable node where
|
// Returns true (1) if the context menu was invoked on an editable node where
|
||||||
// spell-check is enabled.
|
// spell-check is enabled.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_spell_check_enabled)(
|
int(CEF_CALLBACK* is_spell_check_enabled)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns flags representing the actions supported by the editable node, if
|
// Returns flags representing the actions supported by the editable node, if
|
||||||
// any, that the context menu was invoked on.
|
// any, that the context menu was invoked on.
|
||||||
///
|
///
|
||||||
cef_context_menu_edit_state_flags_t (CEF_CALLBACK *get_edit_state_flags)(
|
cef_context_menu_edit_state_flags_t(CEF_CALLBACK* get_edit_state_flags)(
|
||||||
struct _cef_context_menu_params_t* self);
|
struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -275,15 +293,14 @@ typedef struct _cef_context_menu_params_t {
|
|||||||
// renderer process (for example, plugin placeholder or pepper plugin menu
|
// renderer process (for example, plugin placeholder or pepper plugin menu
|
||||||
// items).
|
// items).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_custom_menu)(struct _cef_context_menu_params_t* self);
|
int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the context menu was invoked from a pepper plugin.
|
// Returns true (1) if the context menu was invoked from a pepper plugin.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_pepper_menu)(struct _cef_context_menu_params_t* self);
|
int(CEF_CALLBACK* is_pepper_menu)(struct _cef_context_menu_params_t* self);
|
||||||
} cef_context_menu_params_t;
|
} cef_context_menu_params_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=e0605a0c9918e225b9282b6d5e6138a7d697945b$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||||
@@ -57,7 +59,7 @@ typedef struct _cef_cookie_manager_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the schemes supported by this manager. The default schemes ("http",
|
// Set the schemes supported by this manager. The default schemes ("http",
|
||||||
@@ -65,16 +67,18 @@ typedef struct _cef_cookie_manager_t {
|
|||||||
// NULL it will be executed asnychronously on the IO thread after the change
|
// NULL it will be executed asnychronously on the IO thread after the change
|
||||||
// has been applied. Must be called before any cookies are accessed.
|
// has been applied. Must be called before any cookies are accessed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_supported_schemes)(struct _cef_cookie_manager_t* self,
|
void(CEF_CALLBACK* set_supported_schemes)(
|
||||||
cef_string_list_t schemes, struct _cef_completion_callback_t* callback);
|
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
|
// Visit all cookies on the IO thread. The returned cookies are ordered by
|
||||||
// longest path, then by earliest creation date. Returns false (0) if cookies
|
// longest path, then by earliest creation date. Returns false (0) if cookies
|
||||||
// cannot be accessed.
|
// cannot be accessed.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *visit_all_cookies)(struct _cef_cookie_manager_t* self,
|
int(CEF_CALLBACK* visit_all_cookies)(struct _cef_cookie_manager_t* self,
|
||||||
struct _cef_cookie_visitor_t* visitor);
|
struct _cef_cookie_visitor_t* visitor);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Visit a subset of cookies on the IO thread. The results are filtered by the
|
// Visit a subset of cookies on the IO thread. The results are filtered by the
|
||||||
@@ -83,9 +87,10 @@ typedef struct _cef_cookie_manager_t {
|
|||||||
// cookies are ordered by longest path, then by earliest creation date.
|
// cookies are ordered by longest path, then by earliest creation date.
|
||||||
// Returns false (0) if cookies cannot be accessed.
|
// Returns false (0) if cookies cannot be accessed.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *visit_url_cookies)(struct _cef_cookie_manager_t* self,
|
int(CEF_CALLBACK* visit_url_cookies)(struct _cef_cookie_manager_t* self,
|
||||||
const cef_string_t* url, int includeHttpOnly,
|
const cef_string_t* url,
|
||||||
struct _cef_cookie_visitor_t* visitor);
|
int includeHttpOnly,
|
||||||
|
struct _cef_cookie_visitor_t* visitor);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Sets a cookie given a valid URL and explicit user-provided cookie
|
// Sets a cookie given a valid URL and explicit user-provided cookie
|
||||||
@@ -96,9 +101,10 @@ typedef struct _cef_cookie_manager_t {
|
|||||||
// asnychronously on the IO thread after the cookie has been set. Returns
|
// asnychronously on the IO thread after the cookie has been set. Returns
|
||||||
// false (0) if an invalid URL is specified or if cookies cannot be accessed.
|
// false (0) if an invalid URL is specified or if cookies cannot be accessed.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_cookie)(struct _cef_cookie_manager_t* self,
|
int(CEF_CALLBACK* set_cookie)(struct _cef_cookie_manager_t* self,
|
||||||
const cef_string_t* url, const struct _cef_cookie_t* cookie,
|
const cef_string_t* url,
|
||||||
struct _cef_set_cookie_callback_t* callback);
|
const struct _cef_cookie_t* cookie,
|
||||||
|
struct _cef_set_cookie_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Delete all cookies that match the specified parameters. If both |url| and
|
// Delete all cookies that match the specified parameters. If both |url| and
|
||||||
@@ -111,8 +117,10 @@ typedef struct _cef_cookie_manager_t {
|
|||||||
// or if cookies cannot be accessed. Cookies can alternately be deleted using
|
// or if cookies cannot be accessed. Cookies can alternately be deleted using
|
||||||
// the Visit*Cookies() functions.
|
// the Visit*Cookies() functions.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *delete_cookies)(struct _cef_cookie_manager_t* self,
|
int(CEF_CALLBACK* delete_cookies)(
|
||||||
const cef_string_t* url, const cef_string_t* cookie_name,
|
struct _cef_cookie_manager_t* self,
|
||||||
|
const cef_string_t* url,
|
||||||
|
const cef_string_t* cookie_name,
|
||||||
struct _cef_delete_cookies_callback_t* callback);
|
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
|
// asnychronously on the IO thread after the manager's storage has been
|
||||||
// initialized. Returns false (0) if cookies cannot be accessed.
|
// initialized. Returns false (0) if cookies cannot be accessed.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_storage_path)(struct _cef_cookie_manager_t* self,
|
int(CEF_CALLBACK* set_storage_path)(
|
||||||
const cef_string_t* path, int persist_session_cookies,
|
struct _cef_cookie_manager_t* self,
|
||||||
|
const cef_string_t* path,
|
||||||
|
int persist_session_cookies,
|
||||||
struct _cef_completion_callback_t* callback);
|
struct _cef_completion_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -134,11 +144,10 @@ typedef struct _cef_cookie_manager_t {
|
|||||||
// be executed asnychronously on the IO thread after the flush is complete.
|
// be executed asnychronously on the IO thread after the flush is complete.
|
||||||
// Returns false (0) if cookies cannot be accessed.
|
// Returns false (0) if cookies cannot be accessed.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *flush_store)(struct _cef_cookie_manager_t* self,
|
int(CEF_CALLBACK* flush_store)(struct _cef_cookie_manager_t* self,
|
||||||
struct _cef_completion_callback_t* callback);
|
struct _cef_completion_callback_t* callback);
|
||||||
} cef_cookie_manager_t;
|
} cef_cookie_manager_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the global cookie manager. By default data will be stored at
|
// Returns the global cookie manager. By default data will be stored at
|
||||||
// CefSettings.cache_path if specified or in memory otherwise. If |callback| is
|
// CefSettings.cache_path if specified or in memory otherwise. If |callback| is
|
||||||
@@ -160,10 +169,10 @@ CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
|||||||
// manager's storage has been initialized.
|
// manager's storage has been initialized.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager(
|
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);
|
struct _cef_completion_callback_t* callback);
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure to implement for visiting cookie values. The functions of this
|
// Structure to implement for visiting cookie values. The functions of this
|
||||||
// structure will always be called on the IO thread.
|
// structure will always be called on the IO thread.
|
||||||
@@ -172,7 +181,7 @@ typedef struct _cef_cookie_visitor_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Method that will be called once for each cookie. |count| is the 0-based
|
// Method that will be called once for each cookie. |count| is the 0-based
|
||||||
@@ -181,12 +190,13 @@ typedef struct _cef_cookie_visitor_t {
|
|||||||
// Return false (0) to stop visiting cookies. This function may never be
|
// Return false (0) to stop visiting cookies. This function may never be
|
||||||
// called if no cookies are found.
|
// called if no cookies are found.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *visit)(struct _cef_cookie_visitor_t* self,
|
int(CEF_CALLBACK* visit)(struct _cef_cookie_visitor_t* self,
|
||||||
const struct _cef_cookie_t* cookie, int count, int total,
|
const struct _cef_cookie_t* cookie,
|
||||||
int* deleteCookie);
|
int count,
|
||||||
|
int total,
|
||||||
|
int* deleteCookie);
|
||||||
} cef_cookie_visitor_t;
|
} cef_cookie_visitor_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure to implement to be notified of asynchronous completion via
|
// Structure to implement to be notified of asynchronous completion via
|
||||||
// cef_cookie_manager_t::set_cookie().
|
// cef_cookie_manager_t::set_cookie().
|
||||||
@@ -195,17 +205,16 @@ typedef struct _cef_set_cookie_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Method that will be called upon completion. |success| will be true (1) if
|
// Method that will be called upon completion. |success| will be true (1) if
|
||||||
// the cookie was set successfully.
|
// the cookie was set successfully.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_complete)(struct _cef_set_cookie_callback_t* self,
|
void(CEF_CALLBACK* on_complete)(struct _cef_set_cookie_callback_t* self,
|
||||||
int success);
|
int success);
|
||||||
} cef_set_cookie_callback_t;
|
} cef_set_cookie_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure to implement to be notified of asynchronous completion via
|
// Structure to implement to be notified of asynchronous completion via
|
||||||
// cef_cookie_manager_t::delete_cookies().
|
// cef_cookie_manager_t::delete_cookies().
|
||||||
@@ -214,17 +223,16 @@ typedef struct _cef_delete_cookies_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Method that will be called upon completion. |num_deleted| will be the
|
// Method that will be called upon completion. |num_deleted| will be the
|
||||||
// number of cookies that were deleted or -1 if unknown.
|
// number of cookies that were deleted or -1 if unknown.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_complete)(struct _cef_delete_cookies_callback_t* self,
|
void(CEF_CALLBACK* on_complete)(struct _cef_delete_cookies_callback_t* self,
|
||||||
int num_deleted);
|
int num_deleted);
|
||||||
} cef_delete_cookies_callback_t;
|
} cef_delete_cookies_callback_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
153
include/capi/cef_crash_util_capi.h
Normal file
153
include/capi/cef_crash_util_capi.h
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
// 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=0a8f009404aedce3f63f83864f754df60c36b293$
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
|
||||||
|
#define CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/capi/cef_base_capi.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
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
|
||||||
|
// the main application executable. On macOS this file must be placed in the
|
||||||
|
// top-level app bundle Resources directory (e.g.
|
||||||
|
// "<appname>.app/Contents/Resources"). File contents are as follows:
|
||||||
|
//
|
||||||
|
// # Comments start with a hash character and must be on their own line.
|
||||||
|
//
|
||||||
|
// [Config]
|
||||||
|
// ProductName=<Value of the "prod" crash key; defaults to "cef">
|
||||||
|
// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
|
||||||
|
// AppName=<Windows only; App-specific folder name component for storing crash
|
||||||
|
// information; default to "CEF">
|
||||||
|
// ExternalHandler=<Windows only; Name of the external handler exe to use
|
||||||
|
// instead of re-launching the main exe; default to empty>
|
||||||
|
// BrowserCrashForwardingEnabled=<macOS only; True if browser process crashes
|
||||||
|
// should be forwarded to the system crash
|
||||||
|
// reporter; default to false>
|
||||||
|
// ServerURL=<crash server URL; default to empty>
|
||||||
|
// RateLimitEnabled=<True if uploads should be rate limited; default to true>
|
||||||
|
// MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled;
|
||||||
|
// default to 5>
|
||||||
|
// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value
|
||||||
|
// will cause older reports to be deleted; default to 20>
|
||||||
|
// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted;
|
||||||
|
// default to 5>
|
||||||
|
//
|
||||||
|
// [CrashKeys]
|
||||||
|
// my_key1=<small|medium|large>
|
||||||
|
// my_key2=<small|medium|large>
|
||||||
|
//
|
||||||
|
// Config section:
|
||||||
|
//
|
||||||
|
// If "ProductName" and/or "ProductVersion" are set then the specified values
|
||||||
|
// will be included in the crash dump metadata. On macOS if these values are set
|
||||||
|
// to NULL then they will be retrieved from the Info.plist file using the
|
||||||
|
// "CFBundleName" and "CFBundleShortVersionString" keys respectively.
|
||||||
|
//
|
||||||
|
// If "AppName" is set on Windows then crash report information (metrics,
|
||||||
|
// database and dumps) will be stored locally on disk under the
|
||||||
|
// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other
|
||||||
|
// platforms the CefSettings.user_data_path value will be used.
|
||||||
|
//
|
||||||
|
// If "ExternalHandler" is set on Windows then the specified exe will be
|
||||||
|
// launched as the crashpad-handler instead of re-launching the main process
|
||||||
|
// exe. The value can be an absolute path or a path relative to the main exe
|
||||||
|
// directory. On Linux the CefSettings.browser_subprocess_path value will be
|
||||||
|
// used. On macOS the existing subprocess app bundle will be used.
|
||||||
|
//
|
||||||
|
// If "BrowserCrashForwardingEnabled" is set to true (1) on macOS then browser
|
||||||
|
// process crashes will be forwarded to the system crash reporter. This results
|
||||||
|
// in the crash UI dialog being displayed to the user and crash reports being
|
||||||
|
// logged under "~/Library/Logs/DiagnosticReports". Forwarding of crash reports
|
||||||
|
// from non-browser processes and Debug builds is always disabled.
|
||||||
|
//
|
||||||
|
// If "ServerURL" is set then crashes will be uploaded as a multi-part POST
|
||||||
|
// request to the specified URL. Otherwise, reports will only be stored locally
|
||||||
|
// on disk.
|
||||||
|
//
|
||||||
|
// If "RateLimitEnabled" is set to true (1) then crash report uploads will be
|
||||||
|
// rate limited as follows:
|
||||||
|
// 1. If "MaxUploadsPerDay" is set to a positive value then at most the
|
||||||
|
// specified number of crashes will be uploaded in each 24 hour period.
|
||||||
|
// 2. If crash upload fails due to a network or server error then an
|
||||||
|
// incremental backoff delay up to a maximum of 24 hours will be applied for
|
||||||
|
// retries.
|
||||||
|
// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the
|
||||||
|
// "MaxUploadsPerDay" value will be reduced to 1 until the client is
|
||||||
|
// restarted. This helps to avoid an upload flood when the network or
|
||||||
|
// server error is resolved.
|
||||||
|
// Rate limiting is not supported on Linux.
|
||||||
|
//
|
||||||
|
// If "MaxDatabaseSizeInMb" is set to a positive value then crash report storage
|
||||||
|
// on disk will be limited to that size in megabytes. For example, on Windows
|
||||||
|
// each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 equates to
|
||||||
|
// about 34 crash reports stored on disk. Not supported on Linux.
|
||||||
|
//
|
||||||
|
// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports older
|
||||||
|
// than the specified age in days will be deleted. Not supported on Linux.
|
||||||
|
//
|
||||||
|
// CrashKeys section:
|
||||||
|
//
|
||||||
|
// Any number of crash keys can be specified for use by the application. Crash
|
||||||
|
// key values will be truncated based on the specified size (small = 63 bytes,
|
||||||
|
// medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set
|
||||||
|
// from any thread or process using the CefSetCrashKeyValue function. These
|
||||||
|
// key/value pairs will be sent to the crash server along with the crash dump
|
||||||
|
// file. Medium and large values will be chunked for submission. For example, if
|
||||||
|
// your key is named "mykey" then the value will be broken into ordered chunks
|
||||||
|
// and submitted using keys named "mykey-1", "mykey-2", etc.
|
||||||
|
///
|
||||||
|
CEF_EXPORT int cef_crash_reporting_enabled();
|
||||||
|
|
||||||
|
///
|
||||||
|
// Sets or clears a specific key-value pair from the crash metadata.
|
||||||
|
///
|
||||||
|
CEF_EXPORT void cef_set_crash_key_value(const cef_string_t* key,
|
||||||
|
const cef_string_t* value);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=ddf4110dadc49faf08ac2744d851511c41ca403f$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
|
||||||
@@ -45,7 +47,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure for asynchronous continuation of file dialog requests.
|
// Callback structure for asynchronous continuation of file dialog requests.
|
||||||
///
|
///
|
||||||
@@ -53,7 +54,7 @@ typedef struct _cef_file_dialog_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Continue the file selection. |selected_accept_filter| should be the 0-based
|
// Continue the file selection. |selected_accept_filter| should be the 0-based
|
||||||
@@ -62,16 +63,16 @@ typedef struct _cef_file_dialog_callback_t {
|
|||||||
// or a list of values depending on the dialog mode. An NULL |file_paths|
|
// or a list of values depending on the dialog mode. An NULL |file_paths|
|
||||||
// value is treated the same as calling cancel().
|
// value is treated the same as calling cancel().
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cont)(struct _cef_file_dialog_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_file_dialog_callback_t* self,
|
||||||
int selected_accept_filter, cef_string_list_t file_paths);
|
int selected_accept_filter,
|
||||||
|
cef_string_list_t file_paths);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Cancel the file selection.
|
// Cancel the file selection.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cancel)(struct _cef_file_dialog_callback_t* self);
|
void(CEF_CALLBACK* cancel)(struct _cef_file_dialog_callback_t* self);
|
||||||
} cef_file_dialog_callback_t;
|
} cef_file_dialog_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle dialog events. The functions of this
|
// Implement this structure to handle dialog events. The functions of this
|
||||||
// structure will be called on the browser process UI thread.
|
// structure will be called on the browser process UI thread.
|
||||||
@@ -80,7 +81,7 @@ typedef struct _cef_dialog_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called to run a file chooser dialog. |mode| represents the type of dialog
|
// Called to run a file chooser dialog. |mode| represents the type of dialog
|
||||||
@@ -97,14 +98,17 @@ typedef struct _cef_dialog_handler_t {
|
|||||||
// return true (1) and execute |callback| either inline or at a later time. To
|
// return true (1) and execute |callback| either inline or at a later time. To
|
||||||
// display the default dialog return false (0).
|
// display the default dialog return false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_file_dialog)(struct _cef_dialog_handler_t* self,
|
int(CEF_CALLBACK* on_file_dialog)(
|
||||||
struct _cef_browser_t* browser, cef_file_dialog_mode_t mode,
|
struct _cef_dialog_handler_t* self,
|
||||||
const cef_string_t* title, const cef_string_t* default_file_path,
|
struct _cef_browser_t* browser,
|
||||||
cef_string_list_t accept_filters, int selected_accept_filter,
|
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);
|
struct _cef_file_dialog_callback_t* callback);
|
||||||
} cef_dialog_handler_t;
|
} cef_dialog_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=ab31ef5d72b4b1c9809698e5fbbdae21918af713$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||||
@@ -46,7 +48,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to browser display state.
|
// Implement this structure to handle events related to browser display state.
|
||||||
// The functions of this structure will be called on the UI thread.
|
// The functions of this structure will be called on the UI thread.
|
||||||
@@ -55,26 +56,29 @@ typedef struct _cef_display_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when a frame's address has changed.
|
// Called when a frame's address has changed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_address_change)(struct _cef_display_handler_t* self,
|
void(CEF_CALLBACK* on_address_change)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser,
|
||||||
const cef_string_t* url);
|
struct _cef_frame_t* frame,
|
||||||
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the page title changes.
|
// Called when the page title changes.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_title_change)(struct _cef_display_handler_t* self,
|
void(CEF_CALLBACK* on_title_change)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser, const cef_string_t* title);
|
struct _cef_browser_t* browser,
|
||||||
|
const cef_string_t* title);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the page icon changes.
|
// Called when the page icon changes.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_favicon_urlchange)(struct _cef_display_handler_t* self,
|
void(CEF_CALLBACK* on_favicon_urlchange)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser, 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
|
// Called when web content in the page has toggled fullscreen mode. If
|
||||||
@@ -83,8 +87,9 @@ typedef struct _cef_display_handler_t {
|
|||||||
// automatically return to its original size and position. The client is
|
// automatically return to its original size and position. The client is
|
||||||
// responsible for resizing the browser if desired.
|
// responsible for resizing the browser if desired.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_fullscreen_mode_change)(
|
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);
|
int fullscreen);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -95,25 +100,39 @@ typedef struct _cef_display_handler_t {
|
|||||||
// tooltip. When window rendering is disabled the application is responsible
|
// tooltip. When window rendering is disabled the application is responsible
|
||||||
// for drawing tooltips and the return value is ignored.
|
// for drawing tooltips and the return value is ignored.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_tooltip)(struct _cef_display_handler_t* self,
|
int(CEF_CALLBACK* on_tooltip)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser, cef_string_t* text);
|
struct _cef_browser_t* browser,
|
||||||
|
cef_string_t* text);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the browser receives a status message. |value| contains the
|
// Called when the browser receives a status message. |value| contains the
|
||||||
// text that will be displayed in the status message.
|
// text that will be displayed in the status message.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self,
|
void(CEF_CALLBACK* on_status_message)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser, 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
|
// Called to display a console message. Return true (1) to stop the message
|
||||||
// from being output to the console.
|
// from being output to the console.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self,
|
int(CEF_CALLBACK* on_console_message)(struct _cef_display_handler_t* self,
|
||||||
struct _cef_browser_t* browser, const cef_string_t* message,
|
struct _cef_browser_t* browser,
|
||||||
const cef_string_t* source, int line);
|
cef_log_severity_t level,
|
||||||
} cef_display_handler_t;
|
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);
|
||||||
|
} cef_display_handler_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=b9bef5257ecbd1933356fcc02687bf725bff9277$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
|
||||||
@@ -55,7 +57,7 @@ typedef struct _cef_domvisitor_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Method executed for visiting the DOM. The document object passed to this
|
// Method executed for visiting the DOM. The document object passed to this
|
||||||
@@ -64,11 +66,10 @@ typedef struct _cef_domvisitor_t {
|
|||||||
// keep references to or attempt to access any DOM objects outside the scope
|
// keep references to or attempt to access any DOM objects outside the scope
|
||||||
// of this function.
|
// of this function.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self,
|
void(CEF_CALLBACK* visit)(struct _cef_domvisitor_t* self,
|
||||||
struct _cef_domdocument_t* document);
|
struct _cef_domdocument_t* document);
|
||||||
} cef_domvisitor_t;
|
} cef_domvisitor_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent a DOM document. The functions of this structure
|
// Structure used to represent a DOM document. The functions of this structure
|
||||||
// should only be called on the render process main thread thread.
|
// should only be called on the render process main thread thread.
|
||||||
@@ -77,86 +78,87 @@ typedef struct _cef_domdocument_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the document type.
|
// Returns the document type.
|
||||||
///
|
///
|
||||||
cef_dom_document_type_t (CEF_CALLBACK *get_type)(
|
cef_dom_document_type_t(CEF_CALLBACK* get_type)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the root document node.
|
// Returns the root document node.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_document)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_document)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the BODY node of an HTML document.
|
// Returns the BODY node of an HTML document.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_body)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_body)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the HEAD node of an HTML document.
|
// Returns the HEAD node of an HTML document.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_head)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_head)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the title of an HTML document.
|
// Returns the title of an HTML document.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_title)(
|
cef_string_userfree_t(CEF_CALLBACK* get_title)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the document element with the specified ID value.
|
// Returns the document element with the specified ID value.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_element_by_id)(
|
||||||
struct _cef_domdocument_t* self, const cef_string_t* id);
|
struct _cef_domdocument_t* self,
|
||||||
|
const cef_string_t* id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the node that currently has keyboard focus.
|
// Returns the node that currently has keyboard focus.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_focused_node)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if a portion of the document is selected.
|
// Returns true (1) if a portion of the document is selected.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self);
|
int(CEF_CALLBACK* has_selection)(struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the selection offset within the start node.
|
// Returns the selection offset within the start node.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_selection_start_offset)(
|
int(CEF_CALLBACK* get_selection_start_offset)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the selection offset within the end node.
|
// Returns the selection offset within the end node.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self);
|
int(CEF_CALLBACK* get_selection_end_offset)(struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the contents of this selection as markup.
|
// Returns the contents of this selection as markup.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)(
|
cef_string_userfree_t(CEF_CALLBACK* get_selection_as_markup)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the contents of this selection as text.
|
// Returns the contents of this selection as text.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)(
|
cef_string_userfree_t(CEF_CALLBACK* get_selection_as_text)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the base URL for the document.
|
// Returns the base URL for the document.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_base_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_base_url)(
|
||||||
struct _cef_domdocument_t* self);
|
struct _cef_domdocument_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -164,11 +166,11 @@ typedef struct _cef_domdocument_t {
|
|||||||
// partial URL.
|
// partial URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_complete_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_complete_url)(
|
||||||
struct _cef_domdocument_t* self, const cef_string_t* partialURL);
|
struct _cef_domdocument_t* self,
|
||||||
|
const cef_string_t* partialURL);
|
||||||
} cef_domdocument_t;
|
} cef_domdocument_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent a DOM node. The functions of this structure
|
// Structure used to represent a DOM node. The functions of this structure
|
||||||
// should only be called on the render process main thread.
|
// should only be called on the render process main thread.
|
||||||
@@ -177,168 +179,167 @@ typedef struct _cef_domnode_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the type for this node.
|
// Returns the type for this node.
|
||||||
///
|
///
|
||||||
cef_dom_node_type_t (CEF_CALLBACK *get_type)(struct _cef_domnode_t* self);
|
cef_dom_node_type_t(CEF_CALLBACK* get_type)(struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this is a text node.
|
// Returns true (1) if this is a text node.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self);
|
int(CEF_CALLBACK* is_text)(struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this is an element node.
|
// Returns true (1) if this is an element node.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self);
|
int(CEF_CALLBACK* is_element)(struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this is an editable node.
|
// Returns true (1) if this is an editable node.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_editable)(struct _cef_domnode_t* self);
|
int(CEF_CALLBACK* is_editable)(struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this is a form control element node.
|
// Returns true (1) if this is a form control element node.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_form_control_element)(struct _cef_domnode_t* self);
|
int(CEF_CALLBACK* is_form_control_element)(struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the type of this form control element node.
|
// Returns the type of this form control element node.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_form_control_element_type)(
|
cef_string_userfree_t(CEF_CALLBACK* get_form_control_element_type)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is pointing to the same handle as |that|
|
// Returns true (1) if this object is pointing to the same handle as |that|
|
||||||
// object.
|
// object.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self,
|
int(CEF_CALLBACK* is_same)(struct _cef_domnode_t* self,
|
||||||
struct _cef_domnode_t* that);
|
struct _cef_domnode_t* that);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the name of this node.
|
// Returns the name of this node.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self);
|
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the value of this node.
|
// Returns the value of this node.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self);
|
cef_string_userfree_t(CEF_CALLBACK* get_value)(struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the value of this node. Returns true (1) on success.
|
// Set the value of this node. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self,
|
int(CEF_CALLBACK* set_value)(struct _cef_domnode_t* self,
|
||||||
const cef_string_t* value);
|
const cef_string_t* value);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the contents of this node as markup.
|
// Returns the contents of this node as markup.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_as_markup)(
|
cef_string_userfree_t(CEF_CALLBACK* get_as_markup)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the document associated with this node.
|
// Returns the document associated with this node.
|
||||||
///
|
///
|
||||||
struct _cef_domdocument_t* (CEF_CALLBACK *get_document)(
|
struct _cef_domdocument_t*(CEF_CALLBACK* get_document)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the parent node.
|
// Returns the parent node.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_parent)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_parent)(struct _cef_domnode_t* self);
|
||||||
struct _cef_domnode_t* self);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the previous sibling node.
|
// Returns the previous sibling node.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_previous_sibling)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the next sibling node.
|
// Returns the next sibling node.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_next_sibling)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this node has child nodes.
|
// Returns true (1) if this node has child nodes.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self);
|
int(CEF_CALLBACK* has_children)(struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the first child node.
|
// Return the first child node.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_first_child)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the last child node.
|
// Returns the last child node.
|
||||||
///
|
///
|
||||||
struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)(
|
struct _cef_domnode_t*(CEF_CALLBACK* get_last_child)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
|
|
||||||
// The following functions are valid only for element nodes.
|
// The following functions are valid only for element nodes.
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the tag name of this element.
|
// Returns the tag name of this element.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)(
|
cef_string_userfree_t(CEF_CALLBACK* get_element_tag_name)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this element has attributes.
|
// Returns true (1) if this element has attributes.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self);
|
int(CEF_CALLBACK* has_element_attributes)(struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this element has an attribute named |attrName|.
|
// Returns true (1) if this element has an attribute named |attrName|.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self,
|
int(CEF_CALLBACK* has_element_attribute)(struct _cef_domnode_t* self,
|
||||||
const cef_string_t* attrName);
|
const cef_string_t* attrName);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the element attribute named |attrName|.
|
// Returns the element attribute named |attrName|.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)(
|
cef_string_userfree_t(CEF_CALLBACK* get_element_attribute)(
|
||||||
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.
|
// Returns a map of all element attributes.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self,
|
void(CEF_CALLBACK* get_element_attributes)(struct _cef_domnode_t* self,
|
||||||
cef_string_map_t attrMap);
|
cef_string_map_t attrMap);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the value for the element attribute named |attrName|. Returns true (1)
|
// Set the value for the element attribute named |attrName|. Returns true (1)
|
||||||
// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self,
|
int(CEF_CALLBACK* set_element_attribute)(struct _cef_domnode_t* self,
|
||||||
const cef_string_t* attrName, const cef_string_t* value);
|
const cef_string_t* attrName,
|
||||||
|
const cef_string_t* value);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the inner text of the element.
|
// Returns the inner text of the element.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)(
|
cef_string_userfree_t(CEF_CALLBACK* get_element_inner_text)(
|
||||||
struct _cef_domnode_t* self);
|
struct _cef_domnode_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the bounds of the element.
|
// Returns the bounds of the element.
|
||||||
///
|
///
|
||||||
cef_rect_t (CEF_CALLBACK *get_element_bounds)(struct _cef_domnode_t* self);
|
cef_rect_t(CEF_CALLBACK* get_element_bounds)(struct _cef_domnode_t* self);
|
||||||
} cef_domnode_t;
|
} cef_domnode_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=d9cedd8c411dd064eacde55a95d6e05303dea365$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
|
||||||
@@ -46,7 +48,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure used to asynchronously continue a download.
|
// Callback structure used to asynchronously continue a download.
|
||||||
///
|
///
|
||||||
@@ -54,7 +55,7 @@ typedef struct _cef_before_download_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Call to continue the download. Set |download_path| to the full file path
|
// Call to continue the download. Set |download_path| to the full file path
|
||||||
@@ -62,11 +63,11 @@ typedef struct _cef_before_download_callback_t {
|
|||||||
// suggested name and the default temp directory. Set |show_dialog| to true
|
// suggested name and the default temp directory. Set |show_dialog| to true
|
||||||
// (1) if you do wish to show the default "Save As" dialog.
|
// (1) if you do wish to show the default "Save As" dialog.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cont)(struct _cef_before_download_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_before_download_callback_t* self,
|
||||||
const cef_string_t* download_path, int show_dialog);
|
const cef_string_t* download_path,
|
||||||
|
int show_dialog);
|
||||||
} cef_before_download_callback_t;
|
} cef_before_download_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure used to asynchronously cancel a download.
|
// Callback structure used to asynchronously cancel a download.
|
||||||
///
|
///
|
||||||
@@ -74,25 +75,24 @@ typedef struct _cef_download_item_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Call to cancel the download.
|
// Call to cancel the download.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cancel)(struct _cef_download_item_callback_t* self);
|
void(CEF_CALLBACK* cancel)(struct _cef_download_item_callback_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Call to pause the download.
|
// Call to pause the download.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *pause)(struct _cef_download_item_callback_t* self);
|
void(CEF_CALLBACK* pause)(struct _cef_download_item_callback_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Call to resume the download.
|
// Call to resume the download.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *resume)(struct _cef_download_item_callback_t* self);
|
void(CEF_CALLBACK* resume)(struct _cef_download_item_callback_t* self);
|
||||||
} cef_download_item_callback_t;
|
} cef_download_item_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to handle file downloads. The functions of this structure will
|
// Structure used to handle file downloads. The functions of this structure will
|
||||||
// called on the browser process UI thread.
|
// called on the browser process UI thread.
|
||||||
@@ -101,7 +101,7 @@ typedef struct _cef_download_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called before a download begins. |suggested_name| is the suggested name for
|
// Called before a download begins. |suggested_name| is the suggested name for
|
||||||
@@ -110,7 +110,8 @@ typedef struct _cef_download_handler_t {
|
|||||||
// download if desired. Do not keep a reference to |download_item| outside of
|
// download if desired. Do not keep a reference to |download_item| outside of
|
||||||
// this function.
|
// this function.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_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_browser_t* browser,
|
||||||
struct _cef_download_item_t* download_item,
|
struct _cef_download_item_t* download_item,
|
||||||
const cef_string_t* suggested_name,
|
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
|
// download if desired. Do not keep a reference to |download_item| outside of
|
||||||
// this function.
|
// 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_browser_t* browser,
|
||||||
struct _cef_download_item_t* download_item,
|
struct _cef_download_item_t* download_item,
|
||||||
struct _cef_download_item_callback_t* callback);
|
struct _cef_download_item_callback_t* callback);
|
||||||
} cef_download_handler_t;
|
} cef_download_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=c17ff4fd6d85b1db10dce2e1a5dbea5a4b17e4da$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent a download item.
|
// Structure used to represent a download item.
|
||||||
///
|
///
|
||||||
@@ -52,109 +53,108 @@ typedef struct _cef_download_item_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
// if this function returns false (0).
|
// if this function returns false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_valid)(struct _cef_download_item_t* self);
|
int(CEF_CALLBACK* is_valid)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the download is in progress.
|
// Returns true (1) if the download is in progress.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_in_progress)(struct _cef_download_item_t* self);
|
int(CEF_CALLBACK* is_in_progress)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the download is complete.
|
// Returns true (1) if the download is complete.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_complete)(struct _cef_download_item_t* self);
|
int(CEF_CALLBACK* is_complete)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the download has been canceled or interrupted.
|
// Returns true (1) if the download has been canceled or interrupted.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_canceled)(struct _cef_download_item_t* self);
|
int(CEF_CALLBACK* is_canceled)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns a simple speed estimate in bytes/s.
|
// Returns a simple speed estimate in bytes/s.
|
||||||
///
|
///
|
||||||
int64 (CEF_CALLBACK *get_current_speed)(struct _cef_download_item_t* self);
|
int64(CEF_CALLBACK* get_current_speed)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the rough percent complete or -1 if the receive total size is
|
// Returns the rough percent complete or -1 if the receive total size is
|
||||||
// unknown.
|
// unknown.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_percent_complete)(struct _cef_download_item_t* self);
|
int(CEF_CALLBACK* get_percent_complete)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the total number of bytes.
|
// Returns the total number of bytes.
|
||||||
///
|
///
|
||||||
int64 (CEF_CALLBACK *get_total_bytes)(struct _cef_download_item_t* self);
|
int64(CEF_CALLBACK* get_total_bytes)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the number of received bytes.
|
// Returns the number of received bytes.
|
||||||
///
|
///
|
||||||
int64 (CEF_CALLBACK *get_received_bytes)(struct _cef_download_item_t* self);
|
int64(CEF_CALLBACK* get_received_bytes)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the time that the download started.
|
// Returns the time that the download started.
|
||||||
///
|
///
|
||||||
cef_time_t (CEF_CALLBACK *get_start_time)(struct _cef_download_item_t* self);
|
cef_time_t(CEF_CALLBACK* get_start_time)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the time that the download ended.
|
// Returns the time that the download ended.
|
||||||
///
|
///
|
||||||
cef_time_t (CEF_CALLBACK *get_end_time)(struct _cef_download_item_t* self);
|
cef_time_t(CEF_CALLBACK* get_end_time)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the full path to the downloaded or downloading file.
|
// Returns the full path to the downloaded or downloading file.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_full_path)(
|
cef_string_userfree_t(CEF_CALLBACK* get_full_path)(
|
||||||
struct _cef_download_item_t* self);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the unique identifier for this download.
|
// Returns the unique identifier for this download.
|
||||||
///
|
///
|
||||||
uint32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self);
|
uint32(CEF_CALLBACK* get_id)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the URL.
|
// Returns the URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_url)(
|
||||||
struct _cef_download_item_t* self);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the original URL before any redirections.
|
// Returns the original URL before any redirections.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_original_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_original_url)(
|
||||||
struct _cef_download_item_t* self);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the suggested file name.
|
// Returns the suggested file name.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_suggested_file_name)(
|
cef_string_userfree_t(CEF_CALLBACK* get_suggested_file_name)(
|
||||||
struct _cef_download_item_t* self);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the content disposition.
|
// Returns the content disposition.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_content_disposition)(
|
cef_string_userfree_t(CEF_CALLBACK* get_content_disposition)(
|
||||||
struct _cef_download_item_t* self);
|
struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the mime type.
|
// Returns the mime type.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_mime_type)(
|
cef_string_userfree_t(CEF_CALLBACK* get_mime_type)(
|
||||||
struct _cef_download_item_t* self);
|
struct _cef_download_item_t* self);
|
||||||
} cef_download_item_t;
|
} cef_download_item_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,19 +33,21 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=b72ebf98f79f28a18366c037e65e98326d4a350a$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "include/capi/cef_base_capi.h"
|
#include "include/capi/cef_base_capi.h"
|
||||||
|
#include "include/capi/cef_image_capi.h"
|
||||||
#include "include/capi/cef_stream_capi.h"
|
#include "include/capi/cef_stream_capi.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent drag data. The functions of this structure may be
|
// Structure used to represent drag data. The functions of this structure may be
|
||||||
// called on any thread.
|
// called on any thread.
|
||||||
@@ -54,66 +56,66 @@ typedef struct _cef_drag_data_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns a copy of the current object.
|
// Returns a copy of the current object.
|
||||||
///
|
///
|
||||||
struct _cef_drag_data_t* (CEF_CALLBACK *clone)(struct _cef_drag_data_t* self);
|
struct _cef_drag_data_t*(CEF_CALLBACK* clone)(struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is read-only.
|
// Returns true (1) if this object is read-only.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_read_only)(struct _cef_drag_data_t* self);
|
int(CEF_CALLBACK* is_read_only)(struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the drag data is a link.
|
// Returns true (1) if the drag data is a link.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_link)(struct _cef_drag_data_t* self);
|
int(CEF_CALLBACK* is_link)(struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the drag data is a text or html fragment.
|
// Returns true (1) if the drag data is a text or html fragment.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_fragment)(struct _cef_drag_data_t* self);
|
int(CEF_CALLBACK* is_fragment)(struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the drag data is a file.
|
// Returns true (1) if the drag data is a file.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_file)(struct _cef_drag_data_t* self);
|
int(CEF_CALLBACK* is_file)(struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the link URL that is being dragged.
|
// Return the link URL that is being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_link_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_link_url)(
|
||||||
struct _cef_drag_data_t* self);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the title associated with the link being dragged.
|
// Return the title associated with the link being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_link_title)(
|
cef_string_userfree_t(CEF_CALLBACK* get_link_title)(
|
||||||
struct _cef_drag_data_t* self);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the metadata, if any, associated with the link being dragged.
|
// Return the metadata, if any, associated with the link being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_link_metadata)(
|
cef_string_userfree_t(CEF_CALLBACK* get_link_metadata)(
|
||||||
struct _cef_drag_data_t* self);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the plain text fragment that is being dragged.
|
// Return the plain text fragment that is being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_fragment_text)(
|
cef_string_userfree_t(CEF_CALLBACK* get_fragment_text)(
|
||||||
struct _cef_drag_data_t* self);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the text/html fragment that is being dragged.
|
// Return the text/html fragment that is being dragged.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_fragment_html)(
|
cef_string_userfree_t(CEF_CALLBACK* get_fragment_html)(
|
||||||
struct _cef_drag_data_t* self);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -121,14 +123,14 @@ typedef struct _cef_drag_data_t {
|
|||||||
// resolving relative URLs and may be NULL.
|
// resolving relative URLs and may be NULL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_fragment_base_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_fragment_base_url)(
|
||||||
struct _cef_drag_data_t* self);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the name of the file being dragged out of the browser window.
|
// Return the name of the file being dragged out of the browser window.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_file_name)(
|
cef_string_userfree_t(CEF_CALLBACK* get_file_name)(
|
||||||
struct _cef_drag_data_t* self);
|
struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -137,73 +139,88 @@ typedef struct _cef_drag_data_t {
|
|||||||
// this function will return the size of the file contents in bytes. Call
|
// this function will return the size of the file contents in bytes. Call
|
||||||
// get_file_name() to get a suggested name for the file.
|
// get_file_name() to get a suggested name for the file.
|
||||||
///
|
///
|
||||||
size_t (CEF_CALLBACK *get_file_contents)(struct _cef_drag_data_t* self,
|
size_t(CEF_CALLBACK* get_file_contents)(struct _cef_drag_data_t* self,
|
||||||
struct _cef_stream_writer_t* writer);
|
struct _cef_stream_writer_t* writer);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieve the list of file names that are being dragged into the browser
|
// Retrieve the list of file names that are being dragged into the browser
|
||||||
// window.
|
// window.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self,
|
int(CEF_CALLBACK* get_file_names)(struct _cef_drag_data_t* self,
|
||||||
cef_string_list_t names);
|
cef_string_list_t names);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the link URL that is being dragged.
|
// Set the link URL that is being dragged.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_link_url)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_link_url)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* url);
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the title associated with the link being dragged.
|
// Set the title associated with the link being dragged.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_link_title)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_link_title)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* title);
|
const cef_string_t* title);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the metadata associated with the link being dragged.
|
// Set the metadata associated with the link being dragged.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_link_metadata)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_link_metadata)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* data);
|
const cef_string_t* data);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the plain text fragment that is being dragged.
|
// Set the plain text fragment that is being dragged.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_fragment_text)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_fragment_text)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* text);
|
const cef_string_t* text);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the text/html fragment that is being dragged.
|
// Set the text/html fragment that is being dragged.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_fragment_html)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_fragment_html)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* html);
|
const cef_string_t* html);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the base URL that the fragment came from.
|
// Set the base URL that the fragment came from.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_fragment_base_url)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* set_fragment_base_url)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* base_url);
|
const cef_string_t* base_url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Reset the file contents. You should do this before calling
|
// Reset the file contents. You should do this before calling
|
||||||
// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
|
// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
|
||||||
// to drag in this kind of data.
|
// to drag in this kind of data.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *reset_file_contents)(struct _cef_drag_data_t* self);
|
void(CEF_CALLBACK* reset_file_contents)(struct _cef_drag_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add a file that is being dragged into the webview.
|
// Add a file that is being dragged into the webview.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *add_file)(struct _cef_drag_data_t* self,
|
void(CEF_CALLBACK* add_file)(struct _cef_drag_data_t* self,
|
||||||
const cef_string_t* path, const cef_string_t* display_name);
|
const cef_string_t* path,
|
||||||
} cef_drag_data_t;
|
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.
|
// Create a new cef_drag_data_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_drag_data_t* cef_drag_data_create();
|
CEF_EXPORT cef_drag_data_t* cef_drag_data_create();
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=88d9a33295e7fb7238bcb18b25d12906ba4cb791$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
|
||||||
@@ -46,7 +48,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to dragging. The functions
|
// Implement this structure to handle events related to dragging. The functions
|
||||||
// of this structure will be called on the UI thread.
|
// of this structure will be called on the UI thread.
|
||||||
@@ -55,7 +56,7 @@ typedef struct _cef_drag_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when an external drag event enters the browser window. |dragData|
|
// Called when an external drag event enters the browser window. |dragData|
|
||||||
@@ -63,9 +64,10 @@ typedef struct _cef_drag_handler_t {
|
|||||||
// operation. Return false (0) for default drag handling behavior or true (1)
|
// operation. Return false (0) for default drag handling behavior or true (1)
|
||||||
// to cancel the drag event.
|
// to cancel the drag event.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self,
|
int(CEF_CALLBACK* on_drag_enter)(struct _cef_drag_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData,
|
struct _cef_browser_t* browser,
|
||||||
cef_drag_operations_mask_t mask);
|
struct _cef_drag_data_t* dragData,
|
||||||
|
cef_drag_operations_mask_t mask);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called whenever draggable regions for the browser window change. These can
|
// Called whenever draggable regions for the browser window change. These can
|
||||||
@@ -74,12 +76,13 @@ typedef struct _cef_drag_handler_t {
|
|||||||
// never be called. If the last draggable region is removed from a document
|
// never be called. If the last draggable region is removed from a document
|
||||||
// this function will be called with an NULL vector.
|
// this function will be called with an NULL vector.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_draggable_regions_changed)(
|
void(CEF_CALLBACK* on_draggable_regions_changed)(
|
||||||
struct _cef_drag_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_drag_handler_t* self,
|
||||||
size_t regionsCount, cef_draggable_region_t const* regions);
|
struct _cef_browser_t* browser,
|
||||||
|
size_t regionsCount,
|
||||||
|
cef_draggable_region_t const* regions);
|
||||||
} cef_drag_handler_t;
|
} cef_drag_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#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_
|
||||||
131
include/capi/cef_file_util_capi.h
Normal file
131
include/capi/cef_file_util_capi.h
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
// 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=51f4b75a01dbf07fda0eb4bdbbe7a7f3d3b13bdb$
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
|
||||||
|
#define CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/capi/cef_base_capi.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
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.
|
||||||
|
// The directory is only readable by the current user. Calling this function on
|
||||||
|
// the browser process UI or IO threads is not allowed.
|
||||||
|
///
|
||||||
|
CEF_EXPORT int cef_create_directory(const cef_string_t* full_path);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Get the temporary directory provided by the system.
|
||||||
|
//
|
||||||
|
// WARNING: In general, you should use the temp directory variants below instead
|
||||||
|
// of this function. Those variants will ensure that the proper permissions are
|
||||||
|
// set so that other users on the system can't edit them while they're open
|
||||||
|
// (which could lead to security issues).
|
||||||
|
///
|
||||||
|
CEF_EXPORT int cef_get_temp_directory(cef_string_t* temp_dir);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Creates a new directory. On Windows if |prefix| is provided the new directory
|
||||||
|
// name is in the format of "prefixyyyy". Returns true (1) on success and sets
|
||||||
|
// |new_temp_path| to the full path of the directory that was created. The
|
||||||
|
// directory is only readable by the current user. Calling this function on the
|
||||||
|
// browser process UI or IO threads is not allowed.
|
||||||
|
///
|
||||||
|
CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix,
|
||||||
|
cef_string_t* new_temp_path);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Creates a directory within another directory. Extra characters will be
|
||||||
|
// appended to |prefix| to ensure that the new directory does not have the same
|
||||||
|
// name as an existing directory. Returns true (1) on success and sets |new_dir|
|
||||||
|
// to the full path of the directory that was created. The directory is only
|
||||||
|
// readable by the current user. Calling this function on the browser process UI
|
||||||
|
// 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,
|
||||||
|
cef_string_t* new_dir);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns true (1) if the given path exists and is a directory. Calling this
|
||||||
|
// function on the browser process UI or IO threads is not allowed.
|
||||||
|
///
|
||||||
|
CEF_EXPORT int cef_directory_exists(const cef_string_t* path);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Deletes the given path whether it's a file or a directory. If |path| is a
|
||||||
|
// directory all contents will be deleted. If |recursive| is true (1) any sub-
|
||||||
|
// directories and their contents will also be deleted (equivalent to executing
|
||||||
|
// "rm -rf", so use with caution). On POSIX environments if |path| is a symbolic
|
||||||
|
// link then only the symlink will be deleted. Returns true (1) on successful
|
||||||
|
// deletion or if |path| does not exist. Calling this function on the browser
|
||||||
|
// process UI or IO threads is not allowed.
|
||||||
|
///
|
||||||
|
CEF_EXPORT int cef_delete_file(const cef_string_t* path, int recursive);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Writes the contents of |src_dir| into a zip archive at |dest_file|. If
|
||||||
|
// |include_hidden_files| is true (1) files starting with "." will be included.
|
||||||
|
// Returns true (1) on success. Calling this function on the browser process UI
|
||||||
|
// or IO threads is not allowed.
|
||||||
|
///
|
||||||
|
CEF_EXPORT int cef_zip_directory(const cef_string_t* src_dir,
|
||||||
|
const cef_string_t* dest_file,
|
||||||
|
int include_hidden_files);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Loads the existing "Certificate Revocation Lists" file that is managed by
|
||||||
|
// Google Chrome. This file can generally be found in Chrome's User Data
|
||||||
|
// directory (e.g. "C:\Users\[User]\AppData\Local\Google\Chrome\User Data\" on
|
||||||
|
// Windows) and is updated periodically by Chrome's component updater service.
|
||||||
|
// Must be called in the browser process after the context has been initialized.
|
||||||
|
// See https://dev.chromium.org/Home/chromium-security/crlsets for background.
|
||||||
|
///
|
||||||
|
CEF_EXPORT void cef_load_crlsets_file(const cef_string_t* path);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=200ff1e9b7fac8d0eda63bbbaec68225570bc099$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
||||||
@@ -45,7 +47,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to find results. The
|
// Implement this structure to handle events related to find results. The
|
||||||
// functions of this structure will be called on the UI thread.
|
// functions of this structure will be called on the UI thread.
|
||||||
@@ -54,7 +55,7 @@ typedef struct _cef_find_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called to report find results returned by cef_browser_host_t::find().
|
// Called to report find results returned by cef_browser_host_t::find().
|
||||||
@@ -64,13 +65,15 @@ typedef struct _cef_find_handler_t {
|
|||||||
// current position in the search results, and |finalUpdate| is true (1) if
|
// current position in the search results, and |finalUpdate| is true (1) if
|
||||||
// this is the last find notification.
|
// this is the last find notification.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self,
|
void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self,
|
||||||
struct _cef_browser_t* browser, int identifier, int count,
|
struct _cef_browser_t* browser,
|
||||||
const cef_rect_t* selectionRect, int activeMatchOrdinal,
|
int identifier,
|
||||||
int finalUpdate);
|
int count,
|
||||||
|
const cef_rect_t* selectionRect,
|
||||||
|
int activeMatchOrdinal,
|
||||||
|
int finalUpdate);
|
||||||
} cef_find_handler_t;
|
} cef_find_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=365c6d4385b860543225e086dc973609fbfdedc8$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
|
||||||
@@ -47,7 +49,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to focus. The functions of
|
// Implement this structure to handle events related to focus. The functions of
|
||||||
// this structure will be called on the UI thread.
|
// this structure will be called on the UI thread.
|
||||||
@@ -56,7 +57,7 @@ typedef struct _cef_focus_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the browser component is about to loose focus. For instance, if
|
// Called when the browser component is about to loose focus. For instance, if
|
||||||
@@ -64,25 +65,26 @@ typedef struct _cef_focus_handler_t {
|
|||||||
// will be true (1) if the browser is giving focus to the next component and
|
// will be true (1) if the browser is giving focus to the next component and
|
||||||
// false (0) if the browser is giving focus to the previous component.
|
// false (0) if the browser is giving focus to the previous component.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self,
|
void(CEF_CALLBACK* on_take_focus)(struct _cef_focus_handler_t* self,
|
||||||
struct _cef_browser_t* browser, int next);
|
struct _cef_browser_t* browser,
|
||||||
|
int next);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the browser component is requesting focus. |source| indicates
|
// Called when the browser component is requesting focus. |source| indicates
|
||||||
// where the focus request is originating from. Return false (0) to allow the
|
// where the focus request is originating from. Return false (0) to allow the
|
||||||
// focus to be set or true (1) to cancel setting the focus.
|
// focus to be set or true (1) to cancel setting the focus.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self,
|
int(CEF_CALLBACK* on_set_focus)(struct _cef_focus_handler_t* self,
|
||||||
struct _cef_browser_t* browser, cef_focus_source_t source);
|
struct _cef_browser_t* browser,
|
||||||
|
cef_focus_source_t source);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the browser component has received focus.
|
// Called when the browser component has received focus.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_got_focus)(struct _cef_focus_handler_t* self,
|
void(CEF_CALLBACK* on_got_focus)(struct _cef_focus_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
} cef_focus_handler_t;
|
} cef_focus_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=9495bafa6c18cf4a250f4933c39fb2c4597e4212$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
||||||
@@ -61,88 +63,89 @@ typedef struct _cef_frame_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// True if this object is currently attached to a valid frame.
|
// True if this object is currently attached to a valid frame.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_valid)(struct _cef_frame_t* self);
|
int(CEF_CALLBACK* is_valid)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Execute undo in this frame.
|
// Execute undo in this frame.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *undo)(struct _cef_frame_t* self);
|
void(CEF_CALLBACK* undo)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Execute redo in this frame.
|
// Execute redo in this frame.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *redo)(struct _cef_frame_t* self);
|
void(CEF_CALLBACK* redo)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Execute cut in this frame.
|
// Execute cut in this frame.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cut)(struct _cef_frame_t* self);
|
void(CEF_CALLBACK* cut)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Execute copy in this frame.
|
// Execute copy in this frame.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *copy)(struct _cef_frame_t* self);
|
void(CEF_CALLBACK* copy)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Execute paste in this frame.
|
// Execute paste in this frame.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *paste)(struct _cef_frame_t* self);
|
void(CEF_CALLBACK* paste)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Execute delete in this frame.
|
// Execute delete in this frame.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *del)(struct _cef_frame_t* self);
|
void(CEF_CALLBACK* del)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Execute select all in this frame.
|
// Execute select all in this frame.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self);
|
void(CEF_CALLBACK* select_all)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Save this frame's HTML source to a temporary file and open it in the
|
// Save this frame's HTML source to a temporary file and open it in the
|
||||||
// default text viewing application. This function can only be called from the
|
// default text viewing application. This function can only be called from the
|
||||||
// browser process.
|
// browser process.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self);
|
void(CEF_CALLBACK* view_source)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieve this frame's HTML source as a string sent to the specified
|
// Retrieve this frame's HTML source as a string sent to the specified
|
||||||
// visitor.
|
// visitor.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_source)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* get_source)(struct _cef_frame_t* self,
|
||||||
struct _cef_string_visitor_t* visitor);
|
struct _cef_string_visitor_t* visitor);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieve this frame's display text as a string sent to the specified
|
// Retrieve this frame's display text as a string sent to the specified
|
||||||
// visitor.
|
// visitor.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_text)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* get_text)(struct _cef_frame_t* self,
|
||||||
struct _cef_string_visitor_t* visitor);
|
struct _cef_string_visitor_t* visitor);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Load the request represented by the |request| object.
|
// Load the request represented by the |request| object.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* load_request)(struct _cef_frame_t* self,
|
||||||
struct _cef_request_t* request);
|
struct _cef_request_t* request);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Load the specified |url|.
|
// Load the specified |url|.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* load_url)(struct _cef_frame_t* self,
|
||||||
const cef_string_t* url);
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Load the contents of |string_val| with the specified dummy |url|. |url|
|
// Load the contents of |string_val| with the specified dummy |url|. |url|
|
||||||
// should have a standard scheme (for example, http scheme) or behaviors like
|
// should have a standard scheme (for example, http scheme) or behaviors like
|
||||||
// link clicks and web security restrictions may not behave as expected.
|
// link clicks and web security restrictions may not behave as expected.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self,
|
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|
|
// Execute a string of JavaScript code in this frame. The |script_url|
|
||||||
@@ -151,19 +154,20 @@ typedef struct _cef_frame_t {
|
|||||||
// error. The |start_line| parameter is the base line number to use for error
|
// error. The |start_line| parameter is the base line number to use for error
|
||||||
// reporting.
|
// reporting.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* execute_java_script)(struct _cef_frame_t* self,
|
||||||
const cef_string_t* code, const cef_string_t* script_url,
|
const cef_string_t* code,
|
||||||
int start_line);
|
const cef_string_t* script_url,
|
||||||
|
int start_line);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this is the main (top-level) frame.
|
// Returns true (1) if this is the main (top-level) frame.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self);
|
int(CEF_CALLBACK* is_main)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this is the focused frame.
|
// Returns true (1) if this is the focused frame.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self);
|
int(CEF_CALLBACK* is_focused)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the name for this frame. If the frame has an assigned name (for
|
// Returns the name for this frame. If the frame has an assigned name (for
|
||||||
@@ -173,47 +177,46 @@ typedef struct _cef_frame_t {
|
|||||||
// value.
|
// value.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self);
|
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the globally unique identifier for this frame or < 0 if the
|
// Returns the globally unique identifier for this frame or < 0 if the
|
||||||
// underlying frame does not yet exist.
|
// underlying frame does not yet exist.
|
||||||
///
|
///
|
||||||
int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self);
|
int64(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the parent of this frame or NULL if this is the main (top-level)
|
// Returns the parent of this frame or NULL if this is the main (top-level)
|
||||||
// frame.
|
// frame.
|
||||||
///
|
///
|
||||||
struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self);
|
struct _cef_frame_t*(CEF_CALLBACK* get_parent)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the URL currently loaded in this frame.
|
// Returns the URL currently loaded in this frame.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self);
|
cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the browser that this frame belongs to.
|
// Returns the browser that this frame belongs to.
|
||||||
///
|
///
|
||||||
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self);
|
struct _cef_browser_t*(CEF_CALLBACK* get_browser)(struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the V8 context associated with the frame. This function can only be
|
// Get the V8 context associated with the frame. This function can only be
|
||||||
// called from the render process.
|
// called from the render process.
|
||||||
///
|
///
|
||||||
struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)(
|
struct _cef_v8context_t*(CEF_CALLBACK* get_v8context)(
|
||||||
struct _cef_frame_t* self);
|
struct _cef_frame_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Visit the DOM document. This function can only be called from the render
|
// Visit the DOM document. This function can only be called from the render
|
||||||
// process.
|
// process.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self,
|
void(CEF_CALLBACK* visit_dom)(struct _cef_frame_t* self,
|
||||||
struct _cef_domvisitor_t* visitor);
|
struct _cef_domvisitor_t* visitor);
|
||||||
} cef_frame_t;
|
} cef_frame_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=2af1552c0d2dada94c325be8249bfd889b22ca58$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to receive geolocation updates. The functions of
|
// Implement this structure to receive geolocation updates. The functions of
|
||||||
// this structure will be called on the browser process UI thread.
|
// this structure will be called on the browser process UI thread.
|
||||||
@@ -53,18 +54,17 @@ typedef struct _cef_get_geolocation_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called with the 'best available' location information or, if the location
|
// Called with the 'best available' location information or, if the location
|
||||||
// update failed, with error information.
|
// update failed, with error information.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_location_update)(
|
void(CEF_CALLBACK* on_location_update)(
|
||||||
struct _cef_get_geolocation_callback_t* self,
|
struct _cef_get_geolocation_callback_t* self,
|
||||||
const struct _cef_geoposition_t* position);
|
const struct _cef_geoposition_t* position);
|
||||||
} cef_get_geolocation_callback_t;
|
} cef_get_geolocation_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Request a one-time geolocation update. This function bypasses any user
|
// Request a one-time geolocation update. This function bypasses any user
|
||||||
// permission checks so should only be used by code that is allowed to access
|
// permission checks so should only be used by code that is allowed to access
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=33573a1b0f1caa917899c087b9febe83c2cfd41f$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_
|
||||||
@@ -45,7 +47,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure used for asynchronous continuation of geolocation
|
// Callback structure used for asynchronous continuation of geolocation
|
||||||
// permission requests.
|
// permission requests.
|
||||||
@@ -54,16 +55,14 @@ typedef struct _cef_geolocation_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Call to allow or deny geolocation access.
|
// Call to allow or deny geolocation access.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cont)(struct _cef_geolocation_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_geolocation_callback_t* self, int allow);
|
||||||
int allow);
|
|
||||||
} cef_geolocation_callback_t;
|
} cef_geolocation_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to geolocation permission
|
// Implement this structure to handle events related to geolocation permission
|
||||||
// requests. The functions of this structure will be called on the browser
|
// requests. The functions of this structure will be called on the browser
|
||||||
@@ -73,7 +72,7 @@ typedef struct _cef_geolocation_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when a page requests permission to access geolocation information.
|
// Called when a page requests permission to access geolocation information.
|
||||||
@@ -83,21 +82,23 @@ typedef struct _cef_geolocation_handler_t {
|
|||||||
// time to continue or cancel the request. Return false (0) to cancel the
|
// time to continue or cancel the request. Return false (0) to cancel the
|
||||||
// request immediately.
|
// request immediately.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_request_geolocation_permission)(
|
int(CEF_CALLBACK* on_request_geolocation_permission)(
|
||||||
struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_geolocation_handler_t* self,
|
||||||
const cef_string_t* requesting_url, int request_id,
|
struct _cef_browser_t* browser,
|
||||||
|
const cef_string_t* requesting_url,
|
||||||
|
int request_id,
|
||||||
struct _cef_geolocation_callback_t* callback);
|
struct _cef_geolocation_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when a geolocation access request is canceled. |request_id| is the
|
// Called when a geolocation access request is canceled. |request_id| is the
|
||||||
// unique ID for the permission request.
|
// unique ID for the permission request.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_cancel_geolocation_permission)(
|
void(CEF_CALLBACK* on_cancel_geolocation_permission)(
|
||||||
struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_geolocation_handler_t* self,
|
||||||
|
struct _cef_browser_t* browser,
|
||||||
int request_id);
|
int request_id);
|
||||||
} cef_geolocation_handler_t;
|
} cef_geolocation_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=7e5e6dfee8fe6c6bc17b8d58d3e5ddfa8537e2c5$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
||||||
@@ -45,7 +47,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Container for a single image represented at different scale factors. All
|
// Container for a single image represented at different scale factors. All
|
||||||
// image representations should be the same size in density independent pixel
|
// image representations should be the same size in density independent pixel
|
||||||
@@ -58,19 +59,19 @@ typedef struct _cef_image_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this Image is NULL.
|
// Returns true (1) if this Image is NULL.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_empty)(struct _cef_image_t* self);
|
int(CEF_CALLBACK* is_empty)(struct _cef_image_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this Image and |that| Image share the same underlying
|
// Returns true (1) if this Image and |that| Image share the same underlying
|
||||||
// storage. Will also return true (1) if both images are NULL.
|
// storage. Will also return true (1) if both images are NULL.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_same)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* is_same)(struct _cef_image_t* self,
|
||||||
struct _cef_image_t* that);
|
struct _cef_image_t* that);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA
|
// Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA
|
||||||
@@ -79,49 +80,57 @@ typedef struct _cef_image_t {
|
|||||||
// pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in size.
|
// 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.
|
// |color_type| and |alpha_type| values specify the pixel format.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *add_bitmap)(struct _cef_image_t* self, float scale_factor,
|
int(CEF_CALLBACK* add_bitmap)(struct _cef_image_t* self,
|
||||||
int pixel_width, int pixel_height, cef_color_type_t color_type,
|
float scale_factor,
|
||||||
cef_alpha_type_t alpha_type, const void* pixel_data,
|
int pixel_width,
|
||||||
size_t pixel_data_size);
|
int pixel_height,
|
||||||
|
cef_color_type_t color_type,
|
||||||
|
cef_alpha_type_t alpha_type,
|
||||||
|
const void* pixel_data,
|
||||||
|
size_t pixel_data_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add a PNG image representation for |scale_factor|. |png_data| is the image
|
// Add a PNG image representation for |scale_factor|. |png_data| is the image
|
||||||
// data of size |png_data_size|. Any alpha transparency in the PNG data will
|
// data of size |png_data_size|. Any alpha transparency in the PNG data will
|
||||||
// be maintained.
|
// be maintained.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *add_png)(struct _cef_image_t* self, float scale_factor,
|
int(CEF_CALLBACK* add_png)(struct _cef_image_t* self,
|
||||||
const void* png_data, size_t png_data_size);
|
float scale_factor,
|
||||||
|
const void* png_data,
|
||||||
|
size_t png_data_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
|
// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
|
||||||
// image data of size |jpeg_data_size|. The JPEG format does not support
|
// image data of size |jpeg_data_size|. The JPEG format does not support
|
||||||
// transparency so the alpha byte will be set to 0xFF for all pixels.
|
// transparency so the alpha byte will be set to 0xFF for all pixels.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *add_jpeg)(struct _cef_image_t* self, float scale_factor,
|
int(CEF_CALLBACK* add_jpeg)(struct _cef_image_t* self,
|
||||||
const void* jpeg_data, size_t jpeg_data_size);
|
float scale_factor,
|
||||||
|
const void* jpeg_data,
|
||||||
|
size_t jpeg_data_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the image width in density independent pixel (DIP) units.
|
// Returns the image width in density independent pixel (DIP) units.
|
||||||
///
|
///
|
||||||
size_t (CEF_CALLBACK *get_width)(struct _cef_image_t* self);
|
size_t(CEF_CALLBACK* get_width)(struct _cef_image_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the image height in density independent pixel (DIP) units.
|
// Returns the image height in density independent pixel (DIP) units.
|
||||||
///
|
///
|
||||||
size_t (CEF_CALLBACK *get_height)(struct _cef_image_t* self);
|
size_t(CEF_CALLBACK* get_height)(struct _cef_image_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this image contains a representation for
|
// Returns true (1) if this image contains a representation for
|
||||||
// |scale_factor|.
|
// |scale_factor|.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_representation)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* has_representation)(struct _cef_image_t* self,
|
||||||
float scale_factor);
|
float scale_factor);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Removes the representation for |scale_factor|. Returns true (1) on success.
|
// Removes the representation for |scale_factor|. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *remove_representation)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* remove_representation)(struct _cef_image_t* self,
|
||||||
float scale_factor);
|
float scale_factor);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns information for the representation that most closely matches
|
// Returns information for the representation that most closely matches
|
||||||
@@ -129,9 +138,11 @@ typedef struct _cef_image_t {
|
|||||||
// representation. |pixel_width| and |pixel_height| are the representation
|
// representation. |pixel_width| and |pixel_height| are the representation
|
||||||
// size in pixel coordinates. Returns true (1) on success.
|
// size in pixel coordinates. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_representation_info)(struct _cef_image_t* self,
|
int(CEF_CALLBACK* get_representation_info)(struct _cef_image_t* self,
|
||||||
float scale_factor, float* actual_scale_factor, int* pixel_width,
|
float scale_factor,
|
||||||
int* pixel_height);
|
float* actual_scale_factor,
|
||||||
|
int* pixel_width,
|
||||||
|
int* pixel_height);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the bitmap representation that most closely matches |scale_factor|.
|
// Returns the bitmap representation that most closely matches |scale_factor|.
|
||||||
@@ -141,10 +152,13 @@ typedef struct _cef_image_t {
|
|||||||
// Returns a cef_binary_value_t containing the pixel data on success or NULL
|
// Returns a cef_binary_value_t containing the pixel data on success or NULL
|
||||||
// on failure.
|
// on failure.
|
||||||
///
|
///
|
||||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_as_bitmap)(
|
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_bitmap)(
|
||||||
struct _cef_image_t* self, float scale_factor,
|
struct _cef_image_t* self,
|
||||||
cef_color_type_t color_type, cef_alpha_type_t alpha_type,
|
float scale_factor,
|
||||||
int* pixel_width, int* pixel_height);
|
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
|
// Returns the PNG representation that most closely matches |scale_factor|. If
|
||||||
@@ -154,9 +168,12 @@ typedef struct _cef_image_t {
|
|||||||
// cef_binary_value_t containing the PNG image data on success or NULL on
|
// cef_binary_value_t containing the PNG image data on success or NULL on
|
||||||
// failure.
|
// failure.
|
||||||
///
|
///
|
||||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_as_png)(
|
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_png)(
|
||||||
struct _cef_image_t* self, float scale_factor, int with_transparency,
|
struct _cef_image_t* self,
|
||||||
int* pixel_width, int* pixel_height);
|
float scale_factor,
|
||||||
|
int with_transparency,
|
||||||
|
int* pixel_width,
|
||||||
|
int* pixel_height);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the JPEG representation that most closely matches |scale_factor|.
|
// Returns the JPEG representation that most closely matches |scale_factor|.
|
||||||
@@ -167,19 +184,20 @@ typedef struct _cef_image_t {
|
|||||||
// cef_binary_value_t containing the JPEG image data on success or NULL on
|
// cef_binary_value_t containing the JPEG image data on success or NULL on
|
||||||
// failure.
|
// failure.
|
||||||
///
|
///
|
||||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_as_jpeg)(
|
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_jpeg)(
|
||||||
struct _cef_image_t* self, float scale_factor, int quality,
|
struct _cef_image_t* self,
|
||||||
int* pixel_width, int* pixel_height);
|
float scale_factor,
|
||||||
|
int quality,
|
||||||
|
int* pixel_width,
|
||||||
|
int* pixel_height);
|
||||||
} cef_image_t;
|
} cef_image_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_image_t. It will initially be NULL. Use the Add*() functions
|
// Create a new cef_image_t. It will initially be NULL. Use the Add*() functions
|
||||||
// to add representations at different scale factors.
|
// to add representations at different scale factors.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_image_t* cef_image_create();
|
CEF_EXPORT cef_image_t* cef_image_create();
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=f4cd52053981d473b0a5be80d04bd8239d831d46$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
|
||||||
@@ -45,7 +47,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure used for asynchronous continuation of JavaScript dialog
|
// Callback structure used for asynchronous continuation of JavaScript dialog
|
||||||
// requests.
|
// requests.
|
||||||
@@ -54,17 +55,17 @@ typedef struct _cef_jsdialog_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Continue the JS dialog request. Set |success| to true (1) if the OK button
|
// Continue the JS dialog request. Set |success| to true (1) if the OK button
|
||||||
// was pressed. The |user_input| value should be specified for prompt dialogs.
|
// 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,
|
||||||
const cef_string_t* user_input);
|
int success,
|
||||||
|
const cef_string_t* user_input);
|
||||||
} cef_jsdialog_callback_t;
|
} cef_jsdialog_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to JavaScript dialogs. The
|
// Implement this structure to handle events related to JavaScript dialogs. The
|
||||||
// functions of this structure will be called on the UI thread.
|
// functions of this structure will be called on the UI thread.
|
||||||
@@ -73,7 +74,7 @@ typedef struct _cef_jsdialog_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
|
// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
|
||||||
@@ -92,11 +93,14 @@ typedef struct _cef_jsdialog_handler_t {
|
|||||||
// the application must execute |callback| once the custom dialog is
|
// the application must execute |callback| once the custom dialog is
|
||||||
// dismissed.
|
// dismissed.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_jsdialog)(struct _cef_jsdialog_handler_t* self,
|
int(CEF_CALLBACK* on_jsdialog)(struct _cef_jsdialog_handler_t* self,
|
||||||
struct _cef_browser_t* browser, const cef_string_t* origin_url,
|
struct _cef_browser_t* browser,
|
||||||
cef_jsdialog_type_t dialog_type, const cef_string_t* message_text,
|
const cef_string_t* origin_url,
|
||||||
const cef_string_t* default_prompt_text,
|
cef_jsdialog_type_t dialog_type,
|
||||||
struct _cef_jsdialog_callback_t* callback, int* suppress_message);
|
const cef_string_t* message_text,
|
||||||
|
const cef_string_t* default_prompt_text,
|
||||||
|
struct _cef_jsdialog_callback_t* callback,
|
||||||
|
int* suppress_message);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called to run a dialog asking the user if they want to leave a page. Return
|
// Called to run a dialog asking the user if they want to leave a page. Return
|
||||||
@@ -106,9 +110,11 @@ typedef struct _cef_jsdialog_handler_t {
|
|||||||
// dialog is used the application must execute |callback| once the custom
|
// dialog is used the application must execute |callback| once the custom
|
||||||
// dialog is dismissed.
|
// dialog is dismissed.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_before_unload_dialog)(
|
int(CEF_CALLBACK* on_before_unload_dialog)(
|
||||||
struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_jsdialog_handler_t* self,
|
||||||
const cef_string_t* message_text, int is_reload,
|
struct _cef_browser_t* browser,
|
||||||
|
const cef_string_t* message_text,
|
||||||
|
int is_reload,
|
||||||
struct _cef_jsdialog_callback_t* callback);
|
struct _cef_jsdialog_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -116,17 +122,17 @@ typedef struct _cef_jsdialog_handler_t {
|
|||||||
// be called due to events like page navigation irregardless of whether any
|
// be called due to events like page navigation irregardless of whether any
|
||||||
// dialogs are currently pending.
|
// dialogs are currently pending.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_reset_dialog_state)(
|
void(CEF_CALLBACK* on_reset_dialog_state)(
|
||||||
struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser);
|
struct _cef_jsdialog_handler_t* self,
|
||||||
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the default implementation dialog is closed.
|
// Called when the default implementation dialog is closed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_dialog_closed)(struct _cef_jsdialog_handler_t* self,
|
void(CEF_CALLBACK* on_dialog_closed)(struct _cef_jsdialog_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
} cef_jsdialog_handler_t;
|
} cef_jsdialog_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=7efb9ec2ee02bb511c1d0363b8c4d235a6170cad$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
|
||||||
@@ -45,7 +47,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to keyboard input. The
|
// Implement this structure to handle events related to keyboard input. The
|
||||||
// functions of this structure will be called on the UI thread.
|
// functions of this structure will be called on the UI thread.
|
||||||
@@ -54,7 +55,7 @@ typedef struct _cef_keyboard_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called before a keyboard event is sent to the renderer. |event| contains
|
// Called before a keyboard event is sent to the renderer. |event| contains
|
||||||
@@ -63,9 +64,11 @@ typedef struct _cef_keyboard_handler_t {
|
|||||||
// (0) otherwise. If the event will be handled in on_key_event() as a keyboard
|
// (0) otherwise. If the event will be handled in on_key_event() as a keyboard
|
||||||
// shortcut set |is_keyboard_shortcut| to true (1) and return false (0).
|
// 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,
|
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,
|
struct _cef_browser_t* browser,
|
||||||
cef_event_handle_t os_event, int* is_keyboard_shortcut);
|
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
|
// Called after the renderer and JavaScript in the page has had a chance to
|
||||||
@@ -73,12 +76,12 @@ typedef struct _cef_keyboard_handler_t {
|
|||||||
// |os_event| is the operating system event message, if any. Return true (1)
|
// |os_event| is the operating system event message, if any. Return true (1)
|
||||||
// if the keyboard event was handled or false (0) otherwise.
|
// if the keyboard event was handled or false (0) otherwise.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self,
|
int(CEF_CALLBACK* on_key_event)(struct _cef_keyboard_handler_t* self,
|
||||||
struct _cef_browser_t* browser, const struct _cef_key_event_t* event,
|
struct _cef_browser_t* browser,
|
||||||
cef_event_handle_t os_event);
|
const struct _cef_key_event_t* event,
|
||||||
|
cef_event_handle_t os_event);
|
||||||
} cef_keyboard_handler_t;
|
} cef_keyboard_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=eca8f0216a3430fad8ff3714a0ef65ed27e02f0e$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||||
@@ -56,10 +58,10 @@ typedef struct _cef_life_span_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
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
|
// |browser| and |frame| values represent the source of the popup request. The
|
||||||
// |target_url| and |target_frame_name| values indicate where the popup
|
// |target_url| and |target_frame_name| values indicate where the popup
|
||||||
// browser should navigate and may be NULL if not specified with the request.
|
// browser should navigate and may be NULL if not specified with the request.
|
||||||
@@ -76,22 +78,30 @@ typedef struct _cef_life_span_handler_t {
|
|||||||
// is set to false (0) the new browser will not be scriptable and may not be
|
// 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
|
// hosted in the same renderer process as the source browser. Any
|
||||||
// modifications to |windowInfo| will be ignored if the parent browser is
|
// modifications to |windowInfo| will be ignored if the parent browser is
|
||||||
// wrapped in a cef_browser_view_t.
|
// 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,
|
int(CEF_CALLBACK* on_before_popup)(
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_life_span_handler_t* self,
|
||||||
const cef_string_t* target_url, const cef_string_t* target_frame_name,
|
struct _cef_browser_t* browser,
|
||||||
cef_window_open_disposition_t target_disposition, int user_gesture,
|
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,
|
const struct _cef_popup_features_t* popupFeatures,
|
||||||
struct _cef_window_info_t* windowInfo, struct _cef_client_t** client,
|
struct _cef_window_info_t* windowInfo,
|
||||||
struct _cef_browser_settings_t* settings, int* no_javascript_access);
|
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
|
// Called after a new browser is created. This callback will be the first
|
||||||
// notification that references |browser|.
|
// notification that references |browser|.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_after_created)(struct _cef_life_span_handler_t* self,
|
void(CEF_CALLBACK* on_after_created)(struct _cef_life_span_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when a browser has recieved a request to close. This may result
|
// Called when a browser has recieved a request to close. This may result
|
||||||
@@ -182,8 +192,8 @@ typedef struct _cef_life_span_handler_t {
|
|||||||
// browsers
|
// browsers
|
||||||
// exist.
|
// exist.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *do_close)(struct _cef_life_span_handler_t* self,
|
int(CEF_CALLBACK* do_close)(struct _cef_life_span_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called just before a browser is destroyed. Release all references to the
|
// Called just before a browser is destroyed. Release all references to the
|
||||||
@@ -192,11 +202,10 @@ typedef struct _cef_life_span_handler_t {
|
|||||||
// notification that references |browser|. See do_close() documentation for
|
// notification that references |browser|. See do_close() documentation for
|
||||||
// additional usage information.
|
// additional usage information.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self,
|
void(CEF_CALLBACK* on_before_close)(struct _cef_life_span_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
} cef_life_span_handler_t;
|
} cef_life_span_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=94b07e1d76b57fbd125f0cc8d78298ff119f1822$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
||||||
@@ -46,7 +48,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to browser load status. The
|
// 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
|
// functions of this structure will be called on the browser process UI thread
|
||||||
@@ -56,7 +57,7 @@ typedef struct _cef_load_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the loading state has changed. This callback will be executed
|
// Called when the loading state has changed. This callback will be executed
|
||||||
@@ -65,51 +66,59 @@ typedef struct _cef_load_handler_t {
|
|||||||
// of failure. It will be called before any calls to OnLoadStart and after all
|
// of failure. It will be called before any calls to OnLoadStart and after all
|
||||||
// calls to OnLoadError and/or OnLoadEnd.
|
// calls to OnLoadError and/or OnLoadEnd.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_loading_state_change)(struct _cef_load_handler_t* self,
|
void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self,
|
||||||
struct _cef_browser_t* browser, int isLoading, int canGoBack,
|
struct _cef_browser_t* browser,
|
||||||
int canGoForward);
|
int isLoading,
|
||||||
|
int canGoBack,
|
||||||
|
int canGoForward);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the browser begins loading a frame. The |frame| value will
|
// Called after a navigation has been committed and before the browser begins
|
||||||
// never be NULL -- call the is_main() function to check if this frame is the
|
// loading contents in the frame. The |frame| value will never be NULL -- call
|
||||||
// main frame. |transition_type| provides information about the source of the
|
// the is_main() function to check if this frame is the main frame.
|
||||||
// navigation and an accurate value is only available in the browser process.
|
// |transition_type| provides information about the source of the navigation
|
||||||
// Multiple frames may be loading at the same time. Sub-frames may start or
|
// and an accurate value is only available in the browser process. Multiple
|
||||||
// continue loading after the main frame load has ended. This function will
|
// frames may be loading at the same time. Sub-frames may start or continue
|
||||||
// always be called for all frames irrespective of whether the request
|
// loading after the main frame load has ended. This function will not be
|
||||||
// completes successfully. For notification of overall browser load status use
|
// called for same page navigations (fragments, history state, etc.) or for
|
||||||
// OnLoadingStateChange instead.
|
// 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,
|
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,
|
||||||
cef_transition_type_t transition_type);
|
struct _cef_frame_t* frame,
|
||||||
|
cef_transition_type_t transition_type);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the browser is done loading a frame. The |frame| value will
|
// Called when the browser is done loading a frame. The |frame| value will
|
||||||
// never be NULL -- call the is_main() function to check if this frame is the
|
// never be NULL -- call the is_main() function to check if this frame is the
|
||||||
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
// 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
|
// start or continue loading after the main frame load has ended. This
|
||||||
// function will always be called for all frames irrespective of whether the
|
// function will not be called for same page navigations (fragments, history
|
||||||
// request completes successfully. For notification of overall browser load
|
// state, etc.) or for navigations that fail or are canceled before commit.
|
||||||
// status use OnLoadingStateChange instead.
|
// For notification of overall browser load status use OnLoadingStateChange
|
||||||
|
// instead.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_load_end)(struct _cef_load_handler_t* self,
|
void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser,
|
||||||
int httpStatusCode);
|
struct _cef_frame_t* frame,
|
||||||
|
int httpStatusCode);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the resource load for a navigation fails or is canceled.
|
// Called when a navigation fails or is canceled. This function may be called
|
||||||
// |errorCode| is the error code number, |errorText| is the error text and
|
// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
|
||||||
// |failedUrl| is the URL that failed to load. See net\base\net_error_list.h
|
// after commit. |errorCode| is the error code number, |errorText| is the
|
||||||
// for complete descriptions of the error codes.
|
// 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,
|
void(CEF_CALLBACK* on_load_error)(struct _cef_load_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser,
|
||||||
cef_errorcode_t errorCode, const cef_string_t* errorText,
|
struct _cef_frame_t* frame,
|
||||||
const cef_string_t* failedUrl);
|
cef_errorcode_t errorCode,
|
||||||
|
const cef_string_t* errorText,
|
||||||
|
const cef_string_t* failedUrl);
|
||||||
} cef_load_handler_t;
|
} cef_load_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=c86c5964cd093de8913b092db47d9e820a169ae8$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
||||||
@@ -45,7 +47,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Supports creation and modification of menus. See cef_menu_id_t for the
|
// Supports creation and modification of menus. See cef_menu_id_t for the
|
||||||
// command ids that have default implementations. All user-defined command ids
|
// command ids that have default implementations. All user-defined command ids
|
||||||
@@ -56,331 +57,446 @@ typedef struct _cef_menu_model_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns true (1) if this menu is a submenu.
|
||||||
|
///
|
||||||
|
int(CEF_CALLBACK* is_sub_menu)(struct _cef_menu_model_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Clears the menu. Returns true (1) on success.
|
// Clears the menu. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *clear)(struct _cef_menu_model_t* self);
|
int(CEF_CALLBACK* clear)(struct _cef_menu_model_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the number of items in this menu.
|
// Returns the number of items in this menu.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_count)(struct _cef_menu_model_t* self);
|
int(CEF_CALLBACK* get_count)(struct _cef_menu_model_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add a separator to the menu. Returns true (1) on success.
|
// Add a separator to the menu. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *add_separator)(struct _cef_menu_model_t* self);
|
int(CEF_CALLBACK* add_separator)(struct _cef_menu_model_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add an item to the menu. Returns true (1) on success.
|
// Add an item to the menu. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *add_item)(struct _cef_menu_model_t* self, int command_id,
|
int(CEF_CALLBACK* add_item)(struct _cef_menu_model_t* self,
|
||||||
const cef_string_t* label);
|
int command_id,
|
||||||
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add a check item to the menu. Returns true (1) on success.
|
// Add a check item to the menu. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *add_check_item)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* add_check_item)(struct _cef_menu_model_t* self,
|
||||||
int command_id, 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
|
// Add a radio item to the menu. Only a single item with the specified
|
||||||
// |group_id| can be checked at a time. Returns true (1) on success.
|
// |group_id| can be checked at a time. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *add_radio_item)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* add_radio_item)(struct _cef_menu_model_t* self,
|
||||||
int command_id, 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.
|
// Add a sub-menu to the menu. The new sub-menu is returned.
|
||||||
///
|
///
|
||||||
struct _cef_menu_model_t* (CEF_CALLBACK *add_sub_menu)(
|
struct _cef_menu_model_t*(CEF_CALLBACK* add_sub_menu)(
|
||||||
struct _cef_menu_model_t* self, int command_id,
|
struct _cef_menu_model_t* self,
|
||||||
|
int command_id,
|
||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Insert a separator in the menu at the specified |index|. Returns true (1)
|
// Insert a separator in the menu at the specified |index|. Returns true (1)
|
||||||
// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *insert_separator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* insert_separator_at)(struct _cef_menu_model_t* self,
|
||||||
int index);
|
int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Insert an item in the menu at the specified |index|. Returns true (1) on
|
// Insert an item in the menu at the specified |index|. Returns true (1) on
|
||||||
// success.
|
// success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *insert_item_at)(struct _cef_menu_model_t* self, int index,
|
int(CEF_CALLBACK* insert_item_at)(struct _cef_menu_model_t* self,
|
||||||
int command_id, const cef_string_t* label);
|
int index,
|
||||||
|
int command_id,
|
||||||
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Insert a check item in the menu at the specified |index|. Returns true (1)
|
// Insert a check item in the menu at the specified |index|. Returns true (1)
|
||||||
// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *insert_check_item_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* insert_check_item_at)(struct _cef_menu_model_t* self,
|
||||||
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
|
// Insert a radio item in the menu at the specified |index|. Only a single
|
||||||
// item with the specified |group_id| can be checked at a time. Returns true
|
// item with the specified |group_id| can be checked at a time. Returns true
|
||||||
// (1) on success.
|
// (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *insert_radio_item_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* insert_radio_item_at)(struct _cef_menu_model_t* self,
|
||||||
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
|
// Insert a sub-menu in the menu at the specified |index|. The new sub-menu is
|
||||||
// returned.
|
// returned.
|
||||||
///
|
///
|
||||||
struct _cef_menu_model_t* (CEF_CALLBACK *insert_sub_menu_at)(
|
struct _cef_menu_model_t*(CEF_CALLBACK* insert_sub_menu_at)(
|
||||||
struct _cef_menu_model_t* self, int index, int command_id,
|
struct _cef_menu_model_t* self,
|
||||||
|
int index,
|
||||||
|
int command_id,
|
||||||
const cef_string_t* label);
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Removes the item with the specified |command_id|. Returns true (1) on
|
// Removes the item with the specified |command_id|. Returns true (1) on
|
||||||
// success.
|
// success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *remove)(struct _cef_menu_model_t* self, int command_id);
|
int(CEF_CALLBACK* remove)(struct _cef_menu_model_t* self, int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Removes the item at the specified |index|. Returns true (1) on success.
|
// Removes the item at the specified |index|. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *remove_at)(struct _cef_menu_model_t* self, int index);
|
int(CEF_CALLBACK* remove_at)(struct _cef_menu_model_t* self, int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the index associated with the specified |command_id| or -1 if not
|
// Returns the index associated with the specified |command_id| or -1 if not
|
||||||
// found due to the command id not existing in the menu.
|
// found due to the command id not existing in the menu.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_index_of)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_index_of)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the command id at the specified |index| or -1 if not found due to
|
// Returns the command id at the specified |index| or -1 if not found due to
|
||||||
// invalid range or the index being a separator.
|
// invalid range or the index being a separator.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_command_id_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_command_id_at)(struct _cef_menu_model_t* self,
|
||||||
int index);
|
int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Sets the command id at the specified |index|. Returns true (1) on success.
|
// Sets the command id at the specified |index|. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_command_id_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_command_id_at)(struct _cef_menu_model_t* self,
|
||||||
int index, int command_id);
|
int index,
|
||||||
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the label for the specified |command_id| or NULL if not found.
|
// Returns the label for the specified |command_id| or NULL if not found.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_label)(
|
cef_string_userfree_t(CEF_CALLBACK* get_label)(struct _cef_menu_model_t* self,
|
||||||
struct _cef_menu_model_t* self, int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the label at the specified |index| or NULL if not found due to
|
// Returns the label at the specified |index| or NULL if not found due to
|
||||||
// invalid range or the index being a separator.
|
// invalid range or the index being a separator.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_label_at)(
|
cef_string_userfree_t(
|
||||||
struct _cef_menu_model_t* self, int index);
|
CEF_CALLBACK* get_label_at)(struct _cef_menu_model_t* self, int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Sets the label for the specified |command_id|. Returns true (1) on success.
|
// 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,
|
||||||
const cef_string_t* label);
|
int command_id,
|
||||||
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the label at the specified |index|. Returns true (1) on success.
|
// Set the label at the specified |index|. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_label_at)(struct _cef_menu_model_t* self, int index,
|
int(CEF_CALLBACK* set_label_at)(struct _cef_menu_model_t* self,
|
||||||
const cef_string_t* label);
|
int index,
|
||||||
|
const cef_string_t* label);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the item type for the specified |command_id|.
|
// Returns the item type for the specified |command_id|.
|
||||||
///
|
///
|
||||||
cef_menu_item_type_t (CEF_CALLBACK *get_type)(struct _cef_menu_model_t* self,
|
cef_menu_item_type_t(CEF_CALLBACK* get_type)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the item type at the specified |index|.
|
// Returns the item type at the specified |index|.
|
||||||
///
|
///
|
||||||
cef_menu_item_type_t (CEF_CALLBACK *get_type_at)(
|
cef_menu_item_type_t(
|
||||||
struct _cef_menu_model_t* self, int index);
|
CEF_CALLBACK* get_type_at)(struct _cef_menu_model_t* self, int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the group id for the specified |command_id| or -1 if invalid.
|
// Returns the group id for the specified |command_id| or -1 if invalid.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_group_id)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_group_id)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the group id at the specified |index| or -1 if invalid.
|
// Returns the group id at the specified |index| or -1 if invalid.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_group_id_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_group_id_at)(struct _cef_menu_model_t* self, int index);
|
||||||
int index);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Sets the group id for the specified |command_id|. Returns true (1) on
|
// Sets the group id for the specified |command_id|. Returns true (1) on
|
||||||
// success.
|
// success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_group_id)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_group_id)(struct _cef_menu_model_t* self,
|
||||||
int command_id, int group_id);
|
int command_id,
|
||||||
|
int group_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Sets the group id at the specified |index|. Returns true (1) on success.
|
// Sets the group id at the specified |index|. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_group_id_at)(struct _cef_menu_model_t* self, int index,
|
int(CEF_CALLBACK* set_group_id_at)(struct _cef_menu_model_t* self,
|
||||||
int group_id);
|
int index,
|
||||||
|
int group_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the submenu for the specified |command_id| or NULL if invalid.
|
// Returns the submenu for the specified |command_id| or NULL if invalid.
|
||||||
///
|
///
|
||||||
struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu)(
|
struct _cef_menu_model_t*(CEF_CALLBACK* get_sub_menu)(
|
||||||
struct _cef_menu_model_t* self, int command_id);
|
struct _cef_menu_model_t* self,
|
||||||
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the submenu at the specified |index| or NULL if invalid.
|
// Returns the submenu at the specified |index| or NULL if invalid.
|
||||||
///
|
///
|
||||||
struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu_at)(
|
struct _cef_menu_model_t*(
|
||||||
struct _cef_menu_model_t* self, int index);
|
CEF_CALLBACK* get_sub_menu_at)(struct _cef_menu_model_t* self, int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the specified |command_id| is visible.
|
// Returns true (1) if the specified |command_id| is visible.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_visible)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* is_visible)(struct _cef_menu_model_t* self, int command_id);
|
||||||
int command_id);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the specified |index| is visible.
|
// Returns true (1) if the specified |index| is visible.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_visible_at)(struct _cef_menu_model_t* self, int index);
|
int(CEF_CALLBACK* is_visible_at)(struct _cef_menu_model_t* self, int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Change the visibility of the specified |command_id|. Returns true (1) on
|
// Change the visibility of the specified |command_id|. Returns true (1) on
|
||||||
// success.
|
// success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_visible)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_visible)(struct _cef_menu_model_t* self,
|
||||||
int command_id, int visible);
|
int command_id,
|
||||||
|
int visible);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Change the visibility at the specified |index|. Returns true (1) on
|
// Change the visibility at the specified |index|. Returns true (1) on
|
||||||
// success.
|
// success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_visible_at)(struct _cef_menu_model_t* self, int index,
|
int(CEF_CALLBACK* set_visible_at)(struct _cef_menu_model_t* self,
|
||||||
int visible);
|
int index,
|
||||||
|
int visible);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the specified |command_id| is enabled.
|
// Returns true (1) if the specified |command_id| is enabled.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_enabled)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* is_enabled)(struct _cef_menu_model_t* self, int command_id);
|
||||||
int command_id);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the specified |index| is enabled.
|
// Returns true (1) if the specified |index| is enabled.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_enabled_at)(struct _cef_menu_model_t* self, int index);
|
int(CEF_CALLBACK* is_enabled_at)(struct _cef_menu_model_t* self, int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Change the enabled status of the specified |command_id|. Returns true (1)
|
// Change the enabled status of the specified |command_id|. Returns true (1)
|
||||||
// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_enabled)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_enabled)(struct _cef_menu_model_t* self,
|
||||||
int command_id, int enabled);
|
int command_id,
|
||||||
|
int enabled);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Change the enabled status at the specified |index|. Returns true (1) on
|
// Change the enabled status at the specified |index|. Returns true (1) on
|
||||||
// success.
|
// success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_enabled_at)(struct _cef_menu_model_t* self, int index,
|
int(CEF_CALLBACK* set_enabled_at)(struct _cef_menu_model_t* self,
|
||||||
int enabled);
|
int index,
|
||||||
|
int enabled);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the specified |command_id| is checked. Only applies to
|
// Returns true (1) if the specified |command_id| is checked. Only applies to
|
||||||
// check and radio items.
|
// check and radio items.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_checked)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* is_checked)(struct _cef_menu_model_t* self, int command_id);
|
||||||
int command_id);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the specified |index| is checked. Only applies to check
|
// Returns true (1) if the specified |index| is checked. Only applies to check
|
||||||
// and radio items.
|
// and radio items.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_checked_at)(struct _cef_menu_model_t* self, int index);
|
int(CEF_CALLBACK* is_checked_at)(struct _cef_menu_model_t* self, int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Check the specified |command_id|. Only applies to check and radio items.
|
// Check the specified |command_id|. Only applies to check and radio items.
|
||||||
// Returns true (1) on success.
|
// Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_checked)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_checked)(struct _cef_menu_model_t* self,
|
||||||
int command_id, int checked);
|
int command_id,
|
||||||
|
int checked);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Check the specified |index|. Only applies to check and radio items. Returns
|
// Check the specified |index|. Only applies to check and radio items. Returns
|
||||||
// true (1) on success.
|
// 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 checked);
|
int index,
|
||||||
|
int checked);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the specified |command_id| has a keyboard accelerator
|
// Returns true (1) if the specified |command_id| has a keyboard accelerator
|
||||||
// assigned.
|
// assigned.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_accelerator)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* has_accelerator)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the specified |index| has a keyboard accelerator
|
// Returns true (1) if the specified |index| has a keyboard accelerator
|
||||||
// assigned.
|
// assigned.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_accelerator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* has_accelerator_at)(struct _cef_menu_model_t* self,
|
||||||
int index);
|
int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the keyboard accelerator for the specified |command_id|. |key_code| can
|
// Set the keyboard accelerator for the specified |command_id|. |key_code| can
|
||||||
// be any virtual key or character value. Returns true (1) on success.
|
// be any virtual key or character value. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_accelerator)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_accelerator)(struct _cef_menu_model_t* self,
|
||||||
int command_id, int key_code, int shift_pressed, int ctrl_pressed,
|
int command_id,
|
||||||
int alt_pressed);
|
int key_code,
|
||||||
|
int shift_pressed,
|
||||||
|
int ctrl_pressed,
|
||||||
|
int alt_pressed);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the keyboard accelerator at the specified |index|. |key_code| can be
|
// Set the keyboard accelerator at the specified |index|. |key_code| can be
|
||||||
// any virtual key or character value. Returns true (1) on success.
|
// any virtual key or character value. Returns true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_accelerator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* set_accelerator_at)(struct _cef_menu_model_t* self,
|
||||||
int index, int key_code, int shift_pressed, int ctrl_pressed,
|
int index,
|
||||||
int alt_pressed);
|
int key_code,
|
||||||
|
int shift_pressed,
|
||||||
|
int ctrl_pressed,
|
||||||
|
int alt_pressed);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Remove the keyboard accelerator for the specified |command_id|. Returns
|
// Remove the keyboard accelerator for the specified |command_id|. Returns
|
||||||
// true (1) on success.
|
// true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *remove_accelerator)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* remove_accelerator)(struct _cef_menu_model_t* self,
|
||||||
int command_id);
|
int command_id);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Remove the keyboard accelerator at the specified |index|. Returns true (1)
|
// Remove the keyboard accelerator at the specified |index|. Returns true (1)
|
||||||
// on success.
|
// on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *remove_accelerator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* remove_accelerator_at)(struct _cef_menu_model_t* self,
|
||||||
int index);
|
int index);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieves the keyboard accelerator for the specified |command_id|. Returns
|
// Retrieves the keyboard accelerator for the specified |command_id|. Returns
|
||||||
// true (1) on success.
|
// true (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_accelerator)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_accelerator)(struct _cef_menu_model_t* self,
|
||||||
int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed,
|
int command_id,
|
||||||
int* alt_pressed);
|
int* key_code,
|
||||||
|
int* shift_pressed,
|
||||||
|
int* ctrl_pressed,
|
||||||
|
int* alt_pressed);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieves the keyboard accelerator for the specified |index|. Returns true
|
// Retrieves the keyboard accelerator for the specified |index|. Returns true
|
||||||
// (1) on success.
|
// (1) on success.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_accelerator_at)(struct _cef_menu_model_t* self,
|
int(CEF_CALLBACK* get_accelerator_at)(struct _cef_menu_model_t* self,
|
||||||
int index, int* key_code, int* shift_pressed, int* ctrl_pressed,
|
int index,
|
||||||
int* alt_pressed);
|
int* key_code,
|
||||||
} cef_menu_model_t;
|
int* shift_pressed,
|
||||||
|
int* ctrl_pressed,
|
||||||
|
int* alt_pressed);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set the explicit color for |command_id| and |color_type| to |color|.
|
||||||
|
// Specify a |color| value of 0 to remove the explicit color. If no explicit
|
||||||
|
// color or default color is set for |color_type| then the system color will
|
||||||
|
// be used. Returns true (1) on success.
|
||||||
|
///
|
||||||
|
int(CEF_CALLBACK* set_color)(struct _cef_menu_model_t* self,
|
||||||
|
int command_id,
|
||||||
|
cef_menu_color_type_t color_type,
|
||||||
|
cef_color_t color);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set the explicit color for |command_id| and |index| to |color|. Specify a
|
||||||
|
// |color| value of 0 to remove the explicit color. Specify an |index| value
|
||||||
|
// of -1 to set the default color for items that do not have an explicit color
|
||||||
|
// set. If no explicit color or default color is set for |color_type| then the
|
||||||
|
// system color will be used. Returns true (1) on success.
|
||||||
|
///
|
||||||
|
int(CEF_CALLBACK* set_color_at)(struct _cef_menu_model_t* self,
|
||||||
|
int index,
|
||||||
|
cef_menu_color_type_t color_type,
|
||||||
|
cef_color_t color);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns in |color| the color that was explicitly set for |command_id| and
|
||||||
|
// |color_type|. If a color was not set then 0 will be returned in |color|.
|
||||||
|
// Returns true (1) on success.
|
||||||
|
///
|
||||||
|
int(CEF_CALLBACK* get_color)(struct _cef_menu_model_t* self,
|
||||||
|
int command_id,
|
||||||
|
cef_menu_color_type_t color_type,
|
||||||
|
cef_color_t* color);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns in |color| the color that was explicitly set for |command_id| and
|
||||||
|
// |color_type|. Specify an |index| value of -1 to return the default color in
|
||||||
|
// |color|. If a color was not set then 0 will be returned in |color|. Returns
|
||||||
|
// true (1) on success.
|
||||||
|
///
|
||||||
|
int(CEF_CALLBACK* get_color_at)(struct _cef_menu_model_t* self,
|
||||||
|
int index,
|
||||||
|
cef_menu_color_type_t color_type,
|
||||||
|
cef_color_t* color);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Sets the font list for the specified |command_id|. If |font_list| is NULL
|
||||||
|
// the system font will be used. Returns true (1) on success. The format is
|
||||||
|
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma-
|
||||||
|
// separated list of font family names, - STYLES is an optional space-
|
||||||
|
// separated list of style names (case-sensitive
|
||||||
|
// "Bold" and "Italic" are supported), and
|
||||||
|
// - SIZE is an integer font size in pixels with the suffix "px".
|
||||||
|
//
|
||||||
|
// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||||
|
// Bold Italic 14px" - "Arial, 14px"
|
||||||
|
///
|
||||||
|
int(CEF_CALLBACK* set_font_list)(struct _cef_menu_model_t* self,
|
||||||
|
int command_id,
|
||||||
|
const cef_string_t* font_list);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Sets the font list for the specified |index|. Specify an |index| value of
|
||||||
|
// -1 to set the default font. If |font_list| is NULL the system font will be
|
||||||
|
// used. Returns true (1) on success. The format is
|
||||||
|
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma-
|
||||||
|
// separated list of font family names, - STYLES is an optional space-
|
||||||
|
// separated list of style names (case-sensitive
|
||||||
|
// "Bold" and "Italic" are supported), and
|
||||||
|
// - SIZE is an integer font size in pixels with the suffix "px".
|
||||||
|
//
|
||||||
|
// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||||
|
// Bold Italic 14px" - "Arial, 14px"
|
||||||
|
///
|
||||||
|
int(CEF_CALLBACK* set_font_list_at)(struct _cef_menu_model_t* self,
|
||||||
|
int index,
|
||||||
|
const cef_string_t* font_list);
|
||||||
|
} cef_menu_model_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new MenuModel with the specified |delegate|.
|
// Create a new MenuModel with the specified |delegate|.
|
||||||
@@ -388,7 +504,6 @@ typedef struct _cef_menu_model_t {
|
|||||||
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
|
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
|
||||||
struct _cef_menu_model_delegate_t* delegate);
|
struct _cef_menu_model_delegate_t* delegate);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=d390abde0e3eb8ac8d80d16cbf638d297866b853$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
||||||
@@ -55,23 +57,64 @@ typedef struct _cef_menu_model_delegate_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Perform the action associated with the specified |command_id| and optional
|
// Perform the action associated with the specified |command_id| and optional
|
||||||
// |event_flags|.
|
// |event_flags|.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *execute_command)(struct _cef_menu_model_delegate_t* self,
|
void(CEF_CALLBACK* execute_command)(struct _cef_menu_model_delegate_t* self,
|
||||||
struct _cef_menu_model_t* menu_model, int command_id,
|
struct _cef_menu_model_t* menu_model,
|
||||||
cef_event_flags_t event_flags);
|
int command_id,
|
||||||
|
cef_event_flags_t event_flags);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called when the user moves the mouse outside the menu and over the owning
|
||||||
|
// window.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* mouse_outside_menu)(
|
||||||
|
struct _cef_menu_model_delegate_t* self,
|
||||||
|
struct _cef_menu_model_t* menu_model,
|
||||||
|
const cef_point_t* screen_point);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called on unhandled open submenu keyboard commands. |is_rtl| will be true
|
||||||
|
// (1) if the menu is displaying a right-to-left language.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* unhandled_open_submenu)(
|
||||||
|
struct _cef_menu_model_delegate_t* self,
|
||||||
|
struct _cef_menu_model_t* menu_model,
|
||||||
|
int is_rtl);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called on unhandled close submenu keyboard commands. |is_rtl| will be true
|
||||||
|
// (1) if the menu is displaying a right-to-left language.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* unhandled_close_submenu)(
|
||||||
|
struct _cef_menu_model_delegate_t* self,
|
||||||
|
struct _cef_menu_model_t* menu_model,
|
||||||
|
int is_rtl);
|
||||||
|
|
||||||
///
|
///
|
||||||
// The menu is about to show.
|
// The menu is about to show.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *menu_will_show)(struct _cef_menu_model_delegate_t* self,
|
void(CEF_CALLBACK* menu_will_show)(struct _cef_menu_model_delegate_t* self,
|
||||||
struct _cef_menu_model_t* menu_model);
|
struct _cef_menu_model_t* menu_model);
|
||||||
} cef_menu_model_delegate_t;
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// The menu has closed.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* menu_closed)(struct _cef_menu_model_delegate_t* self,
|
||||||
|
struct _cef_menu_model_t* menu_model);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Optionally modify a menu item label. Return true (1) if |label| was
|
||||||
|
// modified.
|
||||||
|
///
|
||||||
|
int(CEF_CALLBACK* format_label)(struct _cef_menu_model_delegate_t* self,
|
||||||
|
struct _cef_menu_model_t* menu_model,
|
||||||
|
cef_string_t* label);
|
||||||
|
} cef_menu_model_delegate_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=e844a5ea18cdcee85faa937d5f2715452eb19d12$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
|
||||||
@@ -45,7 +47,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent an entry in navigation history.
|
// Structure used to represent an entry in navigation history.
|
||||||
///
|
///
|
||||||
@@ -53,61 +54,61 @@ typedef struct _cef_navigation_entry_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
// if this function returns false (0).
|
// if this function returns false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_valid)(struct _cef_navigation_entry_t* self);
|
int(CEF_CALLBACK* is_valid)(struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the actual URL of the page. For some pages this may be data: URL or
|
// Returns the actual URL of the page. For some pages this may be data: URL or
|
||||||
// similar. Use get_display_url() to return a display-friendly version.
|
// similar. Use get_display_url() to return a display-friendly version.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_url)(
|
||||||
struct _cef_navigation_entry_t* self);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns a display-friendly version of the URL.
|
// Returns a display-friendly version of the URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_display_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_display_url)(
|
||||||
struct _cef_navigation_entry_t* self);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the original URL that was entered by the user before any redirects.
|
// Returns the original URL that was entered by the user before any redirects.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_original_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_original_url)(
|
||||||
struct _cef_navigation_entry_t* self);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the title set by the page. This value may be NULL.
|
// Returns the title set by the page. This value may be NULL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_title)(
|
cef_string_userfree_t(CEF_CALLBACK* get_title)(
|
||||||
struct _cef_navigation_entry_t* self);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the transition type which indicates what the user did to move to
|
// Returns the transition type which indicates what the user did to move to
|
||||||
// this page from the previous page.
|
// this page from the previous page.
|
||||||
///
|
///
|
||||||
cef_transition_type_t (CEF_CALLBACK *get_transition_type)(
|
cef_transition_type_t(CEF_CALLBACK* get_transition_type)(
|
||||||
struct _cef_navigation_entry_t* self);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this navigation includes post data.
|
// Returns true (1) if this navigation includes post data.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_post_data)(struct _cef_navigation_entry_t* self);
|
int(CEF_CALLBACK* has_post_data)(struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the time for the last known successful navigation completion. A
|
// Returns the time for the last known successful navigation completion. A
|
||||||
// navigation may be completed more than once if the page is reloaded. May be
|
// navigation may be completed more than once if the page is reloaded. May be
|
||||||
// 0 if the navigation has not yet completed.
|
// 0 if the navigation has not yet completed.
|
||||||
///
|
///
|
||||||
cef_time_t (CEF_CALLBACK *get_completion_time)(
|
cef_time_t(CEF_CALLBACK* get_completion_time)(
|
||||||
struct _cef_navigation_entry_t* self);
|
struct _cef_navigation_entry_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -115,17 +116,15 @@ typedef struct _cef_navigation_entry_t {
|
|||||||
// response. May be 0 if the response has not yet been received or if the
|
// response. May be 0 if the response has not yet been received or if the
|
||||||
// navigation has not yet completed.
|
// navigation has not yet completed.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_http_status_code)(
|
int(CEF_CALLBACK* get_http_status_code)(struct _cef_navigation_entry_t* self);
|
||||||
struct _cef_navigation_entry_t* self);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the SSL information for this navigation entry.
|
// Returns the SSL information for this navigation entry.
|
||||||
///
|
///
|
||||||
struct _cef_sslstatus_t* (CEF_CALLBACK *get_sslstatus)(
|
struct _cef_sslstatus_t*(CEF_CALLBACK* get_sslstatus)(
|
||||||
struct _cef_navigation_entry_t* self);
|
struct _cef_navigation_entry_t* self);
|
||||||
} cef_navigation_entry_t;
|
} cef_navigation_entry_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=8aa93dd5092138e1cbc66c512624be41de71c1d3$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add an entry to the cross-origin access whitelist.
|
// 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.
|
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
||||||
const cef_string_t* source_origin, const cef_string_t* target_protocol,
|
const cef_string_t* source_origin,
|
||||||
const cef_string_t* target_domain, int allow_target_subdomains);
|
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
|
// Remove an entry from the cross-origin access whitelist. Returns false (0) if
|
||||||
// |source_origin| is invalid or the whitelist cannot be accessed.
|
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
||||||
const cef_string_t* source_origin, const cef_string_t* target_protocol,
|
const cef_string_t* source_origin,
|
||||||
const cef_string_t* target_domain, int allow_target_subdomains);
|
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)
|
// Remove all entries from the cross-origin access whitelist. Returns false (0)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=9f1c8c065c1604c5d09435e0869b45fd3f51aa31$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
|
||||||
@@ -44,13 +46,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Parse the specified |url| into its component parts. Returns false (0) if the
|
// Parse the specified |url| into its component parts. Returns false (0) if the
|
||||||
// URL is NULL or invalid.
|
// URL is NULL or invalid.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
|
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
|
||||||
struct _cef_urlparts_t* parts);
|
struct _cef_urlparts_t* parts);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Creates a URL from the specified |parts|, which must contain a non-NULL spec
|
// Creates a URL from the specified |parts|, which must contain a non-NULL spec
|
||||||
@@ -58,7 +59,7 @@ CEF_EXPORT int cef_parse_url(const cef_string_t* url,
|
|||||||
// if |parts| isn't initialized as described.
|
// if |parts| isn't initialized as described.
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
|
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
|
||||||
cef_string_t* url);
|
cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// This is a convenience function for formatting a URL in a concise and human-
|
// This is a convenience function for formatting a URL in a concise and human-
|
||||||
@@ -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.
|
// for URLs which will be parsed or sent to other applications.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t cef_format_url_for_security_display(
|
CEF_EXPORT cef_string_userfree_t
|
||||||
const cef_string_t* origin_url);
|
cef_format_url_for_security_display(const cef_string_t* origin_url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the mime type for the specified file extension or an NULL string if
|
// Returns the mime type for the specified file extension or an NULL string if
|
||||||
// unknown.
|
// unknown.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t cef_get_mime_type(
|
CEF_EXPORT cef_string_userfree_t
|
||||||
const cef_string_t* extension);
|
cef_get_mime_type(const cef_string_t* extension);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the extensions associated with the given mime type. This should be passed
|
// Get the extensions associated with the given mime type. This should be passed
|
||||||
@@ -89,14 +90,14 @@ CEF_EXPORT cef_string_userfree_t cef_get_mime_type(
|
|||||||
// elements in the provided vector will not be erased.
|
// elements in the provided vector will not be erased.
|
||||||
///
|
///
|
||||||
CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type,
|
CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type,
|
||||||
cef_string_list_t extensions);
|
cef_string_list_t extensions);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Encodes |data| as a base64 string.
|
// Encodes |data| as a base64 string.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data,
|
CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data,
|
||||||
size_t data_size);
|
size_t data_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Decodes the base64 encoded string |data|. The returned value will be NULL if
|
// Decodes the base64 encoded string |data|. The returned value will be NULL if
|
||||||
@@ -113,7 +114,7 @@ CEF_EXPORT struct _cef_binary_value_t* cef_base64decode(
|
|||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text,
|
CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text,
|
||||||
int use_plus);
|
int use_plus);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Unescapes |text| and returns the result. Unescaping consists of looking for
|
// Unescapes |text| and returns the result. Unescaping consists of looking for
|
||||||
@@ -126,14 +127,17 @@ CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text,
|
|||||||
// supports further customization the decoding process.
|
// supports further customization the decoding process.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t cef_uridecode(const cef_string_t* text,
|
CEF_EXPORT cef_string_userfree_t
|
||||||
int convert_to_utf8, cef_uri_unescape_rule_t unescape_rule);
|
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
|
// Parses the specified |json_string| and returns a dictionary or list
|
||||||
// representation. If JSON parsing fails this function returns NULL.
|
// representation. If JSON parsing fails this function returns NULL.
|
||||||
///
|
///
|
||||||
CEF_EXPORT struct _cef_value_t* cef_parse_json(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);
|
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.
|
// formatted error message respectively.
|
||||||
///
|
///
|
||||||
CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
|
CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
|
||||||
const cef_string_t* json_string, cef_json_parser_options_t options,
|
const cef_string_t* json_string,
|
||||||
cef_json_parser_error_t* error_code_out, cef_string_t* error_msg_out);
|
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
|
// 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.
|
// requires exclusive access to |node| including any underlying data.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
CEF_EXPORT cef_string_userfree_t cef_write_json(struct _cef_value_t* node,
|
CEF_EXPORT cef_string_userfree_t
|
||||||
cef_json_writer_options_t options);
|
cef_write_json(struct _cef_value_t* node, cef_json_writer_options_t options);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=9d02d9da5fb643fd5dfe46e12e535da7d2e874c7$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieve the path associated with the specified |key|. Returns true (1) on
|
// Retrieve the path associated with the specified |key|. Returns true (1) on
|
||||||
// success. Can be called on any thread in the browser process.
|
// success. Can be called on any thread in the browser process.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=e063de969dd9903ca0265346818bbbaa52f5446b$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
|
||||||
@@ -46,7 +48,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure for asynchronous continuation of print dialog requests.
|
// Callback structure for asynchronous continuation of print dialog requests.
|
||||||
///
|
///
|
||||||
@@ -54,21 +55,20 @@ typedef struct _cef_print_dialog_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Continue printing with the specified |settings|.
|
// Continue printing with the specified |settings|.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cont)(struct _cef_print_dialog_callback_t* self,
|
void(CEF_CALLBACK* cont)(struct _cef_print_dialog_callback_t* self,
|
||||||
struct _cef_print_settings_t* settings);
|
struct _cef_print_settings_t* settings);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Cancel the printing.
|
// Cancel the printing.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cancel)(struct _cef_print_dialog_callback_t* self);
|
void(CEF_CALLBACK* cancel)(struct _cef_print_dialog_callback_t* self);
|
||||||
} cef_print_dialog_callback_t;
|
} cef_print_dialog_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure for asynchronous continuation of print job requests.
|
// Callback structure for asynchronous continuation of print job requests.
|
||||||
///
|
///
|
||||||
@@ -76,24 +76,24 @@ typedef struct _cef_print_job_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Indicate completion of the print job.
|
// Indicate completion of the print job.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cont)(struct _cef_print_job_callback_t* self);
|
void(CEF_CALLBACK* cont)(struct _cef_print_job_callback_t* self);
|
||||||
} cef_print_job_callback_t;
|
} cef_print_job_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle printing on Linux. The functions of this
|
// Implement this structure to handle printing on Linux. Each browser will have
|
||||||
// structure will be called on the browser process UI thread.
|
// 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 {
|
typedef struct _cef_print_handler_t {
|
||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when printing has started for the specified |browser|. This function
|
// Called when printing has started for the specified |browser|. This function
|
||||||
@@ -101,48 +101,56 @@ typedef struct _cef_print_handler_t {
|
|||||||
// how printing was initiated (e.g. cef_browser_host_t::print(), JavaScript
|
// how printing was initiated (e.g. cef_browser_host_t::print(), JavaScript
|
||||||
// window.print() or PDF extension print button).
|
// window.print() or PDF extension print button).
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_print_start)(struct _cef_print_handler_t* self,
|
void(CEF_CALLBACK* on_print_start)(struct _cef_print_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Synchronize |settings| with client state. If |get_defaults| is true (1)
|
// Synchronize |settings| with client state. If |get_defaults| is true (1)
|
||||||
// then populate |settings| with the default print settings. Do not keep a
|
// then populate |settings| with the default print settings. Do not keep a
|
||||||
// reference to |settings| outside of this callback.
|
// reference to |settings| outside of this callback.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_print_settings)(struct _cef_print_handler_t* self,
|
void(CEF_CALLBACK* on_print_settings)(struct _cef_print_handler_t* self,
|
||||||
struct _cef_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.
|
// Show the print dialog. Execute |callback| once the dialog is dismissed.
|
||||||
// Return true (1) if the dialog will be displayed or false (0) to cancel the
|
// Return true (1) if the dialog will be displayed or false (0) to cancel the
|
||||||
// printing immediately.
|
// printing immediately.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_print_dialog)(struct _cef_print_handler_t* self,
|
int(CEF_CALLBACK* on_print_dialog)(
|
||||||
int has_selection, struct _cef_print_dialog_callback_t* callback);
|
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
|
// Send the print job to the printer. Execute |callback| once the job is
|
||||||
// completed. Return true (1) if the job will proceed or false (0) to cancel
|
// completed. Return true (1) if the job will proceed or false (0) to cancel
|
||||||
// the job immediately.
|
// the job immediately.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_print_job)(struct _cef_print_handler_t* self,
|
int(CEF_CALLBACK* on_print_job)(struct _cef_print_handler_t* self,
|
||||||
const cef_string_t* document_name, const cef_string_t* pdf_file_path,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_print_job_callback_t* callback);
|
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.
|
// 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
|
// Return the PDF paper size in device units. Used in combination with
|
||||||
// cef_browser_host_t::print_to_pdf().
|
// cef_browser_host_t::print_to_pdf().
|
||||||
///
|
///
|
||||||
cef_size_t (CEF_CALLBACK *get_pdf_paper_size)(
|
cef_size_t(CEF_CALLBACK* get_pdf_paper_size)(
|
||||||
struct _cef_print_handler_t* self, int device_units_per_inch);
|
struct _cef_print_handler_t* self,
|
||||||
|
int device_units_per_inch);
|
||||||
} cef_print_handler_t;
|
} cef_print_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=593308c65c50c7f6bd890541426806a9bf07a00b$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure representing print settings.
|
// Structure representing print settings.
|
||||||
///
|
///
|
||||||
@@ -52,43 +53,43 @@ typedef struct _cef_print_settings_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
// if this function returns false (0).
|
// if this function returns false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_valid)(struct _cef_print_settings_t* self);
|
int(CEF_CALLBACK* is_valid)(struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||||
// expose read-only objects.
|
// expose read-only objects.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_read_only)(struct _cef_print_settings_t* self);
|
int(CEF_CALLBACK* is_read_only)(struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns a writable copy of this object.
|
// Returns a writable copy of this object.
|
||||||
///
|
///
|
||||||
struct _cef_print_settings_t* (CEF_CALLBACK *copy)(
|
struct _cef_print_settings_t*(CEF_CALLBACK* copy)(
|
||||||
struct _cef_print_settings_t* self);
|
struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the page orientation.
|
// Set the page orientation.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_orientation)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_orientation)(struct _cef_print_settings_t* self,
|
||||||
int landscape);
|
int landscape);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the orientation is landscape.
|
// Returns true (1) if the orientation is landscape.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_landscape)(struct _cef_print_settings_t* self);
|
int(CEF_CALLBACK* is_landscape)(struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the printer printable area in device units. Some platforms already
|
// Set the printer printable area in device units. Some platforms already
|
||||||
// provide flipped area. Set |landscape_needs_flip| to false (0) on those
|
// provide flipped area. Set |landscape_needs_flip| to false (0) on those
|
||||||
// platforms to avoid double flipping.
|
// platforms to avoid double flipping.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_printer_printable_area)(
|
void(CEF_CALLBACK* set_printer_printable_area)(
|
||||||
struct _cef_print_settings_t* self,
|
struct _cef_print_settings_t* self,
|
||||||
const cef_size_t* physical_size_device_units,
|
const cef_size_t* physical_size_device_units,
|
||||||
const cef_rect_t* printable_area_device_units,
|
const cef_rect_t* printable_area_device_units,
|
||||||
@@ -97,109 +98,109 @@ typedef struct _cef_print_settings_t {
|
|||||||
///
|
///
|
||||||
// Set the device name.
|
// Set the device name.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_device_name)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_device_name)(struct _cef_print_settings_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the device name.
|
// Get the device name.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_device_name)(
|
cef_string_userfree_t(CEF_CALLBACK* get_device_name)(
|
||||||
struct _cef_print_settings_t* self);
|
struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the DPI (dots per inch).
|
// Set the DPI (dots per inch).
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_dpi)(struct _cef_print_settings_t* self, int dpi);
|
void(CEF_CALLBACK* set_dpi)(struct _cef_print_settings_t* self, int dpi);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the DPI (dots per inch).
|
// Get the DPI (dots per inch).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_dpi)(struct _cef_print_settings_t* self);
|
int(CEF_CALLBACK* get_dpi)(struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the page ranges.
|
// Set the page ranges.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_page_ranges)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_page_ranges)(struct _cef_print_settings_t* self,
|
||||||
size_t rangesCount, cef_range_t const* ranges);
|
size_t rangesCount,
|
||||||
|
cef_range_t const* ranges);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the number of page ranges that currently exist.
|
// Returns the number of page ranges that currently exist.
|
||||||
///
|
///
|
||||||
size_t (CEF_CALLBACK *get_page_ranges_count)(
|
size_t(CEF_CALLBACK* get_page_ranges_count)(
|
||||||
struct _cef_print_settings_t* self);
|
struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieve the page ranges.
|
// Retrieve the page ranges.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_page_ranges)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* get_page_ranges)(struct _cef_print_settings_t* self,
|
||||||
size_t* rangesCount, cef_range_t* ranges);
|
size_t* rangesCount,
|
||||||
|
cef_range_t* ranges);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set whether only the selection will be printed.
|
// Set whether only the selection will be printed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_selection_only)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_selection_only)(struct _cef_print_settings_t* self,
|
||||||
int selection_only);
|
int selection_only);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if only the selection will be printed.
|
// Returns true (1) if only the selection will be printed.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_selection_only)(struct _cef_print_settings_t* self);
|
int(CEF_CALLBACK* is_selection_only)(struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set whether pages will be collated.
|
// Set whether pages will be collated.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_collate)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_collate)(struct _cef_print_settings_t* self,
|
||||||
int collate);
|
int collate);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if pages will be collated.
|
// Returns true (1) if pages will be collated.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *will_collate)(struct _cef_print_settings_t* self);
|
int(CEF_CALLBACK* will_collate)(struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the color model.
|
// Set the color model.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_color_model)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_color_model)(struct _cef_print_settings_t* self,
|
||||||
cef_color_model_t model);
|
cef_color_model_t model);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the color model.
|
// Get the color model.
|
||||||
///
|
///
|
||||||
cef_color_model_t (CEF_CALLBACK *get_color_model)(
|
cef_color_model_t(CEF_CALLBACK* get_color_model)(
|
||||||
struct _cef_print_settings_t* self);
|
struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the number of copies.
|
// Set the number of copies.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_copies)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_copies)(struct _cef_print_settings_t* self,
|
||||||
int copies);
|
int copies);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the number of copies.
|
// Get the number of copies.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_copies)(struct _cef_print_settings_t* self);
|
int(CEF_CALLBACK* get_copies)(struct _cef_print_settings_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the duplex mode.
|
// Set the duplex mode.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_duplex_mode)(struct _cef_print_settings_t* self,
|
void(CEF_CALLBACK* set_duplex_mode)(struct _cef_print_settings_t* self,
|
||||||
cef_duplex_mode_t mode);
|
cef_duplex_mode_t mode);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the duplex mode.
|
// Get the duplex mode.
|
||||||
///
|
///
|
||||||
cef_duplex_mode_t (CEF_CALLBACK *get_duplex_mode)(
|
cef_duplex_mode_t(CEF_CALLBACK* get_duplex_mode)(
|
||||||
struct _cef_print_settings_t* self);
|
struct _cef_print_settings_t* self);
|
||||||
} cef_print_settings_t;
|
} cef_print_settings_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_print_settings_t object.
|
// Create a new cef_print_settings_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_print_settings_t* cef_print_settings_create();
|
CEF_EXPORT cef_print_settings_t* cef_print_settings_create();
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=5f8cd4eb4e6215cb0f6161b916dc51197e345204$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
||||||
@@ -45,7 +47,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure representing a message. Can be used on any process and thread.
|
// Structure representing a message. Can be used on any process and thread.
|
||||||
///
|
///
|
||||||
@@ -53,48 +54,46 @@ typedef struct _cef_process_message_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is valid. Do not call any other functions
|
// Returns true (1) if this object is valid. Do not call any other functions
|
||||||
// if this function returns false (0).
|
// if this function returns false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_valid)(struct _cef_process_message_t* self);
|
int(CEF_CALLBACK* is_valid)(struct _cef_process_message_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||||
// expose read-only objects.
|
// expose read-only objects.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_read_only)(struct _cef_process_message_t* self);
|
int(CEF_CALLBACK* is_read_only)(struct _cef_process_message_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns a writable copy of this object.
|
// Returns a writable copy of this object.
|
||||||
///
|
///
|
||||||
struct _cef_process_message_t* (CEF_CALLBACK *copy)(
|
struct _cef_process_message_t*(CEF_CALLBACK* copy)(
|
||||||
struct _cef_process_message_t* self);
|
struct _cef_process_message_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the message name.
|
// Returns the message name.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_name)(
|
cef_string_userfree_t(CEF_CALLBACK* get_name)(
|
||||||
struct _cef_process_message_t* self);
|
struct _cef_process_message_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the list of arguments.
|
// Returns the list of arguments.
|
||||||
///
|
///
|
||||||
struct _cef_list_value_t* (CEF_CALLBACK *get_argument_list)(
|
struct _cef_list_value_t*(CEF_CALLBACK* get_argument_list)(
|
||||||
struct _cef_process_message_t* self);
|
struct _cef_process_message_t* self);
|
||||||
} cef_process_message_t;
|
} cef_process_message_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_process_message_t object with the specified name.
|
// Create a new cef_process_message_t object with the specified name.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_process_message_t* cef_process_message_create(
|
CEF_EXPORT cef_process_message_t* cef_process_message_create(
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=aa003bb87d891baa8c79742dadcac6fe75f32737$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Launches the process specified via |command_line|. Returns true (1) upon
|
// Launches the process specified via |command_line|. Returns true (1) upon
|
||||||
// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
|
// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,11 +33,14 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=3fb1034cb02cfeddcaf02d8fde0dec5b8a18f416$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/capi/cef_accessibility_handler_capi.h"
|
||||||
#include "include/capi/cef_base_capi.h"
|
#include "include/capi/cef_base_capi.h"
|
||||||
#include "include/capi/cef_browser_capi.h"
|
#include "include/capi/cef_browser_capi.h"
|
||||||
#include "include/capi/cef_drag_data_capi.h"
|
#include "include/capi/cef_drag_data_capi.h"
|
||||||
@@ -46,7 +49,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events when window rendering is disabled.
|
// Implement this structure to handle events when window rendering is disabled.
|
||||||
// The functions of this structure will be called on the UI thread.
|
// The functions of this structure will be called on the UI thread.
|
||||||
@@ -55,29 +57,41 @@ typedef struct _cef_render_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
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
|
// Called to retrieve the root window rectangle in screen coordinates. Return
|
||||||
// true (1) if the rectangle was provided.
|
// true (1) if the rectangle was provided.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_root_screen_rect)(struct _cef_render_handler_t* self,
|
int(CEF_CALLBACK* get_root_screen_rect)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, cef_rect_t* rect);
|
struct _cef_browser_t* browser,
|
||||||
|
cef_rect_t* rect);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called to retrieve the view rectangle which is relative to screen
|
// Called to retrieve the view rectangle which is relative to screen
|
||||||
// coordinates. Return true (1) if the rectangle was provided.
|
// coordinates. Return true (1) if the rectangle was provided.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self,
|
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
|
// Called to retrieve the translation from view coordinates to actual screen
|
||||||
// coordinates. Return true (1) if the screen coordinates were provided.
|
// coordinates. Return true (1) if the screen coordinates were provided.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self,
|
int(CEF_CALLBACK* get_screen_point)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, int viewX, int viewY, int* screenX,
|
struct _cef_browser_t* browser,
|
||||||
int* screenY);
|
int viewX,
|
||||||
|
int viewY,
|
||||||
|
int* screenX,
|
||||||
|
int* screenY);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called to allow the client to fill in the CefScreenInfo object with
|
// Called to allow the client to fill in the CefScreenInfo object with
|
||||||
@@ -88,22 +102,25 @@ typedef struct _cef_render_handler_t {
|
|||||||
// will be used. If the rectangle is still NULL or invalid popups may not be
|
// will be used. If the rectangle is still NULL or invalid popups may not be
|
||||||
// drawn correctly.
|
// drawn correctly.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_screen_info)(struct _cef_render_handler_t* self,
|
int(CEF_CALLBACK* get_screen_info)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_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
|
// Called when the browser wants to show or hide the popup widget. The popup
|
||||||
// should be shown if |show| is true (1) and hidden if |show| is false (0).
|
// should be shown if |show| is true (1) and hidden if |show| is false (0).
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self,
|
void(CEF_CALLBACK* on_popup_show)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, int show);
|
struct _cef_browser_t* browser,
|
||||||
|
int show);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the browser wants to move or resize the popup widget. |rect|
|
// Called when the browser wants to move or resize the popup widget. |rect|
|
||||||
// contains the new location and size in view coordinates.
|
// contains the new location and size in view coordinates.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self,
|
void(CEF_CALLBACK* on_popup_size)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, 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
|
// Called when an element should be painted. Pixel values passed to this
|
||||||
@@ -115,17 +132,23 @@ typedef struct _cef_render_handler_t {
|
|||||||
// be |width|*|height|*4 bytes in size and represents a BGRA image with an
|
// be |width|*|height|*4 bytes in size and represents a BGRA image with an
|
||||||
// upper-left origin.
|
// upper-left origin.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self,
|
void(CEF_CALLBACK* on_paint)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, cef_paint_element_type_t type,
|
struct _cef_browser_t* browser,
|
||||||
size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer,
|
cef_paint_element_type_t type,
|
||||||
int width, int height);
|
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
|
// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
|
||||||
// |custom_cursor_info| will be populated with the custom cursor information.
|
// |custom_cursor_info| will be populated with the custom cursor information.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self,
|
void(CEF_CALLBACK* on_cursor_change)(
|
||||||
struct _cef_browser_t* browser, cef_cursor_handle_t cursor,
|
struct _cef_render_handler_t* self,
|
||||||
|
struct _cef_browser_t* browser,
|
||||||
|
cef_cursor_handle_t cursor,
|
||||||
cef_cursor_type_t type,
|
cef_cursor_type_t type,
|
||||||
const struct _cef_cursor_info_t* custom_cursor_info);
|
const struct _cef_cursor_info_t* custom_cursor_info);
|
||||||
|
|
||||||
@@ -143,26 +166,43 @@ typedef struct _cef_render_handler_t {
|
|||||||
// synchronously or asynchronously to inform the web view that the drag
|
// synchronously or asynchronously to inform the web view that the drag
|
||||||
// operation has ended.
|
// operation has ended.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *start_dragging)(struct _cef_render_handler_t* self,
|
int(CEF_CALLBACK* start_dragging)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_drag_data_t* drag_data,
|
struct _cef_browser_t* browser,
|
||||||
cef_drag_operations_mask_t allowed_ops, int x, int y);
|
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 &
|
// Called when the web view wants to update the mouse cursor during a drag &
|
||||||
// drop operation. |operation| describes the allowed operation (none, move,
|
// drop operation. |operation| describes the allowed operation (none, move,
|
||||||
// copy, link).
|
// copy, link).
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *update_drag_cursor)(struct _cef_render_handler_t* self,
|
void(CEF_CALLBACK* update_drag_cursor)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, cef_drag_operations_mask_t operation);
|
struct _cef_browser_t* browser,
|
||||||
|
cef_drag_operations_mask_t operation);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the scroll offset has changed.
|
// Called when the scroll offset has changed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_scroll_offset_changed)(
|
void(CEF_CALLBACK* on_scroll_offset_changed)(
|
||||||
struct _cef_render_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_render_handler_t* self,
|
||||||
double x, double y);
|
struct _cef_browser_t* browser,
|
||||||
} cef_render_handler_t;
|
double x,
|
||||||
|
double y);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called when the IME composition range has changed. |selected_range| is the
|
||||||
|
// range of characters that have been selected. |character_bounds| is the
|
||||||
|
// bounds of each character in view coordinates.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* on_ime_composition_range_changed)(
|
||||||
|
struct _cef_render_handler_t* self,
|
||||||
|
struct _cef_browser_t* browser,
|
||||||
|
const cef_range_t* selected_range,
|
||||||
|
size_t character_boundsCount,
|
||||||
|
cef_rect_t const* character_bounds);
|
||||||
|
} cef_render_handler_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=44b61ca19efaae0a664d6d502d550755fbf326fa$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
||||||
#define 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" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to implement render process callbacks. The functions of this
|
// Structure used to implement render process callbacks. The functions of this
|
||||||
// structure will be called on the render process main thread (TID_RENDERER)
|
// structure will be called on the render process main thread (TID_RENDERER)
|
||||||
@@ -61,7 +62,7 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called after the render process main thread has been created. |extra_info|
|
// Called after the render process main thread has been created. |extra_info|
|
||||||
@@ -69,14 +70,14 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
// cef_browser_process_handler_t::on_render_process_thread_created(). Do not
|
// cef_browser_process_handler_t::on_render_process_thread_created(). Do not
|
||||||
// keep a reference to |extra_info| outside of this function.
|
// keep a reference to |extra_info| outside of this function.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_render_thread_created)(
|
void(CEF_CALLBACK* on_render_thread_created)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_render_process_handler_t* self,
|
||||||
struct _cef_list_value_t* extra_info);
|
struct _cef_list_value_t* extra_info);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called after WebKit has been initialized.
|
// Called after WebKit has been initialized.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_web_kit_initialized)(
|
void(CEF_CALLBACK* on_web_kit_initialized)(
|
||||||
struct _cef_render_process_handler_t* self);
|
struct _cef_render_process_handler_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -84,21 +85,21 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
// browser will be created before the old browser with the same identifier is
|
// browser will be created before the old browser with the same identifier is
|
||||||
// destroyed.
|
// destroyed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_browser_created)(
|
void(CEF_CALLBACK* on_browser_created)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_render_process_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called before a browser is destroyed.
|
// Called before a browser is destroyed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_browser_destroyed)(
|
void(CEF_CALLBACK* on_browser_destroyed)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_render_process_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for browser load status events.
|
// Return the handler for browser load status events.
|
||||||
///
|
///
|
||||||
struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)(
|
struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)(
|
||||||
struct _cef_render_process_handler_t* self);
|
struct _cef_render_process_handler_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -106,10 +107,12 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
// or false (0) to allow the navigation to proceed. The |request| object
|
// or false (0) to allow the navigation to proceed. The |request| object
|
||||||
// cannot be modified in this callback.
|
// cannot be modified in this callback.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_before_navigation)(
|
int(CEF_CALLBACK* on_before_navigation)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_render_process_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_request_t* request, cef_navigation_type_t navigation_type,
|
struct _cef_frame_t* frame,
|
||||||
|
struct _cef_request_t* request,
|
||||||
|
cef_navigation_type_t navigation_type,
|
||||||
int is_redirect);
|
int is_redirect);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -120,18 +123,20 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
// on the associated thread can be retrieved via the
|
// on the associated thread can be retrieved via the
|
||||||
// cef_v8context_t::get_task_runner() function.
|
// cef_v8context_t::get_task_runner() function.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_context_created)(
|
void(CEF_CALLBACK* on_context_created)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_render_process_handler_t* self,
|
||||||
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);
|
struct _cef_v8context_t* context);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called immediately before the V8 context for a frame is released. No
|
// Called immediately before the V8 context for a frame is released. No
|
||||||
// references to the context should be kept after this function is called.
|
// references to the context should be kept after this function is called.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_context_released)(
|
void(CEF_CALLBACK* on_context_released)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_render_process_handler_t* self,
|
||||||
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);
|
struct _cef_v8context_t* context);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -139,10 +144,12 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
// callback is disabled by default. To enable set
|
// callback is disabled by default. To enable set
|
||||||
// CefSettings.uncaught_exception_stack_size > 0.
|
// CefSettings.uncaught_exception_stack_size > 0.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_uncaught_exception)(
|
void(CEF_CALLBACK* on_uncaught_exception)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_render_process_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_v8context_t* context, struct _cef_v8exception_t* exception,
|
struct _cef_frame_t* frame,
|
||||||
|
struct _cef_v8context_t* context,
|
||||||
|
struct _cef_v8exception_t* exception,
|
||||||
struct _cef_v8stack_trace_t* stackTrace);
|
struct _cef_v8stack_trace_t* stackTrace);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -153,9 +160,10 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
// keep references to or attempt to access any DOM objects outside the scope
|
// keep references to or attempt to access any DOM objects outside the scope
|
||||||
// of this function.
|
// of this function.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_focused_node_changed)(
|
void(CEF_CALLBACK* on_focused_node_changed)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_render_process_handler_t* self,
|
||||||
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);
|
struct _cef_domnode_t* node);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -163,13 +171,13 @@ typedef struct _cef_render_process_handler_t {
|
|||||||
// (1) if the message was handled or false (0) otherwise. Do not keep a
|
// (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.
|
// reference to or attempt to access the message outside of this callback.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_process_message_received)(
|
int(CEF_CALLBACK* on_process_message_received)(
|
||||||
struct _cef_render_process_handler_t* self,
|
struct _cef_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);
|
struct _cef_process_message_t* message);
|
||||||
} cef_render_process_handler_t;
|
} cef_render_process_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=d7f34d867389c53c384f366e08f958ed724f9b90$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
||||||
@@ -55,123 +57,126 @@ typedef struct _cef_request_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is read-only.
|
// Returns true (1) if this object is read-only.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_read_only)(struct _cef_request_t* self);
|
int(CEF_CALLBACK* is_read_only)(struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the fully qualified URL.
|
// Get the fully qualified URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self);
|
cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the fully qualified URL.
|
// Set the fully qualified URL.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_url)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_url)(struct _cef_request_t* self,
|
||||||
const cef_string_t* url);
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the request function type. The value will default to POST if post data
|
// Get the request function type. The value will default to POST if post data
|
||||||
// is provided and GET otherwise.
|
// is provided and GET otherwise.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self);
|
cef_string_userfree_t(CEF_CALLBACK* get_method)(struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the request function type.
|
// Set the request function type.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_method)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_method)(struct _cef_request_t* self,
|
||||||
const cef_string_t* method);
|
const cef_string_t* method);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the referrer URL and policy. If non-NULL the referrer URL must be fully
|
// Set the referrer URL and policy. If non-NULL the referrer URL must be fully
|
||||||
// qualified with an HTTP or HTTPS scheme component. Any username, password or
|
// qualified with an HTTP or HTTPS scheme component. Any username, password or
|
||||||
// ref component will be removed.
|
// ref component will be removed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_referrer)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_referrer)(struct _cef_request_t* self,
|
||||||
const cef_string_t* referrer_url, cef_referrer_policy_t policy);
|
const cef_string_t* referrer_url,
|
||||||
|
cef_referrer_policy_t policy);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the referrer URL.
|
// Get the referrer URL.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_referrer_url)(
|
cef_string_userfree_t(CEF_CALLBACK* get_referrer_url)(
|
||||||
struct _cef_request_t* self);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the referrer policy.
|
// Get the referrer policy.
|
||||||
///
|
///
|
||||||
cef_referrer_policy_t (CEF_CALLBACK *get_referrer_policy)(
|
cef_referrer_policy_t(CEF_CALLBACK* get_referrer_policy)(
|
||||||
struct _cef_request_t* self);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the post data.
|
// Get the post data.
|
||||||
///
|
///
|
||||||
struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)(
|
struct _cef_post_data_t*(CEF_CALLBACK* get_post_data)(
|
||||||
struct _cef_request_t* self);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the post data.
|
// Set the post data.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_post_data)(struct _cef_request_t* self,
|
||||||
struct _cef_post_data_t* postData);
|
struct _cef_post_data_t* postData);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the header values. Will not include the Referer value if any.
|
// Get the header values. Will not include the Referer value if any.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* get_header_map)(struct _cef_request_t* self,
|
||||||
cef_string_multimap_t headerMap);
|
cef_string_multimap_t headerMap);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the header values. If a Referer value exists in the header map it will
|
// Set the header values. If a Referer value exists in the header map it will
|
||||||
// be removed and ignored.
|
// be removed and ignored.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self,
|
void(CEF_CALLBACK* set_header_map)(struct _cef_request_t* self,
|
||||||
cef_string_multimap_t headerMap);
|
cef_string_multimap_t headerMap);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set all values at one time.
|
// Set all values at one time.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url,
|
void(CEF_CALLBACK* set)(struct _cef_request_t* self,
|
||||||
const cef_string_t* method, struct _cef_post_data_t* postData,
|
const cef_string_t* url,
|
||||||
cef_string_multimap_t headerMap);
|
const cef_string_t* method,
|
||||||
|
struct _cef_post_data_t* postData,
|
||||||
|
cef_string_multimap_t headerMap);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the flags used in combination with cef_urlrequest_t. See
|
// Get the flags used in combination with cef_urlrequest_t. See
|
||||||
// cef_urlrequest_flags_t for supported values.
|
// cef_urlrequest_flags_t for supported values.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_flags)(struct _cef_request_t* self);
|
int(CEF_CALLBACK* get_flags)(struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the flags used in combination with cef_urlrequest_t. See
|
// Set the flags used in combination with cef_urlrequest_t. See
|
||||||
// cef_urlrequest_flags_t for supported values.
|
// cef_urlrequest_flags_t for supported values.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self, int flags);
|
void(CEF_CALLBACK* set_flags)(struct _cef_request_t* self, int flags);
|
||||||
|
|
||||||
///
|
|
||||||
// Set the URL to the first party for cookies used in combination with
|
|
||||||
// cef_urlrequest_t.
|
|
||||||
///
|
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)(
|
|
||||||
struct _cef_request_t* self);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the URL to the first party for cookies used in combination with
|
// Get the URL to the first party for cookies used in combination with
|
||||||
// cef_urlrequest_t.
|
// cef_urlrequest_t.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self,
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
const cef_string_t* url);
|
cef_string_userfree_t(CEF_CALLBACK* get_first_party_for_cookies)(
|
||||||
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set the URL to the first party for cookies used in combination with
|
||||||
|
// cef_urlrequest_t.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* set_first_party_for_cookies)(struct _cef_request_t* self,
|
||||||
|
const cef_string_t* url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the resource type for this request. Only available in the browser
|
// Get the resource type for this request. Only available in the browser
|
||||||
// process.
|
// process.
|
||||||
///
|
///
|
||||||
cef_resource_type_t (CEF_CALLBACK *get_resource_type)(
|
cef_resource_type_t(CEF_CALLBACK* get_resource_type)(
|
||||||
struct _cef_request_t* self);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -179,7 +184,7 @@ typedef struct _cef_request_t {
|
|||||||
// process and only applies to requests that represent a main frame or sub-
|
// process and only applies to requests that represent a main frame or sub-
|
||||||
// frame navigation.
|
// frame navigation.
|
||||||
///
|
///
|
||||||
cef_transition_type_t (CEF_CALLBACK *get_transition_type)(
|
cef_transition_type_t(CEF_CALLBACK* get_transition_type)(
|
||||||
struct _cef_request_t* self);
|
struct _cef_request_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -187,16 +192,14 @@ typedef struct _cef_request_t {
|
|||||||
// specified. Can be used by cef_request_tHandler implementations in the
|
// specified. Can be used by cef_request_tHandler implementations in the
|
||||||
// browser process to track a single request across multiple callbacks.
|
// browser process to track a single request across multiple callbacks.
|
||||||
///
|
///
|
||||||
uint64 (CEF_CALLBACK *get_identifier)(struct _cef_request_t* self);
|
uint64(CEF_CALLBACK* get_identifier)(struct _cef_request_t* self);
|
||||||
} cef_request_t;
|
} cef_request_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_request_t object.
|
// Create a new cef_request_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_request_t* cef_request_create();
|
CEF_EXPORT cef_request_t* cef_request_create();
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent post data for a web request. The functions of
|
// Structure used to represent post data for a web request. The functions of
|
||||||
// this structure may be called on any thread.
|
// this structure may be called on any thread.
|
||||||
@@ -205,12 +208,12 @@ typedef struct _cef_post_data_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is read-only.
|
// Returns true (1) if this object is read-only.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_t* self);
|
int(CEF_CALLBACK* is_read_only)(struct _cef_post_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if the underlying POST data includes elements that are not
|
// Returns true (1) if the underlying POST data includes elements that are not
|
||||||
@@ -218,45 +221,44 @@ typedef struct _cef_post_data_t {
|
|||||||
// upload data). Modifying cef_post_data_t objects with excluded elements may
|
// upload data). Modifying cef_post_data_t objects with excluded elements may
|
||||||
// result in the request failing.
|
// result in the request failing.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_excluded_elements)(struct _cef_post_data_t* self);
|
int(CEF_CALLBACK* has_excluded_elements)(struct _cef_post_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the number of existing post data elements.
|
// Returns the number of existing post data elements.
|
||||||
///
|
///
|
||||||
size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self);
|
size_t(CEF_CALLBACK* get_element_count)(struct _cef_post_data_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Retrieve the post data elements.
|
// Retrieve the post data elements.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_elements)(struct _cef_post_data_t* self,
|
void(CEF_CALLBACK* get_elements)(struct _cef_post_data_t* self,
|
||||||
size_t* elementsCount, 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
|
// Remove the specified post data element. Returns true (1) if the removal
|
||||||
// succeeds.
|
// succeeds.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self,
|
int(CEF_CALLBACK* remove_element)(struct _cef_post_data_t* self,
|
||||||
struct _cef_post_data_element_t* element);
|
struct _cef_post_data_element_t* element);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Add the specified post data element. Returns true (1) if the add succeeds.
|
// Add the specified post data element. Returns true (1) if the add succeeds.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self,
|
int(CEF_CALLBACK* add_element)(struct _cef_post_data_t* self,
|
||||||
struct _cef_post_data_element_t* element);
|
struct _cef_post_data_element_t* element);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Remove all existing post data elements.
|
// Remove all existing post data elements.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self);
|
void(CEF_CALLBACK* remove_elements)(struct _cef_post_data_t* self);
|
||||||
} cef_post_data_t;
|
} cef_post_data_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_post_data_t object.
|
// Create a new cef_post_data_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_post_data_t* cef_post_data_create();
|
CEF_EXPORT cef_post_data_t* cef_post_data_create();
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent a single element in the request post data. The
|
// Structure used to represent a single element in the request post data. The
|
||||||
// functions of this structure may be called on any thread.
|
// functions of this structure may be called on any thread.
|
||||||
@@ -265,64 +267,64 @@ typedef struct _cef_post_data_element_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is read-only.
|
// Returns true (1) if this object is read-only.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_element_t* self);
|
int(CEF_CALLBACK* is_read_only)(struct _cef_post_data_element_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Remove all contents from the post data element.
|
// Remove all contents from the post data element.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self);
|
void(CEF_CALLBACK* set_to_empty)(struct _cef_post_data_element_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// The post data element will represent a file.
|
// The post data element will represent a file.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self,
|
void(CEF_CALLBACK* set_to_file)(struct _cef_post_data_element_t* self,
|
||||||
const cef_string_t* fileName);
|
const cef_string_t* fileName);
|
||||||
|
|
||||||
///
|
///
|
||||||
// The post data element will represent bytes. The bytes passed in will be
|
// The post data element will represent bytes. The bytes passed in will be
|
||||||
// copied.
|
// copied.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self,
|
void(CEF_CALLBACK* set_to_bytes)(struct _cef_post_data_element_t* self,
|
||||||
size_t size, const void* bytes);
|
size_t size,
|
||||||
|
const void* bytes);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the type of this post data element.
|
// Return the type of this post data element.
|
||||||
///
|
///
|
||||||
cef_postdataelement_type_t (CEF_CALLBACK *get_type)(
|
cef_postdataelement_type_t(CEF_CALLBACK* get_type)(
|
||||||
struct _cef_post_data_element_t* self);
|
struct _cef_post_data_element_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the file name.
|
// Return the file name.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_file)(
|
cef_string_userfree_t(CEF_CALLBACK* get_file)(
|
||||||
struct _cef_post_data_element_t* self);
|
struct _cef_post_data_element_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the number of bytes.
|
// Return the number of bytes.
|
||||||
///
|
///
|
||||||
size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self);
|
size_t(CEF_CALLBACK* get_bytes_count)(struct _cef_post_data_element_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Read up to |size| bytes into |bytes| and return the number of bytes
|
// Read up to |size| bytes into |bytes| and return the number of bytes
|
||||||
// actually read.
|
// actually read.
|
||||||
///
|
///
|
||||||
size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self,
|
size_t(CEF_CALLBACK* get_bytes)(struct _cef_post_data_element_t* self,
|
||||||
size_t size, void* bytes);
|
size_t size,
|
||||||
|
void* bytes);
|
||||||
} cef_post_data_element_t;
|
} cef_post_data_element_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_post_data_element_t object.
|
// Create a new cef_post_data_element_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
|
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=5f6d84d988bab3a600e6fbb6db0523acaeef88b3$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
|
||||||
#define 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_callback_capi.h"
|
||||||
#include "include/capi/cef_cookie_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_request_context_handler_capi.h"
|
||||||
#include "include/capi/cef_values_capi.h"
|
#include "include/capi/cef_values_capi.h"
|
||||||
|
|
||||||
@@ -56,19 +60,18 @@ typedef struct _cef_resolve_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called after the ResolveHost request has completed. |result| will be the
|
// Called on the UI thread after the ResolveHost request has completed.
|
||||||
// result code. |resolved_ips| will be the list of resolved IP addresses or
|
// |result| will be the result code. |resolved_ips| will be the list of
|
||||||
// NULL if the resolution failed.
|
// resolved IP addresses or NULL if the resolution failed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_resolve_completed)(
|
void(CEF_CALLBACK* on_resolve_completed)(struct _cef_resolve_callback_t* self,
|
||||||
struct _cef_resolve_callback_t* self, cef_errorcode_t result,
|
cef_errorcode_t result,
|
||||||
cef_string_list_t resolved_ips);
|
cef_string_list_t resolved_ips);
|
||||||
} cef_resolve_callback_t;
|
} cef_resolve_callback_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// A request context provides request handling for a set of related browser or
|
// 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
|
// URL request objects. A request context can be specified when creating a new
|
||||||
@@ -89,33 +92,33 @@ typedef struct _cef_request_context_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is pointing to the same context as |that|
|
// Returns true (1) if this object is pointing to the same context as |that|
|
||||||
// object.
|
// object.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_same)(struct _cef_request_context_t* self,
|
int(CEF_CALLBACK* is_same)(struct _cef_request_context_t* self,
|
||||||
struct _cef_request_context_t* other);
|
struct _cef_request_context_t* other);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is sharing the same storage as |that|
|
// Returns true (1) if this object is sharing the same storage as |that|
|
||||||
// object.
|
// object.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_sharing_with)(struct _cef_request_context_t* self,
|
int(CEF_CALLBACK* is_sharing_with)(struct _cef_request_context_t* self,
|
||||||
struct _cef_request_context_t* other);
|
struct _cef_request_context_t* other);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is the global context. The global context
|
// Returns true (1) if this object is the global context. The global context
|
||||||
// is used by default when creating a browser or URL request with a NULL
|
// is used by default when creating a browser or URL request with a NULL
|
||||||
// context argument.
|
// context argument.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_global)(struct _cef_request_context_t* self);
|
int(CEF_CALLBACK* is_global)(struct _cef_request_context_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the handler for this context if any.
|
// Returns the handler for this context if any.
|
||||||
///
|
///
|
||||||
struct _cef_request_context_handler_t* (CEF_CALLBACK *get_handler)(
|
struct _cef_request_context_handler_t*(CEF_CALLBACK* get_handler)(
|
||||||
struct _cef_request_context_t* self);
|
struct _cef_request_context_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -123,7 +126,7 @@ typedef struct _cef_request_context_t {
|
|||||||
// memory cache is being used.
|
// memory cache is being used.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_cache_path)(
|
cef_string_userfree_t(CEF_CALLBACK* get_cache_path)(
|
||||||
struct _cef_request_context_t* self);
|
struct _cef_request_context_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -134,7 +137,7 @@ typedef struct _cef_request_context_t {
|
|||||||
// If |callback| is non-NULL it will be executed asnychronously on the IO
|
// If |callback| is non-NULL it will be executed asnychronously on the IO
|
||||||
// thread after the manager's storage has been initialized.
|
// thread after the manager's storage has been initialized.
|
||||||
///
|
///
|
||||||
struct _cef_cookie_manager_t* (CEF_CALLBACK *get_default_cookie_manager)(
|
struct _cef_cookie_manager_t*(CEF_CALLBACK* get_default_cookie_manager)(
|
||||||
struct _cef_request_context_t* self,
|
struct _cef_request_context_t* self,
|
||||||
struct _cef_completion_callback_t* callback);
|
struct _cef_completion_callback_t* callback);
|
||||||
|
|
||||||
@@ -151,8 +154,9 @@ typedef struct _cef_request_context_t {
|
|||||||
// optional |domain_name|. Returns false (0) if an error occurs. This function
|
// optional |domain_name|. Returns false (0) if an error occurs. This function
|
||||||
// may be called on any thread in the browser process.
|
// may be called on any thread in the browser process.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *register_scheme_handler_factory)(
|
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,
|
const cef_string_t* domain_name,
|
||||||
struct _cef_scheme_handler_factory_t* factory);
|
struct _cef_scheme_handler_factory_t* factory);
|
||||||
|
|
||||||
@@ -160,7 +164,7 @@ typedef struct _cef_request_context_t {
|
|||||||
// Clear all registered scheme handler factories. Returns false (0) on error.
|
// Clear all registered scheme handler factories. Returns false (0) on error.
|
||||||
// This function may be called on any thread in the browser process.
|
// This function may be called on any thread in the browser process.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *clear_scheme_handler_factories)(
|
int(CEF_CALLBACK* clear_scheme_handler_factories)(
|
||||||
struct _cef_request_context_t* self);
|
struct _cef_request_context_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -170,15 +174,16 @@ typedef struct _cef_request_context_t {
|
|||||||
// cef_request_tContextHandler::OnBeforePluginLoad may be called to rebuild
|
// cef_request_tContextHandler::OnBeforePluginLoad may be called to rebuild
|
||||||
// the plugin list cache.
|
// the plugin list cache.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *purge_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
|
// Returns true (1) if a preference with the specified |name| exists. This
|
||||||
// function must be called on the browser process UI thread.
|
// function must be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *has_preference)(struct _cef_request_context_t* self,
|
int(CEF_CALLBACK* has_preference)(struct _cef_request_context_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the value for the preference with the specified |name|. Returns
|
// Returns the value for the preference with the specified |name|. Returns
|
||||||
@@ -187,8 +192,9 @@ typedef struct _cef_request_context_t {
|
|||||||
// will not modify the underlying preference value. This function must be
|
// will not modify the underlying preference value. This function must be
|
||||||
// called on the browser process UI thread.
|
// called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
struct _cef_value_t* (CEF_CALLBACK *get_preference)(
|
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)
|
// Returns all preferences as a dictionary. If |include_defaults| is true (1)
|
||||||
@@ -198,8 +204,9 @@ typedef struct _cef_request_context_t {
|
|||||||
// preference values. This function must be called on the browser process UI
|
// preference values. This function must be called on the browser process UI
|
||||||
// thread.
|
// thread.
|
||||||
///
|
///
|
||||||
struct _cef_dictionary_value_t* (CEF_CALLBACK *get_all_preferences)(
|
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
|
// Returns true (1) if the preference with the specified |name| can be
|
||||||
@@ -207,8 +214,8 @@ typedef struct _cef_request_context_t {
|
|||||||
// command-line usually cannot be modified. This function must be called on
|
// command-line usually cannot be modified. This function must be called on
|
||||||
// the browser process UI thread.
|
// the browser process UI thread.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *can_set_preference)(struct _cef_request_context_t* self,
|
int(CEF_CALLBACK* can_set_preference)(struct _cef_request_context_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the |value| associated with preference |name|. Returns true (1) if the
|
// Set the |value| associated with preference |name|. Returns true (1) if the
|
||||||
@@ -217,9 +224,10 @@ typedef struct _cef_request_context_t {
|
|||||||
// fails then |error| will be populated with a detailed description of the
|
// fails then |error| will be populated with a detailed description of the
|
||||||
// problem. This function must be called on the browser process UI thread.
|
// problem. This function must be called on the browser process UI thread.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_preference)(struct _cef_request_context_t* self,
|
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,
|
||||||
cef_string_t* error);
|
struct _cef_value_t* value,
|
||||||
|
cef_string_t* error);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Clears all certificate exceptions that were added as part of handling
|
// Clears all certificate exceptions that were added as part of handling
|
||||||
@@ -229,17 +237,17 @@ typedef struct _cef_request_context_t {
|
|||||||
// |callback| is non-NULL it will be executed on the UI thread after
|
// |callback| is non-NULL it will be executed on the UI thread after
|
||||||
// completion.
|
// completion.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *clear_certificate_exceptions)(
|
void(CEF_CALLBACK* clear_certificate_exceptions)(
|
||||||
struct _cef_request_context_t* self,
|
struct _cef_request_context_t* self,
|
||||||
struct _cef_completion_callback_t* callback);
|
struct _cef_completion_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Clears all active and idle connections that Chromium currently has. This is
|
// 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
|
// 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.
|
// on the UI thread after completion.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *close_all_connections)(
|
void(CEF_CALLBACK* close_all_connections)(
|
||||||
struct _cef_request_context_t* self,
|
struct _cef_request_context_t* self,
|
||||||
struct _cef_completion_callback_t* callback);
|
struct _cef_completion_callback_t* callback);
|
||||||
|
|
||||||
@@ -247,8 +255,9 @@ typedef struct _cef_request_context_t {
|
|||||||
// Attempts to resolve |origin| to a list of associated IP addresses.
|
// Attempts to resolve |origin| to a list of associated IP addresses.
|
||||||
// |callback| will be executed on the UI thread after completion.
|
// |callback| will be executed on the UI thread after completion.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *resolve_host)(struct _cef_request_context_t* self,
|
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
|
// Attempts to resolve |origin| to a list of associated IP addresses using
|
||||||
@@ -256,11 +265,100 @@ typedef struct _cef_request_context_t {
|
|||||||
// addresses or NULL if no cached data is available. Returns ERR_NONE on
|
// addresses or NULL if no cached data is available. Returns ERR_NONE on
|
||||||
// success. This function must be called on the browser process IO thread.
|
// success. This function must be called on the browser process IO thread.
|
||||||
///
|
///
|
||||||
cef_errorcode_t (CEF_CALLBACK *resolve_host_cached)(
|
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_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.
|
// Returns the global context object.
|
||||||
@@ -283,7 +381,6 @@ CEF_EXPORT cef_request_context_t* cef_create_context_shared(
|
|||||||
cef_request_context_t* other,
|
cef_request_context_t* other,
|
||||||
struct _cef_request_context_handler_t* handler);
|
struct _cef_request_context_handler_t* handler);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=52978f64fe2a612c05fc42a91ec53df6ff42079d$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
|
||||||
#define 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" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct _cef_request_context_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to provide handler implementations. The handler
|
// Implement this structure to provide handler implementations. The handler
|
||||||
@@ -56,42 +59,53 @@ typedef struct _cef_request_context_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
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
|
// Called on the browser process IO thread to retrieve the cookie manager. If
|
||||||
// this function returns NULL the default cookie manager retrievable via
|
// this function returns NULL the default cookie manager retrievable via
|
||||||
// cef_request_tContext::get_default_cookie_manager() will be used.
|
// cef_request_tContext::get_default_cookie_manager() will be used.
|
||||||
///
|
///
|
||||||
struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)(
|
struct _cef_cookie_manager_t*(CEF_CALLBACK* get_cookie_manager)(
|
||||||
struct _cef_request_context_handler_t* self);
|
struct _cef_request_context_handler_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on multiple browser process threads before a plugin instance is
|
// Called on multiple browser process threads before a plugin instance is
|
||||||
// loaded. |mime_type| is the mime type of the plugin that will be loaded.
|
// loaded. |mime_type| is the mime type of the plugin that will be loaded.
|
||||||
// |plugin_url| is the content URL that the plugin will load and may be NULL.
|
// |plugin_url| is the content URL that the plugin will load and may be NULL.
|
||||||
// |top_origin_url| is the URL for the top-level frame that contains the
|
// |is_main_frame| will be true (1) if the plugin is being loaded in the main
|
||||||
// plugin when loading a specific plugin instance or NULL when building the
|
// (top-level) frame, |top_origin_url| is the URL for the top-level frame that
|
||||||
// initial list of enabled plugins for 'navigator.plugins' JavaScript state.
|
// contains the plugin when loading a specific plugin instance or NULL when
|
||||||
// |plugin_info| includes additional information about the plugin that will be
|
// building the initial list of enabled plugins for 'navigator.plugins'
|
||||||
// loaded. |plugin_policy| is the recommended policy. Modify |plugin_policy|
|
// JavaScript state. |plugin_info| includes additional information about the
|
||||||
// and return true (1) to change the policy. Return false (0) to use the
|
// plugin that will be loaded. |plugin_policy| is the recommended policy.
|
||||||
// recommended policy. The default plugin policy can be set at runtime using
|
// Modify |plugin_policy| and return true (1) to change the policy. Return
|
||||||
// the `--plugin-policy=[allow|detect|block]` command-line flag. Decisions to
|
// false (0) to use the recommended policy. The default plugin policy can be
|
||||||
// mark a plugin as disabled by setting |plugin_policy| to
|
// set at runtime using the `--plugin-policy=[allow|detect|block]` command-
|
||||||
// PLUGIN_POLICY_DISABLED may be cached when |top_origin_url| is NULL. To
|
// line flag. Decisions to mark a plugin as disabled by setting
|
||||||
// purge the plugin list cache and potentially trigger new calls to this
|
// |plugin_policy| to PLUGIN_POLICY_DISABLED may be cached when
|
||||||
// function call cef_request_tContext::PurgePluginListCache.
|
// |top_origin_url| is NULL. To purge the plugin list cache and potentially
|
||||||
|
// trigger new calls to this function call
|
||||||
|
// cef_request_tContext::PurgePluginListCache.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_before_plugin_load)(
|
int(CEF_CALLBACK* on_before_plugin_load)(
|
||||||
struct _cef_request_context_handler_t* self,
|
struct _cef_request_context_handler_t* self,
|
||||||
const cef_string_t* mime_type, const cef_string_t* plugin_url,
|
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* top_origin_url,
|
||||||
struct _cef_web_plugin_info_t* plugin_info,
|
struct _cef_web_plugin_info_t* plugin_info,
|
||||||
cef_plugin_policy_t* plugin_policy);
|
cef_plugin_policy_t* plugin_policy);
|
||||||
} cef_request_context_handler_t;
|
} cef_request_context_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=b8b5a62b11dbc48f0733c0522864e4dbda8b4f59$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||||
@@ -47,12 +49,12 @@
|
|||||||
#include "include/capi/cef_response_capi.h"
|
#include "include/capi/cef_response_capi.h"
|
||||||
#include "include/capi/cef_response_filter_capi.h"
|
#include "include/capi/cef_response_filter_capi.h"
|
||||||
#include "include/capi/cef_ssl_info_capi.h"
|
#include "include/capi/cef_ssl_info_capi.h"
|
||||||
|
#include "include/capi/cef_x509_certificate_capi.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Callback structure used for asynchronous continuation of url requests.
|
// Callback structure used for asynchronous continuation of url requests.
|
||||||
///
|
///
|
||||||
@@ -60,20 +62,37 @@ typedef struct _cef_request_callback_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Continue the url request. If |allow| is true (1) the request will be
|
// Continue the url request. If |allow| is true (1) the request will be
|
||||||
// continued. Otherwise, the request will be canceled.
|
// continued. Otherwise, the request will be canceled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cont)(struct _cef_request_callback_t* self, int allow);
|
void(CEF_CALLBACK* cont)(struct _cef_request_callback_t* self, int allow);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Cancel the url request.
|
// Cancel the url request.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cancel)(struct _cef_request_callback_t* self);
|
void(CEF_CALLBACK* cancel)(struct _cef_request_callback_t* self);
|
||||||
} cef_request_callback_t;
|
} cef_request_callback_t;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Callback structure used to select a client certificate for authentication.
|
||||||
|
///
|
||||||
|
typedef struct _cef_select_client_certificate_callback_t {
|
||||||
|
///
|
||||||
|
// Base structure.
|
||||||
|
///
|
||||||
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Chooses the specified certificate for client certificate authentication.
|
||||||
|
// NULL value means that no client certificate should be used.
|
||||||
|
///
|
||||||
|
void(CEF_CALLBACK* select)(
|
||||||
|
struct _cef_select_client_certificate_callback_t* self,
|
||||||
|
struct _cef_x509certificate_t* cert);
|
||||||
|
} cef_select_client_certificate_callback_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to handle events related to browser requests. The
|
// Implement this structure to handle events related to browser requests. The
|
||||||
@@ -83,7 +102,7 @@ typedef struct _cef_request_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the UI thread before browser navigation. Return true (1) to
|
// Called on the UI thread before browser navigation. Return true (1) to
|
||||||
@@ -95,9 +114,11 @@ typedef struct _cef_request_handler_t {
|
|||||||
// cef_load_handler_t::OnLoadError will be called with an |errorCode| value of
|
// cef_load_handler_t::OnLoadError will be called with an |errorCode| value of
|
||||||
// ERR_ABORTED.
|
// ERR_ABORTED.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_before_browse)(struct _cef_request_handler_t* self,
|
int(CEF_CALLBACK* on_before_browse)(struct _cef_request_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_request_t* request, int is_redirect);
|
struct _cef_frame_t* frame,
|
||||||
|
struct _cef_request_t* request,
|
||||||
|
int is_redirect);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the UI thread before OnBeforeBrowse in certain limited cases
|
// Called on the UI thread before OnBeforeBrowse in certain limited cases
|
||||||
@@ -115,10 +136,13 @@ typedef struct _cef_request_handler_t {
|
|||||||
// true (1) to cancel the navigation or false (0) to allow the navigation to
|
// true (1) to cancel the navigation or false (0) to allow the navigation to
|
||||||
// proceed in the source browser's top-level frame.
|
// proceed in the source browser's top-level frame.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_open_urlfrom_tab)(struct _cef_request_handler_t* self,
|
int(CEF_CALLBACK* on_open_urlfrom_tab)(
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_request_handler_t* self,
|
||||||
|
struct _cef_browser_t* browser,
|
||||||
|
struct _cef_frame_t* frame,
|
||||||
const cef_string_t* target_url,
|
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|
|
// Called on the IO thread before a resource request is loaded. The |request|
|
||||||
@@ -128,9 +152,11 @@ typedef struct _cef_request_handler_t {
|
|||||||
// Return RV_CANCEL to cancel the request immediately.
|
// Return RV_CANCEL to cancel the request immediately.
|
||||||
//
|
//
|
||||||
///
|
///
|
||||||
cef_return_value_t (CEF_CALLBACK *on_before_resource_load)(
|
cef_return_value_t(CEF_CALLBACK* on_before_resource_load)(
|
||||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_request_handler_t* self,
|
||||||
struct _cef_frame_t* frame, struct _cef_request_t* request,
|
struct _cef_browser_t* browser,
|
||||||
|
struct _cef_frame_t* frame,
|
||||||
|
struct _cef_request_t* request,
|
||||||
struct _cef_request_callback_t* callback);
|
struct _cef_request_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -139,9 +165,11 @@ typedef struct _cef_request_handler_t {
|
|||||||
// a cef_resource_handler_t object. The |request| object should not be
|
// a cef_resource_handler_t object. The |request| object should not be
|
||||||
// modified in this callback.
|
// modified in this callback.
|
||||||
///
|
///
|
||||||
struct _cef_resource_handler_t* (CEF_CALLBACK *get_resource_handler)(
|
struct _cef_resource_handler_t*(CEF_CALLBACK* get_resource_handler)(
|
||||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_request_handler_t* self,
|
||||||
struct _cef_frame_t* frame, struct _cef_request_t* request);
|
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|
|
// Called on the IO thread when a resource load is redirected. The |request|
|
||||||
@@ -151,10 +179,12 @@ typedef struct _cef_request_handler_t {
|
|||||||
// changed if desired. The |request| object cannot be modified in this
|
// changed if desired. The |request| object cannot be modified in this
|
||||||
// callback.
|
// callback.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_resource_redirect)(struct _cef_request_handler_t* self,
|
void(CEF_CALLBACK* on_resource_redirect)(struct _cef_request_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_request_t* request, struct _cef_response_t* response,
|
struct _cef_frame_t* frame,
|
||||||
cef_string_t* new_url);
|
struct _cef_request_t* request,
|
||||||
|
struct _cef_response_t* response,
|
||||||
|
cef_string_t* new_url);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the IO thread when a resource response is received. To allow the
|
// Called on the IO thread when a resource response is received. To allow the
|
||||||
@@ -162,18 +192,22 @@ typedef struct _cef_request_handler_t {
|
|||||||
// resource modify |request| (url, headers or post body) and return true (1).
|
// resource modify |request| (url, headers or post body) and return true (1).
|
||||||
// The |response| object cannot be modified in this callback.
|
// The |response| object cannot be modified in this callback.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_resource_response)(struct _cef_request_handler_t* self,
|
int(CEF_CALLBACK* on_resource_response)(struct _cef_request_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_request_t* request, struct _cef_response_t* response);
|
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.
|
// Called on the IO thread to optionally filter resource response content.
|
||||||
// |request| and |response| represent the request and response respectively
|
// |request| and |response| represent the request and response respectively
|
||||||
// and cannot be modified in this callback.
|
// and cannot be modified in this callback.
|
||||||
///
|
///
|
||||||
struct _cef_response_filter_t* (CEF_CALLBACK *get_resource_response_filter)(
|
struct _cef_response_filter_t*(CEF_CALLBACK* get_resource_response_filter)(
|
||||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_request_handler_t* self,
|
||||||
struct _cef_frame_t* frame, struct _cef_request_t* request,
|
struct _cef_browser_t* browser,
|
||||||
|
struct _cef_frame_t* frame,
|
||||||
|
struct _cef_request_t* request,
|
||||||
struct _cef_response_t* response);
|
struct _cef_response_t* response);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -182,10 +216,13 @@ typedef struct _cef_request_handler_t {
|
|||||||
// modified in this callback. |status| indicates the load completion status.
|
// modified in this callback. |status| indicates the load completion status.
|
||||||
// |received_content_length| is the number of response bytes actually read.
|
// |received_content_length| is the number of response bytes actually read.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_resource_load_complete)(
|
void(CEF_CALLBACK* on_resource_load_complete)(
|
||||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_request_handler_t* self,
|
||||||
struct _cef_frame_t* frame, struct _cef_request_t* request,
|
struct _cef_browser_t* browser,
|
||||||
struct _cef_response_t* response, cef_urlrequest_status_t status,
|
struct _cef_frame_t* frame,
|
||||||
|
struct _cef_request_t* request,
|
||||||
|
struct _cef_response_t* response,
|
||||||
|
cef_urlrequest_status_t status,
|
||||||
int64 received_content_length);
|
int64 received_content_length);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -199,10 +236,39 @@ typedef struct _cef_request_handler_t {
|
|||||||
// the authentication information is available. Return false (0) to cancel the
|
// the authentication information is available. Return false (0) to cancel the
|
||||||
// request immediately.
|
// request immediately.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self,
|
int(CEF_CALLBACK* get_auth_credentials)(
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame, int isProxy,
|
struct _cef_request_handler_t* self,
|
||||||
const cef_string_t* host, int port, const cef_string_t* realm,
|
struct _cef_browser_t* browser,
|
||||||
const cef_string_t* scheme, struct _cef_auth_callback_t* callback);
|
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
|
// Called on the IO thread when JavaScript requests a specific storage quota
|
||||||
@@ -213,9 +279,11 @@ typedef struct _cef_request_handler_t {
|
|||||||
// grant or deny the request. Return false (0) to cancel the request
|
// grant or deny the request. Return false (0) to cancel the request
|
||||||
// immediately.
|
// immediately.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_quota_request)(struct _cef_request_handler_t* self,
|
int(CEF_CALLBACK* on_quota_request)(struct _cef_request_handler_t* self,
|
||||||
struct _cef_browser_t* browser, const cef_string_t* origin_url,
|
struct _cef_browser_t* browser,
|
||||||
int64 new_size, struct _cef_request_callback_t* callback);
|
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
|
// Called on the UI thread to handle requests for URLs with an unknown
|
||||||
@@ -224,9 +292,10 @@ typedef struct _cef_request_handler_t {
|
|||||||
// YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR
|
// YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR
|
||||||
// OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.
|
// OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_protocol_execution)(
|
void(CEF_CALLBACK* on_protocol_execution)(struct _cef_request_handler_t* self,
|
||||||
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
struct _cef_browser_t* browser,
|
||||||
const cef_string_t* url, int* allow_os_execution);
|
const cef_string_t* url,
|
||||||
|
int* allow_os_execution);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the UI thread to handle requests for URLs with an invalid SSL
|
// Called on the UI thread to handle requests for URLs with an invalid SSL
|
||||||
@@ -236,36 +305,63 @@ typedef struct _cef_request_handler_t {
|
|||||||
// CefSettings.ignore_certificate_errors is set all invalid certificates will
|
// CefSettings.ignore_certificate_errors is set all invalid certificates will
|
||||||
// be accepted without calling this function.
|
// be accepted without calling this function.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_certificate_error)(struct _cef_request_handler_t* self,
|
int(CEF_CALLBACK* on_certificate_error)(
|
||||||
struct _cef_browser_t* browser, cef_errorcode_t cert_error,
|
struct _cef_request_handler_t* self,
|
||||||
const cef_string_t* request_url, struct _cef_sslinfo_t* ssl_info,
|
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);
|
struct _cef_request_callback_t* callback);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called on the UI thread when a client certificate is being requested for
|
||||||
|
// authentication. Return false (0) to use the default behavior and
|
||||||
|
// automatically select the first certificate available. Return true (1) and
|
||||||
|
// call cef_select_client_certificate_callback_t::Select either in this
|
||||||
|
// function or at a later time to select a certificate. Do not call Select or
|
||||||
|
// call it with NULL to continue without using any certificate. |isProxy|
|
||||||
|
// indicates whether the host is an HTTPS proxy or the origin server. |host|
|
||||||
|
// and |port| contains the hostname and port of the SSL server. |certificates|
|
||||||
|
// is the list of certificates to choose from; this list has already been
|
||||||
|
// pruned by Chromium so that it only contains certificates from issuers that
|
||||||
|
// 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,
|
||||||
|
size_t certificatesCount,
|
||||||
|
struct _cef_x509certificate_t* const* certificates,
|
||||||
|
struct _cef_select_client_certificate_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the browser process UI thread when a plugin has crashed.
|
// Called on the browser process UI thread when a plugin has crashed.
|
||||||
// |plugin_path| is the path of the plugin that crashed.
|
// |plugin_path| is the path of the plugin that crashed.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_plugin_crashed)(struct _cef_request_handler_t* self,
|
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
|
// Called on the browser process UI thread when the render view associated
|
||||||
// with |browser| is ready to receive/handle IPC messages in the render
|
// with |browser| is ready to receive/handle IPC messages in the render
|
||||||
// process.
|
// process.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_render_view_ready)(struct _cef_request_handler_t* self,
|
void(CEF_CALLBACK* on_render_view_ready)(struct _cef_request_handler_t* self,
|
||||||
struct _cef_browser_t* browser);
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the browser process UI thread when the render process terminates
|
// Called on the browser process UI thread when the render process terminates
|
||||||
// unexpectedly. |status| indicates how the process terminated.
|
// unexpectedly. |status| indicates how the process terminated.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_render_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_termination_status_t status);
|
||||||
} cef_request_handler_t;
|
} cef_request_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=439cc7c4ac7f2178ab0b445ab91df66b6759335f$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used for retrieving resources from the resource bundle (*.pak)
|
// Structure used for retrieving resources from the resource bundle (*.pak)
|
||||||
// files loaded by CEF during startup or via the cef_resource_bundle_tHandler
|
// files loaded by CEF during startup or via the cef_resource_bundle_tHandler
|
||||||
@@ -56,7 +57,7 @@ typedef struct _cef_resource_bundle_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the localized string for the specified |string_id| or an NULL
|
// Returns the localized string for the specified |string_id| or an NULL
|
||||||
@@ -64,8 +65,9 @@ typedef struct _cef_resource_bundle_t {
|
|||||||
// of valid string ID values.
|
// of valid string ID values.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_localized_string)(
|
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
|
// Retrieves the contents of the specified scale independent |resource_id|. If
|
||||||
@@ -75,8 +77,10 @@ typedef struct _cef_resource_bundle_t {
|
|||||||
// memory and should not be freed. Include cef_pack_resources.h for a listing
|
// memory and should not be freed. Include cef_pack_resources.h for a listing
|
||||||
// of valid resource ID values.
|
// of valid resource ID values.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_data_resource)(struct _cef_resource_bundle_t* self,
|
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
|
// Retrieves the contents of the specified |resource_id| nearest the scale
|
||||||
@@ -88,18 +92,19 @@ typedef struct _cef_resource_bundle_t {
|
|||||||
// memory and should not be freed. Include cef_pack_resources.h for a listing
|
// memory and should not be freed. Include cef_pack_resources.h for a listing
|
||||||
// of valid resource ID values.
|
// of valid resource ID values.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_data_resource_for_scale)(
|
int(CEF_CALLBACK* get_data_resource_for_scale)(
|
||||||
struct _cef_resource_bundle_t* self, int resource_id,
|
struct _cef_resource_bundle_t* self,
|
||||||
cef_scale_factor_t scale_factor, void** data, size_t* data_size);
|
int resource_id,
|
||||||
|
cef_scale_factor_t scale_factor,
|
||||||
|
void** data,
|
||||||
|
size_t* data_size);
|
||||||
} cef_resource_bundle_t;
|
} cef_resource_bundle_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the global resource bundle instance.
|
// Returns the global resource bundle instance.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global();
|
CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global();
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=ce250b3a07931595bbf0028fb56c11b6160f836e$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
|
||||||
#define 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" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to implement a custom resource bundle structure. See
|
// Structure used to implement a custom resource bundle structure. See
|
||||||
// CefSettings for additional options related to resource bundle loading. The
|
// CefSettings for additional options related to resource bundle loading. The
|
||||||
@@ -54,7 +55,7 @@ typedef struct _cef_resource_bundle_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called to retrieve a localized translation for the specified |string_id|.
|
// Called to retrieve a localized translation for the specified |string_id|.
|
||||||
@@ -62,8 +63,9 @@ typedef struct _cef_resource_bundle_handler_t {
|
|||||||
// return true (1). To use the default translation return false (0). Include
|
// return true (1). To use the default translation return false (0). Include
|
||||||
// cef_pack_strings.h for a listing of valid string ID values.
|
// cef_pack_strings.h for a listing of valid string ID values.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_localized_string)(
|
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);
|
cef_string_t* string);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -74,8 +76,10 @@ typedef struct _cef_resource_bundle_handler_t {
|
|||||||
// resident in memory. Include cef_pack_resources.h for a listing of valid
|
// resident in memory. Include cef_pack_resources.h for a listing of valid
|
||||||
// resource ID values.
|
// resource ID values.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_data_resource)(
|
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);
|
size_t* data_size);
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -86,12 +90,14 @@ typedef struct _cef_resource_bundle_handler_t {
|
|||||||
// not be copied and must remain resident in memory. Include
|
// not be copied and must remain resident in memory. Include
|
||||||
// cef_pack_resources.h for a listing of valid resource ID values.
|
// cef_pack_resources.h for a listing of valid resource ID values.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_data_resource_for_scale)(
|
int(CEF_CALLBACK* get_data_resource_for_scale)(
|
||||||
struct _cef_resource_bundle_handler_t* self, int resource_id,
|
struct _cef_resource_bundle_handler_t* self,
|
||||||
cef_scale_factor_t scale_factor, void** data, size_t* data_size);
|
int resource_id,
|
||||||
|
cef_scale_factor_t scale_factor,
|
||||||
|
void** data,
|
||||||
|
size_t* data_size);
|
||||||
} cef_resource_bundle_handler_t;
|
} cef_resource_bundle_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=64a8d248c8c6c5b17a8ce1bdf79b82e791d87a1a$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
||||||
@@ -49,7 +51,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to implement a custom request handler structure. The functions
|
// Structure used to implement a custom request handler structure. The functions
|
||||||
// of this structure will always be called on the IO thread.
|
// of this structure will always be called on the IO thread.
|
||||||
@@ -58,7 +59,7 @@ typedef struct _cef_resource_handler_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Begin processing the request. To handle the request return true (1) and
|
// Begin processing the request. To handle the request return true (1) and
|
||||||
@@ -67,8 +68,9 @@ typedef struct _cef_resource_handler_t {
|
|||||||
// function if header information is available immediately). To cancel the
|
// function if header information is available immediately). To cancel the
|
||||||
// request return false (0).
|
// request return false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *process_request)(struct _cef_resource_handler_t* self,
|
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
|
// 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
|
// URL. If an error occured while setting up the request you can call
|
||||||
// set_error() on |response| to indicate the error condition.
|
// set_error() on |response| to indicate the error condition.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_response_headers)(
|
void(CEF_CALLBACK* get_response_headers)(struct _cef_resource_handler_t* self,
|
||||||
struct _cef_resource_handler_t* self, struct _cef_response_t* response,
|
struct _cef_response_t* response,
|
||||||
int64* response_length, cef_string_t* redirectUrl);
|
int64* response_length,
|
||||||
|
cef_string_t* redirectUrl);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Read response data. If data is available immediately copy up to
|
// Read response data. If data is available immediately copy up to
|
||||||
@@ -92,32 +95,33 @@ typedef struct _cef_resource_handler_t {
|
|||||||
// |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the
|
// |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the
|
||||||
// data is available. To indicate response completion return false (0).
|
// data is available. To indicate response completion return false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *read_response)(struct _cef_resource_handler_t* self,
|
int(CEF_CALLBACK* read_response)(struct _cef_resource_handler_t* self,
|
||||||
void* data_out, int bytes_to_read, int* bytes_read,
|
void* data_out,
|
||||||
struct _cef_callback_t* callback);
|
int bytes_to_read,
|
||||||
|
int* bytes_read,
|
||||||
|
struct _cef_callback_t* callback);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return true (1) if the specified cookie can be sent with the request or
|
// Return true (1) if the specified cookie can be sent with the request or
|
||||||
// false (0) otherwise. If false (0) is returned for any cookie then no
|
// false (0) otherwise. If false (0) is returned for any cookie then no
|
||||||
// cookies will be sent with the request.
|
// cookies will be sent with the request.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *can_get_cookie)(struct _cef_resource_handler_t* self,
|
int(CEF_CALLBACK* can_get_cookie)(struct _cef_resource_handler_t* self,
|
||||||
const struct _cef_cookie_t* cookie);
|
const struct _cef_cookie_t* cookie);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return true (1) if the specified cookie returned with the response can be
|
// Return true (1) if the specified cookie returned with the response can be
|
||||||
// set or false (0) otherwise.
|
// set or false (0) otherwise.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *can_set_cookie)(struct _cef_resource_handler_t* self,
|
int(CEF_CALLBACK* can_set_cookie)(struct _cef_resource_handler_t* self,
|
||||||
const struct _cef_cookie_t* cookie);
|
const struct _cef_cookie_t* cookie);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Request processing has been canceled.
|
// Request processing has been canceled.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *cancel)(struct _cef_resource_handler_t* self);
|
void(CEF_CALLBACK* cancel)(struct _cef_resource_handler_t* self);
|
||||||
} cef_resource_handler_t;
|
} cef_resource_handler_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=561e4711432158fd3da971f3c0240dcf5e8e782a$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure used to represent a web response. The functions of this structure
|
// Structure used to represent a web response. The functions of this structure
|
||||||
// may be called on any thread.
|
// may be called on any thread.
|
||||||
@@ -53,88 +54,86 @@ typedef struct _cef_response_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns true (1) if this object is read-only.
|
// Returns true (1) if this object is read-only.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *is_read_only)(struct _cef_response_t* self);
|
int(CEF_CALLBACK* is_read_only)(struct _cef_response_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the response error code. Returns ERR_NONE if there was no error.
|
// Get the response error code. Returns ERR_NONE if there was no error.
|
||||||
///
|
///
|
||||||
cef_errorcode_t (CEF_CALLBACK *get_error)(struct _cef_response_t* self);
|
cef_errorcode_t(CEF_CALLBACK* get_error)(struct _cef_response_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the response error code. This can be used by custom scheme handlers to
|
// Set the response error code. This can be used by custom scheme handlers to
|
||||||
// return errors during initial request processing.
|
// return errors during initial request processing.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_error)(struct _cef_response_t* self,
|
void(CEF_CALLBACK* set_error)(struct _cef_response_t* self,
|
||||||
cef_errorcode_t error);
|
cef_errorcode_t error);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the response status code.
|
// Get the response status code.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_status)(struct _cef_response_t* self);
|
int(CEF_CALLBACK* get_status)(struct _cef_response_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the response status code.
|
// Set the response status code.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_status)(struct _cef_response_t* self, int status);
|
void(CEF_CALLBACK* set_status)(struct _cef_response_t* self, int status);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the response status text.
|
// Get the response status text.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_status_text)(
|
cef_string_userfree_t(CEF_CALLBACK* get_status_text)(
|
||||||
struct _cef_response_t* self);
|
struct _cef_response_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the response status text.
|
// Set the response status text.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_status_text)(struct _cef_response_t* self,
|
void(CEF_CALLBACK* set_status_text)(struct _cef_response_t* self,
|
||||||
const cef_string_t* statusText);
|
const cef_string_t* statusText);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the response mime type.
|
// Get the response mime type.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_mime_type)(
|
cef_string_userfree_t(CEF_CALLBACK* get_mime_type)(
|
||||||
struct _cef_response_t* self);
|
struct _cef_response_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set the response mime type.
|
// Set the response mime type.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_mime_type)(struct _cef_response_t* self,
|
void(CEF_CALLBACK* set_mime_type)(struct _cef_response_t* self,
|
||||||
const cef_string_t* mimeType);
|
const cef_string_t* mimeType);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get the value for the specified response header field.
|
// Get the value for the specified response header field.
|
||||||
///
|
///
|
||||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||||
cef_string_userfree_t (CEF_CALLBACK *get_header)(struct _cef_response_t* self,
|
cef_string_userfree_t(CEF_CALLBACK* get_header)(struct _cef_response_t* self,
|
||||||
const cef_string_t* name);
|
const cef_string_t* name);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Get all response header fields.
|
// Get all response header fields.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *get_header_map)(struct _cef_response_t* self,
|
void(CEF_CALLBACK* get_header_map)(struct _cef_response_t* self,
|
||||||
cef_string_multimap_t headerMap);
|
cef_string_multimap_t headerMap);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set all response header fields.
|
// Set all response header fields.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_header_map)(struct _cef_response_t* self,
|
void(CEF_CALLBACK* set_header_map)(struct _cef_response_t* self,
|
||||||
cef_string_multimap_t headerMap);
|
cef_string_multimap_t headerMap);
|
||||||
} cef_response_t;
|
} cef_response_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create a new cef_response_t object.
|
// Create a new cef_response_t object.
|
||||||
///
|
///
|
||||||
CEF_EXPORT cef_response_t* cef_response_create();
|
CEF_EXPORT cef_response_t* cef_response_create();
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=a0599caa7b458266ace091657d7024453d7ce37a$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_
|
||||||
@@ -44,7 +46,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to filter resource response content. The functions
|
// Implement this structure to filter resource response content. The functions
|
||||||
// of this structure will be called on the browser process IO thread.
|
// of this structure will be called on the browser process IO thread.
|
||||||
@@ -53,39 +54,55 @@ typedef struct _cef_response_filter_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Initialize the response filter. Will only be called a single time. The
|
// Initialize the response filter. Will only be called a single time. The
|
||||||
// filter will not be installed if this function returns false (0).
|
// filter will not be installed if this function returns false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *init_filter)(struct _cef_response_filter_t* self);
|
int(CEF_CALLBACK* init_filter)(struct _cef_response_filter_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called to filter a chunk of data. |data_in| is the input buffer containing
|
// Called to filter a chunk of data. Expected usage is as follows:
|
||||||
// |data_in_size| bytes of pre-filter data (|data_in| will be NULL if
|
//
|
||||||
// |data_in_size| is zero). |data_out| is the output buffer that can accept up
|
// A. Read input data from |data_in| and set |data_in_read| to the number of
|
||||||
// to |data_out_size| bytes of filtered output data. Set |data_in_read| to the
|
// bytes that were read up to a maximum of |data_in_size|. |data_in| will
|
||||||
// number of bytes that were read from |data_in|. Set |data_out_written| to
|
// be NULL if |data_in_size| is zero.
|
||||||
// the number of bytes that were written into |data_out|. If some or all of
|
// B. Write filtered output data to |data_out| and set |data_out_written| to
|
||||||
// the pre-filter data was read successfully but more data is needed in order
|
// the number of bytes that were written up to a maximum of
|
||||||
// to continue filtering (filtered output is pending) return
|
// |data_out_size|. If no output data was written then all data must be
|
||||||
// RESPONSE_FILTER_NEED_MORE_DATA. If some or all of the pre-filter data was
|
// read from |data_in| (user must set |data_in_read| = |data_in_size|).
|
||||||
// read successfully and all available filtered output has been written return
|
// C. Return RESPONSE_FILTER_DONE if all output data was written or
|
||||||
// RESPONSE_FILTER_DONE. If an error occurs during filtering return
|
// RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending.
|
||||||
// RESPONSE_FILTER_ERROR. This function will be called repeatedly until there
|
//
|
||||||
// is no more data to filter (resource response is complete), |data_in_read|
|
// This function will be called repeatedly until the input buffer has been
|
||||||
// matches |data_in_size| (all available pre-filter bytes have been read), and
|
// fully read (user sets |data_in_read| = |data_in_size|) and there is no more
|
||||||
// the function returns RESPONSE_FILTER_DONE or RESPONSE_FILTER_ERROR. Do not
|
// input data to filter (the resource response is complete). This function may
|
||||||
// keep a reference to the buffers passed to this function.
|
// then be called an additional time with an NULL input buffer if the user
|
||||||
|
// filled the output buffer (set |data_out_written| = |data_out_size|) and
|
||||||
|
// returned RESPONSE_FILTER_NEED_MORE_DATA to indicate that output data is
|
||||||
|
// still pending.
|
||||||
|
//
|
||||||
|
// Calls to this function will stop when one of the following conditions is
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// A. There is no more input data to filter (the resource response is
|
||||||
|
// complete) and the user sets |data_out_written| = 0 or returns
|
||||||
|
// RESPONSE_FILTER_DONE to indicate that all data has been written, or;
|
||||||
|
// B. The user returns RESPONSE_FILTER_ERROR to indicate an error.
|
||||||
|
//
|
||||||
|
// Do not keep a reference to the buffers passed to this function.
|
||||||
///
|
///
|
||||||
cef_response_filter_status_t (CEF_CALLBACK *filter)(
|
cef_response_filter_status_t(CEF_CALLBACK* filter)(
|
||||||
struct _cef_response_filter_t* self, void* data_in, size_t data_in_size,
|
struct _cef_response_filter_t* self,
|
||||||
size_t* data_in_read, void* data_out, size_t data_out_size,
|
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);
|
size_t* data_out_written);
|
||||||
} cef_response_filter_t;
|
} cef_response_filter_t;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 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
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
// by hand. See the translator.README.txt file in the tools directory for
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
|
// $hash=57a50b4c4bee68267ffcf7efebfbe711b62b0f84$
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
||||||
#define CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
#define CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
||||||
@@ -58,7 +60,7 @@ typedef struct _cef_scheme_registrar_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_scoped_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Register a custom scheme. This function should not be called for the built-
|
// Register a custom scheme. This function should not be called for the built-
|
||||||
@@ -87,31 +89,48 @@ typedef struct _cef_scheme_registrar_t {
|
|||||||
// is. For example, "scheme:///some%20text" will remain the same. Non-standard
|
// is. For example, "scheme:///some%20text" will remain the same. Non-standard
|
||||||
// scheme URLs cannot be used as a target for form submission.
|
// scheme URLs cannot be used as a target for form submission.
|
||||||
//
|
//
|
||||||
// If |is_local| is true (1) the scheme will be treated as local (i.e., with
|
// If |is_local| is true (1) the scheme will be treated with the same security
|
||||||
// the same security rules as those applied to "file" URLs). Normal pages
|
// rules as those applied to "file" URLs. Normal pages cannot link to or
|
||||||
// cannot link to or access local URLs. Also, by default, local URLs can only
|
// access local URLs. Also, by default, local URLs can only perform
|
||||||
// perform XMLHttpRequest calls to the same URL (origin + path) that
|
// XMLHttpRequest calls to the same URL (origin + path) that originated the
|
||||||
// originated the request. To allow XMLHttpRequest calls from a local URL to
|
// request. To allow XMLHttpRequest calls from a local URL to other URLs with
|
||||||
// other URLs with the same origin set the
|
// the same origin set the CefSettings.file_access_from_file_urls_allowed
|
||||||
// CefSettings.file_access_from_file_urls_allowed value to true (1). To allow
|
// value to true (1). To allow XMLHttpRequest calls from a local URL to all
|
||||||
// XMLHttpRequest calls from a local URL to all origins set the
|
// origins set the CefSettings.universal_access_from_file_urls_allowed value
|
||||||
// CefSettings.universal_access_from_file_urls_allowed value to true (1).
|
// to true (1).
|
||||||
//
|
//
|
||||||
// If |is_display_isolated| is true (1) the scheme will be treated as display-
|
// If |is_display_isolated| is true (1) the scheme can only be displayed from
|
||||||
// isolated. This means that pages cannot display these URLs unless they are
|
// other content hosted with the same scheme. For example, pages in other
|
||||||
// from the same scheme. For example, pages in another origin cannot create
|
// origins cannot create iframes or hyperlinks to URLs with the scheme. For
|
||||||
// iframes or hyperlinks to URLs with this scheme.
|
// schemes that must be accessible from other schemes set this value to false
|
||||||
|
// (0), set |is_cors_enabled| to true (1), and use CORS "Access-Control-Allow-
|
||||||
|
// Origin" headers to further restrict access.
|
||||||
|
//
|
||||||
|
// If |is_secure| is true (1) the scheme will be treated with the same
|
||||||
|
// 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 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
|
// 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
|
// per unique |scheme_name| value. If |scheme_name| is already registered or
|
||||||
// if an error occurs this function will return false (0).
|
// if an error occurs this function will return false (0).
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *add_custom_scheme)(struct _cef_scheme_registrar_t* self,
|
int(CEF_CALLBACK* add_custom_scheme)(struct _cef_scheme_registrar_t* self,
|
||||||
const cef_string_t* scheme_name, int is_standard, int is_local,
|
const cef_string_t* scheme_name,
|
||||||
int is_display_isolated);
|
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;
|
} cef_scheme_registrar_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure that creates cef_resource_handler_t instances for handling scheme
|
// Structure that creates cef_resource_handler_t instances for handling scheme
|
||||||
// requests. The functions of this structure will always be called on the IO
|
// requests. The functions of this structure will always be called on the IO
|
||||||
@@ -121,7 +140,7 @@ typedef struct _cef_scheme_handler_factory_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_ref_counted_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a new resource handler instance to handle the request or an NULL
|
// Return a new resource handler instance to handle the request or an NULL
|
||||||
@@ -131,13 +150,14 @@ typedef struct _cef_scheme_handler_factory_t {
|
|||||||
// example, if the request came from cef_urlrequest_t). The |request| object
|
// example, if the request came from cef_urlrequest_t). The |request| object
|
||||||
// passed to this function will not contain cookie data.
|
// passed to this function will not contain cookie data.
|
||||||
///
|
///
|
||||||
struct _cef_resource_handler_t* (CEF_CALLBACK *create)(
|
struct _cef_resource_handler_t*(CEF_CALLBACK* create)(
|
||||||
struct _cef_scheme_handler_factory_t* self,
|
struct _cef_scheme_handler_factory_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser,
|
||||||
const cef_string_t* scheme_name, struct _cef_request_t* request);
|
struct _cef_frame_t* frame,
|
||||||
|
const cef_string_t* scheme_name,
|
||||||
|
struct _cef_request_t* request);
|
||||||
} cef_scheme_handler_factory_t;
|
} cef_scheme_handler_factory_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Register a scheme handler factory with the global request context. An NULL
|
// 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
|
// |domain_name| value for a standard scheme will cause the factory to match all
|
||||||
@@ -154,7 +174,8 @@ typedef struct _cef_scheme_handler_factory_t {
|
|||||||
// ory().
|
// ory().
|
||||||
///
|
///
|
||||||
CEF_EXPORT int cef_register_scheme_handler_factory(
|
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);
|
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_
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user