mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
54 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a98cd4cdc0 | ||
|
2e23cedb41 | ||
|
9e367620cb | ||
|
8d6f4e38bc | ||
|
6f1563868d | ||
|
b950336a00 | ||
|
ca0a1134ea | ||
|
e874c768d7 | ||
|
496c871d1e | ||
|
414dbb1674 | ||
|
9ea9e58074 | ||
|
518ad36ac8 | ||
|
a614475a0e | ||
|
117413e2a3 | ||
|
8bc83a973d | ||
|
fba80ef0f9 | ||
|
7bc9b87d5e | ||
|
85c53029bf | ||
|
5050c3f0af | ||
|
7add4a33d4 | ||
|
e8fe3cfeaf | ||
|
1e4e18240d | ||
|
8b45f32b33 | ||
|
25c75c5fc4 | ||
|
485f0b9caf | ||
|
fa643b269e | ||
|
60ee4a34aa | ||
|
f33c062d78 | ||
|
fce5af14a8 | ||
|
497e0d2d98 | ||
|
e0c878df5f | ||
|
5433d9fe5c | ||
|
dc35b3a93e | ||
|
4e43f90244 | ||
|
4d1fd05740 | ||
|
0089378a0a | ||
|
7e3b084819 | ||
|
53c365b752 | ||
|
9c359b682b | ||
|
7174c4c328 | ||
|
9ecd25a93b | ||
|
5ea0c141b5 | ||
|
12fc72147c | ||
|
cf7e10aacc | ||
|
09b4cbd32c | ||
|
8645e88e0e | ||
|
fa2464e843 | ||
|
51699e671a | ||
|
14c0f74707 | ||
|
77582a01b5 | ||
|
d7a153bdd4 | ||
|
7b352159df | ||
|
00f34d5e68 | ||
|
f8d90a8972 |
45
BUILD.gn
45
BUILD.gn
@@ -106,6 +106,7 @@ import("//media/media_options.gni")
|
||||
import("//mojo/public/tools/bindings/mojom.gni")
|
||||
import("//ppapi/buildflags/buildflags.gni")
|
||||
import("//printing/buildflags/buildflags.gni")
|
||||
import("//rlz/buildflags/buildflags.gni")
|
||||
import("//testing/test.gni")
|
||||
import("//third_party/icu/config.gni")
|
||||
import("//third_party/widevine/cdm/widevine.gni")
|
||||
@@ -257,6 +258,14 @@ assert(enable_print_preview)
|
||||
# Enable support for Widevine CDM.
|
||||
assert(enable_widevine)
|
||||
|
||||
if (is_mac || is_win) {
|
||||
# Enable Widevine CDM host verification and storage ID.
|
||||
assert(enable_cdm_host_verification)
|
||||
assert(enable_cdm_storage_id)
|
||||
assert(alternate_cdm_storage_id_key != "")
|
||||
assert(enable_rlz)
|
||||
}
|
||||
|
||||
# Enable Views UI framework.
|
||||
assert(toolkit_views)
|
||||
|
||||
@@ -602,6 +611,8 @@ source_set("libcef_static") {
|
||||
"libcef/browser/frame_host_impl.cc",
|
||||
"libcef/browser/frame_host_impl.h",
|
||||
"libcef/browser/frame_service_base.h",
|
||||
"libcef/browser/global_preference_manager_impl.cc",
|
||||
"libcef/browser/global_preference_manager_impl.h",
|
||||
"libcef/browser/image_impl.cc",
|
||||
"libcef/browser/image_impl.h",
|
||||
"libcef/browser/iothread_state.cc",
|
||||
@@ -700,14 +711,18 @@ source_set("libcef_static") {
|
||||
"libcef/browser/permission_prompt.h",
|
||||
"libcef/browser/prefs/browser_prefs.cc",
|
||||
"libcef/browser/prefs/browser_prefs.h",
|
||||
"libcef/browser/prefs/pref_helper.cc",
|
||||
"libcef/browser/prefs/pref_helper.h",
|
||||
"libcef/browser/prefs/pref_registrar.cc",
|
||||
"libcef/browser/prefs/pref_registrar.h",
|
||||
"libcef/browser/prefs/pref_store.cc",
|
||||
"libcef/browser/prefs/pref_store.h",
|
||||
"libcef/browser/prefs/renderer_prefs.cc",
|
||||
"libcef/browser/prefs/renderer_prefs.h",
|
||||
"libcef/browser/print_settings_impl.cc",
|
||||
"libcef/browser/print_settings_impl.h",
|
||||
"libcef/browser/printing/print_view_manager.cc",
|
||||
"libcef/browser/printing/print_view_manager.h",
|
||||
"libcef/browser/printing/print_util.cc",
|
||||
"libcef/browser/printing/print_util.h",
|
||||
"libcef/browser/process_util_impl.cc",
|
||||
"libcef/browser/request_context_handler_map.cc",
|
||||
"libcef/browser/request_context_handler_map.h",
|
||||
@@ -1165,6 +1180,13 @@ source_set("libcef_static") {
|
||||
"//ui/wm/public",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_cdm_host_verification) {
|
||||
sources += [
|
||||
"libcef/common/cdm_host_file_path.cc",
|
||||
"libcef/common/cdm_host_file_path.h",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1194,6 +1216,21 @@ config("libcef_dll_wrapper_config") {
|
||||
]
|
||||
|
||||
configs = [ ":libcef_autogen_config" ]
|
||||
|
||||
if (is_win) {
|
||||
if (current_cpu == "x86") {
|
||||
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB minimum
|
||||
# needed by CEF's main thread. This saves significant memory on threads
|
||||
# (like those in the Windows thread pool, and others) whose stack size we
|
||||
# can only control through this setting. The main thread (in 32-bit builds
|
||||
# only) uses fibers to switch to a 4MiB stack at runtime via
|
||||
# CefRunWinMainWithPreferredStackSize().
|
||||
ldflags = [ "/STACK:0x80000" ]
|
||||
} else {
|
||||
# Increase the initial stack size to 8MiB from the default 1MiB.
|
||||
ldflags = [ "/STACK:0x800000" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# libcef_dll_wrapper target.
|
||||
@@ -1361,7 +1398,7 @@ make_pack_header("strings") {
|
||||
"$root_gen_dir/chrome/grit/generated_resources.h",
|
||||
"$root_gen_dir/chrome/grit/locale_settings.h",
|
||||
"$root_gen_dir/chrome/grit/platform_locale_settings.h",
|
||||
"$root_gen_dir/components/omnibox/resources/grit/omnibox_resources.h",
|
||||
"$root_gen_dir/components/omnibox/resources/grit/omnibox_pedal_synonyms.h",
|
||||
"$root_gen_dir/components/strings/grit/components_chromium_strings.h",
|
||||
"$root_gen_dir/components/strings/grit/components_strings.h",
|
||||
"$root_gen_dir/extensions/strings/grit/extensions_strings.h",
|
||||
@@ -1377,7 +1414,7 @@ make_pack_header("strings") {
|
||||
"//chrome/app:generated_resources",
|
||||
"//chrome/app/resources:locale_settings",
|
||||
"//chrome/app/resources:platform_locale_settings",
|
||||
"//components/omnibox/resources:omnibox_resources",
|
||||
"//components/omnibox/resources:omnibox_pedal_synonyms",
|
||||
"//components/strings:components_chromium_strings",
|
||||
"//components/strings:components_locale_settings",
|
||||
"//components/strings:components_strings",
|
||||
|
@@ -7,5 +7,6 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/106.0.5249.0'
|
||||
'chromium_checkout': 'refs/tags/108.0.5359.125',
|
||||
'depot_tools_checkout': '64b6175557'
|
||||
}
|
||||
|
@@ -33,8 +33,6 @@
|
||||
'chrome/browser/extensions/chrome_extension_web_contents_observer.*',
|
||||
'chrome/browser/extensions/component_loader.*',
|
||||
'chrome/browser/extensions/extension_service.*',
|
||||
'chrome/browser/printing/print_view_manager*',
|
||||
'chrome/browser/printing/printing_message_filter*',
|
||||
'chrome/browser/profiles/profile.h',
|
||||
'chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.*',
|
||||
'chrome/common/extensions/api/*_features.json',
|
||||
|
@@ -48,7 +48,7 @@
|
||||
# libgtk3.0-dev (required by the cefclient target only)
|
||||
#
|
||||
# - MacOS requirements:
|
||||
# Xcode 12.2 to 13.0 building on MacOS 10.15.4 (Catalina) or newer. Only
|
||||
# Xcode 12.2 to 13.4 building on MacOS 10.15.4 (Catalina) or newer. Only
|
||||
# 64-bit builds are supported. The Xcode command-line tools must also be
|
||||
# installed. Newer Xcode versions may not have been been tested and are not
|
||||
# recommended.
|
||||
@@ -234,3 +234,22 @@ endif()
|
||||
|
||||
# Display configuration settings.
|
||||
PRINT_CEF_CONFIG()
|
||||
|
||||
|
||||
#
|
||||
# Define the API documentation target.
|
||||
#
|
||||
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
add_custom_target(apidocs ALL
|
||||
# Generate documentation in the docs/html directory.
|
||||
COMMAND "${DOXYGEN_EXECUTABLE}" Doxyfile
|
||||
# Write a docs/index.html file.
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL='html/index.html'\"/></head></html>" > docs/index.html
|
||||
WORKING_DIRECTORY "${CEF_ROOT}"
|
||||
COMMENT "Generating API documentation with Doxygen..."
|
||||
VERBATIM )
|
||||
else()
|
||||
message(WARNING "Doxygen must be installed to generate API documentation.")
|
||||
endif()
|
||||
|
@@ -9,8 +9,7 @@ The Chromium Embedded Framework (CEF) is a simple framework for embedding Chromi
|
||||
* Branches and Building - https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
* Announcements - https://groups.google.com/forum/#!forum/cef-announce
|
||||
* Support Forum - http://www.magpcss.org/ceforum/
|
||||
* CEF1 C++ API Docs - http://magpcss.org/ceforum/apidocs/
|
||||
* CEF3 C++ API Docs - http://magpcss.org/ceforum/apidocs3/
|
||||
* C++ API Docs - [Stable release docs](https://cef-builds.spotifycdn.com/docs/stable.html) / [Beta release docs](https://cef-builds.spotifycdn.com/docs/beta.html)
|
||||
* Downloads - https://cef-builds.spotifycdn.com/index.html
|
||||
* Donations - http://www.magpcss.org/ceforum/donate.php
|
||||
|
||||
@@ -29,7 +28,7 @@ Numerous individuals and organizations contribute time and resources to support
|
||||
|
||||
# Getting Started
|
||||
|
||||
Users new to CEF development should start by reading the [Tutorial](https://bitbucket.org/chromiumembedded/cef/wiki/Tutorial) Wiki page for an overview of CEF usage and then proceed to the [GeneralUsage](https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage) Wiki page for a more in-depth discussion or architectural and usage issues. Complete API documentation is available [here](http://magpcss.org/ceforum/apidocs3/). CEF support and related discussion is available on the [CEF Forum](http://www.magpcss.org/ceforum/).
|
||||
Users new to CEF development should start by reading the [Tutorial](https://bitbucket.org/chromiumembedded/cef/wiki/Tutorial) Wiki page for an overview of CEF usage and then proceed to the [GeneralUsage](https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage) Wiki page for a more in-depth discussion or architectural and usage issues. Complete API documentation is available [here](https://cef-builds.spotifycdn.com/docs/stable.html). CEF support and related discussion is available on the [CEF Forum](http://www.magpcss.org/ceforum/).
|
||||
|
||||
# Binary Distributions
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
# by hand. See the translator.README.txt file in the tools directory for
|
||||
# more information.
|
||||
#
|
||||
# $hash=ffc0502a0275b74228f1fd642566d3f020e538a0$
|
||||
# $hash=0373d7e3fc02d16a128a5891aac70af56fb9ddc1$
|
||||
#
|
||||
|
||||
{
|
||||
@@ -56,6 +56,7 @@
|
||||
'include/cef_parser.h',
|
||||
'include/cef_path_util.h',
|
||||
'include/cef_permission_handler.h',
|
||||
'include/cef_preference.h',
|
||||
'include/cef_print_handler.h',
|
||||
'include/cef_print_settings.h',
|
||||
'include/cef_process_message.h',
|
||||
@@ -159,6 +160,7 @@
|
||||
'include/capi/cef_parser_capi.h',
|
||||
'include/capi/cef_path_util_capi.h',
|
||||
'include/capi/cef_permission_handler_capi.h',
|
||||
'include/capi/cef_preference_capi.h',
|
||||
'include/capi/cef_print_handler_capi.h',
|
||||
'include/capi/cef_print_settings_capi.h',
|
||||
'include/capi/cef_process_message_capi.h',
|
||||
@@ -382,6 +384,10 @@
|
||||
'libcef_dll/cpptoc/post_data_cpptoc.h',
|
||||
'libcef_dll/cpptoc/post_data_element_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/post_data_element_cpptoc.h',
|
||||
'libcef_dll/cpptoc/preference_manager_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/preference_manager_cpptoc.h',
|
||||
'libcef_dll/cpptoc/preference_registrar_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/preference_registrar_cpptoc.h',
|
||||
'libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/print_dialog_callback_cpptoc.h',
|
||||
'libcef_dll/ctocpp/print_handler_ctocpp.cc',
|
||||
@@ -706,6 +712,10 @@
|
||||
'libcef_dll/ctocpp/post_data_ctocpp.h',
|
||||
'libcef_dll/ctocpp/post_data_element_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/post_data_element_ctocpp.h',
|
||||
'libcef_dll/ctocpp/preference_manager_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/preference_manager_ctocpp.h',
|
||||
'libcef_dll/ctocpp/preference_registrar_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/preference_registrar_ctocpp.h',
|
||||
'libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/print_dialog_callback_ctocpp.h',
|
||||
'libcef_dll/cpptoc/print_handler_cpptoc.cc',
|
||||
|
@@ -17,7 +17,6 @@
|
||||
'include/base/cef_callback_list.h',
|
||||
'include/base/cef_cancelable_callback.h',
|
||||
'include/base/cef_compiler_specific.h',
|
||||
'include/base/cef_cxx17_backports.h',
|
||||
'include/base/cef_lock.h',
|
||||
'include/base/cef_logging.h',
|
||||
'include/base/cef_macros.h',
|
||||
@@ -80,6 +79,7 @@
|
||||
'include/internal/cef_win.h',
|
||||
],
|
||||
'includes_win_capi': [
|
||||
'include/internal/cef_app_win.h',
|
||||
'include/internal/cef_types_win.h',
|
||||
],
|
||||
'includes_mac': [
|
||||
@@ -234,6 +234,8 @@
|
||||
'tests/cefclient/browser/client_handler_osr.h',
|
||||
'tests/cefclient/browser/client_handler_std.cc',
|
||||
'tests/cefclient/browser/client_handler_std.h',
|
||||
'tests/cefclient/browser/client_prefs.cc',
|
||||
'tests/cefclient/browser/client_prefs.h',
|
||||
'tests/cefclient/browser/client_types.h',
|
||||
'tests/cefclient/browser/dialog_test.cc',
|
||||
'tests/cefclient/browser/dialog_test.h',
|
||||
|
@@ -448,6 +448,23 @@ if(OS_WINDOWS)
|
||||
NDEBUG _NDEBUG # Not a debug build
|
||||
)
|
||||
|
||||
if(PROJECT_ARCH STREQUAL "x86")
|
||||
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB minimum
|
||||
# needed by CEF's main thread. This saves significant memory on threads
|
||||
# (like those in the Windows thread pool, and others) whose stack size we
|
||||
# can only control through this setting. The main thread (in 32-bit builds
|
||||
# only) uses fibers to switch to a 4MiB stack at runtime via
|
||||
# CefRunWinMainWithPreferredStackSize().
|
||||
list(APPEND CEF_EXE_LINKER_FLAGS
|
||||
/STACK:0x8000
|
||||
)
|
||||
else()
|
||||
# Increase the initial stack size to 8MiB from the default 1MiB.
|
||||
list(APPEND CEF_EXE_LINKER_FLAGS
|
||||
/STACK:0x800000
|
||||
)
|
||||
endif()
|
||||
|
||||
# Standard libraries.
|
||||
set(CEF_STANDARD_LIBS
|
||||
comctl32.lib
|
||||
|
@@ -49,9 +49,11 @@
|
||||
|
||||
namespace base {
|
||||
|
||||
// A flag that can safely be set from one thread and read from other threads.
|
||||
//
|
||||
// This class IS NOT intended for synchronization between threads.
|
||||
///
|
||||
/// A flag that can safely be set from one thread and read from other threads.
|
||||
///
|
||||
/// This class IS NOT intended for synchronization between threads.
|
||||
///
|
||||
class AtomicFlag {
|
||||
public:
|
||||
AtomicFlag();
|
||||
@@ -61,19 +63,26 @@ class AtomicFlag {
|
||||
|
||||
~AtomicFlag();
|
||||
|
||||
// Set the flag. Must always be called from the same thread.
|
||||
///
|
||||
/// Set the flag. Must always be called from the same thread.
|
||||
///
|
||||
void Set();
|
||||
|
||||
// Returns true iff the flag was set. If this returns true, the current thread
|
||||
// is guaranteed to be synchronized with all memory operations on the thread
|
||||
// which invoked Set() up until at least the first call to Set() on it.
|
||||
///
|
||||
/// Returns true iff the flag was set. If this returns true, the current
|
||||
/// thread is guaranteed to be synchronized with all memory operations on the
|
||||
/// thread which invoked Set() up until at least the first call to Set() on
|
||||
/// it.
|
||||
///
|
||||
bool IsSet() const {
|
||||
// Inline here: this has a measurable performance impact on base::WeakPtr.
|
||||
return flag_.load(std::memory_order_acquire) != 0;
|
||||
}
|
||||
|
||||
// Resets the flag. Be careful when using this: callers might not expect
|
||||
// IsSet() to return false after returning true once.
|
||||
///
|
||||
/// Resets the flag. Be careful when using this: callers might not expect
|
||||
/// IsSet() to return false after returning true once.
|
||||
///
|
||||
void UnsafeResetForTesting();
|
||||
|
||||
private:
|
||||
|
@@ -58,19 +58,25 @@ class AtomicRefCount {
|
||||
explicit constexpr AtomicRefCount(int initial_value)
|
||||
: ref_count_(initial_value) {}
|
||||
|
||||
// Increment a reference count.
|
||||
// Returns the previous value of the count.
|
||||
///
|
||||
/// Increment a reference count.
|
||||
/// Returns the previous value of the count.
|
||||
///
|
||||
int Increment() { return Increment(1); }
|
||||
|
||||
// Increment a reference count by "increment", which must exceed 0.
|
||||
// Returns the previous value of the count.
|
||||
///
|
||||
/// Increment a reference count by "increment", which must exceed 0.
|
||||
/// Returns the previous value of the count.
|
||||
///
|
||||
int Increment(int increment) {
|
||||
return ref_count_.fetch_add(increment, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
// Decrement a reference count, 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.
|
||||
///
|
||||
/// Decrement a reference count, 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.
|
||||
///
|
||||
bool Decrement() {
|
||||
// TODO(jbroman): Technically this doesn't need to be an acquire operation
|
||||
// unless the result is 1 (i.e., the ref count did indeed reach zero).
|
||||
@@ -79,23 +85,29 @@ class AtomicRefCount {
|
||||
return ref_count_.fetch_sub(1, std::memory_order_acq_rel) != 1;
|
||||
}
|
||||
|
||||
// Return whether the reference count is one. If the reference count is used
|
||||
// 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.
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool IsOne() const { return ref_count_.load(std::memory_order_acquire) == 1; }
|
||||
|
||||
// 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.
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
bool IsZero() const {
|
||||
return ref_count_.load(std::memory_order_acquire) == 0;
|
||||
}
|
||||
|
||||
// Returns the current reference count (with no barriers). This is subtle, and
|
||||
// should be used only for debugging.
|
||||
///
|
||||
/// Returns the current reference count (with no barriers). This is subtle,
|
||||
/// and should be used only for debugging.
|
||||
///
|
||||
int SubtleRefCountForDebug() const {
|
||||
return ref_count_.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
@@ -28,41 +28,42 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Usage documentation
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// Overview:
|
||||
// base::BindOnce() and base::BindRepeating() are helpers for creating
|
||||
// base::OnceCallback and base::RepeatingCallback objects respectively.
|
||||
//
|
||||
// For a runnable object of n-arity, the base::Bind*() family allows partial
|
||||
// application of the first m arguments. The remaining n - m arguments must be
|
||||
// passed when invoking the callback with Run().
|
||||
//
|
||||
// // The first argument is bound at callback creation; the remaining
|
||||
// // two must be passed when calling Run() on the callback object.
|
||||
// base::OnceCallback<long(int, long)> cb = base::BindOnce(
|
||||
// [](short x, int y, long z) { return x * y * z; }, 42);
|
||||
//
|
||||
// When binding to a method, the receiver object must also be specified at
|
||||
// callback creation time. When Run() is invoked, the method will be invoked on
|
||||
// the specified receiver object.
|
||||
//
|
||||
// class C : public base::RefCounted<C> { void F(); };
|
||||
// auto instance = base::MakeRefCounted<C>();
|
||||
// auto cb = base::BindOnce(&C::F, instance);
|
||||
// std::move(cb).Run(); // Identical to instance->F()
|
||||
//
|
||||
// See //docs/callback.md for the full documentation.
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
///
|
||||
/// \file
|
||||
/// base::BindOnce() and base::BindRepeating() are helpers for creating
|
||||
/// base::OnceCallback and base::RepeatingCallback objects respectively.
|
||||
///
|
||||
/// For a runnable object of n-arity, the base::Bind*() family allows partial
|
||||
/// application of the first m arguments. The remaining n - m arguments must be
|
||||
/// passed when invoking the callback with Run().
|
||||
///
|
||||
/// <pre>
|
||||
/// // The first argument is bound at callback creation; the remaining
|
||||
/// // two must be passed when calling Run() on the callback object.
|
||||
/// base::OnceCallback<long(int, long)> cb = base::BindOnce(
|
||||
/// [](short x, int y, long z) { return x * y * z; }, 42);
|
||||
/// </pre>
|
||||
///
|
||||
/// When binding to a method, the receiver object must also be specified at
|
||||
/// callback creation time. When Run() is invoked, the method will be invoked on
|
||||
/// the specified receiver object.
|
||||
///
|
||||
/// <pre>
|
||||
/// class C : public base::RefCounted<C> { void F(); };
|
||||
/// auto instance = base::MakeRefCounted<C>();
|
||||
/// auto cb = base::BindOnce(&C::F, instance);
|
||||
/// std::move(cb).Run(); // Identical to instance->F()
|
||||
/// </pre>
|
||||
///
|
||||
/// See https://chromium.googlesource.com/chromium/src/+/lkgr/docs/callback.md
|
||||
/// for the full documentation.
|
||||
///
|
||||
|
||||
// Implementation notes
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// If you're reading the implementation, before proceeding further, you should
|
||||
// read the top comment of base/internal/cef_bind_internal.h for a definition of
|
||||
// common terms and concepts.
|
||||
// read the top comment of base/internal/cef_bind_internal.h for a definition
|
||||
// of common terms and concepts.
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_BIND_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_BIND_H_
|
||||
@@ -92,7 +93,9 @@
|
||||
|
||||
namespace base {
|
||||
|
||||
// Bind as OnceCallback.
|
||||
///
|
||||
/// Bind as OnceCallback.
|
||||
///
|
||||
template <typename Functor, typename... Args>
|
||||
inline OnceCallback<internal::MakeUnboundRunType<Functor, Args...>> BindOnce(
|
||||
Functor&& functor,
|
||||
@@ -111,7 +114,9 @@ inline OnceCallback<internal::MakeUnboundRunType<Functor, Args...>> BindOnce(
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
// Bind as RepeatingCallback.
|
||||
///
|
||||
/// Bind as RepeatingCallback.
|
||||
///
|
||||
template <typename Functor, typename... Args>
|
||||
inline RepeatingCallback<internal::MakeUnboundRunType<Functor, Args...>>
|
||||
BindRepeating(Functor&& functor, Args&&... args) {
|
||||
@@ -123,9 +128,11 @@ BindRepeating(Functor&& functor, Args&&... args) {
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
// Special cases for binding to a base::Callback without extra bound arguments.
|
||||
// We CHECK() the validity of callback to guard against null pointers
|
||||
// accidentally ending up in posted tasks, causing hard-to-debug crashes.
|
||||
///
|
||||
/// Special cases for binding to a base::Callback without extra bound arguments.
|
||||
/// We CHECK() the validity of callback to guard against null pointers
|
||||
/// accidentally ending up in posted tasks, causing hard-to-debug crashes.
|
||||
///
|
||||
template <typename Signature>
|
||||
OnceCallback<Signature> BindOnce(OnceCallback<Signature> callback) {
|
||||
CHECK(callback);
|
||||
@@ -145,44 +152,54 @@ RepeatingCallback<Signature> BindRepeating(
|
||||
return callback;
|
||||
}
|
||||
|
||||
// Unretained() allows binding a non-refcounted class, and to disable
|
||||
// refcounting on arguments that are refcounted objects.
|
||||
//
|
||||
// EXAMPLE OF Unretained():
|
||||
//
|
||||
// class Foo {
|
||||
// public:
|
||||
// void func() { cout << "Foo:f" << endl; }
|
||||
// };
|
||||
//
|
||||
// // In some function somewhere.
|
||||
// Foo foo;
|
||||
// OnceClosure foo_callback =
|
||||
// BindOnce(&Foo::func, Unretained(&foo));
|
||||
// std::move(foo_callback).Run(); // Prints "Foo:f".
|
||||
//
|
||||
// Without the Unretained() wrapper on |&foo|, the above call would fail
|
||||
// to compile because Foo does not support the AddRef() and Release() methods.
|
||||
///
|
||||
/// Unretained() allows binding a non-refcounted class, and to disable
|
||||
/// refcounting on arguments that are refcounted objects.
|
||||
///
|
||||
/// EXAMPLE OF Unretained():
|
||||
///
|
||||
/// <pre>
|
||||
/// class Foo {
|
||||
/// public:
|
||||
/// void func() { cout << "Foo:f" << endl; }
|
||||
/// };
|
||||
///
|
||||
/// // In some function somewhere.
|
||||
/// Foo foo;
|
||||
/// OnceClosure foo_callback =
|
||||
/// BindOnce(&Foo::func, Unretained(&foo));
|
||||
/// std::move(foo_callback).Run(); // Prints "Foo:f".
|
||||
/// </pre>
|
||||
///
|
||||
/// Without the Unretained() wrapper on |&foo|, the above call would fail
|
||||
/// to compile because Foo does not support the AddRef() and Release() methods.
|
||||
///
|
||||
template <typename T>
|
||||
inline internal::UnretainedWrapper<T> Unretained(T* o) {
|
||||
return internal::UnretainedWrapper<T>(o);
|
||||
}
|
||||
|
||||
// RetainedRef() accepts a ref counted object and retains a reference to it.
|
||||
// When the callback is called, the object is passed as a raw pointer.
|
||||
//
|
||||
// EXAMPLE OF RetainedRef():
|
||||
//
|
||||
// void foo(RefCountedBytes* bytes) {}
|
||||
//
|
||||
// scoped_refptr<RefCountedBytes> bytes = ...;
|
||||
// OnceClosure callback = BindOnce(&foo, base::RetainedRef(bytes));
|
||||
// std::move(callback).Run();
|
||||
//
|
||||
// Without RetainedRef, the scoped_refptr would try to implicitly convert to
|
||||
// a raw pointer and fail compilation:
|
||||
//
|
||||
// OnceClosure callback = BindOnce(&foo, bytes); // ERROR!
|
||||
///
|
||||
/// RetainedRef() accepts a ref counted object and retains a reference to it.
|
||||
/// When the callback is called, the object is passed as a raw pointer.
|
||||
///
|
||||
/// EXAMPLE OF RetainedRef():
|
||||
///
|
||||
/// <pre>
|
||||
/// void foo(RefCountedBytes* bytes) {}
|
||||
///
|
||||
/// scoped_refptr<RefCountedBytes> bytes = ...;
|
||||
/// OnceClosure callback = BindOnce(&foo, base::RetainedRef(bytes));
|
||||
/// std::move(callback).Run();
|
||||
/// </pre>
|
||||
///
|
||||
/// Without RetainedRef, the scoped_refptr would try to implicitly convert to
|
||||
/// a raw pointer and fail compilation:
|
||||
///
|
||||
/// <pre>
|
||||
/// OnceClosure callback = BindOnce(&foo, bytes); // ERROR!
|
||||
/// </pre>
|
||||
///
|
||||
template <typename T>
|
||||
inline internal::RetainedRefWrapper<T> RetainedRef(T* o) {
|
||||
return internal::RetainedRefWrapper<T>(o);
|
||||
@@ -192,26 +209,30 @@ inline internal::RetainedRefWrapper<T> RetainedRef(scoped_refptr<T> o) {
|
||||
return internal::RetainedRefWrapper<T>(std::move(o));
|
||||
}
|
||||
|
||||
// Owned() transfers ownership of an object to the callback resulting from
|
||||
// bind; the object will be deleted when the callback is deleted.
|
||||
//
|
||||
// EXAMPLE OF Owned():
|
||||
//
|
||||
// void foo(int* arg) { cout << *arg << endl }
|
||||
//
|
||||
// int* pn = new int(1);
|
||||
// RepeatingClosure foo_callback = BindRepeating(&foo, Owned(pn));
|
||||
//
|
||||
// foo_callback.Run(); // Prints "1"
|
||||
// foo_callback.Run(); // Prints "1"
|
||||
// *pn = 2;
|
||||
// foo_callback.Run(); // Prints "2"
|
||||
//
|
||||
// foo_callback.Reset(); // |pn| is deleted. Also will happen when
|
||||
// // |foo_callback| goes out of scope.
|
||||
//
|
||||
// Without Owned(), someone would have to know to delete |pn| when the last
|
||||
// reference to the callback is deleted.
|
||||
///
|
||||
/// Owned() transfers ownership of an object to the callback resulting from
|
||||
/// bind; the object will be deleted when the callback is deleted.
|
||||
///
|
||||
/// EXAMPLE OF Owned():
|
||||
///
|
||||
/// <pre>
|
||||
/// void foo(int* arg) { cout << *arg << endl }
|
||||
///
|
||||
/// int* pn = new int(1);
|
||||
/// RepeatingClosure foo_callback = BindRepeating(&foo, Owned(pn));
|
||||
///
|
||||
/// foo_callback.Run(); // Prints "1"
|
||||
/// foo_callback.Run(); // Prints "1"
|
||||
/// *pn = 2;
|
||||
/// foo_callback.Run(); // Prints "2"
|
||||
///
|
||||
/// foo_callback.Reset(); // |pn| is deleted. Also will happen when
|
||||
/// // |foo_callback| goes out of scope.
|
||||
/// </pre>
|
||||
///
|
||||
/// Without Owned(), someone would have to know to delete |pn| when the last
|
||||
/// reference to the callback is deleted.
|
||||
///
|
||||
template <typename T>
|
||||
inline internal::OwnedWrapper<T> Owned(T* o) {
|
||||
return internal::OwnedWrapper<T>(o);
|
||||
@@ -223,78 +244,89 @@ inline internal::OwnedWrapper<T, Deleter> Owned(
|
||||
return internal::OwnedWrapper<T, Deleter>(std::move(ptr));
|
||||
}
|
||||
|
||||
// OwnedRef() stores an object in the callback resulting from
|
||||
// bind and passes a reference to the object to the bound function.
|
||||
//
|
||||
// EXAMPLE OF OwnedRef():
|
||||
//
|
||||
// void foo(int& arg) { cout << ++arg << endl }
|
||||
//
|
||||
// int counter = 0;
|
||||
// RepeatingClosure foo_callback = BindRepeating(&foo, OwnedRef(counter));
|
||||
//
|
||||
// foo_callback.Run(); // Prints "1"
|
||||
// foo_callback.Run(); // Prints "2"
|
||||
// foo_callback.Run(); // Prints "3"
|
||||
//
|
||||
// cout << counter; // Prints "0", OwnedRef creates a copy of counter.
|
||||
//
|
||||
// Supports OnceCallbacks as well, useful to pass placeholder arguments:
|
||||
//
|
||||
// void bar(int& ignore, const std::string& s) { cout << s << endl }
|
||||
//
|
||||
// OnceClosure bar_callback = BindOnce(&bar, OwnedRef(0), "Hello");
|
||||
//
|
||||
// std::move(bar_callback).Run(); // Prints "Hello"
|
||||
//
|
||||
// Without OwnedRef() it would not be possible to pass a mutable reference to an
|
||||
// object owned by the callback.
|
||||
///
|
||||
/// OwnedRef() stores an object in the callback resulting from
|
||||
/// bind and passes a reference to the object to the bound function.
|
||||
///
|
||||
/// EXAMPLE OF OwnedRef():
|
||||
///
|
||||
/// <pre>
|
||||
/// void foo(int& arg) { cout << ++arg << endl }
|
||||
///
|
||||
/// int counter = 0;
|
||||
/// RepeatingClosure foo_callback = BindRepeating(&foo, OwnedRef(counter));
|
||||
///
|
||||
/// foo_callback.Run(); // Prints "1"
|
||||
/// foo_callback.Run(); // Prints "2"
|
||||
/// foo_callback.Run(); // Prints "3"
|
||||
///
|
||||
/// cout << counter; // Prints "0", OwnedRef creates a copy of counter.
|
||||
/// </pre>
|
||||
///
|
||||
/// Supports OnceCallbacks as well, useful to pass placeholder arguments:
|
||||
///
|
||||
/// <pre>
|
||||
/// void bar(int& ignore, const std::string& s) { cout << s << endl }
|
||||
///
|
||||
/// OnceClosure bar_callback = BindOnce(&bar, OwnedRef(0), "Hello");
|
||||
///
|
||||
/// std::move(bar_callback).Run(); // Prints "Hello"
|
||||
/// </pre>
|
||||
///
|
||||
/// Without OwnedRef() it would not be possible to pass a mutable reference to
|
||||
/// an object owned by the callback.
|
||||
///
|
||||
template <typename T>
|
||||
internal::OwnedRefWrapper<std::decay_t<T>> OwnedRef(T&& t) {
|
||||
return internal::OwnedRefWrapper<std::decay_t<T>>(std::forward<T>(t));
|
||||
}
|
||||
|
||||
// Passed() is for transferring movable-but-not-copyable types (eg. unique_ptr)
|
||||
// through a RepeatingCallback. Logically, this signifies a destructive transfer
|
||||
// of the state of the argument into the target function. Invoking
|
||||
// RepeatingCallback::Run() twice on a callback that was created with a Passed()
|
||||
// argument will CHECK() because the first invocation would have already
|
||||
// transferred ownership to the target function.
|
||||
//
|
||||
// Note that Passed() is not necessary with BindOnce(), as std::move() does the
|
||||
// same thing. Avoid Passed() in favor of std::move() with BindOnce().
|
||||
//
|
||||
// EXAMPLE OF Passed():
|
||||
//
|
||||
// void TakesOwnership(std::unique_ptr<Foo> arg) { }
|
||||
// std::unique_ptr<Foo> CreateFoo() { return std::make_unique<Foo>();
|
||||
// }
|
||||
//
|
||||
// auto f = std::make_unique<Foo>();
|
||||
//
|
||||
// // |cb| is given ownership of Foo(). |f| is now NULL.
|
||||
// // You can use std::move(f) in place of &f, but it's more verbose.
|
||||
// RepeatingClosure cb = BindRepeating(&TakesOwnership, Passed(&f));
|
||||
//
|
||||
// // Run was never called so |cb| still owns Foo() and deletes
|
||||
// // it on Reset().
|
||||
// cb.Reset();
|
||||
//
|
||||
// // |cb| is given a new Foo created by CreateFoo().
|
||||
// cb = BindRepeating(&TakesOwnership, Passed(CreateFoo()));
|
||||
//
|
||||
// // |arg| in TakesOwnership() is given ownership of Foo(). |cb|
|
||||
// // no longer owns Foo() and, if reset, would not delete Foo().
|
||||
// cb.Run(); // Foo() is now transferred to |arg| and deleted.
|
||||
// cb.Run(); // This CHECK()s since Foo() already been used once.
|
||||
//
|
||||
// We offer 2 syntaxes for calling Passed(). The first takes an rvalue and is
|
||||
// best suited for use with the return value of a function or other temporary
|
||||
// rvalues. The second takes a pointer to the scoper and is just syntactic sugar
|
||||
// to avoid having to write Passed(std::move(scoper)).
|
||||
//
|
||||
// Both versions of Passed() prevent T from being an lvalue reference. The first
|
||||
// via use of enable_if, and the second takes a T* which will not bind to T&.
|
||||
///
|
||||
/// Passed() is for transferring movable-but-not-copyable types (eg. unique_ptr)
|
||||
/// through a RepeatingCallback. Logically, this signifies a destructive
|
||||
/// transfer of the state of the argument into the target function. Invoking
|
||||
/// RepeatingCallback::Run() twice on a callback that was created with a
|
||||
/// Passed() argument will CHECK() because the first invocation would have
|
||||
/// already transferred ownership to the target function.
|
||||
///
|
||||
/// Note that Passed() is not necessary with BindOnce(), as std::move() does the
|
||||
/// same thing. Avoid Passed() in favor of std::move() with BindOnce().
|
||||
///
|
||||
/// EXAMPLE OF Passed():
|
||||
///
|
||||
/// <pre>
|
||||
/// void TakesOwnership(std::unique_ptr<Foo> arg) { }
|
||||
/// std::unique_ptr<Foo> CreateFoo() { return std::make_unique<Foo>();
|
||||
/// }
|
||||
///
|
||||
/// auto f = std::make_unique<Foo>();
|
||||
///
|
||||
/// // |cb| is given ownership of Foo(). |f| is now NULL.
|
||||
/// // You can use std::move(f) in place of &f, but it's more verbose.
|
||||
/// RepeatingClosure cb = BindRepeating(&TakesOwnership, Passed(&f));
|
||||
///
|
||||
/// // Run was never called so |cb| still owns Foo() and deletes
|
||||
/// // it on Reset().
|
||||
/// cb.Reset();
|
||||
///
|
||||
/// // |cb| is given a new Foo created by CreateFoo().
|
||||
/// cb = BindRepeating(&TakesOwnership, Passed(CreateFoo()));
|
||||
///
|
||||
/// // |arg| in TakesOwnership() is given ownership of Foo(). |cb|
|
||||
/// // no longer owns Foo() and, if reset, would not delete Foo().
|
||||
/// cb.Run(); // Foo() is now transferred to |arg| and deleted.
|
||||
/// cb.Run(); // This CHECK()s since Foo() already been used once.
|
||||
/// </pre>
|
||||
///
|
||||
/// We offer 2 syntaxes for calling Passed(). The first takes an rvalue and is
|
||||
/// best suited for use with the return value of a function or other temporary
|
||||
/// rvalues. The second takes a pointer to the scoper and is just syntactic
|
||||
/// sugar to avoid having to write Passed(std::move(scoper)).
|
||||
///
|
||||
/// Both versions of Passed() prevent T from being an lvalue reference. The
|
||||
/// first via use of enable_if, and the second takes a T* which will not bind to
|
||||
/// T&.
|
||||
///
|
||||
template <typename T,
|
||||
std::enable_if_t<!std::is_lvalue_reference<T>::value>* = nullptr>
|
||||
inline internal::PassedWrapper<T> Passed(T&& scoper) {
|
||||
@@ -305,21 +337,25 @@ inline internal::PassedWrapper<T> Passed(T* scoper) {
|
||||
return internal::PassedWrapper<T>(std::move(*scoper));
|
||||
}
|
||||
|
||||
// IgnoreResult() is used to adapt a function or callback with a return type to
|
||||
// one with a void return. This is most useful if you have a function with,
|
||||
// say, a pesky ignorable bool return that you want to use with PostTask or
|
||||
// something else that expect a callback with a void return.
|
||||
//
|
||||
// EXAMPLE OF IgnoreResult():
|
||||
//
|
||||
// int DoSomething(int arg) { cout << arg << endl; }
|
||||
//
|
||||
// // Assign to a callback with a void return type.
|
||||
// OnceCallback<void(int)> cb = BindOnce(IgnoreResult(&DoSomething));
|
||||
// std::move(cb).Run(1); // Prints "1".
|
||||
//
|
||||
// // Prints "2" on |ml|.
|
||||
// ml->PostTask(FROM_HERE, BindOnce(IgnoreResult(&DoSomething), 2);
|
||||
///
|
||||
/// IgnoreResult() is used to adapt a function or callback with a return type to
|
||||
/// one with a void return. This is most useful if you have a function with,
|
||||
/// say, a pesky ignorable bool return that you want to use with PostTask or
|
||||
/// something else that expect a callback with a void return.
|
||||
///
|
||||
/// EXAMPLE OF IgnoreResult():
|
||||
///
|
||||
/// <pre>
|
||||
/// int DoSomething(int arg) { cout << arg << endl; }
|
||||
///
|
||||
/// // Assign to a callback with a void return type.
|
||||
/// OnceCallback<void(int)> cb = BindOnce(IgnoreResult(&DoSomething));
|
||||
/// std::move(cb).Run(1); // Prints "1".
|
||||
///
|
||||
/// // Prints "2" on |ml|.
|
||||
/// ml->PostTask(FROM_HERE, BindOnce(IgnoreResult(&DoSomething), 2);
|
||||
/// </pre>
|
||||
///
|
||||
template <typename T>
|
||||
inline internal::IgnoreResultHelper<T> IgnoreResult(T data) {
|
||||
return internal::IgnoreResultHelper<T>(std::move(data));
|
||||
@@ -327,16 +363,20 @@ inline internal::IgnoreResultHelper<T> IgnoreResult(T data) {
|
||||
|
||||
#if defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
|
||||
|
||||
// RetainBlock() is used to adapt an Objective-C block when Automated Reference
|
||||
// Counting (ARC) is disabled. This is unnecessary when ARC is enabled, as the
|
||||
// BindOnce and BindRepeating already support blocks then.
|
||||
//
|
||||
// EXAMPLE OF RetainBlock():
|
||||
//
|
||||
// // Wrap the block and bind it to a callback.
|
||||
// OnceCallback<void(int)> cb =
|
||||
// BindOnce(RetainBlock(^(int n) { NSLog(@"%d", n); }));
|
||||
// std::move(cb).Run(1); // Logs "1".
|
||||
///
|
||||
/// RetainBlock() is used to adapt an Objective-C block when Automated Reference
|
||||
/// Counting (ARC) is disabled. This is unnecessary when ARC is enabled, as the
|
||||
/// BindOnce and BindRepeating already support blocks then.
|
||||
///
|
||||
/// EXAMPLE OF RetainBlock():
|
||||
///
|
||||
/// <pre>
|
||||
/// // Wrap the block and bind it to a callback.
|
||||
/// OnceCallback<void(int)> cb =
|
||||
/// BindOnce(RetainBlock(^(int n) { NSLog(@"%d", n); }));
|
||||
/// std::move(cb).Run(1); // Logs "1".
|
||||
/// </pre>
|
||||
///
|
||||
template <typename R, typename... Args>
|
||||
base::mac::ScopedBlock<R (^)(Args...)> RetainBlock(R (^block)(Args...)) {
|
||||
return base::mac::ScopedBlock<R (^)(Args...)>(block,
|
||||
|
@@ -27,36 +27,40 @@
|
||||
// (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 adds defines about the platform we're currently building on.
|
||||
//
|
||||
// Operating System:
|
||||
// OS_AIX / OS_ANDROID / OS_ASMJS / OS_FREEBSD / OS_FUCHSIA / OS_IOS /
|
||||
// OS_LINUX / OS_MAC / OS_NACL (SFI or NONSFI) / OS_NETBSD / OS_OPENBSD /
|
||||
// OS_QNX / OS_SOLARIS / OS_WIN
|
||||
// Operating System family:
|
||||
// OS_APPLE: IOS or MAC
|
||||
// OS_BSD: FREEBSD or NETBSD or OPENBSD
|
||||
// OS_POSIX: AIX or ANDROID or ASMJS or CHROMEOS or FREEBSD or IOS or LINUX
|
||||
// or MAC or NACL or NETBSD or OPENBSD or QNX or SOLARIS
|
||||
//
|
||||
// /!\ Note: OS_CHROMEOS is set by the build system, not this file
|
||||
//
|
||||
// Compiler:
|
||||
// COMPILER_MSVC / COMPILER_GCC
|
||||
//
|
||||
// Processor:
|
||||
// ARCH_CPU_ARM64 / ARCH_CPU_ARMEL / ARCH_CPU_MIPS / ARCH_CPU_MIPS64 /
|
||||
// ARCH_CPU_MIPS64EL / ARCH_CPU_MIPSEL / ARCH_CPU_PPC64 / ARCH_CPU_S390 /
|
||||
// ARCH_CPU_S390X / ARCH_CPU_X86 / ARCH_CPU_X86_64
|
||||
// Processor family:
|
||||
// ARCH_CPU_ARM_FAMILY: ARMEL or ARM64
|
||||
// ARCH_CPU_MIPS_FAMILY: MIPS64EL or MIPSEL or MIPS64 or MIPS
|
||||
// ARCH_CPU_PPC64_FAMILY: PPC64
|
||||
// ARCH_CPU_S390_FAMILY: S390 or S390X
|
||||
// ARCH_CPU_X86_FAMILY: X86 or X86_64
|
||||
// Processor features:
|
||||
// ARCH_CPU_31_BITS / ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
|
||||
// ARCH_CPU_BIG_ENDIAN / ARCH_CPU_LITTLE_ENDIAN
|
||||
/// \file
|
||||
/// This file adds defines about the platform we're currently building on.
|
||||
///
|
||||
/// <pre>
|
||||
/// Operating System:
|
||||
/// OS_AIX / OS_ANDROID / OS_ASMJS / OS_FREEBSD / OS_FUCHSIA / OS_IOS /
|
||||
/// OS_LINUX / OS_MAC / OS_NACL (SFI or NONSFI) / OS_NETBSD / OS_OPENBSD /
|
||||
/// OS_QNX / OS_SOLARIS / OS_WIN
|
||||
/// Operating System family:
|
||||
/// OS_APPLE: IOS or MAC
|
||||
/// OS_BSD: FREEBSD or NETBSD or OPENBSD
|
||||
/// OS_POSIX: AIX or ANDROID or ASMJS or CHROMEOS or FREEBSD or IOS or LINUX
|
||||
/// or MAC or NACL or NETBSD or OPENBSD or QNX or SOLARIS
|
||||
///
|
||||
/// /!\ Note: OS_CHROMEOS is set by the build system, not this file
|
||||
///
|
||||
/// Compiler:
|
||||
/// COMPILER_MSVC / COMPILER_GCC
|
||||
///
|
||||
/// Processor:
|
||||
/// ARCH_CPU_ARM64 / ARCH_CPU_ARMEL / ARCH_CPU_MIPS / ARCH_CPU_MIPS64 /
|
||||
/// ARCH_CPU_MIPS64EL / ARCH_CPU_MIPSEL / ARCH_CPU_PPC64 / ARCH_CPU_S390 /
|
||||
/// ARCH_CPU_S390X / ARCH_CPU_X86 / ARCH_CPU_X86_64
|
||||
/// Processor family:
|
||||
/// ARCH_CPU_ARM_FAMILY: ARMEL or ARM64
|
||||
/// ARCH_CPU_MIPS_FAMILY: MIPS64EL or MIPSEL or MIPS64 or MIPS
|
||||
/// ARCH_CPU_PPC64_FAMILY: PPC64
|
||||
/// ARCH_CPU_S390_FAMILY: S390 or S390X
|
||||
/// ARCH_CPU_X86_FAMILY: X86 or X86_64
|
||||
/// Processor features:
|
||||
/// ARCH_CPU_31_BITS / ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
|
||||
/// ARCH_CPU_BIG_ENDIAN / ARCH_CPU_LITTLE_ENDIAN
|
||||
/// </pre>
|
||||
///
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||
|
@@ -28,40 +28,38 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Usage documentation
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// Overview:
|
||||
// A callback is similar in concept to a function pointer: it wraps a runnable
|
||||
// object such as a function, method, lambda, or even another callback, allowing
|
||||
// the runnable object to be invoked later via the callback object.
|
||||
//
|
||||
// Unlike function pointers, callbacks are created with base::BindOnce() or
|
||||
// base::BindRepeating() and support partial function application.
|
||||
//
|
||||
// A base::OnceCallback may be Run() at most once; a base::RepeatingCallback may
|
||||
// be Run() any number of times. |is_null()| is guaranteed to return true for a
|
||||
// moved-from callback.
|
||||
//
|
||||
// // The lambda takes two arguments, but the first argument |x| is bound at
|
||||
// // callback creation.
|
||||
// base::OnceCallback<int(int)> cb = base::BindOnce([] (int x, int y) {
|
||||
// return x + y;
|
||||
// }, 1);
|
||||
// // Run() only needs the remaining unbound argument |y|.
|
||||
// printf("1 + 2 = %d\n", std::move(cb).Run(2)); // Prints 3
|
||||
// printf("cb is null? %s\n",
|
||||
// cb.is_null() ? "true" : "false"); // Prints true
|
||||
// std::move(cb).Run(2); // Crashes since |cb| has already run.
|
||||
//
|
||||
// Callbacks also support cancellation. A common use is binding the receiver
|
||||
// object as a WeakPtr<T>. If that weak pointer is invalidated, calling Run()
|
||||
// will be a no-op. Note that |IsCancelled()| and |is_null()| are distinct:
|
||||
// simply cancelling a callback will not also make it null.
|
||||
//
|
||||
// See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/callback.md
|
||||
// for the full documentation.
|
||||
/// \file
|
||||
/// A callback is similar in concept to a function pointer: it wraps a runnable
|
||||
/// object such as a function, method, lambda, or even another callback,
|
||||
/// allowing the runnable object to be invoked later via the callback object.
|
||||
///
|
||||
/// Unlike function pointers, callbacks are created with base::BindOnce() or
|
||||
/// base::BindRepeating() and support partial function application.
|
||||
///
|
||||
/// A base::OnceCallback may be Run() at most once; a base::RepeatingCallback
|
||||
/// may be Run() any number of times. |is_null()| is guaranteed to return true
|
||||
/// for a moved-from callback.
|
||||
///
|
||||
/// <pre>
|
||||
/// // The lambda takes two arguments, but the first argument |x| is bound at
|
||||
/// // callback creation.
|
||||
/// base::OnceCallback<int(int)> cb = base::BindOnce([] (int x, int y) {
|
||||
/// return x + y;
|
||||
/// }, 1);
|
||||
/// // Run() only needs the remaining unbound argument |y|.
|
||||
/// printf("1 + 2 = %d\n", std::move(cb).Run(2)); // Prints 3
|
||||
/// printf("cb is null? %s\n",
|
||||
/// cb.is_null() ? "true" : "false"); // Prints true
|
||||
/// std::move(cb).Run(2); // Crashes since |cb| has already run.
|
||||
/// </pre>
|
||||
///
|
||||
/// Callbacks also support cancellation. A common use is binding the receiver
|
||||
/// object as a WeakPtr<T>. If that weak pointer is invalidated, calling Run()
|
||||
/// will be a no-op. Note that |IsCancelled()| and |is_null()| are distinct:
|
||||
/// simply cancelling a callback will not also make it null.
|
||||
///
|
||||
/// See https://chromium.googlesource.com/chromium/src/+/lkgr/docs/callback.md
|
||||
/// for the full documentation.
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_CALLBACK_H_
|
||||
|
@@ -48,9 +48,11 @@ class OnceCallback;
|
||||
template <typename Signature>
|
||||
class RepeatingCallback;
|
||||
|
||||
// Syntactic sugar to make OnceClosure<void()> and RepeatingClosure<void()>
|
||||
// easier to declare since they will be used in a lot of APIs with delayed
|
||||
// execution.
|
||||
///
|
||||
/// Syntactic sugar to make OnceClosure<void()> and RepeatingClosure<void()>
|
||||
/// easier to declare since they will be used in a lot of APIs with delayed
|
||||
/// execution.
|
||||
///
|
||||
using OnceClosure = OnceCallback<void()>;
|
||||
using RepeatingClosure = RepeatingCallback<void()>;
|
||||
|
||||
|
@@ -75,24 +75,32 @@ struct IsOnceCallbackImpl<OnceCallback<R(Args...)>> : std::true_type {};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// IsBaseCallback<T>::value is true when T is any of the Closure or Callback
|
||||
// family of types.
|
||||
///
|
||||
/// IsBaseCallback<T>::value is true when T is any of the Closure or Callback
|
||||
/// family of types.
|
||||
///
|
||||
template <typename T>
|
||||
using IsBaseCallback = internal::IsBaseCallbackImpl<std::decay_t<T>>;
|
||||
|
||||
// IsOnceCallback<T>::value is true when T is a OnceClosure or OnceCallback
|
||||
// type.
|
||||
///
|
||||
/// IsOnceCallback<T>::value is true when T is a OnceClosure or OnceCallback
|
||||
/// type.
|
||||
///
|
||||
template <typename T>
|
||||
using IsOnceCallback = internal::IsOnceCallbackImpl<std::decay_t<T>>;
|
||||
|
||||
// SFINAE friendly enabler allowing to overload methods for both Repeating and
|
||||
// OnceCallbacks.
|
||||
//
|
||||
// Usage:
|
||||
// template <template <typename> class CallbackType,
|
||||
// ... other template args ...,
|
||||
// typename = EnableIfIsBaseCallback<CallbackType>>
|
||||
// void DoStuff(CallbackType<...> cb, ...);
|
||||
///
|
||||
/// SFINAE friendly enabler allowing to overload methods for both Repeating and
|
||||
/// OnceCallbacks.
|
||||
///
|
||||
/// Usage:
|
||||
/// <pre>
|
||||
/// template <template <typename> class CallbackType,
|
||||
/// ... other template args ...,
|
||||
/// typename = EnableIfIsBaseCallback<CallbackType>>
|
||||
/// void DoStuff(CallbackType<...> cb, ...);
|
||||
/// </pre>
|
||||
///
|
||||
template <template <typename> class CallbackType>
|
||||
using EnableIfIsBaseCallback =
|
||||
std::enable_if_t<IsBaseCallback<CallbackType<void()>>::value>;
|
||||
@@ -129,13 +137,16 @@ class OnceCallbackHolder final {
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// Wraps the given OnceCallback into a RepeatingCallback that relays its
|
||||
// invocation to the original OnceCallback on the first invocation. The
|
||||
// following invocations are just ignored.
|
||||
//
|
||||
// Note that this deliberately subverts the Once/Repeating paradigm of Callbacks
|
||||
// but helps ease the migration from old-style Callbacks. Avoid if possible; use
|
||||
// if necessary for migration. TODO(tzik): Remove it. https://crbug.com/730593
|
||||
///
|
||||
/// Wraps the given OnceCallback into a RepeatingCallback that relays its
|
||||
/// invocation to the original OnceCallback on the first invocation. The
|
||||
/// following invocations are just ignored.
|
||||
///
|
||||
/// Note that this deliberately subverts the Once/Repeating paradigm of
|
||||
/// Callbacks but helps ease the migration from old-style Callbacks. Avoid if
|
||||
/// possible; use if necessary for migration.
|
||||
///
|
||||
// TODO(tzik): Remove it. https://crbug.com/730593
|
||||
template <typename... Args>
|
||||
RepeatingCallback<void(Args...)> AdaptCallbackForRepeating(
|
||||
OnceCallback<void(Args...)> callback) {
|
||||
@@ -145,9 +156,11 @@ RepeatingCallback<void(Args...)> AdaptCallbackForRepeating(
|
||||
/*ignore_extra_runs=*/true));
|
||||
}
|
||||
|
||||
// Wraps the given OnceCallback and returns two OnceCallbacks with an identical
|
||||
// signature. On first invokation of either returned callbacks, the original
|
||||
// callback is invoked. Invoking the remaining callback results in a crash.
|
||||
///
|
||||
/// Wraps the given OnceCallback and returns two OnceCallbacks with an identical
|
||||
/// signature. On first invokation of either returned callbacks, the original
|
||||
/// callback is invoked. Invoking the remaining callback results in a crash.
|
||||
///
|
||||
template <typename... Args>
|
||||
std::pair<OnceCallback<void(Args...)>, OnceCallback<void(Args...)>>
|
||||
SplitOnceCallback(OnceCallback<void(Args...)> callback) {
|
||||
@@ -158,10 +171,12 @@ SplitOnceCallback(OnceCallback<void(Args...)> callback) {
|
||||
return std::make_pair(wrapped_once, wrapped_once);
|
||||
}
|
||||
|
||||
// ScopedClosureRunner is akin to std::unique_ptr<> for Closures. It ensures
|
||||
// that the Closure is executed no matter how the current scope exits.
|
||||
// If you are looking for "ScopedCallback", "CallbackRunner", or
|
||||
// "CallbackScoper" this is the class you want.
|
||||
///
|
||||
/// ScopedClosureRunner is akin to std::unique_ptr<> for Closures. It ensures
|
||||
/// that the Closure is executed no matter how the current scope exits.
|
||||
/// If you are looking for "ScopedCallback", "CallbackRunner", or
|
||||
/// "CallbackScoper" this is the class you want.
|
||||
///
|
||||
class ScopedClosureRunner {
|
||||
public:
|
||||
ScopedClosureRunner();
|
||||
@@ -189,7 +204,9 @@ class ScopedClosureRunner {
|
||||
OnceClosure closure_;
|
||||
};
|
||||
|
||||
// Creates a null callback.
|
||||
///
|
||||
/// Creates a null callback.
|
||||
///
|
||||
class NullCallback {
|
||||
public:
|
||||
template <typename R, typename... Args>
|
||||
@@ -202,7 +219,9 @@ class NullCallback {
|
||||
}
|
||||
};
|
||||
|
||||
// Creates a callback that does nothing when called.
|
||||
///
|
||||
/// Creates a callback that does nothing when called.
|
||||
///
|
||||
class DoNothing {
|
||||
public:
|
||||
template <typename... Args>
|
||||
@@ -225,9 +244,11 @@ class DoNothing {
|
||||
}
|
||||
};
|
||||
|
||||
// Useful for creating a Closure that will delete a pointer when invoked. Only
|
||||
// use this when necessary. In most cases MessageLoop::DeleteSoon() is a better
|
||||
// fit.
|
||||
///
|
||||
/// Useful for creating a Closure that will delete a pointer when invoked. Only
|
||||
/// use this when necessary. In most cases MessageLoop::DeleteSoon() is a better
|
||||
/// fit.
|
||||
///
|
||||
template <typename T>
|
||||
void DeletePointer(T* obj) {
|
||||
delete obj;
|
||||
|
@@ -28,54 +28,57 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// OVERVIEW:
|
||||
//
|
||||
// A container for a list of callbacks. Provides callers the ability to manually
|
||||
// or automatically unregister callbacks at any time, including during callback
|
||||
// notification.
|
||||
//
|
||||
// TYPICAL USAGE:
|
||||
//
|
||||
// class MyWidget {
|
||||
// public:
|
||||
// using CallbackList = base::RepeatingCallbackList<void(const Foo&)>;
|
||||
//
|
||||
// // Registers |cb| to be called whenever NotifyFoo() is executed.
|
||||
// CallbackListSubscription RegisterCallback(CallbackList::CallbackType cb) {
|
||||
// return callback_list_.Add(std::move(cb));
|
||||
// }
|
||||
//
|
||||
// private:
|
||||
// // Calls all registered callbacks, with |foo| as the supplied arg.
|
||||
// void NotifyFoo(const Foo& foo) {
|
||||
// callback_list_.Notify(foo);
|
||||
// }
|
||||
//
|
||||
// CallbackList callback_list_;
|
||||
// };
|
||||
//
|
||||
//
|
||||
// class MyWidgetListener {
|
||||
// private:
|
||||
// void OnFoo(const Foo& foo) {
|
||||
// // Called whenever MyWidget::NotifyFoo() is executed, unless
|
||||
// // |foo_subscription_| has been destroyed.
|
||||
// }
|
||||
//
|
||||
// // Automatically deregisters the callback when deleted (e.g. in
|
||||
// // ~MyWidgetListener()). Unretained(this) is safe here since the
|
||||
// // ScopedClosureRunner does not outlive |this|.
|
||||
// CallbackListSubscription foo_subscription_ =
|
||||
// MyWidget::Get()->RegisterCallback(
|
||||
// base::BindRepeating(&MyWidgetListener::OnFoo,
|
||||
// base::Unretained(this)));
|
||||
// };
|
||||
//
|
||||
// UNSUPPORTED:
|
||||
//
|
||||
// * Destroying the CallbackList during callback notification.
|
||||
//
|
||||
// This is possible to support, but not currently necessary.
|
||||
///
|
||||
/// \file
|
||||
/// A container for a list of callbacks. Provides callers the ability to
|
||||
/// manually or automatically unregister callbacks at any time, including during
|
||||
/// callback notification.
|
||||
///
|
||||
/// TYPICAL USAGE:
|
||||
///
|
||||
/// <pre>
|
||||
/// class MyWidget {
|
||||
/// public:
|
||||
/// using CallbackList = base::RepeatingCallbackList<void(const Foo&)>;
|
||||
///
|
||||
/// // Registers |cb| to be called whenever NotifyFoo() is executed.
|
||||
/// CallbackListSubscription RegisterCallback(CallbackList::CallbackType cb) {
|
||||
/// return callback_list_.Add(std::move(cb));
|
||||
/// }
|
||||
///
|
||||
/// private:
|
||||
/// // Calls all registered callbacks, with |foo| as the supplied arg.
|
||||
/// void NotifyFoo(const Foo& foo) {
|
||||
/// callback_list_.Notify(foo);
|
||||
/// }
|
||||
///
|
||||
/// CallbackList callback_list_;
|
||||
/// };
|
||||
///
|
||||
///
|
||||
/// class MyWidgetListener {
|
||||
/// private:
|
||||
/// void OnFoo(const Foo& foo) {
|
||||
/// // Called whenever MyWidget::NotifyFoo() is executed, unless
|
||||
/// // |foo_subscription_| has been destroyed.
|
||||
/// }
|
||||
///
|
||||
/// // Automatically deregisters the callback when deleted (e.g. in
|
||||
/// // ~MyWidgetListener()). Unretained(this) is safe here since the
|
||||
/// // ScopedClosureRunner does not outlive |this|.
|
||||
/// CallbackListSubscription foo_subscription_ =
|
||||
/// MyWidget::Get()->RegisterCallback(
|
||||
/// base::BindRepeating(&MyWidgetListener::OnFoo,
|
||||
/// base::Unretained(this)));
|
||||
/// };
|
||||
/// </pre>
|
||||
///
|
||||
/// UNSUPPORTED:
|
||||
///
|
||||
/// * Destroying the CallbackList during callback notification.
|
||||
///
|
||||
/// This is possible to support, but not currently necessary.
|
||||
///
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
|
||||
@@ -381,9 +384,9 @@ class RepeatingCallbackList
|
||||
}
|
||||
};
|
||||
|
||||
// Syntactic sugar to parallel that used for Callbacks.
|
||||
// ClosureList explicitly not provided since it is not used, and CallbackList
|
||||
// is deprecated. {Once,Repeating}ClosureList should instead be used.
|
||||
///
|
||||
/// Syntactic sugar to parallel that used for Callbacks.
|
||||
///
|
||||
using OnceClosureList = OnceCallbackList<void()>;
|
||||
using RepeatingClosureList = RepeatingCallbackList<void()>;
|
||||
|
||||
|
@@ -28,44 +28,51 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// CancelableCallback is a wrapper around base::Callback that allows
|
||||
// cancellation of a callback. CancelableCallback takes a reference on the
|
||||
// wrapped callback until this object is destroyed or Reset()/Cancel() are
|
||||
// called.
|
||||
//
|
||||
// NOTE:
|
||||
//
|
||||
// Calling CancelableCallback::Cancel() brings the object back to its natural,
|
||||
// default-constructed state, i.e., CancelableCallback::callback() will return
|
||||
// a null callback.
|
||||
//
|
||||
// THREAD-SAFETY:
|
||||
//
|
||||
// CancelableCallback objects must be created on, posted to, cancelled on, and
|
||||
// destroyed on the same thread.
|
||||
//
|
||||
//
|
||||
// EXAMPLE USAGE:
|
||||
//
|
||||
// In the following example, the test is verifying that RunIntensiveTest()
|
||||
// Quit()s the message loop within 4 seconds. The cancelable callback is posted
|
||||
// to the message loop, the intensive test runs, the message loop is run,
|
||||
// then the callback is cancelled.
|
||||
//
|
||||
// RunLoop run_loop;
|
||||
//
|
||||
// void TimeoutCallback(const std::string& timeout_message) {
|
||||
// FAIL() << timeout_message;
|
||||
// run_loop.QuitWhenIdle();
|
||||
// }
|
||||
//
|
||||
// CancelableOnceClosure timeout(
|
||||
// base::BindOnce(&TimeoutCallback, "Test timed out."));
|
||||
// ThreadTaskRunnerHandle::Get()->PostDelayedTask(FROM_HERE, timeout.callback(),
|
||||
// TimeDelta::FromSeconds(4));
|
||||
// RunIntensiveTest();
|
||||
// run_loop.Run();
|
||||
// timeout.Cancel(); // Hopefully this is hit before the timeout callback runs.
|
||||
///
|
||||
/// \file
|
||||
/// CancelableCallback is a wrapper around base::Callback that allows
|
||||
/// cancellation of a callback. CancelableCallback takes a reference on the
|
||||
/// wrapped callback until this object is destroyed or Reset()/Cancel() are
|
||||
/// called.
|
||||
///
|
||||
/// NOTE:
|
||||
///
|
||||
/// Calling CancelableCallback::Cancel() brings the object back to its natural,
|
||||
/// default-constructed state, i.e., CancelableCallback::callback() will return
|
||||
/// a null callback.
|
||||
///
|
||||
/// THREAD-SAFETY:
|
||||
///
|
||||
/// CancelableCallback objects must be created on, posted to, cancelled on, and
|
||||
/// destroyed on the same thread.
|
||||
///
|
||||
///
|
||||
/// EXAMPLE USAGE:
|
||||
///
|
||||
/// In the following example, the test is verifying that RunIntensiveTest()
|
||||
/// Quit()s the message loop within 4 seconds. The cancelable callback is posted
|
||||
/// to the message loop, the intensive test runs, the message loop is run,
|
||||
/// then the callback is cancelled.
|
||||
///
|
||||
/// <pre>
|
||||
/// RunLoop run_loop;
|
||||
///
|
||||
/// void TimeoutCallback(const std::string& timeout_message) {
|
||||
/// FAIL() << timeout_message;
|
||||
/// run_loop.QuitWhenIdle();
|
||||
/// }
|
||||
///
|
||||
/// CancelableOnceClosure timeout(
|
||||
/// base::BindOnce(&TimeoutCallback, "Test timed out."));
|
||||
/// ThreadTaskRunnerHandle::Get()->PostDelayedTask(FROM_HERE,
|
||||
/// timeout.callback(),
|
||||
/// TimeDelta::FromSeconds(4));
|
||||
/// RunIntensiveTest();
|
||||
/// run_loop.Run();
|
||||
/// // Hopefully this is hit before the timeout callback runs.
|
||||
/// timeout.Cancel();
|
||||
/// </pre>
|
||||
///
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
|
||||
@@ -166,8 +173,10 @@ class CancelableCallbackImpl {
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// Consider using base::WeakPtr directly instead of base::CancelableCallback for
|
||||
// the task cancellation.
|
||||
///
|
||||
/// Consider using base::WeakPtr directly instead of base::CancelableCallback
|
||||
/// for the task cancellation.
|
||||
///
|
||||
template <typename Signature>
|
||||
using CancelableOnceCallback =
|
||||
internal::CancelableCallbackImpl<OnceCallback<Signature>>;
|
||||
|
@@ -1,60 +0,0 @@
|
||||
// Copyright (c) 2021 Marshall A. Greenblatt. Portions copyright (c) 2021
|
||||
// Google Inc. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_CXX17_BACKPORTS_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_CXX17_BACKPORTS_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/cxx17_backports.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following was removed from Chromium in https://crrev.com/78734f77be.
|
||||
|
||||
namespace base {
|
||||
|
||||
// C++14 implementation of C++17's std::size():
|
||||
// http://en.cppreference.com/w/cpp/iterator/size
|
||||
template <typename Container>
|
||||
constexpr auto size(const Container& c) -> decltype(c.size()) {
|
||||
return c.size();
|
||||
}
|
||||
|
||||
template <typename T, size_t N>
|
||||
constexpr size_t size(const T (&array)[N]) noexcept {
|
||||
return N;
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_CXX17_BACKPORTS_H_
|
@@ -47,9 +47,11 @@
|
||||
namespace base {
|
||||
namespace cef_internal {
|
||||
|
||||
// A convenient wrapper for an OS specific critical section. The only real
|
||||
// intelligence in this class is in debug mode for the support for the
|
||||
// AssertAcquired() method.
|
||||
///
|
||||
/// A convenient wrapper for an OS specific critical section. The only real
|
||||
/// intelligence in this class is in debug mode for the support for the
|
||||
/// AssertAcquired() method.
|
||||
///
|
||||
class Lock {
|
||||
public:
|
||||
#if !DCHECK_IS_ON() // Optimized wrapper implementation
|
||||
@@ -62,10 +64,12 @@ class Lock {
|
||||
void Acquire() { lock_.Lock(); }
|
||||
void Release() { lock_.Unlock(); }
|
||||
|
||||
// If the lock is not held, take it and return true. If the lock is already
|
||||
// held by another thread, immediately return false. This must not be called
|
||||
// by a thread already holding the lock (what happens is undefined and an
|
||||
// assertion may fail).
|
||||
///
|
||||
/// If the lock is not held, take it and return true. If the lock is already
|
||||
/// held by another thread, immediately return false. This must not be called
|
||||
/// by a thread already holding the lock (what happens is undefined and an
|
||||
/// assertion may fail).
|
||||
///
|
||||
bool Try() { return lock_.Try(); }
|
||||
|
||||
// Null implementation if not debug.
|
||||
@@ -116,7 +120,9 @@ class Lock {
|
||||
LockImpl lock_;
|
||||
};
|
||||
|
||||
// A helper class that acquires the given Lock while the AutoLock is in scope.
|
||||
///
|
||||
/// A helper class that acquires the given Lock while the AutoLock is in scope.
|
||||
///
|
||||
class AutoLock {
|
||||
public:
|
||||
struct AlreadyAcquired {};
|
||||
@@ -139,8 +145,10 @@ class AutoLock {
|
||||
Lock& lock_;
|
||||
};
|
||||
|
||||
// AutoUnlock is a helper that will Release() the |lock| argument in the
|
||||
// constructor, and re-Acquire() it in the destructor.
|
||||
///
|
||||
/// AutoUnlock is a helper that will Release() the |lock| argument in the
|
||||
/// constructor, and re-Acquire() it in the destructor.
|
||||
///
|
||||
class AutoUnlock {
|
||||
public:
|
||||
explicit AutoUnlock(Lock& lock) : lock_(lock) {
|
||||
|
@@ -27,110 +27,130 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file are only available to applications that link
|
||||
// against the libcef_dll_wrapper target.
|
||||
//
|
||||
// WARNING: Logging macros should not be used in the main/browser process before
|
||||
// calling CefInitialize or in sub-processes before calling CefExecuteProcess.
|
||||
//
|
||||
// Instructions
|
||||
// ------------
|
||||
//
|
||||
// Make a bunch of macros for logging. The way to log things is to stream
|
||||
// things to LOG(<a particular severity level>). E.g.,
|
||||
//
|
||||
// LOG(INFO) << "Found " << num_cookies << " cookies";
|
||||
//
|
||||
// You can also do conditional logging:
|
||||
//
|
||||
// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
||||
//
|
||||
// The CHECK(condition) macro is active in both debug and release builds and
|
||||
// effectively performs a LOG(FATAL) which terminates the process and
|
||||
// generates a crashdump unless a debugger is attached.
|
||||
//
|
||||
// There are also "debug mode" logging macros like the ones above:
|
||||
//
|
||||
// DLOG(INFO) << "Found cookies";
|
||||
//
|
||||
// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
||||
//
|
||||
// All "debug mode" logging is compiled away to nothing for non-debug mode
|
||||
// compiles. LOG_IF and development flags also work well together
|
||||
// because the code can be compiled away sometimes.
|
||||
//
|
||||
// We also have
|
||||
//
|
||||
// LOG_ASSERT(assertion);
|
||||
// DLOG_ASSERT(assertion);
|
||||
//
|
||||
// which is syntactic sugar for {,D}LOG_IF(FATAL, assert fails) << assertion;
|
||||
//
|
||||
// There are "verbose level" logging macros. They look like
|
||||
//
|
||||
// VLOG(1) << "I'm printed when you run the program with --v=1 or more";
|
||||
// VLOG(2) << "I'm printed when you run the program with --v=2 or more";
|
||||
//
|
||||
// These always log at the INFO log level (when they log at all).
|
||||
// The verbose logging can also be turned on module-by-module. For instance,
|
||||
// --vmodule=profile=2,icon_loader=1,browser_*=3,*/chromeos/*=4 --v=0
|
||||
// will cause:
|
||||
// a. VLOG(2) and lower messages to be printed from profile.{h,cc}
|
||||
// b. VLOG(1) and lower messages to be printed from icon_loader.{h,cc}
|
||||
// c. VLOG(3) and lower messages to be printed from files prefixed with
|
||||
// "browser"
|
||||
// d. VLOG(4) and lower messages to be printed from files under a
|
||||
// "chromeos" directory.
|
||||
// e. VLOG(0) and lower messages to be printed from elsewhere
|
||||
//
|
||||
// The wildcarding functionality shown by (c) supports both '*' (match
|
||||
// 0 or more characters) and '?' (match any single character)
|
||||
// wildcards. Any pattern containing a forward or backward slash will
|
||||
// be tested against the whole pathname and not just the module.
|
||||
// E.g., "*/foo/bar/*=2" would change the logging level for all code
|
||||
// in source files under a "foo/bar" directory.
|
||||
//
|
||||
// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as
|
||||
//
|
||||
// if (VLOG_IS_ON(2)) {
|
||||
// // do some logging preparation and logging
|
||||
// // that can't be accomplished with just VLOG(2) << ...;
|
||||
// }
|
||||
//
|
||||
// There is also a VLOG_IF "verbose level" condition macro for sample
|
||||
// cases, when some extra computation and preparation for logs is not
|
||||
// needed.
|
||||
//
|
||||
// VLOG_IF(1, (size > 1024))
|
||||
// << "I'm printed when size is more than 1024 and when you run the "
|
||||
// "program with --v=1 or more";
|
||||
//
|
||||
// We also override the standard 'assert' to use 'DLOG_ASSERT'.
|
||||
//
|
||||
// Lastly, there is:
|
||||
//
|
||||
// PLOG(ERROR) << "Couldn't do foo";
|
||||
// DPLOG(ERROR) << "Couldn't do foo";
|
||||
// PLOG_IF(ERROR, cond) << "Couldn't do foo";
|
||||
// DPLOG_IF(ERROR, cond) << "Couldn't do foo";
|
||||
// PCHECK(condition) << "Couldn't do foo";
|
||||
// DPCHECK(condition) << "Couldn't do foo";
|
||||
//
|
||||
// which append the last system error to the message in string form (taken from
|
||||
// GetLastError() on Windows and errno on POSIX).
|
||||
//
|
||||
// The supported severity levels for macros that allow you to specify one
|
||||
// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL.
|
||||
//
|
||||
// Very important: logging a message at the FATAL severity level causes
|
||||
// the program to terminate (after the message is logged).
|
||||
//
|
||||
// There is the special severity of DFATAL, which logs FATAL in debug mode,
|
||||
// ERROR in normal mode.
|
||||
//
|
||||
|
||||
///
|
||||
/// \file
|
||||
/// A bunch of macros for logging.
|
||||
///
|
||||
/// NOTE: The contents of this file are only available to applications that link
|
||||
/// against the libcef_dll_wrapper target.
|
||||
///
|
||||
/// WARNING: Logging macros should not be used in the main/browser process
|
||||
/// before calling CefInitialize or in sub-processes before calling
|
||||
/// CefExecuteProcess.
|
||||
///
|
||||
/// INSTRUCTIONS:
|
||||
///
|
||||
/// The way to log things is to stream things to LOG(<a particular severity
|
||||
/// level>). E.g.,
|
||||
///
|
||||
/// <pre>
|
||||
/// LOG(INFO) << "Found " << num_cookies << " cookies";
|
||||
/// </pre>
|
||||
///
|
||||
/// You can also do conditional logging:
|
||||
///
|
||||
/// <pre>
|
||||
/// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
||||
/// </pre>
|
||||
///
|
||||
/// The CHECK(condition) macro is active in both debug and release builds and
|
||||
/// effectively performs a LOG(FATAL) which terminates the process and
|
||||
/// generates a crashdump unless a debugger is attached.
|
||||
///
|
||||
/// There are also "debug mode" logging macros like the ones above:
|
||||
///
|
||||
/// <pre>
|
||||
/// DLOG(INFO) << "Found cookies";
|
||||
///
|
||||
/// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
|
||||
/// </pre>
|
||||
///
|
||||
/// All "debug mode" logging is compiled away to nothing for non-debug mode
|
||||
/// compiles. LOG_IF and development flags also work well together
|
||||
/// because the code can be compiled away sometimes.
|
||||
///
|
||||
/// We also have
|
||||
///
|
||||
/// <pre>
|
||||
/// LOG_ASSERT(assertion);
|
||||
/// DLOG_ASSERT(assertion);
|
||||
/// </pre>
|
||||
///
|
||||
/// which is syntactic sugar for "{,D}LOG_IF(FATAL, assert fails) << assertion;"
|
||||
///
|
||||
/// There are "verbose level" logging macros. They look like
|
||||
///
|
||||
/// <pre>
|
||||
/// VLOG(1) << "I'm printed when you run the program with --v=1 or more";
|
||||
/// VLOG(2) << "I'm printed when you run the program with --v=2 or more";
|
||||
/// </pre>
|
||||
///
|
||||
/// These always log at the INFO log level (when they log at all).
|
||||
/// The verbose logging can also be turned on module-by-module. For instance,
|
||||
/// <pre>
|
||||
/// --vmodule=profile=2,icon_loader=1,browser_*=3,*/chromeos/*=4 --v=0
|
||||
/// </pre>
|
||||
/// will cause:
|
||||
/// 1. VLOG(2) and lower messages to be printed from profile.{h,cc}
|
||||
/// 2. VLOG(1) and lower messages to be printed from icon_loader.{h,cc}
|
||||
/// 3. VLOG(3) and lower messages to be printed from files prefixed with
|
||||
/// "browser"
|
||||
/// 4. VLOG(4) and lower messages to be printed from files under a
|
||||
/// "chromeos" directory.
|
||||
/// 5. VLOG(0) and lower messages to be printed from elsewhere
|
||||
///
|
||||
/// The wildcarding functionality shown by (c) supports both '*' (match
|
||||
/// 0 or more characters) and '?' (match any single character)
|
||||
/// wildcards. Any pattern containing a forward or backward slash will
|
||||
/// be tested against the whole pathname and not just the module.
|
||||
/// E.g., "*/foo/bar/*=2" would change the logging level for all code
|
||||
/// in source files under a "foo/bar" directory.
|
||||
///
|
||||
/// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as
|
||||
///
|
||||
/// <pre>
|
||||
/// if (VLOG_IS_ON(2)) {
|
||||
/// // do some logging preparation and logging
|
||||
/// // that can't be accomplished with just VLOG(2) << ...;
|
||||
/// }
|
||||
/// </pre>
|
||||
///
|
||||
/// There is also a VLOG_IF "verbose level" condition macro for sample
|
||||
/// cases, when some extra computation and preparation for logs is not
|
||||
/// needed.
|
||||
///
|
||||
/// <pre>
|
||||
/// VLOG_IF(1, (size > 1024))
|
||||
/// << "I'm printed when size is more than 1024 and when you run the "
|
||||
/// "program with --v=1 or more";
|
||||
/// </pre>
|
||||
///
|
||||
/// We also override the standard 'assert' to use 'DLOG_ASSERT'.
|
||||
///
|
||||
/// Lastly, there is:
|
||||
///
|
||||
/// <pre>
|
||||
/// PLOG(ERROR) << "Couldn't do foo";
|
||||
/// DPLOG(ERROR) << "Couldn't do foo";
|
||||
/// PLOG_IF(ERROR, cond) << "Couldn't do foo";
|
||||
/// DPLOG_IF(ERROR, cond) << "Couldn't do foo";
|
||||
/// PCHECK(condition) << "Couldn't do foo";
|
||||
/// DPCHECK(condition) << "Couldn't do foo";
|
||||
/// </pre>
|
||||
///
|
||||
/// which append the last system error to the message in string form (taken from
|
||||
/// GetLastError() on Windows and errno on POSIX).
|
||||
///
|
||||
/// The supported severity levels for macros that allow you to specify one
|
||||
/// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL.
|
||||
///
|
||||
/// Very important: logging a message at the FATAL severity level causes
|
||||
/// the program to terminate (after the message is logged).
|
||||
///
|
||||
/// There is the special severity of DFATAL, which logs FATAL in debug mode,
|
||||
/// ERROR in normal mode.
|
||||
///
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_LOGGING_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_LOGGING_H_
|
||||
|
@@ -38,8 +38,8 @@
|
||||
// updated to match.
|
||||
|
||||
// ALL DISALLOW_xxx MACROS ARE DEPRECATED; DO NOT USE IN NEW CODE.
|
||||
// Use explicit deletions instead. See the section on copyability/movability in
|
||||
// //styleguide/c++/c++-dos-and-donts.md for more information.
|
||||
// Use explicit deletions instead. For more information see
|
||||
// https://chromium.googlesource.com/chromium/src/+/lkgr/styleguide/c++/c++-dos-and-donts.md#explicitly-declare-class-copyability_movability
|
||||
|
||||
// DEPRECATED: See above. Makes a class uncopyable.
|
||||
#define DISALLOW_COPY(TypeName) TypeName(const TypeName&) = delete
|
||||
|
@@ -49,17 +49,21 @@
|
||||
|
||||
namespace base {
|
||||
|
||||
// Used for logging. Always an integer value.
|
||||
///
|
||||
/// Used for logging. Always an integer value.
|
||||
///
|
||||
typedef cef_platform_thread_id_t PlatformThreadId;
|
||||
|
||||
// Used for thread checking and debugging.
|
||||
// Meant to be as fast as possible.
|
||||
// These are produced by PlatformThread::CurrentRef(), and used to later
|
||||
// check if we are on the same thread or not by using ==. These are safe
|
||||
// to copy between threads, but can't be copied to another process as they
|
||||
// have no meaning there. Also, the internal identifier can be re-used
|
||||
// after a thread dies, so a PlatformThreadRef cannot be reliably used
|
||||
// to distinguish a new thread from an old, dead thread.
|
||||
///
|
||||
/// Used for thread checking and debugging.
|
||||
/// Meant to be as fast as possible.
|
||||
/// These are produced by PlatformThread::CurrentRef(), and used to later
|
||||
/// check if we are on the same thread or not by using ==. These are safe
|
||||
/// to copy between threads, but can't be copied to another process as they
|
||||
/// have no meaning there. Also, the internal identifier can be re-used
|
||||
/// after a thread dies, so a PlatformThreadRef cannot be reliably used
|
||||
/// to distinguish a new thread from an old, dead thread.
|
||||
///
|
||||
class PlatformThreadRef {
|
||||
public:
|
||||
typedef cef_platform_thread_handle_t RefType;
|
||||
@@ -76,18 +80,24 @@ class PlatformThreadRef {
|
||||
RefType id_;
|
||||
};
|
||||
|
||||
// A namespace for low-level thread functions.
|
||||
// Chromium uses a class with static methods but CEF uses an actual namespace
|
||||
// to avoid linker problems with the sandbox libaries on Windows.
|
||||
///
|
||||
/// A namespace for low-level thread functions.
|
||||
/// Chromium uses a class with static methods but CEF uses an actual namespace
|
||||
/// to avoid linker problems with the sandbox libaries on Windows.
|
||||
///
|
||||
namespace PlatformThread {
|
||||
|
||||
// Gets the current thread id, which may be useful for logging purposes.
|
||||
///
|
||||
/// Gets the current thread id, which may be useful for logging purposes.
|
||||
///
|
||||
inline PlatformThreadId CurrentId() {
|
||||
return cef_get_current_platform_thread_id();
|
||||
}
|
||||
|
||||
// Gets the current thread reference, which can be used to check if
|
||||
// we're on the right thread quickly.
|
||||
///
|
||||
/// Gets the current thread reference, which can be used to check if
|
||||
/// we're on the right thread quickly.
|
||||
///
|
||||
inline PlatformThreadRef CurrentRef() {
|
||||
return PlatformThreadRef(cef_get_current_platform_thread_handle());
|
||||
}
|
||||
|
@@ -45,9 +45,11 @@
|
||||
|
||||
namespace base {
|
||||
|
||||
// Helper to transfer ownership of a raw pointer to a std::unique_ptr<T>.
|
||||
// Note that std::unique_ptr<T> has very different semantics from
|
||||
// std::unique_ptr<T[]>: do not use this helper for array allocations.
|
||||
///
|
||||
/// Helper to transfer ownership of a raw pointer to a std::unique_ptr<T>.
|
||||
/// Note that std::unique_ptr<T> has very different semantics from
|
||||
/// std::unique_ptr<T[]>: do not use this helper for array allocations.
|
||||
///
|
||||
template <typename T>
|
||||
std::unique_ptr<T> WrapUnique(T* ptr) {
|
||||
return std::unique_ptr<T>(ptr);
|
||||
|
@@ -290,52 +290,26 @@ class ScopedAllowCrossThreadRefCountAccess final {
|
||||
using ScopedAllowCrossThreadRefCountAccess =
|
||||
cef_subtle::ScopedAllowCrossThreadRefCountAccess;
|
||||
|
||||
//
|
||||
// A base class for reference counted classes. Otherwise, known as a cheap
|
||||
// knock-off of WebKit's RefCounted<T> class. To use this, just extend your
|
||||
// class from it like so:
|
||||
//
|
||||
// class MyFoo : public base::RefCounted<MyFoo> {
|
||||
// ...
|
||||
// private:
|
||||
// friend class base::RefCounted<MyFoo>;
|
||||
// ~MyFoo();
|
||||
// };
|
||||
//
|
||||
// Usage Notes:
|
||||
// 1. You should always make your destructor non-public, to avoid any code
|
||||
// deleting the object accidentally while there are references to it.
|
||||
// 2. You should always make the ref-counted base class a friend of your class,
|
||||
// so that it can access the destructor.
|
||||
//
|
||||
// The ref count manipulation to RefCounted is NOT thread safe and has DCHECKs
|
||||
// to trap unsafe cross thread usage. A subclass instance of RefCounted can be
|
||||
// passed to another execution thread only when its ref count is 1. If the ref
|
||||
// count is more than 1, the RefCounted class verifies the ref updates are made
|
||||
// on the same execution thread as the previous ones. The subclass can also
|
||||
// manually call IsOnValidThread to trap other non-thread-safe accesses; see
|
||||
// the documentation for that method.
|
||||
//
|
||||
//
|
||||
// The reference count starts from zero by default, and we intended to migrate
|
||||
// to start-from-one ref count. Put REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() to
|
||||
// the ref counted class to opt-in.
|
||||
//
|
||||
// If an object has start-from-one ref count, the first scoped_refptr need to be
|
||||
// created by base::AdoptRef() or base::MakeRefCounted(). We can use
|
||||
// base::MakeRefCounted() to create create both type of ref counted object.
|
||||
//
|
||||
// The motivations to use start-from-one ref count are:
|
||||
// - Start-from-one ref count doesn't need the ref count increment for the
|
||||
// first reference.
|
||||
// - It can detect an invalid object acquisition for a being-deleted object
|
||||
// that has zero ref count. That tends to happen on custom deleter that
|
||||
// delays the deletion.
|
||||
// TODO(tzik): Implement invalid acquisition detection.
|
||||
// - Behavior parity to Blink's WTF::RefCounted, whose count starts from one.
|
||||
// And start-from-one ref count is a step to merge WTF::RefCounted into
|
||||
// base::RefCounted.
|
||||
//
|
||||
///
|
||||
/// The reference count starts from zero by default, and we intended to migrate
|
||||
/// to start-from-one ref count. Put REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() to
|
||||
/// the ref counted class to opt-in.
|
||||
///
|
||||
/// If an object has start-from-one ref count, the first scoped_refptr need to
|
||||
/// be created by base::AdoptRef() or base::MakeRefCounted(). We can use
|
||||
/// base::MakeRefCounted() to create create both type of ref counted object.
|
||||
///
|
||||
/// The motivations to use start-from-one ref count are:
|
||||
/// - Start-from-one ref count doesn't need the ref count increment for the
|
||||
/// first reference.
|
||||
/// - It can detect an invalid object acquisition for a being-deleted object
|
||||
/// that has zero ref count. That tends to happen on custom deleter that
|
||||
/// delays the deletion.
|
||||
/// TODO(tzik): Implement invalid acquisition detection.
|
||||
/// - Behavior parity to Blink's WTF::RefCounted, whose count starts from one.
|
||||
/// And start-from-one ref count is a step to merge WTF::RefCounted into
|
||||
/// base::RefCounted.
|
||||
///
|
||||
#define REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() \
|
||||
static constexpr ::base::cef_subtle::StartRefCountFromOneTag \
|
||||
kRefCountPreference = ::base::cef_subtle::kStartRefCountFromOneTag
|
||||
@@ -343,6 +317,10 @@ using ScopedAllowCrossThreadRefCountAccess =
|
||||
template <class T, typename Traits>
|
||||
class RefCounted;
|
||||
|
||||
///
|
||||
/// Default traits for RefCounted<T>. Deletes the object when its ref count
|
||||
/// reaches 0. Overload to delete it on a different thread etc.
|
||||
///
|
||||
template <typename T>
|
||||
struct DefaultRefCountedTraits {
|
||||
static void Destruct(const T* x) {
|
||||
@@ -350,6 +328,34 @@ struct DefaultRefCountedTraits {
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
/// A base class for reference counted classes. Otherwise, known as a cheap
|
||||
/// knock-off of WebKit's RefCounted<T> class. To use this, just extend your
|
||||
/// class from it like so:
|
||||
///
|
||||
/// <pre>
|
||||
/// class MyFoo : public base::RefCounted<MyFoo> {
|
||||
/// ...
|
||||
/// private:
|
||||
/// friend class base::RefCounted<MyFoo>;
|
||||
/// ~MyFoo();
|
||||
/// };
|
||||
/// </pre>
|
||||
///
|
||||
/// Usage Notes:
|
||||
/// 1. You should always make your destructor non-public, to avoid any code
|
||||
/// deleting the object accidentally while there are references to it.
|
||||
/// 2. You should always make the ref-counted base class a friend of your class,
|
||||
/// so that it can access the destructor.
|
||||
///
|
||||
/// The ref count manipulation to RefCounted is NOT thread safe and has DCHECKs
|
||||
/// to trap unsafe cross thread usage. A subclass instance of RefCounted can be
|
||||
/// passed to another execution thread only when its ref count is 1. If the ref
|
||||
/// count is more than 1, the RefCounted class verifies the ref updates are made
|
||||
/// on the same execution thread as the previous ones. The subclass can also
|
||||
/// manually call IsOnValidThread to trap other non-thread-safe accesses; see
|
||||
/// the documentation for that method.
|
||||
///
|
||||
template <class T, typename Traits = DefaultRefCountedTraits<T>>
|
||||
class RefCounted : public cef_subtle::RefCountedBase {
|
||||
public:
|
||||
@@ -389,8 +395,10 @@ class RefCounted : public cef_subtle::RefCountedBase {
|
||||
template <class T, typename Traits>
|
||||
class RefCountedThreadSafe;
|
||||
|
||||
// Default traits for RefCountedThreadSafe<T>. Deletes the object when its ref
|
||||
// count reaches 0. Overload to delete it on a different thread etc.
|
||||
///
|
||||
/// Default traits for RefCountedThreadSafe<T>. Deletes the object when its ref
|
||||
/// count reaches 0. Overload to delete it on a different thread etc.
|
||||
///
|
||||
template <typename T>
|
||||
struct DefaultRefCountedThreadSafeTraits {
|
||||
static void Destruct(const T* x) {
|
||||
@@ -402,21 +410,26 @@ struct DefaultRefCountedThreadSafeTraits {
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// A thread-safe variant of RefCounted<T>
|
||||
//
|
||||
// class MyFoo : public base::RefCountedThreadSafe<MyFoo> {
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// If you're using the default trait, then you should add compile time
|
||||
// asserts that no one else is deleting your object. i.e.
|
||||
// private:
|
||||
// friend class base::RefCountedThreadSafe<MyFoo>;
|
||||
// ~MyFoo();
|
||||
//
|
||||
// We can use REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() with RefCountedThreadSafe
|
||||
// too. See the comment above the RefCounted definition for details.
|
||||
///
|
||||
/// A thread-safe variant of RefCounted<T>
|
||||
///
|
||||
/// <pre>
|
||||
/// class MyFoo : public base::RefCountedThreadSafe<MyFoo> {
|
||||
/// ...
|
||||
/// };
|
||||
/// </pre>
|
||||
///
|
||||
/// If you're using the default trait, then you should add compile time
|
||||
/// asserts that no one else is deleting your object. i.e.
|
||||
/// <pre>
|
||||
/// private:
|
||||
/// friend class base::RefCountedThreadSafe<MyFoo>;
|
||||
/// ~MyFoo();
|
||||
/// </pre>
|
||||
///
|
||||
/// We can use REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() with RefCountedThreadSafe
|
||||
/// too. See the comment above the RefCounted definition for details.
|
||||
///
|
||||
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T>>
|
||||
class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
||||
public:
|
||||
@@ -457,10 +470,10 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// A thread-safe wrapper for some piece of data so we can place other
|
||||
// things in scoped_refptrs<>.
|
||||
//
|
||||
///
|
||||
/// A thread-safe wrapper for some piece of data so we can place other
|
||||
/// things in scoped_refptrs<>.
|
||||
///
|
||||
template <typename T>
|
||||
class RefCountedData
|
||||
: public base::RefCountedThreadSafe<base::RefCountedData<T>> {
|
||||
|
@@ -142,68 +142,76 @@ scoped_refptr<T> WrapRefCounted(T* t) {
|
||||
|
||||
} // namespace base
|
||||
|
||||
//
|
||||
// A smart pointer class for reference counted objects. Use this class instead
|
||||
// of calling AddRef and Release manually on a reference counted object to
|
||||
// avoid common memory leaks caused by forgetting to Release an object
|
||||
// reference. Sample usage:
|
||||
//
|
||||
// class MyFoo : public RefCounted<MyFoo> {
|
||||
// ...
|
||||
// private:
|
||||
// friend class RefCounted<MyFoo>; // Allow destruction by RefCounted<>.
|
||||
// ~MyFoo(); // Destructor must be private/protected.
|
||||
// };
|
||||
//
|
||||
// void some_function() {
|
||||
// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
|
||||
// foo->Method(param);
|
||||
// // |foo| is released when this function returns
|
||||
// }
|
||||
//
|
||||
// void some_other_function() {
|
||||
// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
|
||||
// ...
|
||||
// foo.reset(); // explicitly releases |foo|
|
||||
// ...
|
||||
// if (foo)
|
||||
// foo->Method(param);
|
||||
// }
|
||||
//
|
||||
// The above examples show how scoped_refptr<T> acts like a pointer to T.
|
||||
// Given two scoped_refptr<T> classes, it is also possible to exchange
|
||||
// references between the two objects, like so:
|
||||
//
|
||||
// {
|
||||
// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
|
||||
// scoped_refptr<MyFoo> b;
|
||||
//
|
||||
// b.swap(a);
|
||||
// // now, |b| references the MyFoo object, and |a| references nullptr.
|
||||
// }
|
||||
//
|
||||
// To make both |a| and |b| in the above example reference the same MyFoo
|
||||
// object, simply use the assignment operator:
|
||||
//
|
||||
// {
|
||||
// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
|
||||
// scoped_refptr<MyFoo> b;
|
||||
//
|
||||
// b = a;
|
||||
// // now, |a| and |b| each own a reference to the same MyFoo object.
|
||||
// }
|
||||
//
|
||||
// Also see Chromium's ownership and calling conventions:
|
||||
// https://chromium.googlesource.com/chromium/src/+/lkgr/styleguide/c++/c++.md#object-ownership-and-calling-conventions
|
||||
// Specifically:
|
||||
// If the function (at least sometimes) takes a ref on a refcounted object,
|
||||
// declare the param as scoped_refptr<T>. The caller can decide whether it
|
||||
// wishes to transfer ownership (by calling std::move(t) when passing t) or
|
||||
// retain its ref (by simply passing t directly).
|
||||
// In other words, use scoped_refptr like you would a std::unique_ptr except
|
||||
// in the odd case where it's required to hold on to a ref while handing one
|
||||
// to another component (if a component merely needs to use t on the stack
|
||||
// without keeping a ref: pass t as a raw T*).
|
||||
///
|
||||
/// A smart pointer class for reference counted objects. Use this class instead
|
||||
/// of calling AddRef and Release manually on a reference counted object to
|
||||
/// avoid common memory leaks caused by forgetting to Release an object
|
||||
/// reference. Sample usage:
|
||||
///
|
||||
/// <pre>
|
||||
/// class MyFoo : public RefCounted<MyFoo> {
|
||||
/// ...
|
||||
/// private:
|
||||
/// friend class RefCounted<MyFoo>; // Allow destruction by RefCounted<>.
|
||||
/// ~MyFoo(); // Destructor must be
|
||||
/// private/protected.
|
||||
/// };
|
||||
///
|
||||
/// void some_function() {
|
||||
/// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
|
||||
/// foo->Method(param);
|
||||
/// // |foo| is released when this function returns
|
||||
/// }
|
||||
///
|
||||
/// void some_other_function() {
|
||||
/// scoped_refptr<MyFoo> foo = MakeRefCounted<MyFoo>();
|
||||
/// ...
|
||||
/// foo.reset(); // explicitly releases |foo|
|
||||
/// ...
|
||||
/// if (foo)
|
||||
/// foo->Method(param);
|
||||
/// }
|
||||
/// </pre>
|
||||
///
|
||||
/// The above examples show how scoped_refptr<T> acts like a pointer to T.
|
||||
/// Given two scoped_refptr<T> classes, it is also possible to exchange
|
||||
/// references between the two objects, like so:
|
||||
///
|
||||
/// <pre>
|
||||
/// {
|
||||
/// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
|
||||
/// scoped_refptr<MyFoo> b;
|
||||
///
|
||||
/// b.swap(a);
|
||||
/// // now, |b| references the MyFoo object, and |a| references nullptr.
|
||||
/// }
|
||||
/// </pre>
|
||||
///
|
||||
/// To make both |a| and |b| in the above example reference the same MyFoo
|
||||
/// object, simply use the assignment operator:
|
||||
///
|
||||
/// <pre>
|
||||
/// {
|
||||
/// scoped_refptr<MyFoo> a = MakeRefCounted<MyFoo>();
|
||||
/// scoped_refptr<MyFoo> b;
|
||||
///
|
||||
/// b = a;
|
||||
/// // now, |a| and |b| each own a reference to the same MyFoo object.
|
||||
/// }
|
||||
/// </pre>
|
||||
///
|
||||
/// Also see Chromium's ownership and calling conventions:
|
||||
/// https://chromium.googlesource.com/chromium/src/+/lkgr/styleguide/c++/c++.md#object-ownership-and-calling-conventions
|
||||
/// Specifically:
|
||||
/// If the function (at least sometimes) takes a ref on a refcounted object,
|
||||
/// declare the param as scoped_refptr<T>. The caller can decide whether it
|
||||
/// wishes to transfer ownership (by calling std::move(t) when passing t) or
|
||||
/// retain its ref (by simply passing t directly).
|
||||
/// In other words, use scoped_refptr like you would a std::unique_ptr except
|
||||
/// in the odd case where it's required to hold on to a ref while handing one
|
||||
/// to another component (if a component merely needs to use t on the stack
|
||||
/// without keeping a ref: pass t as a raw T*).
|
||||
///
|
||||
template <class T>
|
||||
class TRIVIAL_ABI scoped_refptr {
|
||||
public:
|
||||
|
@@ -28,40 +28,6 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// ScopedTypeRef<> is patterned after std::unique_ptr<>, but maintains ownership
|
||||
// of a reference to any type that is maintained by Retain and Release methods.
|
||||
//
|
||||
// The Traits structure must provide the Retain and Release methods for type T.
|
||||
// A default ScopedTypeRefTraits is used but not defined, and should be defined
|
||||
// for each type to use this interface. For example, an appropriate definition
|
||||
// of ScopedTypeRefTraits for CGLContextObj would be:
|
||||
//
|
||||
// template<>
|
||||
// struct ScopedTypeRefTraits<CGLContextObj> {
|
||||
// static CGLContextObj InvalidValue() { return nullptr; }
|
||||
// static CGLContextObj Retain(CGLContextObj object) {
|
||||
// CGLContextRetain(object);
|
||||
// return object;
|
||||
// }
|
||||
// static void Release(CGLContextObj object) { CGLContextRelease(object); }
|
||||
// };
|
||||
//
|
||||
// For the many types that have pass-by-pointer create functions, the function
|
||||
// InitializeInto() is provided to allow direct initialization and assumption
|
||||
// of ownership of the object. For example, continuing to use the above
|
||||
// CGLContextObj specialization:
|
||||
//
|
||||
// base::ScopedTypeRef<CGLContextObj> context;
|
||||
// CGLCreateContext(pixel_format, share_group, context.InitializeInto());
|
||||
//
|
||||
// For initialization with an existing object, the caller may specify whether
|
||||
// the ScopedTypeRef<> being initialized is assuming the caller's existing
|
||||
// ownership of the object (and should not call Retain in initialization) or if
|
||||
// it should not assume this ownership and must create its own (by calling
|
||||
// Retain in initialization). This behavior is based on the |policy| parameter,
|
||||
// with |ASSUME| for the former and |RETAIN| for the latter. The default policy
|
||||
// is to |ASSUME|.
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_SCOPED_TYPEREF_MAC_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_SCOPED_TYPEREF_MAC_H_
|
||||
#pragma once
|
||||
@@ -82,6 +48,46 @@ namespace base {
|
||||
template <typename T>
|
||||
struct ScopedTypeRefTraits;
|
||||
|
||||
///
|
||||
/// ScopedTypeRef<> is patterned after std::unique_ptr<>, but maintains
|
||||
/// ownership of a reference to any type that is maintained by Retain and
|
||||
/// Release methods.
|
||||
///
|
||||
/// The Traits structure must provide the Retain and Release methods for type T.
|
||||
/// A default ScopedTypeRefTraits is used but not defined, and should be defined
|
||||
/// for each type to use this interface. For example, an appropriate definition
|
||||
/// of ScopedTypeRefTraits for CGLContextObj would be:
|
||||
///
|
||||
/// <pre>
|
||||
/// template<>
|
||||
/// struct ScopedTypeRefTraits<CGLContextObj> {
|
||||
/// static CGLContextObj InvalidValue() { return nullptr; }
|
||||
/// static CGLContextObj Retain(CGLContextObj object) {
|
||||
/// CGLContextRetain(object);
|
||||
/// return object;
|
||||
/// }
|
||||
/// static void Release(CGLContextObj object) { CGLContextRelease(object); }
|
||||
/// };
|
||||
/// </pre>
|
||||
///
|
||||
/// For the many types that have pass-by-pointer create functions, the function
|
||||
/// InitializeInto() is provided to allow direct initialization and assumption
|
||||
/// of ownership of the object. For example, continuing to use the above
|
||||
/// CGLContextObj specialization:
|
||||
///
|
||||
/// <pre>
|
||||
/// base::ScopedTypeRef<CGLContextObj> context;
|
||||
/// CGLCreateContext(pixel_format, share_group, context.InitializeInto());
|
||||
/// </pre>
|
||||
///
|
||||
/// For initialization with an existing object, the caller may specify whether
|
||||
/// the ScopedTypeRef<> being initialized is assuming the caller's existing
|
||||
/// ownership of the object (and should not call Retain in initialization) or if
|
||||
/// it should not assume this ownership and must create its own (by calling
|
||||
/// Retain in initialization). This behavior is based on the |policy| parameter,
|
||||
/// with |ASSUME| for the former and |RETAIN| for the latter. The default policy
|
||||
/// is to |ASSUME|.
|
||||
///
|
||||
template <typename T, typename Traits = ScopedTypeRefTraits<T>>
|
||||
class ScopedTypeRef {
|
||||
public:
|
||||
|
@@ -43,10 +43,12 @@
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/internal/cef_thread_checker_impl.h"
|
||||
|
||||
// Apart from debug builds, we also enable the thread checker in
|
||||
// builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots
|
||||
// with this define will get the same level of thread checking as
|
||||
// debug bots.
|
||||
///
|
||||
/// Apart from debug builds, we also enable the thread checker in
|
||||
/// builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots
|
||||
/// with this define will get the same level of thread checking as
|
||||
/// debug bots.
|
||||
///
|
||||
#if DCHECK_IS_ON()
|
||||
#define ENABLE_THREAD_CHECKER 1
|
||||
#else
|
||||
@@ -57,10 +59,12 @@ namespace base {
|
||||
|
||||
namespace cef_internal {
|
||||
|
||||
// Do nothing implementation, for use in release mode.
|
||||
//
|
||||
// Note: You should almost always use the ThreadChecker class to get the
|
||||
// right version for your build configuration.
|
||||
///
|
||||
/// Do nothing implementation, for use in release mode.
|
||||
///
|
||||
/// Note: You should almost always use the ThreadChecker class to get the
|
||||
/// right version for your build configuration.
|
||||
///
|
||||
class ThreadCheckerDoNothing {
|
||||
public:
|
||||
bool CalledOnValidThread() const { return true; }
|
||||
@@ -70,37 +74,42 @@ class ThreadCheckerDoNothing {
|
||||
|
||||
} // namespace cef_internal
|
||||
|
||||
// ThreadChecker is a helper class used to help verify that some methods of a
|
||||
// class are called from the same thread. It provides identical functionality to
|
||||
// base::NonThreadSafe, but it is meant to be held as a member variable, rather
|
||||
// than inherited from base::NonThreadSafe.
|
||||
//
|
||||
// While inheriting from base::NonThreadSafe may give a clear indication about
|
||||
// the thread-safety of a class, it may also lead to violations of the style
|
||||
// guide with regard to multiple inheritance. The choice between having a
|
||||
// ThreadChecker member and inheriting from base::NonThreadSafe should be based
|
||||
// on whether:
|
||||
// - Derived classes need to know the thread they belong to, as opposed to
|
||||
// having that functionality fully encapsulated in the base class.
|
||||
// - Derived classes should be able to reassign the base class to another
|
||||
// thread, via DetachFromThread.
|
||||
//
|
||||
// If neither of these are true, then having a ThreadChecker member and calling
|
||||
// CalledOnValidThread is the preferable solution.
|
||||
//
|
||||
// Example:
|
||||
// class MyClass {
|
||||
// public:
|
||||
// void Foo() {
|
||||
// DCHECK(thread_checker_.CalledOnValidThread());
|
||||
// ... (do stuff) ...
|
||||
// }
|
||||
//
|
||||
// private:
|
||||
// ThreadChecker thread_checker_;
|
||||
// }
|
||||
//
|
||||
// In Release mode, CalledOnValidThread will always return true.
|
||||
///
|
||||
/// ThreadChecker is a helper class used to help verify that some methods of a
|
||||
/// class are called from the same thread. It provides identical functionality
|
||||
/// to base::NonThreadSafe, but it is meant to be held as a member variable,
|
||||
/// rather than inherited from base::NonThreadSafe.
|
||||
///
|
||||
/// While inheriting from base::NonThreadSafe may give a clear indication about
|
||||
/// the thread-safety of a class, it may also lead to violations of the style
|
||||
/// guide with regard to multiple inheritance. The choice between having a
|
||||
/// ThreadChecker member and inheriting from base::NonThreadSafe should be based
|
||||
/// on whether:
|
||||
/// - Derived classes need to know the thread they belong to, as opposed to
|
||||
/// having that functionality fully encapsulated in the base class.
|
||||
/// - Derived classes should be able to reassign the base class to another
|
||||
/// thread, via DetachFromThread.
|
||||
///
|
||||
/// If neither of these are true, then having a ThreadChecker member and calling
|
||||
/// CalledOnValidThread is the preferable solution.
|
||||
///
|
||||
/// Example:
|
||||
///
|
||||
/// <pre>
|
||||
/// class MyClass {
|
||||
/// public:
|
||||
/// void Foo() {
|
||||
/// DCHECK(thread_checker_.CalledOnValidThread());
|
||||
/// ... (do stuff) ...
|
||||
/// }
|
||||
///
|
||||
/// private:
|
||||
/// ThreadChecker thread_checker_;
|
||||
/// }
|
||||
/// </pre>
|
||||
///
|
||||
/// In Release mode, CalledOnValidThread will always return true.
|
||||
///
|
||||
#if ENABLE_THREAD_CHECKER
|
||||
class ThreadChecker : public cef_internal::ThreadCheckerImpl {};
|
||||
#else
|
||||
|
@@ -29,111 +29,133 @@
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
///
|
||||
// Trace events are for tracking application performance and resource usage.
|
||||
// Macros are provided to track:
|
||||
// Begin and end of function calls
|
||||
// Counters
|
||||
//
|
||||
// Events are issued against categories. Whereas LOG's categories are statically
|
||||
// defined, TRACE categories are created implicitly with a string. For example:
|
||||
// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent")
|
||||
//
|
||||
// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope:
|
||||
// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly")
|
||||
// doSomethingCostly()
|
||||
// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly")
|
||||
// Note: Our tools can't always determine the correct BEGIN/END pairs unless
|
||||
// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you
|
||||
// need them to be in separate scopes.
|
||||
//
|
||||
// A common use case is to trace entire function scopes. This issues a trace
|
||||
// BEGIN and END automatically:
|
||||
// void doSomethingCostly() {
|
||||
// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly");
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// Additional parameters can be associated with an event:
|
||||
// void doSomethingCostly2(int howMuch) {
|
||||
// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly",
|
||||
// "howMuch", howMuch);
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// The trace system will automatically add to this information the current
|
||||
// process id, thread id, and a timestamp in microseconds.
|
||||
//
|
||||
// To trace an asynchronous procedure such as an IPC send/receive, use
|
||||
// ASYNC_BEGIN and ASYNC_END:
|
||||
// [single threaded sender code]
|
||||
// static int send_count = 0;
|
||||
// ++send_count;
|
||||
// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count);
|
||||
// Send(new MyMessage(send_count));
|
||||
// [receive code]
|
||||
// void OnMyMessage(send_count) {
|
||||
// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count);
|
||||
// }
|
||||
// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs.
|
||||
// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process.
|
||||
// Pointers can be used for the ID parameter, and they will be mangled
|
||||
// internally so that the same pointer on two different processes will not
|
||||
// match. For example:
|
||||
// class MyTracedClass {
|
||||
// public:
|
||||
// MyTracedClass() {
|
||||
// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this);
|
||||
// }
|
||||
// ~MyTracedClass() {
|
||||
// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// The trace event also supports counters, which is a way to track a quantity
|
||||
// as it varies over time. Counters are created with the following macro:
|
||||
// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue);
|
||||
//
|
||||
// Counters are process-specific. The macro itself can be issued from any
|
||||
// thread, however.
|
||||
//
|
||||
// Sometimes, you want to track two counters at once. You can do this with two
|
||||
// counter macros:
|
||||
// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]);
|
||||
// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]);
|
||||
// Or you can do it with a combined macro:
|
||||
// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter",
|
||||
// "bytesPinned", g_myCounterValue[0],
|
||||
// "bytesAllocated", g_myCounterValue[1]);
|
||||
// This indicates to the tracing UI that these counters should be displayed
|
||||
// in a single graph, as a summed area chart.
|
||||
//
|
||||
// Since counters are in a global namespace, you may want to disembiguate with a
|
||||
// unique ID, by using the TRACE_COUNTER_ID* variations.
|
||||
//
|
||||
// By default, trace collection is compiled in, but turned off at runtime.
|
||||
// Collecting trace data is the responsibility of the embedding application. In
|
||||
// CEF's case, calling BeginTracing will turn on tracing on all active
|
||||
// processes.
|
||||
//
|
||||
//
|
||||
// Memory scoping note:
|
||||
// Tracing copies the pointers, not the string content, of the strings passed
|
||||
// in for category, name, and arg_names. Thus, the following code will cause
|
||||
// problems:
|
||||
// char* str = strdup("impprtantName");
|
||||
// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD!
|
||||
// free(str); // Trace system now has dangling pointer
|
||||
//
|
||||
// To avoid this issue with the |name| and |arg_name| parameters, use the
|
||||
// TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime
|
||||
// overhead.
|
||||
// Notes: The category must always be in a long-lived char* (i.e. static const).
|
||||
// The |arg_values|, when used, are always deep copied with the _COPY
|
||||
// macros.
|
||||
//
|
||||
//
|
||||
// Thread Safety:
|
||||
// All macros are thread safe and can be used from any process.
|
||||
/// \file
|
||||
/// Trace events are for tracking application performance and resource usage.
|
||||
/// Macros are provided to track:
|
||||
/// Begin and end of function calls
|
||||
/// Counters
|
||||
///
|
||||
/// Events are issued against categories. Whereas LOG's categories are
|
||||
/// statically defined, TRACE categories are created implicitly with a string.
|
||||
/// For example: <pre>
|
||||
/// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent")
|
||||
/// </pre>
|
||||
///
|
||||
/// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope:
|
||||
/// <pre>
|
||||
/// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly")
|
||||
/// doSomethingCostly()
|
||||
/// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly")
|
||||
/// </pre>
|
||||
/// Note: Our tools can't always determine the correct BEGIN/END pairs unless
|
||||
/// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you
|
||||
/// need them to be in separate scopes.
|
||||
///
|
||||
/// A common use case is to trace entire function scopes. This issues a trace
|
||||
/// BEGIN and END automatically:
|
||||
/// <pre>
|
||||
/// void doSomethingCostly() {
|
||||
/// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly");
|
||||
/// ...
|
||||
/// }
|
||||
/// </pre>
|
||||
///
|
||||
/// Additional parameters can be associated with an event:
|
||||
/// <pre>
|
||||
/// void doSomethingCostly2(int howMuch) {
|
||||
/// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly",
|
||||
/// "howMuch", howMuch);
|
||||
/// ...
|
||||
/// }
|
||||
/// </pre>
|
||||
///
|
||||
/// The trace system will automatically add to this information the current
|
||||
/// process id, thread id, and a timestamp in microseconds.
|
||||
///
|
||||
/// To trace an asynchronous procedure such as an IPC send/receive, use
|
||||
/// ASYNC_BEGIN and ASYNC_END:
|
||||
/// <pre>
|
||||
/// [single threaded sender code]
|
||||
/// static int send_count = 0;
|
||||
/// ++send_count;
|
||||
/// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count);
|
||||
/// Send(new MyMessage(send_count));
|
||||
/// [receive code]
|
||||
/// void OnMyMessage(send_count) {
|
||||
/// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count);
|
||||
/// }
|
||||
/// </pre>
|
||||
/// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs.
|
||||
/// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process.
|
||||
/// Pointers can be used for the ID parameter, and they will be mangled
|
||||
/// internally so that the same pointer on two different processes will not
|
||||
/// match. For example:
|
||||
/// <pre>
|
||||
/// class MyTracedClass {
|
||||
/// public:
|
||||
/// MyTracedClass() {
|
||||
/// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this);
|
||||
/// }
|
||||
/// ~MyTracedClass() {
|
||||
/// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this);
|
||||
/// }
|
||||
/// }
|
||||
/// </pre>
|
||||
///
|
||||
/// The trace event also supports counters, which is a way to track a quantity
|
||||
/// as it varies over time. Counters are created with the following macro:
|
||||
/// <pre>
|
||||
/// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue);
|
||||
/// </pre>
|
||||
///
|
||||
/// Counters are process-specific. The macro itself can be issued from any
|
||||
/// thread, however.
|
||||
///
|
||||
/// Sometimes, you want to track two counters at once. You can do this with two
|
||||
/// counter macros:
|
||||
/// <pre>
|
||||
/// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]);
|
||||
/// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]);
|
||||
/// </pre>
|
||||
/// Or you can do it with a combined macro:
|
||||
/// <pre>
|
||||
/// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter",
|
||||
/// "bytesPinned", g_myCounterValue[0],
|
||||
/// "bytesAllocated", g_myCounterValue[1]);
|
||||
/// </pre>
|
||||
/// This indicates to the tracing UI that these counters should be displayed
|
||||
/// in a single graph, as a summed area chart.
|
||||
///
|
||||
/// Since counters are in a global namespace, you may want to disembiguate with
|
||||
/// a unique ID, by using the TRACE_COUNTER_ID* variations.
|
||||
///
|
||||
/// By default, trace collection is compiled in, but turned off at runtime.
|
||||
/// Collecting trace data is the responsibility of the embedding application. In
|
||||
/// CEF's case, calling BeginTracing will turn on tracing on all active
|
||||
/// processes.
|
||||
///
|
||||
///
|
||||
/// Memory scoping note:
|
||||
/// Tracing copies the pointers, not the string content, of the strings passed
|
||||
/// in for category, name, and arg_names. Thus, the following code will cause
|
||||
/// problems:
|
||||
/// <pre>
|
||||
/// char* str = strdup("impprtantName");
|
||||
/// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD!
|
||||
/// free(str); // Trace system now has dangling pointer
|
||||
/// </pre>
|
||||
///
|
||||
/// To avoid this issue with the |name| and |arg_name| parameters, use the
|
||||
/// TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime
|
||||
/// overhead.
|
||||
///
|
||||
/// Notes: The category must always be in a long-lived char* (i.e. static
|
||||
/// const). The |arg_values|, when used, are always deep copied with
|
||||
/// the _COPY macros.
|
||||
///
|
||||
///
|
||||
/// Thread Safety:
|
||||
/// All macros are thread safe and can be used from any process.
|
||||
///
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_
|
||||
@@ -141,7 +163,7 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
/// When building CEF include the Chromium header directly.
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
@@ -150,11 +172,13 @@
|
||||
|
||||
#include "include/internal/cef_trace_event_internal.h"
|
||||
|
||||
// Records a pair of begin and end events called "name" for the current
|
||||
// scope, with 0, 1 or 2 associated arguments. If the category is not
|
||||
// enabled, then this does nothing.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
///
|
||||
/// Records a pair of begin and end events called "name" for the current
|
||||
/// scope, with 0, 1 or 2 associated arguments. If the category is not
|
||||
/// enabled, then this does nothing.
|
||||
/// - category and name strings must have application lifetime (statics or
|
||||
/// literals). They may not include " chars.
|
||||
///
|
||||
#define TRACE_EVENT0(category, name) \
|
||||
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false); \
|
||||
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
|
||||
@@ -179,11 +203,13 @@
|
||||
cef_trace_event::CefTraceEndOnScopeClose CEF_INTERNAL_TRACE_EVENT_UID( \
|
||||
profileScope)(category, name)
|
||||
|
||||
// Records a single event called "name" immediately, with 0, 1 or 2
|
||||
// associated arguments. If the category is not enabled, then this
|
||||
// does nothing.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
///
|
||||
/// Records a single event called "name" immediately, with 0, 1 or 2
|
||||
/// associated arguments. If the category is not enabled, then this
|
||||
/// does nothing.
|
||||
/// - category and name strings must have application lifetime (statics or
|
||||
/// literals). They may not include " chars.
|
||||
///
|
||||
#define TRACE_EVENT_INSTANT0(category, name) \
|
||||
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false)
|
||||
#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \
|
||||
@@ -201,11 +227,13 @@
|
||||
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val, true)
|
||||
|
||||
// Records a single BEGIN event called "name" immediately, with 0, 1 or 2
|
||||
// associated arguments. If the category is not enabled, then this
|
||||
// does nothing.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
///
|
||||
/// Records a single BEGIN event called "name" immediately, with 0, 1 or 2
|
||||
/// associated arguments. If the category is not enabled, then this
|
||||
/// does nothing.
|
||||
/// - category and name strings must have application lifetime (statics or
|
||||
/// literals). They may not include " chars.
|
||||
///
|
||||
#define TRACE_EVENT_BEGIN0(category, name) \
|
||||
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false)
|
||||
#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \
|
||||
@@ -223,10 +251,12 @@
|
||||
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val, true)
|
||||
|
||||
// Records a single END event for "name" immediately. If the category
|
||||
// is not enabled, then this does nothing.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
///
|
||||
/// Records a single END event for "name" immediately. If the category
|
||||
/// is not enabled, then this does nothing.
|
||||
/// - category and name strings must have application lifetime (statics or
|
||||
/// literals). They may not include " chars.
|
||||
///
|
||||
#define TRACE_EVENT_END0(category, name) \
|
||||
cef_trace_event_end(category, name, NULL, 0, NULL, 0, false)
|
||||
#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \
|
||||
@@ -244,20 +274,24 @@
|
||||
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
|
||||
arg2_val, true)
|
||||
|
||||
// Records the value of a counter called "name" immediately. Value
|
||||
// must be representable as a 32 bit integer.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
///
|
||||
/// Records the value of a counter called "name" immediately. Value
|
||||
/// must be representable as a 32 bit integer.
|
||||
/// - category and name strings must have application lifetime (statics or
|
||||
/// literals). They may not include " chars.
|
||||
///
|
||||
#define TRACE_COUNTER1(category, name, value) \
|
||||
cef_trace_counter(category, name, NULL, value, NULL, 0, false)
|
||||
#define TRACE_COPY_COUNTER1(category, name, value) \
|
||||
cef_trace_counter(category, name, NULL, value, NULL, 0, true)
|
||||
|
||||
// Records the values of a multi-parted counter called "name" immediately.
|
||||
// The UI will treat value1 and value2 as parts of a whole, displaying their
|
||||
// values as a stacked-bar chart.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
///
|
||||
/// Records the values of a multi-parted counter called "name" immediately.
|
||||
/// The UI will treat value1 and value2 as parts of a whole, displaying their
|
||||
/// values as a stacked-bar chart.
|
||||
/// - category and name strings must have application lifetime (statics or
|
||||
/// literals). They may not include " chars.
|
||||
///
|
||||
#define TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, \
|
||||
value2_val) \
|
||||
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
|
||||
@@ -267,28 +301,32 @@
|
||||
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
|
||||
value2_val, true)
|
||||
|
||||
// Records the value of a counter called "name" immediately. Value
|
||||
// must be representable as a 32 bit integer.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
// - |id| is used to disambiguate counters with the same name. It must either
|
||||
// be a pointer or an integer value up to 64 bits. If it's a pointer, the
|
||||
// bits will be xored with a hash of the process ID so that the same pointer
|
||||
// on two different processes will not collide.
|
||||
///
|
||||
/// Records the value of a counter called "name" immediately. Value
|
||||
/// must be representable as a 32 bit integer.
|
||||
/// - category and name strings must have application lifetime (statics or
|
||||
/// literals). They may not include " chars.
|
||||
/// - |id| is used to disambiguate counters with the same name. It must either
|
||||
/// be a pointer or an integer value up to 64 bits. If it's a pointer, the
|
||||
/// bits will be xored with a hash of the process ID so that the same pointer
|
||||
/// on two different processes will not collide.
|
||||
///
|
||||
#define TRACE_COUNTER_ID1(category, name, id, value) \
|
||||
cef_trace_counter_id(category, name, id, NULL, value, NULL, 0, false)
|
||||
#define TRACE_COPY_COUNTER_ID1(category, name, id, value) \
|
||||
cef_trace_counter_id(category, name, id, NULL, value, NULL, 0, true)
|
||||
|
||||
// Records the values of a multi-parted counter called "name" immediately.
|
||||
// The UI will treat value1 and value2 as parts of a whole, displaying their
|
||||
// values as a stacked-bar chart.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
// - |id| is used to disambiguate counters with the same name. It must either
|
||||
// be a pointer or an integer value up to 64 bits. If it's a pointer, the
|
||||
// bits will be xored with a hash of the process ID so that the same pointer
|
||||
// on two different processes will not collide.
|
||||
///
|
||||
/// Records the values of a multi-parted counter called "name" immediately.
|
||||
/// The UI will treat value1 and value2 as parts of a whole, displaying their
|
||||
/// values as a stacked-bar chart.
|
||||
/// - category and name strings must have application lifetime (statics or
|
||||
/// literals). They may not include " chars.
|
||||
/// - |id| is used to disambiguate counters with the same name. It must either
|
||||
/// be a pointer or an integer value up to 64 bits. If it's a pointer, the
|
||||
/// bits will be xored with a hash of the process ID so that the same pointer
|
||||
/// on two different processes will not collide.
|
||||
///
|
||||
#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \
|
||||
value2_name, value2_val) \
|
||||
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
||||
@@ -298,22 +336,24 @@
|
||||
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
|
||||
value2_name, value2_val, true)
|
||||
|
||||
// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
|
||||
// associated arguments. If the category is not enabled, then this
|
||||
// does nothing.
|
||||
// - category and name strings must have application lifetime (statics or
|
||||
// literals). They may not include " chars.
|
||||
// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event.
|
||||
// ASYNC events are considered to match if their category, name and id values
|
||||
// all match. |id| must either be a pointer or an integer value up to 64
|
||||
// bits. If it's a pointer, the bits will be xored with a hash of the process
|
||||
// ID sothat the same pointer on two different processes will not collide.
|
||||
// An asynchronous operation can consist of multiple phases. The first phase is
|
||||
// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the
|
||||
// ASYNC_STEP_BEGIN macros. When the operation completes, call ASYNC_END.
|
||||
// An async operation can span threads and processes, but all events in that
|
||||
// operation must use the same |name| and |id|. Each event can have its own
|
||||
// args.
|
||||
///
|
||||
/// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
|
||||
/// associated arguments. If the category is not enabled, then this
|
||||
/// does nothing.
|
||||
/// - category and name strings must have application lifetime (statics or
|
||||
/// literals). They may not include " chars.
|
||||
/// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event.
|
||||
/// ASYNC events are considered to match if their category, name and id values
|
||||
/// all match. |id| must either be a pointer or an integer value up to 64
|
||||
/// bits. If it's a pointer, the bits will be xored with a hash of the process
|
||||
/// ID sothat the same pointer on two different processes will not collide.
|
||||
/// An asynchronous operation can consist of multiple phases. The first phase is
|
||||
/// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the
|
||||
/// ASYNC_STEP_BEGIN macros. When the operation completes, call ASYNC_END.
|
||||
/// An async operation can span threads and processes, but all events in that
|
||||
/// operation must use the same |name| and |id|. Each event can have its own
|
||||
/// args.
|
||||
///
|
||||
#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
|
||||
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, false)
|
||||
#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
|
||||
@@ -333,12 +373,14 @@
|
||||
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
|
||||
arg2_name, arg2_val, true)
|
||||
|
||||
// Records a single ASYNC_STEP_INTO event for |step| immediately. If the
|
||||
// category is not enabled, then this does nothing. The |name| and |id| must
|
||||
// match the ASYNC_BEGIN event above. The |step| param identifies this step
|
||||
// within the async event. This should be called at the beginning of the next
|
||||
// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
|
||||
// ASYNC_STEP_PAST events.
|
||||
///
|
||||
/// 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
|
||||
/// match the ASYNC_BEGIN event above. The |step| param identifies this step
|
||||
/// within the async event. This should be called at the beginning of the next
|
||||
/// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
|
||||
/// ASYNC_STEP_PAST events.
|
||||
///
|
||||
#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \
|
||||
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false)
|
||||
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
|
||||
@@ -352,12 +394,14 @@
|
||||
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
|
||||
arg1_val, true)
|
||||
|
||||
// Records a single ASYNC_STEP_PAST event for |step| immediately. If the
|
||||
// category is not enabled, then this does nothing. The |name| and |id| must
|
||||
// match the ASYNC_BEGIN event above. The |step| param identifies this step
|
||||
// within the async event. This should be called at the beginning of the next
|
||||
// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
|
||||
// ASYNC_STEP_INTO events.
|
||||
///
|
||||
/// 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
|
||||
/// match the ASYNC_BEGIN event above. The |step| param identifies this step
|
||||
/// within the async event. This should be called at the beginning of the next
|
||||
/// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
|
||||
/// ASYNC_STEP_INTO events.
|
||||
///
|
||||
#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \
|
||||
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false)
|
||||
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
|
||||
@@ -371,8 +415,10 @@
|
||||
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
|
||||
arg1_val, true)
|
||||
|
||||
// Records a single ASYNC_END event for "name" immediately. If the category
|
||||
// is not enabled, then this does nothing.
|
||||
///
|
||||
/// Records a single ASYNC_END event for "name" immediately. If the category
|
||||
/// is not enabled, then this does nothing.
|
||||
///
|
||||
#define TRACE_EVENT_ASYNC_END0(category, name, id) \
|
||||
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, false)
|
||||
#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
|
||||
@@ -394,7 +440,9 @@
|
||||
|
||||
namespace cef_trace_event {
|
||||
|
||||
// Used by TRACE_EVENTx macro. Do not use directly.
|
||||
///
|
||||
/// Used by TRACE_EVENTx macro. Do not use directly.
|
||||
///
|
||||
class CefTraceEndOnScopeClose {
|
||||
public:
|
||||
CefTraceEndOnScopeClose(const char* category, const char* name)
|
||||
@@ -408,7 +456,7 @@ class CefTraceEndOnScopeClose {
|
||||
const char* name_;
|
||||
};
|
||||
|
||||
} // cef_trace_event
|
||||
} // namespace cef_trace_event
|
||||
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
|
@@ -28,25 +28,30 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// Use std::tuple as tuple type. This file contains helper functions for
|
||||
// working with std::tuples.
|
||||
// The functions DispatchToMethod and DispatchToFunction take a function pointer
|
||||
// or instance and method pointer, and unpack a tuple into arguments to the
|
||||
// call.
|
||||
//
|
||||
// Example usage:
|
||||
// // These two methods of creating a Tuple are identical.
|
||||
// std::tuple<int, const char*> tuple_a(1, "wee");
|
||||
// std::tuple<int, const char*> tuple_b = std::make_tuple(1, "wee");
|
||||
//
|
||||
// void SomeFunc(int a, const char* b) { }
|
||||
// DispatchToFunction(&SomeFunc, tuple_a); // SomeFunc(1, "wee")
|
||||
// DispatchToFunction(
|
||||
// &SomeFunc, std::make_tuple(10, "foo")); // SomeFunc(10, "foo")
|
||||
//
|
||||
// struct { void SomeMeth(int a, int b, int c) { } } foo;
|
||||
// DispatchToMethod(&foo, &Foo::SomeMeth, std::make_tuple(1, 2, 3));
|
||||
// // foo->SomeMeth(1, 2, 3);
|
||||
///
|
||||
/// \file
|
||||
/// Use std::tuple as tuple type. This file contains helper functions for
|
||||
/// working with std::tuples.
|
||||
/// The functions DispatchToMethod and DispatchToFunction take a function
|
||||
/// pointer or instance and method pointer, and unpack a tuple into arguments to
|
||||
/// the call.
|
||||
///
|
||||
/// Example usage:
|
||||
/// <pre>
|
||||
/// // These two methods of creating a Tuple are identical.
|
||||
/// std::tuple<int, const char*> tuple_a(1, "wee");
|
||||
/// std::tuple<int, const char*> tuple_b = std::make_tuple(1, "wee");
|
||||
///
|
||||
/// void SomeFunc(int a, const char* b) { }
|
||||
/// DispatchToFunction(&SomeFunc, tuple_a); // SomeFunc(1, "wee")
|
||||
/// DispatchToFunction(
|
||||
/// &SomeFunc, std::make_tuple(10, "foo")); // SomeFunc(10, "foo")
|
||||
///
|
||||
/// struct { void SomeMeth(int a, int b, int c) { } } foo;
|
||||
/// DispatchToMethod(&foo, &Foo::SomeMeth, std::make_tuple(1, 2, 3));
|
||||
/// // foo->SomeMeth(1, 2, 3);
|
||||
/// </pre>
|
||||
///
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_TUPLE_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_TUPLE_H_
|
||||
@@ -88,9 +93,7 @@ inline void DispatchToMethodImpl(const ObjT& obj,
|
||||
}
|
||||
|
||||
template <typename ObjT, typename Method, typename Tuple>
|
||||
inline void DispatchToMethod(const ObjT& obj,
|
||||
Method method,
|
||||
Tuple&& args) {
|
||||
inline void DispatchToMethod(const ObjT& obj, Method method, Tuple&& args) {
|
||||
constexpr size_t size = std::tuple_size<std::decay_t<Tuple>>::value;
|
||||
DispatchToMethodImpl(obj, method, std::forward<Tuple>(args),
|
||||
std::make_index_sequence<size>());
|
||||
|
@@ -28,69 +28,73 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// Weak pointers are pointers to an object that do not affect its lifetime,
|
||||
// and which may be invalidated (i.e. reset to nullptr) by the object, or its
|
||||
// owner, at any time, most commonly when the object is about to be deleted.
|
||||
|
||||
// Weak pointers are useful when an object needs to be accessed safely by one
|
||||
// or more objects other than its owner, and those callers can cope with the
|
||||
// object vanishing and e.g. tasks posted to it being silently dropped.
|
||||
// Reference-counting such an object would complicate the ownership graph and
|
||||
// make it harder to reason about the object's lifetime.
|
||||
|
||||
// EXAMPLE:
|
||||
//
|
||||
// class Controller {
|
||||
// public:
|
||||
// void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); }
|
||||
// void WorkComplete(const Result& result) { ... }
|
||||
// private:
|
||||
// // Member variables should appear before the WeakPtrFactory, to ensure
|
||||
// // that any WeakPtrs to Controller are invalidated before its members
|
||||
// // variable's destructors are executed, rendering them invalid.
|
||||
// WeakPtrFactory<Controller> weak_factory_{this};
|
||||
// };
|
||||
//
|
||||
// class Worker {
|
||||
// public:
|
||||
// static void StartNew(WeakPtr<Controller> controller) {
|
||||
// Worker* worker = new Worker(std::move(controller));
|
||||
// // Kick off asynchronous processing...
|
||||
// }
|
||||
// private:
|
||||
// Worker(WeakPtr<Controller> controller)
|
||||
// : controller_(std::move(controller)) {}
|
||||
// void DidCompleteAsynchronousProcessing(const Result& result) {
|
||||
// if (controller_)
|
||||
// controller_->WorkComplete(result);
|
||||
// }
|
||||
// WeakPtr<Controller> controller_;
|
||||
// };
|
||||
//
|
||||
// With this implementation a caller may use SpawnWorker() to dispatch multiple
|
||||
// Workers and subsequently delete the Controller, without waiting for all
|
||||
// Workers to have completed.
|
||||
|
||||
// ------------------------- IMPORTANT: Thread-safety -------------------------
|
||||
|
||||
// Weak pointers may be passed safely between threads, but must always be
|
||||
// dereferenced and invalidated on the same ThreaddTaskRunner otherwise
|
||||
// checking the pointer would be racey.
|
||||
//
|
||||
// To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory
|
||||
// is dereferenced, the factory and its WeakPtrs become bound to the calling
|
||||
// thread or current ThreaddWorkerPool token, and cannot be dereferenced or
|
||||
// invalidated on any other task runner. Bound WeakPtrs can still be handed
|
||||
// off to other task runners, e.g. to use to post tasks back to object on the
|
||||
// bound thread.
|
||||
//
|
||||
// If all WeakPtr objects are destroyed or invalidated then the factory is
|
||||
// unbound from the ThreaddTaskRunner/Thread. The WeakPtrFactory may then be
|
||||
// destroyed, or new WeakPtr objects may be used, from a different thread.
|
||||
//
|
||||
// Thus, at least one WeakPtr object must exist and have been dereferenced on
|
||||
// the correct thread to enforce that other WeakPtr objects will enforce they
|
||||
// are used on the desired thread.
|
||||
///
|
||||
/// \file
|
||||
/// Weak pointers are pointers to an object that do not affect its lifetime.
|
||||
/// They may be invalidated (i.e. reset to nullptr) by the object, or its
|
||||
/// owner, at any time, most commonly when the object is about to be deleted.
|
||||
///
|
||||
/// Weak pointers are useful when an object needs to be accessed safely by one
|
||||
/// or more objects other than its owner, and those callers can cope with the
|
||||
/// object vanishing and e.g. tasks posted to it being silently dropped.
|
||||
/// Reference-counting such an object would complicate the ownership graph and
|
||||
/// make it harder to reason about the object's lifetime.
|
||||
///
|
||||
/// EXAMPLE:
|
||||
///
|
||||
/// <pre>
|
||||
/// class Controller {
|
||||
/// public:
|
||||
/// void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); }
|
||||
/// void WorkComplete(const Result& result) { ... }
|
||||
/// private:
|
||||
/// // Member variables should appear before the WeakPtrFactory, to ensure
|
||||
/// // that any WeakPtrs to Controller are invalidated before its members
|
||||
/// // variable's destructors are executed, rendering them invalid.
|
||||
/// WeakPtrFactory<Controller> weak_factory_{this};
|
||||
/// };
|
||||
///
|
||||
/// class Worker {
|
||||
/// public:
|
||||
/// static void StartNew(WeakPtr<Controller> controller) {
|
||||
/// Worker* worker = new Worker(std::move(controller));
|
||||
/// // Kick off asynchronous processing...
|
||||
/// }
|
||||
/// private:
|
||||
/// Worker(WeakPtr<Controller> controller)
|
||||
/// : controller_(std::move(controller)) {}
|
||||
/// void DidCompleteAsynchronousProcessing(const Result& result) {
|
||||
/// if (controller_)
|
||||
/// controller_->WorkComplete(result);
|
||||
/// }
|
||||
/// WeakPtr<Controller> controller_;
|
||||
/// };
|
||||
/// </pre>
|
||||
///
|
||||
/// With this implementation a caller may use SpawnWorker() to dispatch multiple
|
||||
/// Workers and subsequently delete the Controller, without waiting for all
|
||||
/// Workers to have completed.
|
||||
///
|
||||
/// <b>IMPORTANT: Thread-safety</b>
|
||||
///
|
||||
/// Weak pointers may be passed safely between threads, but must always be
|
||||
/// dereferenced and invalidated on the same ThreaddTaskRunner otherwise
|
||||
/// checking the pointer would be racey.
|
||||
///
|
||||
/// To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory
|
||||
/// is dereferenced, the factory and its WeakPtrs become bound to the calling
|
||||
/// thread or current ThreaddWorkerPool token, and cannot be dereferenced or
|
||||
/// invalidated on any other task runner. Bound WeakPtrs can still be handed
|
||||
/// off to other task runners, e.g. to use to post tasks back to object on the
|
||||
/// bound thread.
|
||||
///
|
||||
/// If all WeakPtr objects are destroyed or invalidated then the factory is
|
||||
/// unbound from the ThreadedTaskRunner/Thread. The WeakPtrFactory may then be
|
||||
/// destroyed, or new WeakPtr objects may be used, from a different thread.
|
||||
///
|
||||
/// Thus, at least one WeakPtr object must exist and have been dereferenced on
|
||||
/// the correct thread to enforce that other WeakPtr objects will enforce they
|
||||
/// are used on the desired thread.
|
||||
|
||||
#ifndef CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
|
||||
#define CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
|
||||
@@ -243,27 +247,32 @@ class SupportsWeakPtrBase {
|
||||
template <typename T>
|
||||
class WeakPtrFactory;
|
||||
|
||||
// The WeakPtr class holds a weak reference to |T*|.
|
||||
//
|
||||
// This class is designed to be used like a normal pointer. You should always
|
||||
// null-test an object of this class before using it or invoking a method that
|
||||
// may result in the underlying object being destroyed.
|
||||
//
|
||||
// EXAMPLE:
|
||||
//
|
||||
// class Foo { ... };
|
||||
// WeakPtr<Foo> foo;
|
||||
// if (foo)
|
||||
// foo->method();
|
||||
//
|
||||
///
|
||||
/// The WeakPtr class holds a weak reference to |T*|.
|
||||
///
|
||||
/// This class is designed to be used like a normal pointer. You should always
|
||||
/// null-test an object of this class before using it or invoking a method that
|
||||
/// may result in the underlying object being destroyed.
|
||||
///
|
||||
/// EXAMPLE:
|
||||
///
|
||||
/// <pre>
|
||||
/// class Foo { ... };
|
||||
/// WeakPtr<Foo> foo;
|
||||
/// if (foo)
|
||||
/// foo->method();
|
||||
/// </pre>
|
||||
///
|
||||
template <typename T>
|
||||
class WeakPtr : public internal::WeakPtrBase {
|
||||
public:
|
||||
WeakPtr() = default;
|
||||
WeakPtr(std::nullptr_t) {}
|
||||
|
||||
// Allow conversion from U to T provided U "is a" T. Note that this
|
||||
// is separate from the (implicit) copy and move constructors.
|
||||
///
|
||||
/// Allow conversion from U to T provided U "is a" T. Note that this
|
||||
/// is separate from the (implicit) copy and move constructors.
|
||||
///
|
||||
template <typename U>
|
||||
WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other) {
|
||||
// Need to cast from U* to T* to do pointer adjustment in case of multiple
|
||||
@@ -292,21 +301,27 @@ class WeakPtr : public internal::WeakPtrBase {
|
||||
return get();
|
||||
}
|
||||
|
||||
// Allow conditionals to test validity, e.g. if (weak_ptr) {...};
|
||||
///
|
||||
/// Allow conditionals to test validity, e.g. `if (weak_ptr) {...}`;
|
||||
///
|
||||
explicit operator bool() const { return get() != nullptr; }
|
||||
|
||||
// Returns false if the WeakPtr is confirmed to be invalid. This call is safe
|
||||
// to make from any thread, e.g. to optimize away unnecessary work, but
|
||||
// operator bool() must always be called, on the correct thread, before
|
||||
// actually using the pointer.
|
||||
//
|
||||
// Warning: as with any object, this call is only thread-safe if the WeakPtr
|
||||
// instance isn't being re-assigned or reset() racily with this call.
|
||||
///
|
||||
/// Returns false if the WeakPtr is confirmed to be invalid. This call is safe
|
||||
/// to make from any thread, e.g. to optimize away unnecessary work, but
|
||||
/// operator bool() must always be called, on the correct thread, before
|
||||
/// actually using the pointer.
|
||||
///
|
||||
/// Warning: as with any object, this call is only thread-safe if the WeakPtr
|
||||
/// instance isn't being re-assigned or reset() racily with this call.
|
||||
///
|
||||
bool MaybeValid() const { return ref_.MaybeValid(); }
|
||||
|
||||
// Returns whether the object |this| points to has been invalidated. This can
|
||||
// be used to distinguish a WeakPtr to a destroyed object from one that has
|
||||
// been explicitly set to null.
|
||||
///
|
||||
/// Returns whether the object |this| points to has been invalidated. This can
|
||||
/// be used to distinguish a WeakPtr to a destroyed object from one that has
|
||||
/// been explicitly set to null.
|
||||
///
|
||||
bool WasInvalidated() const { return ptr_ && !ref_.IsValid(); }
|
||||
|
||||
private:
|
||||
@@ -320,7 +335,9 @@ class WeakPtr : public internal::WeakPtrBase {
|
||||
: WeakPtrBase(ref, reinterpret_cast<uintptr_t>(ptr)) {}
|
||||
};
|
||||
|
||||
// Allow callers to compare WeakPtrs against nullptr to test validity.
|
||||
///
|
||||
/// Allow callers to compare WeakPtrs against nullptr to test validity.
|
||||
///
|
||||
template <class T>
|
||||
bool operator!=(const WeakPtr<T>& weak_ptr, std::nullptr_t) {
|
||||
return !(weak_ptr == nullptr);
|
||||
@@ -348,11 +365,14 @@ class WeakPtrFactoryBase {
|
||||
};
|
||||
} // namespace internal
|
||||
|
||||
// A class may be composed of a WeakPtrFactory and thereby
|
||||
// control how it exposes weak pointers to itself. This is helpful if you only
|
||||
// need weak pointers within the implementation of a class. This class is also
|
||||
// useful when working with primitive types. For example, you could have a
|
||||
// WeakPtrFactory<bool> that is used to pass around a weak reference to a bool.
|
||||
///
|
||||
/// A class may be composed of a WeakPtrFactory and thereby control how it
|
||||
/// exposes weak pointers to itself. This is helpful if you only need weak
|
||||
/// pointers within the implementation of a class. This class is also useful
|
||||
/// when working with primitive types. For example, you could have a
|
||||
/// WeakPtrFactory<bool> that is used to pass around a weak reference to a
|
||||
/// bool.
|
||||
///
|
||||
template <class T>
|
||||
class WeakPtrFactory : public internal::WeakPtrFactoryBase {
|
||||
public:
|
||||
@@ -371,24 +391,30 @@ class WeakPtrFactory : public internal::WeakPtrFactoryBase {
|
||||
reinterpret_cast<T*>(ptr_));
|
||||
}
|
||||
|
||||
// Call this method to invalidate all existing weak pointers.
|
||||
///
|
||||
/// Call this method to invalidate all existing weak pointers.
|
||||
///
|
||||
void InvalidateWeakPtrs() {
|
||||
DCHECK(ptr_);
|
||||
weak_reference_owner_.Invalidate();
|
||||
}
|
||||
|
||||
// Call this method to determine if any weak pointers exist.
|
||||
///
|
||||
/// Call this method to determine if any weak pointers exist.
|
||||
///
|
||||
bool HasWeakPtrs() const {
|
||||
DCHECK(ptr_);
|
||||
return weak_reference_owner_.HasRefs();
|
||||
}
|
||||
};
|
||||
|
||||
// A class may extend from SupportsWeakPtr to let others take weak pointers to
|
||||
// it. This avoids the class itself implementing boilerplate to dispense weak
|
||||
// pointers. However, since SupportsWeakPtr's destructor won't invalidate
|
||||
// weak pointers to the class until after the derived class' members have been
|
||||
// destroyed, its use can lead to subtle use-after-destroy issues.
|
||||
///
|
||||
/// A class may extend from SupportsWeakPtr to let others take weak pointers to
|
||||
/// it. This avoids the class itself implementing boilerplate to dispense weak
|
||||
/// pointers. However, since SupportsWeakPtr's destructor won't invalidate
|
||||
/// weak pointers to the class until after the derived class' members have been
|
||||
/// destroyed, its use can lead to subtle use-after-destroy issues.
|
||||
///
|
||||
template <class T>
|
||||
class SupportsWeakPtr : public internal::SupportsWeakPtrBase {
|
||||
public:
|
||||
@@ -408,24 +434,29 @@ class SupportsWeakPtr : public internal::SupportsWeakPtrBase {
|
||||
internal::WeakReferenceOwner weak_reference_owner_;
|
||||
};
|
||||
|
||||
// Helper function that uses type deduction to safely return a WeakPtr<Derived>
|
||||
// when Derived doesn't directly extend SupportsWeakPtr<Derived>, instead it
|
||||
// extends a Base that extends SupportsWeakPtr<Base>.
|
||||
//
|
||||
// EXAMPLE:
|
||||
// class Base : public base::SupportsWeakPtr<Producer> {};
|
||||
// class Derived : public Base {};
|
||||
//
|
||||
// Derived derived;
|
||||
// base::WeakPtr<Derived> ptr = base::AsWeakPtr(&derived);
|
||||
//
|
||||
// Note that the following doesn't work (invalid type conversion) since
|
||||
// Derived::AsWeakPtr() is WeakPtr<Base> SupportsWeakPtr<Base>::AsWeakPtr(),
|
||||
// and there's no way to safely cast WeakPtr<Base> to WeakPtr<Derived> at
|
||||
// the caller.
|
||||
//
|
||||
// base::WeakPtr<Derived> ptr = derived.AsWeakPtr(); // Fails.
|
||||
|
||||
///
|
||||
/// Helper function that uses type deduction to safely return a WeakPtr<Derived>
|
||||
/// when Derived doesn't directly extend SupportsWeakPtr<Derived>, instead it
|
||||
/// extends a Base that extends SupportsWeakPtr<Base>.
|
||||
///
|
||||
/// EXAMPLE:
|
||||
/// <pre>
|
||||
/// class Base : public base::SupportsWeakPtr<Producer> {};
|
||||
/// class Derived : public Base {};
|
||||
///
|
||||
/// Derived derived;
|
||||
/// base::WeakPtr<Derived> ptr = base::AsWeakPtr(&derived);
|
||||
/// </pre>
|
||||
///
|
||||
/// Note that the following doesn't work (invalid type conversion) since
|
||||
/// Derived::AsWeakPtr() is WeakPtr<Base> SupportsWeakPtr<Base>::AsWeakPtr(),
|
||||
/// and there's no way to safely cast WeakPtr<Base> to WeakPtr<Derived> at
|
||||
/// the caller.
|
||||
///
|
||||
/// <pre>
|
||||
/// base::WeakPtr<Derived> ptr = derived.AsWeakPtr(); // Fails.
|
||||
/// </pre>
|
||||
///
|
||||
template <typename Derived>
|
||||
WeakPtr<Derived> AsWeakPtr(Derived* t) {
|
||||
return internal::SupportsWeakPtrBase::StaticAsWeakPtr<Derived>(t);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=306e44d49ab6198a0fa1bcea50e8a25ee18672be$
|
||||
// $hash=6bdc0ce413420b45510fcc7f415c6a6fb05f0112$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
|
||||
@@ -47,27 +47,27 @@ 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.
|
||||
/// 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.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called after renderer process sends accessibility tree changes to the
|
||||
// browser process.
|
||||
/// 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.
|
||||
/// 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,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=84440a43cf4be6728b51919e65c5f33e5736c502$
|
||||
// $hash=2f4bdc6adde5defdc86dbb5c998266d6372dd164$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
|
||||
@@ -54,25 +54,26 @@ extern "C" {
|
||||
struct _cef_app_t;
|
||||
|
||||
///
|
||||
// Implement this structure to provide handler implementations. Methods will be
|
||||
// called by the process and/or thread indicated.
|
||||
/// Implement this structure to provide handler implementations. Methods will be
|
||||
/// called by the process and/or thread indicated.
|
||||
///
|
||||
typedef struct _cef_app_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Provides an opportunity to view and/or modify command-line arguments before
|
||||
// processing by CEF and Chromium. The |process_type| value will be NULL for
|
||||
// the browser process. Do not keep a reference to the cef_command_line_t
|
||||
// object passed to this function. The CefSettings.command_line_args_disabled
|
||||
// value can be used to start with an NULL command-line object. Any values
|
||||
// specified in CefSettings that equate to command-line arguments will be set
|
||||
// before this function is called. Be cautious when using this function to
|
||||
// modify command-line arguments for non-browser processes as this may result
|
||||
// in undefined behavior including crashes.
|
||||
/// Provides an opportunity to view and/or modify command-line arguments
|
||||
/// before processing by CEF and Chromium. The |process_type| value will be
|
||||
/// NULL for the browser process. Do not keep a reference to the
|
||||
/// cef_command_line_t object passed to this function. The
|
||||
/// cef_settings_t.command_line_args_disabled value can be used to start with
|
||||
/// an NULL command-line object. Any values specified in CefSettings that
|
||||
/// equate to command-line arguments will be set before this function is
|
||||
/// called. Be cautious when using this function to modify command-line
|
||||
/// arguments for non-browser processes as this may result in undefined
|
||||
/// behavior including crashes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_before_command_line_processing)(
|
||||
struct _cef_app_t* self,
|
||||
@@ -80,61 +81,62 @@ typedef struct _cef_app_t {
|
||||
struct _cef_command_line_t* command_line);
|
||||
|
||||
///
|
||||
// Provides an opportunity to register custom schemes. Do not keep a reference
|
||||
// to the |registrar| object. This function is called on the main thread for
|
||||
// each process and the registered schemes should be the same across all
|
||||
// processes.
|
||||
/// Provides an opportunity to register custom schemes. Do not keep a
|
||||
/// reference to the |registrar| object. This function is called on the main
|
||||
/// thread for each process and the registered schemes should be the same
|
||||
/// across all processes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_register_custom_schemes)(
|
||||
struct _cef_app_t* self,
|
||||
struct _cef_scheme_registrar_t* registrar);
|
||||
|
||||
///
|
||||
// Return the handler for resource bundle events. If
|
||||
// CefSettings.pack_loading_disabled is true (1) a handler must be returned.
|
||||
// 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.
|
||||
/// Return the handler for resource bundle events. If
|
||||
/// cef_settings_t.pack_loading_disabled is true (1) a handler must be
|
||||
/// returned. If no handler is returned resources will be loaded from pack
|
||||
/// files. This function is called by the browser and render processes on
|
||||
/// multiple threads.
|
||||
///
|
||||
struct _cef_resource_bundle_handler_t*(
|
||||
CEF_CALLBACK* get_resource_bundle_handler)(struct _cef_app_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for functionality specific to the browser process. This
|
||||
// function is called on multiple threads in the browser process.
|
||||
/// Return the handler for functionality specific to the browser process. This
|
||||
/// function is called on multiple threads in the browser process.
|
||||
///
|
||||
struct _cef_browser_process_handler_t*(
|
||||
CEF_CALLBACK* get_browser_process_handler)(struct _cef_app_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for functionality specific to the render process. This
|
||||
// function is called on the render process main thread.
|
||||
/// Return the handler for functionality specific to the render process. This
|
||||
/// function is called on the render process main thread.
|
||||
///
|
||||
struct _cef_render_process_handler_t*(
|
||||
CEF_CALLBACK* get_render_process_handler)(struct _cef_app_t* self);
|
||||
} cef_app_t;
|
||||
|
||||
///
|
||||
// This function should be called from the application entry point function to
|
||||
// execute a secondary process. It can be used to run secondary processes from
|
||||
// the browser client executable (default behavior) or from a separate
|
||||
// executable specified by the CefSettings.browser_subprocess_path value. If
|
||||
// called for the browser process (identified by no "type" command-line value)
|
||||
// it will return immediately with a value of -1. If called for a recognized
|
||||
// secondary process it will block until the process should exit and then return
|
||||
// the process exit code. The |application| parameter may be NULL. The
|
||||
// |windows_sandbox_info| parameter is only used on Windows and may be NULL (see
|
||||
// cef_sandbox_win.h for details).
|
||||
/// 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
|
||||
/// the browser client executable (default behavior) or from a separate
|
||||
/// executable specified by the cef_settings_t.browser_subprocess_path value. If
|
||||
/// called for the browser process (identified by no "type" command-line value)
|
||||
/// it will return immediately with a value of -1. If called for a recognized
|
||||
/// secondary process it will block until the process should exit and then
|
||||
/// return the process exit code. The |application| parameter may be NULL. The
|
||||
/// |windows_sandbox_info| parameter is only used on Windows and may be NULL
|
||||
/// (see cef_sandbox_win.h for details).
|
||||
///
|
||||
CEF_EXPORT int cef_execute_process(const cef_main_args_t* args,
|
||||
cef_app_t* application,
|
||||
void* windows_sandbox_info);
|
||||
|
||||
///
|
||||
// This function should be called on the main application thread to initialize
|
||||
// the CEF browser process. The |application| parameter may be NULL. A return
|
||||
// value of true (1) indicates that it succeeded and false (0) indicates that it
|
||||
// failed. The |windows_sandbox_info| parameter is only used on Windows and may
|
||||
// be NULL (see cef_sandbox_win.h for details).
|
||||
/// This function should be called on the main application thread to initialize
|
||||
/// the CEF browser process. The |application| parameter may be NULL. A return
|
||||
/// value of true (1) indicates that it succeeded and false (0) indicates that
|
||||
/// it failed. The |windows_sandbox_info| parameter is only used on Windows and
|
||||
/// may be NULL (see cef_sandbox_win.h for details).
|
||||
///
|
||||
CEF_EXPORT int cef_initialize(const cef_main_args_t* args,
|
||||
const struct _cef_settings_t* settings,
|
||||
@@ -142,58 +144,45 @@ CEF_EXPORT int cef_initialize(const cef_main_args_t* args,
|
||||
void* windows_sandbox_info);
|
||||
|
||||
///
|
||||
// This function should be called on the main application thread to shut down
|
||||
// the CEF browser process before the application exits.
|
||||
/// This function should be called on the main application thread to shut down
|
||||
/// the CEF browser process before the application exits.
|
||||
///
|
||||
CEF_EXPORT void cef_shutdown(void);
|
||||
|
||||
///
|
||||
// Perform a single iteration of CEF message loop processing. This function is
|
||||
// provided for cases where the CEF message loop must be integrated into an
|
||||
// existing application message loop. Use of this function is not recommended
|
||||
// for most users; use either the cef_run_message_loop() function or
|
||||
// CefSettings.multi_threaded_message_loop if possible. When using this function
|
||||
// care must be taken to balance performance against excessive CPU usage. It is
|
||||
// recommended to enable the CefSettings.external_message_pump option when using
|
||||
// this function so that
|
||||
// cef_browser_process_handler_t::on_schedule_message_pump_work() callbacks can
|
||||
// facilitate the scheduling process. This function should only be called on the
|
||||
// main application thread and only if cef_initialize() is called with a
|
||||
// CefSettings.multi_threaded_message_loop value of false (0). This function
|
||||
// will not block.
|
||||
/// Perform a single iteration of CEF message loop processing. This function is
|
||||
/// provided for cases where the CEF message loop must be integrated into an
|
||||
/// existing application message loop. Use of this function is not recommended
|
||||
/// for most users; use either the cef_run_message_loop() function or
|
||||
/// cef_settings_t.multi_threaded_message_loop if possible. When using this
|
||||
/// function care must be taken to balance performance against excessive CPU
|
||||
/// usage. It is recommended to enable the cef_settings_t.external_message_pump
|
||||
/// option when using this function so that
|
||||
/// cef_browser_process_handler_t::on_schedule_message_pump_work() callbacks can
|
||||
/// facilitate the scheduling process. This function should only be called on
|
||||
/// the main application thread and only if cef_initialize() is called with a
|
||||
/// cef_settings_t.multi_threaded_message_loop value of false (0). This function
|
||||
/// will not block.
|
||||
///
|
||||
CEF_EXPORT void cef_do_message_loop_work(void);
|
||||
|
||||
///
|
||||
// Run the CEF message loop. Use this function instead of an application-
|
||||
// provided message loop to get the best balance between performance and CPU
|
||||
// usage. This function should only be called on the main application thread and
|
||||
// only if cef_initialize() is called with a
|
||||
// CefSettings.multi_threaded_message_loop value of false (0). This function
|
||||
// will block until a quit message is received by the system.
|
||||
/// Run the CEF message loop. Use this function instead of an application-
|
||||
/// provided message loop to get the best balance between performance and CPU
|
||||
/// usage. This function should only be called on the main application thread
|
||||
/// and only if cef_initialize() is called with a
|
||||
/// cef_settings_t.multi_threaded_message_loop value of false (0). This function
|
||||
/// will block until a quit message is received by the system.
|
||||
///
|
||||
CEF_EXPORT void cef_run_message_loop(void);
|
||||
|
||||
///
|
||||
// Quit the CEF message loop that was started by calling cef_run_message_loop().
|
||||
// This function should only be called on the main application thread and only
|
||||
// if cef_run_message_loop() was used.
|
||||
/// Quit the CEF message loop that was started by calling
|
||||
/// cef_run_message_loop(). This function should only be called on the main
|
||||
/// application thread and only if cef_run_message_loop() was used.
|
||||
///
|
||||
CEF_EXPORT void cef_quit_message_loop(void);
|
||||
|
||||
///
|
||||
// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a
|
||||
// modal message loop. Set to false (0) after exiting the modal message loop.
|
||||
///
|
||||
CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop);
|
||||
|
||||
///
|
||||
// Call during process startup to enable High-DPI support on Windows 7 or newer.
|
||||
// Older versions of Windows should be left DPI-unaware because they do not
|
||||
// support DirectWrite and GDI fonts are kerned very badly.
|
||||
///
|
||||
CEF_EXPORT void cef_enable_highdpi_support(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=62f58ab826b8a3d436655bf0855848632f2a73b5$
|
||||
// $hash=4e243df31e29bc6e473d56e371ed6328d948959c$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
|
||||
@@ -48,30 +48,30 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle audio events.
|
||||
/// Implement this structure to handle audio events.
|
||||
///
|
||||
typedef struct _cef_audio_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the UI thread to allow configuration of audio stream parameters.
|
||||
// Return true (1) to proceed with audio stream capture, or false (0) to
|
||||
// cancel it. All members of |params| can optionally be configured here, but
|
||||
// they are also pre-filled with some sensible defaults.
|
||||
/// Called on the UI thread to allow configuration of audio stream parameters.
|
||||
/// Return true (1) to proceed with audio stream capture, or false (0) to
|
||||
/// cancel it. All members of |params| can optionally be configured here, but
|
||||
/// they are also pre-filled with some sensible defaults.
|
||||
///
|
||||
int(CEF_CALLBACK* get_audio_parameters)(struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_audio_parameters_t* params);
|
||||
|
||||
///
|
||||
// Called on a browser audio capture thread when the browser starts streaming
|
||||
// audio. OnAudioStreamStopped will always be called after
|
||||
// OnAudioStreamStarted; both functions may be called multiple times for the
|
||||
// same browser. |params| contains the audio parameters like sample rate and
|
||||
// channel layout. |channels| is the number of channels.
|
||||
/// Called on a browser audio capture thread when the browser starts streaming
|
||||
/// audio. OnAudioStreamStopped will always be called after
|
||||
/// OnAudioStreamStarted; both functions may be called multiple times for the
|
||||
/// same browser. |params| contains the audio parameters like sample rate and
|
||||
/// channel layout. |channels| is the number of channels.
|
||||
///
|
||||
void(CEF_CALLBACK* on_audio_stream_started)(
|
||||
struct _cef_audio_handler_t* self,
|
||||
@@ -80,14 +80,14 @@ typedef struct _cef_audio_handler_t {
|
||||
int channels);
|
||||
|
||||
///
|
||||
// Called on the audio stream thread when a PCM packet is received for the
|
||||
// stream. |data| is an array representing the raw PCM data as a floating
|
||||
// point type, i.e. 4-byte value(s). |frames| is the number of frames in the
|
||||
// PCM packet. |pts| is the presentation timestamp (in milliseconds since the
|
||||
// Unix Epoch) and represents the time at which the decompressed packet should
|
||||
// be presented to the user. Based on |frames| and the |channel_layout| value
|
||||
// passed to OnAudioStreamStarted you can calculate the size of the |data|
|
||||
// array in bytes.
|
||||
/// Called on the audio stream thread when a PCM packet is received for the
|
||||
/// stream. |data| is an array representing the raw PCM data as a floating
|
||||
/// point type, i.e. 4-byte value(s). |frames| is the number of frames in the
|
||||
/// PCM packet. |pts| is the presentation timestamp (in milliseconds since the
|
||||
/// Unix Epoch) and represents the time at which the decompressed packet
|
||||
/// should be presented to the user. Based on |frames| and the
|
||||
/// |channel_layout| value passed to OnAudioStreamStarted you can calculate
|
||||
/// the size of the |data| array in bytes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_audio_stream_packet)(struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -96,18 +96,18 @@ typedef struct _cef_audio_handler_t {
|
||||
int64 pts);
|
||||
|
||||
///
|
||||
// Called on the UI thread when the stream has stopped. OnAudioSteamStopped
|
||||
// will always be called after OnAudioStreamStarted; both functions may be
|
||||
// called multiple times for the same stream.
|
||||
/// Called on the UI thread when the stream has stopped. OnAudioSteamStopped
|
||||
/// will always be called after OnAudioStreamStarted; both functions may be
|
||||
/// called multiple times for the same stream.
|
||||
///
|
||||
void(CEF_CALLBACK* on_audio_stream_stopped)(struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called on the UI or audio stream thread when an error occurred. During the
|
||||
// stream creation phase this callback will be called on the UI thread while
|
||||
// in the capturing phase it will be called on the audio stream thread. The
|
||||
// stream will be stopped immediately.
|
||||
/// Called on the UI or audio stream thread when an error occurred. During the
|
||||
/// stream creation phase this callback will be called on the UI thread while
|
||||
/// in the capturing phase it will be called on the audio stream thread. The
|
||||
/// stream will be stopped immediately.
|
||||
///
|
||||
void(CEF_CALLBACK* on_audio_stream_error)(struct _cef_audio_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=01a33de48ac9780f78d606d8aee2429ddb0c81a2$
|
||||
// $hash=c0704c0a87e8b57b20887be75700a30e887fee4f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
|
||||
@@ -47,24 +47,24 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of authentication
|
||||
// requests.
|
||||
/// Callback structure used for asynchronous continuation of authentication
|
||||
/// requests.
|
||||
///
|
||||
typedef struct _cef_auth_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Continue the authentication request.
|
||||
/// Continue the authentication request.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_auth_callback_t* self,
|
||||
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);
|
||||
} cef_auth_callback_t;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ad0a78715daff99c1ec987800b7e5d62196e7100$
|
||||
// $hash=a4d3026623111f1ba226d1579c6b03de3b924457$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_client_capi.h"
|
||||
#include "include/capi/cef_command_line_capi.h"
|
||||
#include "include/capi/cef_preference_capi.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -50,57 +51,84 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure used to implement browser process callbacks. The functions of this
|
||||
// structure will be called on the browser process main thread unless otherwise
|
||||
// indicated.
|
||||
/// Structure used to implement browser process callbacks. The functions of this
|
||||
/// structure will be called on the browser process main thread unless otherwise
|
||||
/// indicated.
|
||||
///
|
||||
typedef struct _cef_browser_process_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the browser process UI thread immediately after the CEF context
|
||||
// has been initialized.
|
||||
/// Provides an opportunity to register custom preferences prior to global and
|
||||
/// request context initialization.
|
||||
///
|
||||
/// If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be
|
||||
/// accessed via cef_preference_manager_t::GetGlobalPreferences after
|
||||
/// OnContextInitialized is called. Global preferences are registered a single
|
||||
/// time at application startup. See related cef_settings_t.cache_path and
|
||||
/// cef_settings_t.persist_user_preferences configuration.
|
||||
///
|
||||
/// If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be
|
||||
/// accessed via the cef_request_context_t after
|
||||
/// cef_request_context_handler_t::OnRequestContextInitialized is called.
|
||||
/// Request context preferences are registered each time a new
|
||||
/// cef_request_context_t is created. It is intended but not required that all
|
||||
/// request contexts have the same registered preferences. See related
|
||||
/// cef_request_context_settings_t.cache_path and
|
||||
/// cef_request_context_settings_t.persist_user_preferences configuration.
|
||||
///
|
||||
/// Do not keep a reference to the |registrar| object. This function is called
|
||||
/// on the browser process UI thread.
|
||||
///
|
||||
void(CEF_CALLBACK* on_register_custom_preferences)(
|
||||
struct _cef_browser_process_handler_t* self,
|
||||
cef_preferences_type_t type,
|
||||
struct _cef_preference_registrar_t* registrar);
|
||||
|
||||
///
|
||||
/// Called on the browser process UI thread immediately after the CEF context
|
||||
/// has been initialized.
|
||||
///
|
||||
void(CEF_CALLBACK* on_context_initialized)(
|
||||
struct _cef_browser_process_handler_t* self);
|
||||
|
||||
///
|
||||
// Called before a child process is launched. Will be called on the browser
|
||||
// process UI thread when launching a render process and on the browser
|
||||
// process IO thread when launching a GPU process. Provides an opportunity to
|
||||
// modify the child process command line. Do not keep a reference to
|
||||
// |command_line| outside of this function.
|
||||
/// Called before a child process is launched. Will be called on the browser
|
||||
/// process UI thread when launching a render process and on the browser
|
||||
/// process IO thread when launching a GPU process. Provides an opportunity to
|
||||
/// modify the child process command line. Do not keep a reference to
|
||||
/// |command_line| outside of this function.
|
||||
///
|
||||
void(CEF_CALLBACK* on_before_child_process_launch)(
|
||||
struct _cef_browser_process_handler_t* self,
|
||||
struct _cef_command_line_t* command_line);
|
||||
|
||||
///
|
||||
// Called from any thread when work has been scheduled for the browser process
|
||||
// main (UI) thread. This callback is used in combination with CefSettings.
|
||||
// external_message_pump and cef_do_message_loop_work() in cases where the CEF
|
||||
// message loop must be integrated into an existing application message loop
|
||||
// (see additional comments and warnings on CefDoMessageLoopWork). This
|
||||
// callback should schedule a cef_do_message_loop_work() call to happen on the
|
||||
// main (UI) thread. |delay_ms| is the requested delay in milliseconds. If
|
||||
// |delay_ms| is <= 0 then the call should happen reasonably soon. If
|
||||
// |delay_ms| is > 0 then the call should be scheduled to happen after the
|
||||
// specified delay and any currently pending scheduled call should be
|
||||
// cancelled.
|
||||
/// Called from any thread when work has been scheduled for the browser
|
||||
/// process main (UI) thread. This callback is used in combination with
|
||||
/// cef_settings_t.external_message_pump and cef_do_message_loop_work() in
|
||||
/// cases where the CEF message loop must be integrated into an existing
|
||||
/// application message loop (see additional comments and warnings on
|
||||
/// CefDoMessageLoopWork). This callback should schedule a
|
||||
/// cef_do_message_loop_work() call to happen on the main (UI) thread.
|
||||
/// |delay_ms| is the requested delay in milliseconds. If |delay_ms| is <= 0
|
||||
/// then the call should happen reasonably soon. If |delay_ms| is > 0 then the
|
||||
/// call should be scheduled to happen after the specified delay and any
|
||||
/// currently pending scheduled call should be cancelled.
|
||||
///
|
||||
void(CEF_CALLBACK* on_schedule_message_pump_work)(
|
||||
struct _cef_browser_process_handler_t* self,
|
||||
int64 delay_ms);
|
||||
|
||||
///
|
||||
// Return the default client for use with a newly created browser window. If
|
||||
// null is returned the browser will be unmanaged (no callbacks will be
|
||||
// executed for that browser) and application shutdown will be blocked until
|
||||
// the browser window is closed manually. This function is currently only used
|
||||
// with the chrome runtime.
|
||||
/// Return the default client for use with a newly created browser window. If
|
||||
/// null is returned the browser will be unmanaged (no callbacks will be
|
||||
/// executed for that browser) and application shutdown will be blocked until
|
||||
/// the browser window is closed manually. This function is currently only
|
||||
/// used with the chrome runtime.
|
||||
///
|
||||
struct _cef_client_t*(CEF_CALLBACK* get_default_client)(
|
||||
struct _cef_browser_process_handler_t* self);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=10ef5088ce2a5c6ffb38f8864d3aad6e5ac88b40$
|
||||
// $hash=1bb026d01d1d4bb38ceb4c54f6bcf70300bf5201$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
|
||||
@@ -47,36 +47,36 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Generic callback structure used for asynchronous continuation.
|
||||
/// Generic callback structure used for asynchronous continuation.
|
||||
///
|
||||
typedef struct _cef_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Continue processing.
|
||||
/// Continue processing.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_callback_t* self);
|
||||
|
||||
///
|
||||
// Cancel processing.
|
||||
/// Cancel processing.
|
||||
///
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_callback_t* self);
|
||||
} cef_callback_t;
|
||||
|
||||
///
|
||||
// Generic callback structure used for asynchronous completion.
|
||||
/// Generic callback structure used for asynchronous completion.
|
||||
///
|
||||
typedef struct _cef_completion_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
} cef_completion_callback_t;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=03ae4ba9762510e2b0c19ea29322c20ebaf2e683$
|
||||
// $hash=93f1c39c102dc97d6ad8d236a90a2e0e88f10fb7$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
|
||||
@@ -66,134 +66,134 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to provide handler implementations.
|
||||
/// Implement this structure to provide handler implementations.
|
||||
///
|
||||
typedef struct _cef_client_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Return the handler for audio rendering events.
|
||||
/// Return the handler for audio rendering events.
|
||||
///
|
||||
struct _cef_audio_handler_t*(CEF_CALLBACK* get_audio_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for commands. If no handler is provided the default
|
||||
// implementation will be used.
|
||||
/// Return the handler for commands. If no handler is provided the default
|
||||
/// implementation will be used.
|
||||
///
|
||||
struct _cef_command_handler_t*(CEF_CALLBACK* get_command_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for context menus. If no handler is provided the default
|
||||
// implementation will be used.
|
||||
/// Return the handler for context menus. If no handler is provided the
|
||||
/// default implementation will be used.
|
||||
///
|
||||
struct _cef_context_menu_handler_t*(CEF_CALLBACK* get_context_menu_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for dialogs. If no handler is provided the default
|
||||
// implementation will be used.
|
||||
/// Return the handler for dialogs. If no handler is provided the default
|
||||
/// implementation will be used.
|
||||
///
|
||||
struct _cef_dialog_handler_t*(CEF_CALLBACK* get_dialog_handler)(
|
||||
struct _cef_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_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for download events. If no handler is returned downloads
|
||||
// will not be allowed.
|
||||
/// Return the handler for download events. If no handler is returned
|
||||
/// downloads will not be allowed.
|
||||
///
|
||||
struct _cef_download_handler_t*(CEF_CALLBACK* get_download_handler)(
|
||||
struct _cef_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_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_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_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for events related to cef_frame_t lifespan. This
|
||||
// function will be called once during cef_browser_t creation and the result
|
||||
// will be cached for performance reasons.
|
||||
/// Return the handler for events related to cef_frame_t lifespan. This
|
||||
/// function will be called once during cef_browser_t creation and the result
|
||||
/// will be cached for performance reasons.
|
||||
///
|
||||
struct _cef_frame_handler_t*(CEF_CALLBACK* get_frame_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for permission requests.
|
||||
/// Return the handler for permission requests.
|
||||
///
|
||||
struct _cef_permission_handler_t*(CEF_CALLBACK* get_permission_handler)(
|
||||
struct _cef_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for JavaScript dialogs. If no handler is provided the
|
||||
// default implementation will be used.
|
||||
/// Return the handler for JavaScript dialogs. If no handler is provided the
|
||||
/// default implementation will be used.
|
||||
///
|
||||
struct _cef_jsdialog_handler_t*(CEF_CALLBACK* get_jsdialog_handler)(
|
||||
struct _cef_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_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_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_client_t* self);
|
||||
|
||||
///
|
||||
// Return the handler for printing on Linux. If a print handler is not
|
||||
// provided then printing will not be supported on the Linux platform.
|
||||
/// Return the handler for printing on Linux. If a print handler is not
|
||||
/// provided then printing will not be supported on the Linux platform.
|
||||
///
|
||||
struct _cef_print_handler_t*(CEF_CALLBACK* get_print_handler)(
|
||||
struct _cef_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_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_client_t* self);
|
||||
|
||||
///
|
||||
// Called when a new message is received from a different process. Return true
|
||||
// (1) if the message was handled or false (0) otherwise. It is safe to keep
|
||||
// a reference to |message| outside of this callback.
|
||||
/// Called when a new message is received from a different process. Return
|
||||
/// true (1) if the message was handled or false (0) otherwise. It is safe to
|
||||
/// keep a reference to |message| outside of this callback.
|
||||
///
|
||||
int(CEF_CALLBACK* on_process_message_received)(
|
||||
struct _cef_client_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=54332b79c057df9c8f3be56cc77f1daf877b3ac1$
|
||||
// $hash=ec05ae57537091e3543c4b31d72d2d84d44df876$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
|
||||
@@ -48,23 +48,23 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to commands. The functions
|
||||
// of this structure will be called on the UI thread.
|
||||
/// Implement this structure to handle events related to commands. The functions
|
||||
/// of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_command_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called to execute a Chrome command triggered via menu selection or keyboard
|
||||
// shortcut. Values for |command_id| can be found in the cef_command_ids.h
|
||||
// file. |disposition| provides information about the intended command target.
|
||||
// Return true (1) if the command was handled or false (0) for the default
|
||||
// implementation. For context menu commands this will be called after
|
||||
// cef_context_menu_handler_t::OnContextMenuCommand. Only used with the Chrome
|
||||
// runtime.
|
||||
/// Called to execute a Chrome command triggered via menu selection or
|
||||
/// keyboard shortcut. Values for |command_id| can be found in the
|
||||
/// cef_command_ids.h file. |disposition| provides information about the
|
||||
/// intended command target. Return true (1) if the command was handled or
|
||||
/// false (0) for the default implementation. For context menu commands this
|
||||
/// will be called after cef_context_menu_handler_t::OnContextMenuCommand.
|
||||
/// Only used with the Chrome runtime.
|
||||
///
|
||||
int(CEF_CALLBACK* on_chrome_command)(
|
||||
struct _cef_command_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=3049c9960a95d32d61cc57ae998c0eba12820673$
|
||||
// $hash=f535e9560b9fde9b53fc4d8383905105ed029ea4$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
|
||||
@@ -47,104 +47,104 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure used to create and/or parse command line arguments. Arguments with
|
||||
// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
|
||||
// will always precede any arguments without switch prefixes. Switches can
|
||||
// optionally have a value specified using the '=' delimiter (e.g.
|
||||
// "-switch=value"). An argument of "--" will terminate switch parsing with all
|
||||
// subsequent tokens, regardless of prefix, being interpreted as non-switch
|
||||
// arguments. Switch names should be lowercase ASCII and will be converted to
|
||||
// such if necessary. Switch values will retain the original case and UTF8
|
||||
// encoding. This structure can be used before cef_initialize() is called.
|
||||
/// Structure used to create and/or parse command line arguments. Arguments with
|
||||
/// "--", "-" and, on Windows, "/" prefixes are considered switches. Switches
|
||||
/// will always precede any arguments without switch prefixes. Switches can
|
||||
/// optionally have a value specified using the "=" delimiter (e.g.
|
||||
/// "-switch=value"). An argument of "--" will terminate switch parsing with all
|
||||
/// subsequent tokens, regardless of prefix, being interpreted as non-switch
|
||||
/// arguments. Switch names should be lowercase ASCII and will be converted to
|
||||
/// such if necessary. Switch values will retain the original case and UTF8
|
||||
/// encoding. This structure can be used before cef_initialize() is called.
|
||||
///
|
||||
typedef struct _cef_command_line_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
||||
/// if this function returns false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* is_valid)(struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
/// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
/// expose read-only objects.
|
||||
///
|
||||
int(CEF_CALLBACK* is_read_only)(struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// 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* self);
|
||||
|
||||
///
|
||||
// Initialize the command line with the specified |argc| and |argv| values.
|
||||
// The first argument must be the name of the program. This function is only
|
||||
// supported on non-Windows platforms.
|
||||
/// Initialize the command line with the specified |argc| and |argv| values.
|
||||
/// The first argument must be the name of the program. This function is only
|
||||
/// supported on non-Windows platforms.
|
||||
///
|
||||
void(CEF_CALLBACK* init_from_argv)(struct _cef_command_line_t* self,
|
||||
int argc,
|
||||
const char* const* argv);
|
||||
|
||||
///
|
||||
// Initialize the command line with the string returned by calling
|
||||
// GetCommandLineW(). This function is only supported on Windows.
|
||||
/// Initialize the command line with the string returned by calling
|
||||
/// GetCommandLineW(). This function is only supported on Windows.
|
||||
///
|
||||
void(CEF_CALLBACK* init_from_string)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* command_line);
|
||||
|
||||
///
|
||||
// Reset the command-line switches and arguments but leave the program
|
||||
// component unchanged.
|
||||
/// Reset the command-line switches and arguments but leave the program
|
||||
/// component unchanged.
|
||||
///
|
||||
void(CEF_CALLBACK* reset)(struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Retrieve the original command line string as a vector of strings. The argv
|
||||
// array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* }
|
||||
/// Retrieve the original command line string as a vector of strings. The argv
|
||||
/// array: `{ program, [(--|-|/)switch[=value]]*, [--], [argument]* }`
|
||||
///
|
||||
void(CEF_CALLBACK* get_argv)(struct _cef_command_line_t* self,
|
||||
cef_string_list_t argv);
|
||||
|
||||
///
|
||||
// Constructs and returns the represented command line string. Use this
|
||||
// function cautiously because quoting behavior is unclear.
|
||||
/// Constructs and returns the represented command line string. Use this
|
||||
/// function cautiously because quoting behavior is unclear.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_command_line_string)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_program)(
|
||||
struct _cef_command_line_t* self);
|
||||
|
||||
///
|
||||
// Set the program part of the command line string (the first item).
|
||||
/// Set the program part of the command line string (the first item).
|
||||
///
|
||||
void(CEF_CALLBACK* set_program)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* program);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Returns the value associated with the given switch. If the switch has no
|
||||
// value or isn't present this function returns the NULL string.
|
||||
/// Returns the value associated with the given switch. If the switch has no
|
||||
/// value or isn't present this function returns the NULL string.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_switch_value)(
|
||||
@@ -152,59 +152,59 @@ typedef struct _cef_command_line_t {
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Returns the map of switch names and values. If a switch has no value an
|
||||
// NULL string is returned.
|
||||
/// Returns the map of switch names and values. If a switch has no value an
|
||||
/// NULL string is returned.
|
||||
///
|
||||
void(CEF_CALLBACK* get_switches)(struct _cef_command_line_t* self,
|
||||
cef_string_map_t switches);
|
||||
|
||||
///
|
||||
// Add a switch to the end of the command line. If the switch has no value
|
||||
// pass an NULL value string.
|
||||
/// Add a switch to the end of the command line. If the switch has no value
|
||||
/// pass an NULL value string.
|
||||
///
|
||||
void(CEF_CALLBACK* append_switch)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// 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)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* name,
|
||||
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);
|
||||
|
||||
///
|
||||
// Get the remaining command line arguments.
|
||||
/// Get the remaining command line arguments.
|
||||
///
|
||||
void(CEF_CALLBACK* get_arguments)(struct _cef_command_line_t* self,
|
||||
cef_string_list_t arguments);
|
||||
|
||||
///
|
||||
// Add an argument to the end of the command line.
|
||||
/// Add an argument to the end of the command line.
|
||||
///
|
||||
void(CEF_CALLBACK* append_argument)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* argument);
|
||||
|
||||
///
|
||||
// Insert a command before the current command. Common for debuggers, like
|
||||
// "valgrind" or "gdb --args".
|
||||
/// Insert a command before the current command. Common for debuggers, like
|
||||
/// "valgrind" or "gdb --args".
|
||||
///
|
||||
void(CEF_CALLBACK* prepend_wrapper)(struct _cef_command_line_t* self,
|
||||
const cef_string_t* wrapper);
|
||||
} cef_command_line_t;
|
||||
|
||||
///
|
||||
// Create a new cef_command_line_t instance.
|
||||
/// Create a new cef_command_line_t instance.
|
||||
///
|
||||
CEF_EXPORT cef_command_line_t* cef_command_line_create(void);
|
||||
|
||||
///
|
||||
// Returns the singleton global cef_command_line_t object. The returned object
|
||||
// will be read-only.
|
||||
/// Returns the singleton global cef_command_line_t object. The returned object
|
||||
/// will be read-only.
|
||||
///
|
||||
CEF_EXPORT cef_command_line_t* cef_command_line_get_global(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=d9498ae2e32ec124df3dd2c3017bcf415d4205f8$
|
||||
// $hash=0ae549ed35e30afcbb01961fe55455beaadcd7f9$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
|
||||
@@ -52,67 +52,67 @@ extern "C" {
|
||||
struct _cef_context_menu_params_t;
|
||||
|
||||
///
|
||||
// Callback structure used for continuation of custom context menu display.
|
||||
/// Callback structure used for continuation of custom context menu display.
|
||||
///
|
||||
typedef struct _cef_run_context_menu_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Complete context menu display by selecting the specified |command_id| and
|
||||
// |event_flags|.
|
||||
/// Complete context menu display by selecting the specified |command_id| and
|
||||
/// |event_flags|.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_run_context_menu_callback_t* self,
|
||||
int command_id,
|
||||
cef_event_flags_t event_flags);
|
||||
|
||||
///
|
||||
// Cancel context menu display.
|
||||
/// Cancel context menu display.
|
||||
///
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_run_context_menu_callback_t* self);
|
||||
} cef_run_context_menu_callback_t;
|
||||
|
||||
///
|
||||
// Callback structure used for continuation of custom quick menu display.
|
||||
/// Callback structure used for continuation of custom quick menu display.
|
||||
///
|
||||
typedef struct _cef_run_quick_menu_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Complete quick menu display by selecting the specified |command_id| and
|
||||
// |event_flags|.
|
||||
/// Complete quick menu display by selecting the specified |command_id| and
|
||||
/// |event_flags|.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_run_quick_menu_callback_t* self,
|
||||
int command_id,
|
||||
cef_event_flags_t event_flags);
|
||||
|
||||
///
|
||||
// Cancel quick menu display.
|
||||
/// Cancel quick menu display.
|
||||
///
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_run_quick_menu_callback_t* self);
|
||||
} cef_run_quick_menu_callback_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle context menu events. The functions of this
|
||||
// structure will be called on the UI thread.
|
||||
/// Implement this structure to handle context menu events. The functions of
|
||||
/// this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_context_menu_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called before a context menu is displayed. |params| provides information
|
||||
// about the context menu state. |model| initially contains the default
|
||||
// context menu. The |model| can be cleared to show no context menu or
|
||||
// modified to show a custom menu. Do not keep references to |params| or
|
||||
// |model| outside of this callback.
|
||||
/// Called before a context menu is displayed. |params| provides information
|
||||
/// about the context menu state. |model| initially contains the default
|
||||
/// context menu. The |model| can be cleared to show no context menu or
|
||||
/// modified to show a custom menu. Do not keep references to |params| or
|
||||
/// |model| outside of this callback.
|
||||
///
|
||||
void(CEF_CALLBACK* on_before_context_menu)(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
@@ -122,12 +122,12 @@ typedef struct _cef_context_menu_handler_t {
|
||||
struct _cef_menu_model_t* model);
|
||||
|
||||
///
|
||||
// Called to allow custom display of the context menu. |params| provides
|
||||
// information about the context menu state. |model| contains the context menu
|
||||
// model resulting from OnBeforeContextMenu. For custom display return true
|
||||
// (1) and execute |callback| either synchronously or asynchronously with the
|
||||
// selected command ID. For default display return false (0). Do not keep
|
||||
// references to |params| or |model| outside of this callback.
|
||||
/// Called to allow custom display of the context menu. |params| provides
|
||||
/// information about the context menu state. |model| contains the context
|
||||
/// menu model resulting from OnBeforeContextMenu. For custom display return
|
||||
/// true (1) and execute |callback| either synchronously or asynchronously
|
||||
/// with the selected command ID. For default display return false (0). Do not
|
||||
/// keep references to |params| or |model| outside of this callback.
|
||||
///
|
||||
int(CEF_CALLBACK* run_context_menu)(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
@@ -138,13 +138,13 @@ typedef struct _cef_context_menu_handler_t {
|
||||
struct _cef_run_context_menu_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called to execute a command selected from the context menu. Return true (1)
|
||||
// if the command was handled or false (0) for the default implementation. See
|
||||
// cef_menu_id_t for the command ids that have default implementations. All
|
||||
// user-defined command ids should be between MENU_ID_USER_FIRST and
|
||||
// MENU_ID_USER_LAST. |params| will have the same values as what was passed to
|
||||
// on_before_context_menu(). Do not keep a reference to |params| outside of
|
||||
// this callback.
|
||||
/// Called to execute a command selected from the context menu. Return true
|
||||
/// (1) if the command was handled or false (0) for the default
|
||||
/// implementation. See cef_menu_id_t for the command ids that have default
|
||||
/// implementations. All user-defined command ids should be between
|
||||
/// MENU_ID_USER_FIRST and MENU_ID_USER_LAST. |params| will have the same
|
||||
/// values as what was passed to on_before_context_menu(). Do not keep a
|
||||
/// reference to |params| outside of this callback.
|
||||
///
|
||||
int(CEF_CALLBACK* on_context_menu_command)(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
@@ -155,8 +155,8 @@ typedef struct _cef_context_menu_handler_t {
|
||||
cef_event_flags_t event_flags);
|
||||
|
||||
///
|
||||
// Called when the context menu is dismissed irregardless of whether the menu
|
||||
// was canceled or a command was selected.
|
||||
/// Called when the context menu is dismissed irregardless of whether the menu
|
||||
/// was canceled or a command was selected.
|
||||
///
|
||||
void(CEF_CALLBACK* on_context_menu_dismissed)(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
@@ -164,13 +164,13 @@ typedef struct _cef_context_menu_handler_t {
|
||||
struct _cef_frame_t* frame);
|
||||
|
||||
///
|
||||
// Called to allow custom display of the quick menu for a windowless browser.
|
||||
// |location| is the top left corner of the selected region. |size| is the
|
||||
// size of the selected region. |edit_state_flags| is a combination of flags
|
||||
// that represent the state of the quick menu. Return true (1) if the menu
|
||||
// will be handled and execute |callback| either synchronously or
|
||||
// asynchronously with the selected command ID. Return false (0) to cancel the
|
||||
// menu.
|
||||
/// Called to allow custom display of the quick menu for a windowless browser.
|
||||
/// |location| is the top left corner of the selected region. |size| is the
|
||||
/// size of the selected region. |edit_state_flags| is a combination of flags
|
||||
/// that represent the state of the quick menu. Return true (1) if the menu
|
||||
/// will be handled and execute |callback| either synchronously or
|
||||
/// asynchronously with the selected command ID. Return false (0) to cancel
|
||||
/// the menu.
|
||||
///
|
||||
int(CEF_CALLBACK* run_quick_menu)(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
@@ -182,10 +182,10 @@ typedef struct _cef_context_menu_handler_t {
|
||||
struct _cef_run_quick_menu_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called to execute a command selected from the quick menu for a windowless
|
||||
// browser. Return true (1) if the command was handled or false (0) for the
|
||||
// default implementation. See cef_menu_id_t for command IDs that have default
|
||||
// implementations.
|
||||
/// Called to execute a command selected from the quick menu for a windowless
|
||||
/// browser. Return true (1) if the command was handled or false (0) for the
|
||||
/// default implementation. See cef_menu_id_t for command IDs that have
|
||||
/// default implementations.
|
||||
///
|
||||
int(CEF_CALLBACK* on_quick_menu_command)(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
@@ -195,8 +195,8 @@ typedef struct _cef_context_menu_handler_t {
|
||||
cef_event_flags_t event_flags);
|
||||
|
||||
///
|
||||
// Called when the quick menu for a windowless browser is dismissed
|
||||
// irregardless of whether the menu was canceled or a command was selected.
|
||||
/// Called when the quick menu for a windowless browser is dismissed
|
||||
/// irregardless of whether the menu was canceled or a command was selected.
|
||||
///
|
||||
void(CEF_CALLBACK* on_quick_menu_dismissed)(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
@@ -205,155 +205,157 @@ typedef struct _cef_context_menu_handler_t {
|
||||
} cef_context_menu_handler_t;
|
||||
|
||||
///
|
||||
// Provides information about the context menu state. The functions of this
|
||||
// structure can only be accessed on browser process the UI thread.
|
||||
/// Provides information about the context menu state. The functions of this
|
||||
/// structure can only be accessed on browser process the UI thread.
|
||||
///
|
||||
typedef struct _cef_context_menu_params_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns the X coordinate of the mouse where the context menu was invoked.
|
||||
// Coords are relative to the associated RenderView's origin.
|
||||
/// Returns the X coordinate of the mouse where the context menu was invoked.
|
||||
/// Coords are relative to the associated RenderView's origin.
|
||||
///
|
||||
int(CEF_CALLBACK* get_xcoord)(struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the Y coordinate of the mouse where the context menu was invoked.
|
||||
// Coords are relative to the associated RenderView's origin.
|
||||
/// Returns the Y coordinate of the mouse where the context menu was invoked.
|
||||
/// Coords are relative to the associated RenderView's origin.
|
||||
///
|
||||
int(CEF_CALLBACK* get_ycoord)(struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns flags representing the type of node that the context menu was
|
||||
// invoked on.
|
||||
/// Returns flags representing the type of node that the context menu was
|
||||
/// invoked on.
|
||||
///
|
||||
cef_context_menu_type_flags_t(CEF_CALLBACK* get_type_flags)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the URL of the link, if any, that encloses the node that the
|
||||
// context menu was invoked on.
|
||||
/// Returns the URL of the link, if any, that encloses the node that the
|
||||
/// context menu was invoked on.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_link_url)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the link URL, if any, to be used ONLY for "copy link address". We
|
||||
// don't validate this field in the frontend process.
|
||||
/// Returns the link URL, if any, to be used ONLY for "copy link address". We
|
||||
/// don't validate this field in the frontend process.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_unfiltered_link_url)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the source URL, if any, for the element that the context menu was
|
||||
// invoked on. Example of elements with source URLs are img, audio, and video.
|
||||
/// Returns the source URL, if any, for the element that the context menu was
|
||||
/// invoked on. Example of elements with source URLs are img, audio, and
|
||||
/// video.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_source_url)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the context menu was invoked on an image which has non-
|
||||
// NULL contents.
|
||||
/// Returns true (1) if the context menu was invoked on an image which has
|
||||
/// non-NULL 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.
|
||||
/// 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);
|
||||
|
||||
///
|
||||
// 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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_page_url)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the URL of the subframe that the context menu was invoked on.
|
||||
/// Returns the URL of the subframe that the context menu was invoked on.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_frame_url)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the character encoding of the subframe that the context menu was
|
||||
// invoked on.
|
||||
/// Returns the character encoding of the subframe that the context menu was
|
||||
/// invoked on.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_frame_charset)(
|
||||
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)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns flags representing the actions supported by the media element, if
|
||||
// any, that the context menu was invoked on.
|
||||
/// Returns flags representing the actions supported by the media element, if
|
||||
/// any, that the context menu was invoked on.
|
||||
///
|
||||
cef_context_menu_media_state_flags_t(CEF_CALLBACK* get_media_state_flags)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the text of the selection, if any, that the context menu was
|
||||
// invoked on.
|
||||
/// Returns the text of the selection, if any, that the context menu was
|
||||
/// invoked on.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_selection_text)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the text of the misspelled word, if any, that the context menu was
|
||||
// invoked on.
|
||||
/// Returns the text of the misspelled word, if any, that the context menu was
|
||||
/// invoked on.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_misspelled_word)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if suggestions exist, false (0) otherwise. Fills in
|
||||
// |suggestions| from the spell check service for the misspelled word if there
|
||||
// is one.
|
||||
/// Returns true (1) if suggestions exist, false (0) otherwise. Fills in
|
||||
/// |suggestions| from the spell check service for the misspelled word if
|
||||
/// there is one.
|
||||
///
|
||||
int(CEF_CALLBACK* get_dictionary_suggestions)(
|
||||
struct _cef_context_menu_params_t* self,
|
||||
cef_string_list_t suggestions);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// Returns true (1) if the context menu was invoked on an editable node where
|
||||
// spell-check is enabled.
|
||||
/// Returns true (1) if the context menu was invoked on an editable node where
|
||||
/// spell-check is enabled.
|
||||
///
|
||||
int(CEF_CALLBACK* is_spell_check_enabled)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns flags representing the actions supported by the editable node, if
|
||||
// any, that the context menu was invoked on.
|
||||
/// Returns flags representing the actions supported by the editable node, if
|
||||
/// any, that the context menu was invoked on.
|
||||
///
|
||||
cef_context_menu_edit_state_flags_t(CEF_CALLBACK* get_edit_state_flags)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the context menu contains items specified by the
|
||||
// renderer process.
|
||||
/// Returns true (1) if the context menu contains items specified by the
|
||||
/// renderer process.
|
||||
///
|
||||
int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self);
|
||||
} cef_context_menu_params_t;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=d9790a35d74621e985b917935a4fca74ba7db1e0$
|
||||
// $hash=37b5e115ff7abd1df1b9913404b69505fb9fef29$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||
@@ -52,29 +52,29 @@ struct _cef_delete_cookies_callback_t;
|
||||
struct _cef_set_cookie_callback_t;
|
||||
|
||||
///
|
||||
// Structure used for managing cookies. The functions of this structure may be
|
||||
// called on any thread unless otherwise indicated.
|
||||
/// Structure used for managing cookies. The functions of this structure may be
|
||||
/// called on any thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_cookie_manager_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Visit all cookies on the UI thread. The returned cookies are ordered by
|
||||
// longest path, then by earliest creation date. Returns false (0) if cookies
|
||||
// cannot be accessed.
|
||||
/// Visit all cookies on the UI thread. The returned cookies are ordered by
|
||||
/// longest path, then by earliest creation date. Returns false (0) if cookies
|
||||
/// cannot be accessed.
|
||||
///
|
||||
int(CEF_CALLBACK* visit_all_cookies)(struct _cef_cookie_manager_t* self,
|
||||
struct _cef_cookie_visitor_t* visitor);
|
||||
|
||||
///
|
||||
// Visit a subset of cookies on the UI thread. The results are filtered by the
|
||||
// given url scheme, host, domain and path. If |includeHttpOnly| is true (1)
|
||||
// HTTP-only cookies will also be included in the results. The returned
|
||||
// cookies are ordered by longest path, then by earliest creation date.
|
||||
// Returns false (0) if cookies cannot be accessed.
|
||||
/// Visit a subset of cookies on the UI thread. The results are filtered by
|
||||
/// the given url scheme, host, domain and path. If |includeHttpOnly| is true
|
||||
/// (1) HTTP-only cookies will also be included in the results. The returned
|
||||
/// cookies are ordered by longest path, then by earliest creation date.
|
||||
/// Returns false (0) if cookies cannot be accessed.
|
||||
///
|
||||
int(CEF_CALLBACK* visit_url_cookies)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* url,
|
||||
@@ -82,13 +82,13 @@ typedef struct _cef_cookie_manager_t {
|
||||
struct _cef_cookie_visitor_t* visitor);
|
||||
|
||||
///
|
||||
// Sets a cookie given a valid URL and explicit user-provided cookie
|
||||
// attributes. This function expects each attribute to be well-formed. It will
|
||||
// check for disallowed characters (e.g. the ';' character is disallowed
|
||||
// within the cookie value attribute) and fail without setting the cookie if
|
||||
// such characters are found. If |callback| is non-NULL it will be executed
|
||||
// asnychronously on the UI thread after the cookie has been set. Returns
|
||||
// false (0) if an invalid URL is specified or if cookies cannot be accessed.
|
||||
/// Sets a cookie given a valid URL and explicit user-provided cookie
|
||||
/// attributes. This function expects each attribute to be well-formed. It
|
||||
/// will check for disallowed characters (e.g. the ';' character is disallowed
|
||||
/// within the cookie value attribute) and fail without setting the cookie if
|
||||
/// such characters are found. If |callback| is non-NULL it will be executed
|
||||
/// asnychronously on the UI thread after the cookie has been set. Returns
|
||||
/// false (0) if an invalid URL is specified or if cookies cannot be accessed.
|
||||
///
|
||||
int(CEF_CALLBACK* set_cookie)(struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* url,
|
||||
@@ -96,15 +96,15 @@ typedef struct _cef_cookie_manager_t {
|
||||
struct _cef_set_cookie_callback_t* callback);
|
||||
|
||||
///
|
||||
// Delete all cookies that match the specified parameters. If both |url| and
|
||||
// |cookie_name| values are specified all host and domain cookies matching
|
||||
// both will be deleted. If only |url| is specified all host cookies (but not
|
||||
// domain cookies) irrespective of path will be deleted. If |url| is NULL all
|
||||
// cookies for all hosts and domains will be deleted. If |callback| is non-
|
||||
// NULL it will be executed asnychronously on the UI thread after the cookies
|
||||
// have been deleted. Returns false (0) if a non-NULL invalid URL is specified
|
||||
// or if cookies cannot be accessed. Cookies can alternately be deleted using
|
||||
// the Visit*Cookies() functions.
|
||||
/// Delete all cookies that match the specified parameters. If both |url| and
|
||||
/// |cookie_name| values are specified all host and domain cookies matching
|
||||
/// both will be deleted. If only |url| is specified all host cookies (but not
|
||||
/// domain cookies) irrespective of path will be deleted. If |url| is NULL all
|
||||
/// cookies for all hosts and domains will be deleted. If |callback| is non-
|
||||
/// NULL it will be executed asnychronously on the UI thread after the cookies
|
||||
/// have been deleted. Returns false (0) if a non-NULL invalid URL is
|
||||
/// specified or if cookies cannot be accessed. Cookies can alternately be
|
||||
/// deleted using the Visit*Cookies() functions.
|
||||
///
|
||||
int(CEF_CALLBACK* delete_cookies)(
|
||||
struct _cef_cookie_manager_t* self,
|
||||
@@ -113,41 +113,41 @@ typedef struct _cef_cookie_manager_t {
|
||||
struct _cef_delete_cookies_callback_t* callback);
|
||||
|
||||
///
|
||||
// Flush the backing store (if any) to disk. If |callback| is non-NULL it will
|
||||
// be executed asnychronously on the UI thread after the flush is complete.
|
||||
// Returns false (0) if cookies cannot be accessed.
|
||||
/// Flush the backing store (if any) to disk. If |callback| is non-NULL it
|
||||
/// will be executed asnychronously on the UI thread after the flush is
|
||||
/// complete. Returns false (0) if cookies cannot be accessed.
|
||||
///
|
||||
int(CEF_CALLBACK* flush_store)(struct _cef_cookie_manager_t* self,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
} cef_cookie_manager_t;
|
||||
|
||||
///
|
||||
// Returns the global cookie manager. By default data will be stored at
|
||||
// CefSettings.cache_path if specified or in memory otherwise. If |callback| is
|
||||
// non-NULL it will be executed asnychronously on the UI thread after the
|
||||
// manager's storage has been initialized. Using this function is equivalent to
|
||||
// calling cef_request_context_t::cef_request_context_get_global_context()->GetD
|
||||
// efaultCookieManager().
|
||||
/// Returns the global cookie manager. By default data will be stored at
|
||||
/// cef_settings_t.cache_path if specified or in memory otherwise. If |callback|
|
||||
/// is non-NULL it will be executed asnychronously on the UI thread after the
|
||||
/// manager's storage has been initialized. Using this function is equivalent to
|
||||
/// calling cef_request_context_t::cef_request_context_get_global_context()->Get
|
||||
/// DefaultCookieManager().
|
||||
///
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Structure to implement for visiting cookie values. The functions of this
|
||||
// structure will always be called on the UI thread.
|
||||
/// Structure to implement for visiting cookie values. The functions of this
|
||||
/// structure will always be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_cookie_visitor_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Method that will be called once for each cookie. |count| is the 0-based
|
||||
// index for the current cookie. |total| is the total number of cookies. Set
|
||||
// |deleteCookie| to true (1) to delete the cookie currently being visited.
|
||||
// Return false (0) to stop visiting cookies. This function may never be
|
||||
// called if no cookies are found.
|
||||
/// Method that will be called once for each cookie. |count| is the 0-based
|
||||
/// index for the current cookie. |total| is the total number of cookies. Set
|
||||
/// |deleteCookie| to true (1) to delete the cookie currently being visited.
|
||||
/// Return false (0) to stop visiting cookies. This function may never be
|
||||
/// called if no cookies are found.
|
||||
///
|
||||
int(CEF_CALLBACK* visit)(struct _cef_cookie_visitor_t* self,
|
||||
const struct _cef_cookie_t* cookie,
|
||||
@@ -157,36 +157,36 @@ typedef struct _cef_cookie_visitor_t {
|
||||
} cef_cookie_visitor_t;
|
||||
|
||||
///
|
||||
// Structure to implement to be notified of asynchronous completion via
|
||||
// cef_cookie_manager_t::set_cookie().
|
||||
/// Structure to implement to be notified of asynchronous completion via
|
||||
/// cef_cookie_manager_t::set_cookie().
|
||||
///
|
||||
typedef struct _cef_set_cookie_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Method that will be called upon completion. |success| will be true (1) if
|
||||
// the cookie was set successfully.
|
||||
/// Method that will be called upon completion. |success| will be true (1) if
|
||||
/// the cookie was set successfully.
|
||||
///
|
||||
void(CEF_CALLBACK* on_complete)(struct _cef_set_cookie_callback_t* self,
|
||||
int success);
|
||||
} cef_set_cookie_callback_t;
|
||||
|
||||
///
|
||||
// Structure to implement to be notified of asynchronous completion via
|
||||
// cef_cookie_manager_t::delete_cookies().
|
||||
/// Structure to implement to be notified of asynchronous completion via
|
||||
/// cef_cookie_manager_t::delete_cookies().
|
||||
///
|
||||
typedef struct _cef_delete_cookies_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Method that will be called upon completion. |num_deleted| will be the
|
||||
// number of cookies that were deleted.
|
||||
/// Method that will be called upon completion. |num_deleted| will be the
|
||||
/// number of cookies that were deleted.
|
||||
///
|
||||
void(CEF_CALLBACK* on_complete)(struct _cef_delete_cookies_callback_t* self,
|
||||
int num_deleted);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5d111a67218403f78737f2c4dc92d2fd96dc125d$
|
||||
// $hash=1ce19c3213f033ca9059da738102b9b4292d4a06$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
|
||||
@@ -47,99 +47,102 @@ 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:
|
||||
//
|
||||
// A maximum of 26 crash keys of each size can be specified for use by the
|
||||
// application. Crash key values will be truncated based on the specified size
|
||||
// (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of
|
||||
// crash keys can be set from any thread or process using the
|
||||
// CefSetCrashKeyValue function. These key/value pairs will be sent to the crash
|
||||
// server along with the crash dump file.
|
||||
/// 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:
|
||||
///
|
||||
/// <pre>
|
||||
/// # Comments start with a hash character and must be on their own line.
|
||||
///
|
||||
/// [Config]
|
||||
/// ProductName=<Value of the "prod" crash key; defaults to "cef">
|
||||
/// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
|
||||
/// AppName=<Windows only; App-specific folder name component for storing crash
|
||||
/// information; default to "CEF">
|
||||
/// ExternalHandler=<Windows only; Name of the external handler exe to use
|
||||
/// instead of re-launching the main exe; default to empty>
|
||||
/// BrowserCrashForwardingEnabled=<macOS only; True if browser process crashes
|
||||
/// should be forwarded to the system crash
|
||||
/// reporter; default to false>
|
||||
/// ServerURL=<crash server URL; default to empty>
|
||||
/// RateLimitEnabled=<True if uploads should be rate limited; default to true>
|
||||
/// MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled;
|
||||
/// default to 5>
|
||||
/// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value
|
||||
/// will cause older reports to be deleted; default to 20>
|
||||
/// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted;
|
||||
/// default to 5>
|
||||
///
|
||||
/// [CrashKeys]
|
||||
/// my_key1=<small|medium|large>
|
||||
/// my_key2=<small|medium|large>
|
||||
/// </pre>
|
||||
///
|
||||
/// <b>Config section:</b>
|
||||
///
|
||||
/// If "ProductName" and/or "ProductVersion" are set then the specified values
|
||||
/// will be included in the crash dump metadata. On macOS if these values are
|
||||
/// set to NULL then they will be retrieved from the Info.plist file using the
|
||||
/// "CFBundleName" and "CFBundleShortVersionString" keys respectively.
|
||||
///
|
||||
/// If "AppName" is set on Windows then crash report information (metrics,
|
||||
/// database and dumps) will be stored locally on disk under the
|
||||
/// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other
|
||||
/// platforms the cef_settings_t.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 cef_settings_t.browser_subprocess_path value will be
|
||||
/// used. On macOS the existing subprocess app bundle will be used.
|
||||
///
|
||||
/// If "BrowserCrashForwardingEnabled" is set to true (1) on macOS then browser
|
||||
/// process crashes will be forwarded to the system crash reporter. This results
|
||||
/// in the crash UI dialog being displayed to the user and crash reports being
|
||||
/// logged under "~/Library/Logs/DiagnosticReports". Forwarding of crash reports
|
||||
/// from non-browser processes and Debug builds is always disabled.
|
||||
///
|
||||
/// If "ServerURL" is set then crashes will be uploaded as a multi-part POST
|
||||
/// request to the specified URL. Otherwise, reports will only be stored locally
|
||||
/// on disk.
|
||||
///
|
||||
/// If "RateLimitEnabled" is set to true (1) then crash report uploads will be
|
||||
/// rate limited as follows:
|
||||
/// 1. If "MaxUploadsPerDay" is set to a positive value then at most the
|
||||
/// specified number of crashes will be uploaded in each 24 hour period.
|
||||
/// 2. If crash upload fails due to a network or server error then an
|
||||
/// incremental backoff delay up to a maximum of 24 hours will be applied
|
||||
/// for retries.
|
||||
/// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the
|
||||
/// "MaxUploadsPerDay" value will be reduced to 1 until the client is
|
||||
/// restarted. This helps to avoid an upload flood when the network or
|
||||
/// server error is resolved.
|
||||
/// Rate limiting is not supported on Linux.
|
||||
///
|
||||
/// If "MaxDatabaseSizeInMb" is set to a positive value then crash report
|
||||
/// storage on disk will be limited to that size in megabytes. For example, on
|
||||
/// Windows each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20
|
||||
/// equates to about 34 crash reports stored on disk. Not supported on Linux.
|
||||
///
|
||||
/// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports
|
||||
/// older than the specified age in days will be deleted. Not supported on
|
||||
/// Linux.
|
||||
///
|
||||
/// <b>CrashKeys section:</b>
|
||||
///
|
||||
/// A maximum of 26 crash keys of each size can be specified for use by the
|
||||
/// application. Crash key values will be truncated based on the specified size
|
||||
/// (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of
|
||||
/// crash keys can be set from any thread or process using the
|
||||
/// CefSetCrashKeyValue function. These key/value pairs will be sent to the
|
||||
/// crash server along with the crash dump file.
|
||||
///
|
||||
CEF_EXPORT int cef_crash_reporting_enabled(void);
|
||||
|
||||
///
|
||||
// Sets or clears a specific key-value pair from the crash metadata.
|
||||
/// Sets or clears a specific key-value pair from the crash metadata.
|
||||
///
|
||||
CEF_EXPORT void cef_set_crash_key_value(const cef_string_t* key,
|
||||
const cef_string_t* value);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ec62239c2b24ff512b64ca758be825ff57fb3b6b$
|
||||
// $hash=076a01db2fc4241efeb46c5f247a9737fd828f9b$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_
|
||||
@@ -49,35 +49,36 @@ extern "C" {
|
||||
struct _cef_browser_t;
|
||||
|
||||
///
|
||||
// Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The
|
||||
// functions of this structure will be called on the browser process UI thread.
|
||||
/// Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The
|
||||
/// functions of this structure will be called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_dev_tools_message_observer_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Method that will be called on receipt of a DevTools protocol message.
|
||||
// |browser| is the originating browser instance. |message| is a UTF8-encoded
|
||||
// JSON dictionary representing either a function result or an event.
|
||||
// |message| is only valid for the scope of this callback and should be copied
|
||||
// if necessary. Return true (1) if the message was handled or false (0) if
|
||||
// the message should be further processed and passed to the
|
||||
// OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate.
|
||||
//
|
||||
// Method result dictionaries include an "id" (int) value that identifies the
|
||||
// orginating function call sent from cef_browser_host_t::SendDevToolsMessage,
|
||||
// and optionally either a "result" (dictionary) or "error" (dictionary)
|
||||
// value. The "error" dictionary will contain "code" (int) and "message"
|
||||
// (string) values. Event dictionaries include a "function" (string) value and
|
||||
// optionally a "params" (dictionary) value. See the DevTools protocol
|
||||
// documentation at https://chromedevtools.github.io/devtools-protocol/ for
|
||||
// details of supported function calls and the expected "result" or "params"
|
||||
// dictionary contents. JSON dictionaries can be parsed using the CefParseJSON
|
||||
// function if desired, however be aware of performance considerations when
|
||||
// parsing large messages (some of which may exceed 1MB in size).
|
||||
/// Method that will be called on receipt of a DevTools protocol message.
|
||||
/// |browser| is the originating browser instance. |message| is a UTF8-encoded
|
||||
/// JSON dictionary representing either a function result or an event.
|
||||
/// |message| is only valid for the scope of this callback and should be
|
||||
/// copied if necessary. Return true (1) if the message was handled or false
|
||||
/// (0) if the message should be further processed and passed to the
|
||||
/// OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate.
|
||||
///
|
||||
/// Method result dictionaries include an "id" (int) value that identifies the
|
||||
/// orginating function call sent from
|
||||
/// cef_browser_host_t::SendDevToolsMessage, and optionally either a "result"
|
||||
/// (dictionary) or "error" (dictionary) value. The "error" dictionary will
|
||||
/// contain "code" (int) and "message" (string) values. Event dictionaries
|
||||
/// include a "function" (string) value and optionally a "params" (dictionary)
|
||||
/// value. See the DevTools protocol documentation at
|
||||
/// https://chromedevtools.github.io/devtools-protocol/ for details of
|
||||
/// supported function calls and the expected "result" or "params" dictionary
|
||||
/// contents. JSON dictionaries can be parsed using the CefParseJSON function
|
||||
/// if desired, however be aware of performance considerations when parsing
|
||||
/// large messages (some of which may exceed 1MB in size).
|
||||
///
|
||||
int(CEF_CALLBACK* on_dev_tools_message)(
|
||||
struct _cef_dev_tools_message_observer_t* self,
|
||||
@@ -86,16 +87,16 @@ typedef struct _cef_dev_tools_message_observer_t {
|
||||
size_t message_size);
|
||||
|
||||
///
|
||||
// Method that will be called after attempted execution of a DevTools protocol
|
||||
// function. |browser| is the originating browser instance. |message_id| is
|
||||
// the "id" value that identifies the originating function call message. If
|
||||
// the function succeeded |success| will be true (1) and |result| will be the
|
||||
// UTF8-encoded JSON "result" dictionary value (which may be NULL). If the
|
||||
// function failed |success| will be false (0) and |result| will be the
|
||||
// UTF8-encoded JSON "error" dictionary value. |result| is only valid for the
|
||||
// scope of this callback and should be copied if necessary. See the
|
||||
// OnDevToolsMessage documentation for additional details on |result|
|
||||
// contents.
|
||||
/// Method that will be called after attempted execution of a DevTools
|
||||
/// protocol function. |browser| is the originating browser instance.
|
||||
/// |message_id| is the "id" value that identifies the originating function
|
||||
/// call message. If the function succeeded |success| will be true (1) and
|
||||
/// |result| will be the UTF8-encoded JSON "result" dictionary value (which
|
||||
/// may be NULL). If the function failed |success| will be false (0) and
|
||||
/// |result| will be the UTF8-encoded JSON "error" dictionary value. |result|
|
||||
/// is only valid for the scope of this callback and should be copied if
|
||||
/// necessary. See the OnDevToolsMessage documentation for additional details
|
||||
/// on |result| contents.
|
||||
///
|
||||
void(CEF_CALLBACK* on_dev_tools_method_result)(
|
||||
struct _cef_dev_tools_message_observer_t* self,
|
||||
@@ -106,12 +107,12 @@ typedef struct _cef_dev_tools_message_observer_t {
|
||||
size_t result_size);
|
||||
|
||||
///
|
||||
// Method that will be called on receipt of a DevTools protocol event.
|
||||
// |browser| is the originating browser instance. |function| is the "function"
|
||||
// value. |params| is the UTF8-encoded JSON "params" dictionary value (which
|
||||
// may be NULL). |params| is only valid for the scope of this callback and
|
||||
// should be copied if necessary. See the OnDevToolsMessage documentation for
|
||||
// additional details on |params| contents.
|
||||
/// Method that will be called on receipt of a DevTools protocol event.
|
||||
/// |browser| is the originating browser instance. |function| is the
|
||||
/// "function" value. |params| is the UTF8-encoded JSON "params" dictionary
|
||||
/// value (which may be NULL). |params| is only valid for the scope of this
|
||||
/// callback and should be copied if necessary. See the OnDevToolsMessage
|
||||
/// documentation for additional details on |params| contents.
|
||||
///
|
||||
void(CEF_CALLBACK* on_dev_tools_event)(
|
||||
struct _cef_dev_tools_message_observer_t* self,
|
||||
@@ -121,19 +122,19 @@ typedef struct _cef_dev_tools_message_observer_t {
|
||||
size_t params_size);
|
||||
|
||||
///
|
||||
// Method that will be called when the DevTools agent has attached. |browser|
|
||||
// is the originating browser instance. This will generally occur in response
|
||||
// to the first message sent while the agent is detached.
|
||||
/// Method that will be called when the DevTools agent has attached. |browser|
|
||||
/// is the originating browser instance. This will generally occur in response
|
||||
/// to the first message sent while the agent is detached.
|
||||
///
|
||||
void(CEF_CALLBACK* on_dev_tools_agent_attached)(
|
||||
struct _cef_dev_tools_message_observer_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Method that will be called when the DevTools agent has detached. |browser|
|
||||
// is the originating browser instance. Any function results that were pending
|
||||
// before the agent became detached will not be delivered, and any active
|
||||
// event subscriptions will be canceled.
|
||||
/// Method that will be called when the DevTools agent has detached. |browser|
|
||||
/// is the originating browser instance. Any function results that were
|
||||
/// pending before the agent became detached will not be delivered, and any
|
||||
/// active event subscriptions will be canceled.
|
||||
///
|
||||
void(CEF_CALLBACK* on_dev_tools_agent_detached)(
|
||||
struct _cef_dev_tools_message_observer_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=dc579beb1f25f9bbdb72afb4b5b381e129f84e31$
|
||||
// $hash=3a1a3ac84690c6090d356ddec3ddb49b934fe28c$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
|
||||
@@ -48,51 +48,51 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Callback structure for asynchronous continuation of file dialog requests.
|
||||
/// Callback structure for asynchronous continuation of file dialog requests.
|
||||
///
|
||||
typedef struct _cef_file_dialog_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Continue the file selection. |file_paths| should be a single value or a
|
||||
// list of values depending on the dialog mode. An NULL |file_paths| value is
|
||||
// treated the same as calling cancel().
|
||||
/// Continue the file selection. |file_paths| should be a single value or a
|
||||
/// list of values depending on the dialog mode. An NULL |file_paths| value is
|
||||
/// treated the same as calling cancel().
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_file_dialog_callback_t* self,
|
||||
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);
|
||||
} cef_file_dialog_callback_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle dialog events. The functions of this
|
||||
// structure will be called on the browser process UI thread.
|
||||
/// Implement this structure to handle dialog events. The functions of this
|
||||
/// structure will be called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_dialog_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called to run a file chooser dialog. |mode| represents the type of dialog
|
||||
// to display. |title| to the title to be used for the dialog and may be NULL
|
||||
// to show the default title ("Open" or "Save" depending on the mode).
|
||||
// |default_file_path| is the path with optional directory and/or file name
|
||||
// component that should be initially selected in the dialog. |accept_filters|
|
||||
// are used to restrict the selectable file types and may any combination of
|
||||
// (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b)
|
||||
// individual file extensions (e.g. ".txt" or ".png"), or (c) combined
|
||||
// description and file extension delimited using "|" and ";" (e.g. "Image
|
||||
// Types|.png;.gif;.jpg"). To display a custom dialog return true (1) and
|
||||
// execute |callback| either inline or at a later time. To display the default
|
||||
// dialog return false (0).
|
||||
/// Called to run a file chooser dialog. |mode| represents the type of dialog
|
||||
/// to display. |title| to the title to be used for the dialog and may be NULL
|
||||
/// to show the default title ("Open" or "Save" depending on the mode).
|
||||
/// |default_file_path| is the path with optional directory and/or file name
|
||||
/// component that should be initially selected in the dialog.
|
||||
/// |accept_filters| are used to restrict the selectable file types and may
|
||||
/// any combination of (a) valid lower-cased MIME types (e.g. "text/*" or
|
||||
/// "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c)
|
||||
/// combined description and file extension delimited using "|" and ";" (e.g.
|
||||
/// "Image Types|.png;.gif;.jpg"). To display a custom dialog return true (1)
|
||||
/// and execute |callback| either inline or at a later time. To display the
|
||||
/// default dialog return false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* on_file_dialog)(
|
||||
struct _cef_dialog_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=adb78c1968bb0634d6255e1b5e49b56211da4fa8$
|
||||
// $hash=976a61df924efbcb0c53afeb75265e5e9e80c2de$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||
@@ -49,17 +49,17 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser display state.
|
||||
// The functions of this structure will be called on the UI thread.
|
||||
/// Implement this structure to handle events related to browser display state.
|
||||
/// The functions of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_display_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -67,25 +67,25 @@ typedef struct _cef_display_handler_t {
|
||||
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,
|
||||
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,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_string_list_t icon_urls);
|
||||
|
||||
///
|
||||
// Called when web content in the page has toggled fullscreen mode. If
|
||||
// |fullscreen| is true (1) the content will automatically be sized to fill
|
||||
// the browser content area. If |fullscreen| is false (0) the content will
|
||||
// automatically return to its original size and position. The client is
|
||||
// responsible for resizing the browser if desired.
|
||||
/// Called when web content in the page has toggled fullscreen mode. If
|
||||
/// |fullscreen| is true (1) the content will automatically be sized to fill
|
||||
/// the browser content area. If |fullscreen| is false (0) the content will
|
||||
/// automatically return to its original size and position. The client is
|
||||
/// responsible for resizing the browser if desired.
|
||||
///
|
||||
void(CEF_CALLBACK* on_fullscreen_mode_change)(
|
||||
struct _cef_display_handler_t* self,
|
||||
@@ -93,28 +93,28 @@ typedef struct _cef_display_handler_t {
|
||||
int fullscreen);
|
||||
|
||||
///
|
||||
// Called when the browser is about to display a tooltip. |text| contains the
|
||||
// text that will be displayed in the tooltip. To handle the display of the
|
||||
// tooltip yourself return true (1). Otherwise, you can optionally modify
|
||||
// |text| and then return false (0) to allow the browser to display the
|
||||
// tooltip. When window rendering is disabled the application is responsible
|
||||
// for drawing tooltips and the return value is ignored.
|
||||
/// Called when the browser is about to display a tooltip. |text| contains the
|
||||
/// text that will be displayed in the tooltip. To handle the display of the
|
||||
/// tooltip yourself return true (1). Otherwise, you can optionally modify
|
||||
/// |text| and then return false (0) to allow the browser to display the
|
||||
/// tooltip. When window rendering is disabled the application is responsible
|
||||
/// for drawing tooltips and the return value is ignored.
|
||||
///
|
||||
int(CEF_CALLBACK* on_tooltip)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_string_t* text);
|
||||
|
||||
///
|
||||
// Called when the browser receives a status message. |value| contains the
|
||||
// text that will be displayed in the status message.
|
||||
/// Called when the browser receives a status message. |value| contains the
|
||||
/// text that will be displayed in the status message.
|
||||
///
|
||||
void(CEF_CALLBACK* on_status_message)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
// Called to display a console message. Return true (1) to stop the message
|
||||
// from being output to the console.
|
||||
/// Called to display a console message. Return true (1) to stop the message
|
||||
/// from being output to the console.
|
||||
///
|
||||
int(CEF_CALLBACK* on_console_message)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -124,18 +124,18 @@ typedef struct _cef_display_handler_t {
|
||||
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.
|
||||
/// Called when auto-resize is enabled via
|
||||
/// cef_browser_host_t::SetAutoResizeEnabled and the contents have auto-
|
||||
/// resized. |new_size| will be the desired size in view coordinates. Return
|
||||
/// true (1) if the resize was handled or false (0) for default handling.
|
||||
///
|
||||
int(CEF_CALLBACK* on_auto_resize)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_size_t* new_size);
|
||||
|
||||
///
|
||||
// Called when the overall page loading progress has changed. |progress|
|
||||
// ranges from 0.0 to 1.0.
|
||||
/// Called when the overall page loading progress has changed. |progress|
|
||||
/// ranges from 0.0 to 1.0.
|
||||
///
|
||||
void(CEF_CALLBACK* on_loading_progress_change)(
|
||||
struct _cef_display_handler_t* self,
|
||||
@@ -143,10 +143,10 @@ typedef struct _cef_display_handler_t {
|
||||
double progress);
|
||||
|
||||
///
|
||||
// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
|
||||
// |custom_cursor_info| will be populated with the custom cursor information.
|
||||
// Return true (1) if the cursor change was handled or false (0) for default
|
||||
// handling.
|
||||
/// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
|
||||
/// |custom_cursor_info| will be populated with the custom cursor information.
|
||||
/// Return true (1) if the cursor change was handled or false (0) for default
|
||||
/// handling.
|
||||
///
|
||||
int(CEF_CALLBACK* on_cursor_change)(
|
||||
struct _cef_display_handler_t* self,
|
||||
@@ -156,8 +156,8 @@ typedef struct _cef_display_handler_t {
|
||||
const cef_cursor_info_t* custom_cursor_info);
|
||||
|
||||
///
|
||||
// Called when the browser's access to an audio and/or video source has
|
||||
// changed.
|
||||
/// Called when the browser's access to an audio and/or video source has
|
||||
/// changed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_media_access_change)(
|
||||
struct _cef_display_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ddff4ad975fc26d0abfe05799aedb597b8274ffd$
|
||||
// $hash=47d8c186f687b65c8e7f394b97d72530e67593cd$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
|
||||
@@ -50,120 +50,120 @@ struct _cef_domdocument_t;
|
||||
struct _cef_domnode_t;
|
||||
|
||||
///
|
||||
// Structure to implement for visiting the DOM. The functions of this structure
|
||||
// will be called on the render process main thread.
|
||||
/// Structure to implement for visiting the DOM. The functions of this structure
|
||||
/// will be called on the render process main thread.
|
||||
///
|
||||
typedef struct _cef_domvisitor_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Method executed for visiting the DOM. The document object passed to this
|
||||
// function represents a snapshot of the DOM at the time this function is
|
||||
// executed. DOM objects are only valid for the scope of this function. Do not
|
||||
// keep references to or attempt to access any DOM objects outside the scope
|
||||
// of this function.
|
||||
/// Method executed for visiting the DOM. The document object passed to this
|
||||
/// function represents a snapshot of the DOM at the time this function is
|
||||
/// executed. DOM objects are only valid for the scope of this function. Do
|
||||
/// not keep references to or attempt to access any DOM objects outside the
|
||||
/// scope of this function.
|
||||
///
|
||||
void(CEF_CALLBACK* visit)(struct _cef_domvisitor_t* self,
|
||||
struct _cef_domdocument_t* document);
|
||||
} cef_domvisitor_t;
|
||||
|
||||
///
|
||||
// Structure used to represent a DOM document. The functions of this structure
|
||||
// should only be called on the render process main thread thread.
|
||||
/// Structure used to represent a DOM document. The functions of this structure
|
||||
/// should only be called on the render process main thread thread.
|
||||
///
|
||||
typedef struct _cef_domdocument_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns the document type.
|
||||
/// Returns the document type.
|
||||
///
|
||||
cef_dom_document_type_t(CEF_CALLBACK* get_type)(
|
||||
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_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_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_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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_title)(
|
||||
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_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_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);
|
||||
|
||||
///
|
||||
// Returns the selection offset within the start node.
|
||||
/// Returns the selection offset within the start node.
|
||||
///
|
||||
int(CEF_CALLBACK* get_selection_start_offset)(
|
||||
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);
|
||||
|
||||
///
|
||||
// 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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_selection_as_markup)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_selection_as_text)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_base_url)(
|
||||
struct _cef_domdocument_t* self);
|
||||
|
||||
///
|
||||
// Returns a complete URL based on the document base URL and the specified
|
||||
// partial URL.
|
||||
/// Returns a complete URL based on the document base URL and the specified
|
||||
/// partial URL.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_complete_url)(
|
||||
@@ -172,141 +172,139 @@ typedef struct _cef_domdocument_t {
|
||||
} cef_domdocument_t;
|
||||
|
||||
///
|
||||
// Structure used to represent a DOM node. The functions of this structure
|
||||
// should only be called on the render process main thread.
|
||||
/// Structure used to represent a DOM node. The functions of this structure
|
||||
/// should only be called on the render process main thread.
|
||||
///
|
||||
typedef struct _cef_domnode_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_form_control_element_type)(
|
||||
struct _cef_domnode_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is pointing to the same handle as |that|
|
||||
// object.
|
||||
/// Returns true (1) if this object is pointing to the same handle as |that|
|
||||
/// object.
|
||||
///
|
||||
int(CEF_CALLBACK* is_same)(struct _cef_domnode_t* self,
|
||||
struct _cef_domnode_t* that);
|
||||
|
||||
///
|
||||
// Returns the name of this node.
|
||||
/// Returns the name of this node.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_domnode_t* self);
|
||||
|
||||
///
|
||||
// Returns the value of this node.
|
||||
/// Returns the value of this node.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_value)(struct _cef_domnode_t* self);
|
||||
|
||||
///
|
||||
// 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,
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_as_markup)(
|
||||
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_domnode_t* self);
|
||||
|
||||
///
|
||||
// Returns the parent node.
|
||||
/// Returns the parent node.
|
||||
///
|
||||
struct _cef_domnode_t*(CEF_CALLBACK* get_parent)(struct _cef_domnode_t* self);
|
||||
|
||||
///
|
||||
// Returns the previous sibling node.
|
||||
/// Returns the previous sibling node.
|
||||
///
|
||||
struct _cef_domnode_t*(CEF_CALLBACK* get_previous_sibling)(
|
||||
struct _cef_domnode_t* self);
|
||||
|
||||
///
|
||||
// Returns the next sibling node.
|
||||
/// Returns the next sibling node.
|
||||
///
|
||||
struct _cef_domnode_t*(CEF_CALLBACK* get_next_sibling)(
|
||||
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);
|
||||
|
||||
///
|
||||
// Return the first child node.
|
||||
/// Return the first child node.
|
||||
///
|
||||
struct _cef_domnode_t*(CEF_CALLBACK* get_first_child)(
|
||||
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* self);
|
||||
|
||||
// The following functions are valid only for element nodes.
|
||||
|
||||
///
|
||||
// Returns the tag name of this element.
|
||||
/// Returns the tag name of this element.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_element_tag_name)(
|
||||
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);
|
||||
|
||||
///
|
||||
// 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,
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_element_attribute)(
|
||||
@@ -314,29 +312,29 @@ typedef struct _cef_domnode_t {
|
||||
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,
|
||||
cef_string_map_t attrMap);
|
||||
|
||||
///
|
||||
// Set the value for the element attribute named |attrName|. Returns true (1)
|
||||
// on success.
|
||||
/// Set the value for the element attribute named |attrName|. Returns true (1)
|
||||
/// on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_element_attribute)(struct _cef_domnode_t* self,
|
||||
const cef_string_t* attrName,
|
||||
const cef_string_t* value);
|
||||
|
||||
///
|
||||
// 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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_element_inner_text)(
|
||||
struct _cef_domnode_t* self);
|
||||
|
||||
///
|
||||
// Returns the bounds of the element in device pixels. Use
|
||||
// "window.devicePixelRatio" to convert to/from CSS pixels.
|
||||
/// Returns the bounds of the element in device pixels. Use
|
||||
/// "window.devicePixelRatio" to convert to/from CSS pixels.
|
||||
///
|
||||
cef_rect_t(CEF_CALLBACK* get_element_bounds)(struct _cef_domnode_t* self);
|
||||
} cef_domnode_t;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=33862915eb4156a70794a346a090154c468763e2$
|
||||
// $hash=aff139899b4b8b769fd0e506d8a46e434f924eee$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
|
||||
@@ -49,19 +49,19 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Callback structure used to asynchronously continue a download.
|
||||
/// Callback structure used to asynchronously continue a download.
|
||||
///
|
||||
typedef struct _cef_before_download_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Call to continue the download. Set |download_path| to the full file path
|
||||
// for the download including the file name or leave blank to use the
|
||||
// suggested name and the default temp directory. Set |show_dialog| to true
|
||||
// (1) if you do wish to show the default "Save As" dialog.
|
||||
/// Call to continue the download. Set |download_path| to the full file path
|
||||
/// for the download including the file name or leave blank to use the
|
||||
/// suggested name and the default temp directory. Set |show_dialog| to true
|
||||
/// (1) if you do wish to show the default "Save As" dialog.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_before_download_callback_t* self,
|
||||
const cef_string_t* download_path,
|
||||
@@ -69,46 +69,46 @@ typedef struct _cef_before_download_callback_t {
|
||||
} cef_before_download_callback_t;
|
||||
|
||||
///
|
||||
// Callback structure used to asynchronously cancel a download.
|
||||
/// Callback structure used to asynchronously cancel a download.
|
||||
///
|
||||
typedef struct _cef_download_item_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Call to pause the download.
|
||||
/// Call to pause the download.
|
||||
///
|
||||
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);
|
||||
} cef_download_item_callback_t;
|
||||
|
||||
///
|
||||
// Structure used to handle file downloads. The functions of this structure will
|
||||
// called on the browser process UI thread.
|
||||
/// Structure used to handle file downloads. The functions of this structure
|
||||
/// will called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_download_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called before a download begins in response to a user-initiated action
|
||||
// (e.g. alt + link click or link click that returns a `Content-Disposition:
|
||||
// attachment` response from the server). |url| is the target download URL and
|
||||
// |request_function| is the target function (GET, POST, etc). Return true (1)
|
||||
// to proceed with the download or false (0) to cancel the download.
|
||||
/// Called before a download begins in response to a user-initiated action
|
||||
/// (e.g. alt + link click or link click that returns a `Content-Disposition:
|
||||
/// attachment` response from the server). |url| is the target download URL
|
||||
/// and |request_function| is the target function (GET, POST, etc). Return
|
||||
/// true (1) to proceed with the download or false (0) to cancel the download.
|
||||
///
|
||||
int(CEF_CALLBACK* can_download)(struct _cef_download_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -116,11 +116,11 @@ typedef struct _cef_download_handler_t {
|
||||
const cef_string_t* request_method);
|
||||
|
||||
///
|
||||
// Called before a download begins. |suggested_name| is the suggested name for
|
||||
// the download file. By default the download will be canceled. Execute
|
||||
// |callback| either asynchronously or in this function to continue the
|
||||
// download if desired. Do not keep a reference to |download_item| outside of
|
||||
// this function.
|
||||
/// Called before a download begins. |suggested_name| is the suggested name
|
||||
/// for the download file. By default the download will be canceled. Execute
|
||||
/// |callback| either asynchronously or in this function to continue the
|
||||
/// download if desired. Do not keep a reference to |download_item| outside of
|
||||
/// this function.
|
||||
///
|
||||
void(CEF_CALLBACK* on_before_download)(
|
||||
struct _cef_download_handler_t* self,
|
||||
@@ -130,11 +130,11 @@ typedef struct _cef_download_handler_t {
|
||||
struct _cef_before_download_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called when a download's status or progress information has been updated.
|
||||
// This may be called multiple times before and after on_before_download().
|
||||
// Execute |callback| either asynchronously or in this function to cancel the
|
||||
// download if desired. Do not keep a reference to |download_item| outside of
|
||||
// this function.
|
||||
/// Called when a download's status or progress information has been updated.
|
||||
/// This may be called multiple times before and after on_before_download().
|
||||
/// Execute |callback| either asynchronously or in this function to cancel the
|
||||
/// download if desired. Do not keep a reference to |download_item| outside of
|
||||
/// this function.
|
||||
///
|
||||
void(CEF_CALLBACK* on_download_updated)(
|
||||
struct _cef_download_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1c1dd82539e356f15be95b66d824740075c48e4f$
|
||||
// $hash=a218058d7ceb842c9ea0cf0c252f9787de6562e7$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
|
||||
@@ -47,109 +47,109 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure used to represent a download item.
|
||||
/// Structure used to represent a download item.
|
||||
///
|
||||
typedef struct _cef_download_item_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
||||
/// if this function returns false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* is_valid)(struct _cef_download_item_t* self);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// Returns the rough percent complete or -1 if the receive total size is
|
||||
// unknown.
|
||||
/// Returns the rough percent complete or -1 if the receive total size is
|
||||
/// unknown.
|
||||
///
|
||||
int(CEF_CALLBACK* get_percent_complete)(struct _cef_download_item_t* self);
|
||||
|
||||
///
|
||||
// Returns the total number of bytes.
|
||||
/// Returns the total number of bytes.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Returns the time that the download started.
|
||||
/// Returns the time that the download started.
|
||||
///
|
||||
cef_basetime_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_basetime_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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_full_path)(
|
||||
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);
|
||||
|
||||
///
|
||||
// Returns the URL.
|
||||
/// Returns the URL.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_url)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_original_url)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_suggested_file_name)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_content_disposition)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_mime_type)(
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=c99e9efb74fea2a2a99b25a694c59256f59238ab$
|
||||
// $hash=9e8375de3d30eb7e4f67488da3568d19848eb038$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
|
||||
@@ -49,180 +49,180 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure used to represent drag data. The functions of this structure may be
|
||||
// called on any thread.
|
||||
/// Structure used to represent drag data. The functions of this structure may
|
||||
/// be called on any thread.
|
||||
///
|
||||
typedef struct _cef_drag_data_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_link_url)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_link_title)(
|
||||
struct _cef_drag_data_t* self);
|
||||
|
||||
///
|
||||
// Return the metadata, if any, associated with the link being dragged.
|
||||
/// Return the metadata, if any, associated with the link being dragged.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_link_metadata)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_fragment_text)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_fragment_html)(
|
||||
struct _cef_drag_data_t* self);
|
||||
|
||||
///
|
||||
// Return the base URL that the fragment came from. This value is used for
|
||||
// resolving relative URLs and may be NULL.
|
||||
/// Return the base URL that the fragment came from. This value is used for
|
||||
/// resolving relative URLs and may be NULL.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_fragment_base_url)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_file_name)(
|
||||
struct _cef_drag_data_t* self);
|
||||
|
||||
///
|
||||
// Write the contents of the file being dragged out of the web view into
|
||||
// |writer|. Returns the number of bytes sent to |writer|. If |writer| is NULL
|
||||
// this function will return the size of the file contents in bytes. Call
|
||||
// get_file_name() to get a suggested name for the file.
|
||||
/// Write the contents of the file being dragged out of the web view into
|
||||
/// |writer|. Returns the number of bytes sent to |writer|. If |writer| is
|
||||
/// NULL this function will return the size of the file contents in bytes.
|
||||
/// Call get_file_name() to get a suggested name for the file.
|
||||
///
|
||||
size_t(CEF_CALLBACK* get_file_contents)(struct _cef_drag_data_t* self,
|
||||
struct _cef_stream_writer_t* writer);
|
||||
|
||||
///
|
||||
// Retrieve the list of file names that are being dragged into the browser
|
||||
// window.
|
||||
/// Retrieve the list of file names that are being dragged into the browser
|
||||
/// window.
|
||||
///
|
||||
int(CEF_CALLBACK* get_file_names)(struct _cef_drag_data_t* self,
|
||||
cef_string_list_t names);
|
||||
|
||||
///
|
||||
// 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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
const cef_string_t* base_url);
|
||||
|
||||
///
|
||||
// Reset the file contents. You should do this before calling
|
||||
// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
|
||||
// to drag in this kind of data.
|
||||
/// Reset the file contents. You should do this before calling
|
||||
/// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
|
||||
/// to drag in this kind of data.
|
||||
///
|
||||
void(CEF_CALLBACK* reset_file_contents)(struct _cef_drag_data_t* self);
|
||||
|
||||
///
|
||||
// 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,
|
||||
const cef_string_t* path,
|
||||
const cef_string_t* display_name);
|
||||
|
||||
///
|
||||
// Clear list of filenames.
|
||||
/// Clear list of filenames.
|
||||
///
|
||||
void(CEF_CALLBACK* clear_filenames)(struct _cef_drag_data_t* self);
|
||||
|
||||
///
|
||||
// Get the image representation of drag data. May return NULL if no image
|
||||
// representation is available.
|
||||
/// 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).
|
||||
/// 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.
|
||||
/// 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(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5b2051c42c1d4c41b85ca823d34b26bfa5de6777$
|
||||
// $hash=ec450acb2c3cc4d0e69b7da725387d5c1049773b$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
|
||||
@@ -50,20 +50,20 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to dragging. The functions
|
||||
// of this structure will be called on the UI thread.
|
||||
/// Implement this structure to handle events related to dragging. The functions
|
||||
/// of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_drag_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called when an external drag event enters the browser window. |dragData|
|
||||
// contains the drag event data and |mask| represents the type of drag
|
||||
// operation. Return false (0) for default drag handling behavior or true (1)
|
||||
// to cancel the drag event.
|
||||
/// Called when an external drag event enters the browser window. |dragData|
|
||||
/// contains the drag event data and |mask| represents the type of drag
|
||||
/// operation. Return false (0) for default drag handling behavior or true (1)
|
||||
/// to cancel the drag event.
|
||||
///
|
||||
int(CEF_CALLBACK* on_drag_enter)(struct _cef_drag_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -71,11 +71,11 @@ typedef struct _cef_drag_handler_t {
|
||||
cef_drag_operations_mask_t mask);
|
||||
|
||||
///
|
||||
// Called whenever draggable regions for the browser window change. These can
|
||||
// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
|
||||
// draggable regions are never defined in a document this function will also
|
||||
// never be called. If the last draggable region is removed from a document
|
||||
// this function will be called with an NULL vector.
|
||||
/// Called whenever draggable regions for the browser window change. These can
|
||||
/// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
|
||||
/// draggable regions are never defined in a document this function will also
|
||||
/// never be called. If the last draggable region is removed from a document
|
||||
/// this function will be called with an NULL vector.
|
||||
///
|
||||
void(CEF_CALLBACK* on_draggable_regions_changed)(
|
||||
struct _cef_drag_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=fcfe34c1517ebdb3f00c1f737b91361e771b820d$
|
||||
// $hash=b16b1c47d26e911d360159e5535743622a411c31$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
|
||||
@@ -51,74 +51,74 @@ struct _cef_extension_handler_t;
|
||||
struct _cef_request_context_t;
|
||||
|
||||
///
|
||||
// Object representing an extension. Methods may be called on any thread unless
|
||||
// otherwise indicated.
|
||||
/// Object representing an extension. Methods may be called on any thread unless
|
||||
/// otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_extension_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// 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.
|
||||
/// Returns the unique extension identifier. This is calculated based on the
|
||||
/// extension public key, if available, or on the extension path. See
|
||||
/// https://developer.chrome.com/extensions/manifest/key for details.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
|
||||
struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Returns the absolute path to the extension directory on disk. This value
|
||||
// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to
|
||||
// cef_request_context_t::LoadExtension.
|
||||
/// Returns the absolute path to the extension directory on disk. This value
|
||||
/// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to
|
||||
/// cef_request_context_t::LoadExtension.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_path)(struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Returns the extension manifest contents as a cef_dictionary_value_t object.
|
||||
// See https://developer.chrome.com/extensions/manifest for details.
|
||||
/// 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.
|
||||
/// Returns true (1) if this object is the same extension as |that| object.
|
||||
/// Extensions are considered the same if identifier, path and loader context
|
||||
/// match.
|
||||
///
|
||||
int(CEF_CALLBACK* is_same)(struct _cef_extension_t* self,
|
||||
struct _cef_extension_t* that);
|
||||
|
||||
///
|
||||
// Returns the handler for this extension. Will return NULL for internal
|
||||
// extensions or if no handler was passed to
|
||||
// cef_request_context_t::LoadExtension.
|
||||
/// Returns the handler for this extension. Will return NULL for internal
|
||||
/// extensions or if no handler was passed to
|
||||
/// cef_request_context_t::LoadExtension.
|
||||
///
|
||||
struct _cef_extension_handler_t*(CEF_CALLBACK* get_handler)(
|
||||
struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Returns the request context that loaded this extension. Will return NULL
|
||||
// for internal extensions or if the extension has been unloaded. See the
|
||||
// cef_request_context_t::LoadExtension documentation for more information
|
||||
// about loader contexts. Must be called on the browser process UI thread.
|
||||
/// Returns the request context that loaded this extension. Will return NULL
|
||||
/// for internal extensions or if the extension has been unloaded. See the
|
||||
/// cef_request_context_t::LoadExtension documentation for more information
|
||||
/// about loader contexts. Must be called on the browser process UI thread.
|
||||
///
|
||||
struct _cef_request_context_t*(CEF_CALLBACK* get_loader_context)(
|
||||
struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this extension is currently loaded. Must be called on
|
||||
// the browser process UI thread.
|
||||
/// Returns true (1) if this extension is currently loaded. Must be called on
|
||||
/// the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* is_loaded)(struct _cef_extension_t* self);
|
||||
|
||||
///
|
||||
// Unload this extension if it is not an internal extension and is currently
|
||||
// loaded. Will result in a call to
|
||||
// cef_extension_handler_t::OnExtensionUnloaded on success.
|
||||
/// Unload this extension if it is not an internal extension and is currently
|
||||
/// loaded. Will result in a call to
|
||||
/// cef_extension_handler_t::OnExtensionUnloaded on success.
|
||||
///
|
||||
void(CEF_CALLBACK* unload)(struct _cef_extension_t* self);
|
||||
} cef_extension_t;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=768e2436e54cceb2675ddd03ebdc61b5c0785bdc$
|
||||
// $hash=ba961ade334c82e53213e7e8ac848adc2a7b533a$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
|
||||
@@ -52,75 +52,76 @@ extern "C" {
|
||||
struct _cef_client_t;
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of
|
||||
// cef_extension_handler_t::GetExtensionResource.
|
||||
/// Callback structure used for asynchronous continuation of
|
||||
/// cef_extension_handler_t::GetExtensionResource.
|
||||
///
|
||||
typedef struct _cef_get_extension_resource_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Continue the request. Read the resource contents from |stream|.
|
||||
/// Continue the request. Read the resource contents from |stream|.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_get_extension_resource_callback_t* self,
|
||||
struct _cef_stream_reader_t* stream);
|
||||
|
||||
///
|
||||
// Cancel the request.
|
||||
/// Cancel the request.
|
||||
///
|
||||
void(CEF_CALLBACK* cancel)(
|
||||
struct _cef_get_extension_resource_callback_t* self);
|
||||
} cef_get_extension_resource_callback_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser extensions. The
|
||||
// functions of this structure will be called on the UI thread. See
|
||||
// cef_request_context_t::LoadExtension for information about extension loading.
|
||||
/// Implement this structure to handle events related to browser extensions. The
|
||||
/// functions of this structure will be called on the UI thread. See
|
||||
/// cef_request_context_t::LoadExtension for information about extension
|
||||
/// loading.
|
||||
///
|
||||
typedef struct _cef_extension_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called if the cef_request_context_t::LoadExtension request fails. |result|
|
||||
// will be the error code.
|
||||
/// Called if the cef_request_context_t::LoadExtension request fails. |result|
|
||||
/// will be the error code.
|
||||
///
|
||||
void(CEF_CALLBACK* on_extension_load_failed)(
|
||||
struct _cef_extension_handler_t* self,
|
||||
cef_errorcode_t result);
|
||||
|
||||
///
|
||||
// Called if the cef_request_context_t::LoadExtension request succeeds.
|
||||
// |extension| is the loaded extension.
|
||||
/// Called if the cef_request_context_t::LoadExtension request succeeds.
|
||||
/// |extension| is the loaded extension.
|
||||
///
|
||||
void(CEF_CALLBACK* on_extension_loaded)(struct _cef_extension_handler_t* self,
|
||||
struct _cef_extension_t* extension);
|
||||
|
||||
///
|
||||
// Called after the cef_extension_t::Unload request has completed.
|
||||
/// 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.
|
||||
/// 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,
|
||||
@@ -130,19 +131,19 @@ typedef struct _cef_extension_handler_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -157,13 +158,13 @@ typedef struct _cef_extension_handler_t {
|
||||
struct _cef_browser_settings_t* settings);
|
||||
|
||||
///
|
||||
// Called when no tabId is specified to an extension API call that accepts a
|
||||
// tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the
|
||||
// source of the API call. Return the browser that will be acted on by the API
|
||||
// call or return NULL to act on |browser|. The returned browser must share
|
||||
// the same cef_request_context_t as |browser|. Incognito browsers should not
|
||||
// be considered unless the source extension has incognito access enabled, in
|
||||
// which case |include_incognito| will be true (1).
|
||||
/// Called when no tabId is specified to an extension API call that accepts a
|
||||
/// tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the
|
||||
/// source of the API call. Return the browser that will be acted on by the
|
||||
/// API call or return NULL to act on |browser|. The returned browser must
|
||||
/// share the same cef_request_context_t as |browser|. Incognito browsers
|
||||
/// should not be considered unless the source extension has incognito access
|
||||
/// enabled, in which case |include_incognito| will be true (1).
|
||||
///
|
||||
struct _cef_browser_t*(CEF_CALLBACK* get_active_browser)(
|
||||
struct _cef_extension_handler_t* self,
|
||||
@@ -172,12 +173,12 @@ typedef struct _cef_extension_handler_t {
|
||||
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).
|
||||
/// 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,
|
||||
@@ -186,14 +187,15 @@ typedef struct _cef_extension_handler_t {
|
||||
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.
|
||||
/// 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,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=e76fa23e9682bf0865319d93e4009752ac8f854f$
|
||||
// $hash=3e2e068a2be0a3b12653eea65a4bbe1c9cdb8c7f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
|
||||
@@ -47,40 +47,40 @@ 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.
|
||||
/// 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).
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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,
|
||||
@@ -88,39 +88,40 @@ CEF_EXPORT int cef_create_temp_directory_in_directory(
|
||||
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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f2e80b8637b07f19adea666e554269de4627e399$
|
||||
// $hash=30e86c9dd440616305f94747b313eb526c4323c7$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
||||
@@ -48,23 +48,23 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to find results. The
|
||||
// functions of this structure will be called on the UI thread.
|
||||
/// Implement this structure to handle events related to find results. The
|
||||
/// functions of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_find_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called to report find results returned by cef_browser_host_t::find().
|
||||
// |identifer| is a unique incremental identifier for the currently active
|
||||
// search, |count| is the number of matches currently identified,
|
||||
// |selectionRect| is the location of where the match was found (in window
|
||||
// coordinates), |activeMatchOrdinal| is the current position in the search
|
||||
// results, and |finalUpdate| is true (1) if this is the last find
|
||||
// notification.
|
||||
/// Called to report find results returned by cef_browser_host_t::find().
|
||||
/// |identifer| is a unique incremental identifier for the currently active
|
||||
/// search, |count| is the number of matches currently identified,
|
||||
/// |selectionRect| is the location of where the match was found (in window
|
||||
/// coordinates), |activeMatchOrdinal| is the current position in the search
|
||||
/// results, and |finalUpdate| is true (1) if this is the last find
|
||||
/// notification.
|
||||
///
|
||||
void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=a136a2679c8af339b21a89e8ae3090a9dbb8daa7$
|
||||
// $hash=907b9628ac4b7ab4603dc6e20b7e8675a51987ba$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
|
||||
@@ -50,36 +50,37 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to focus. The functions of
|
||||
// this structure will be called on the UI thread.
|
||||
/// Implement this structure to handle events related to focus. The functions of
|
||||
/// this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_focus_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called when the browser component is about to loose focus. For instance, if
|
||||
// focus was on the last HTML element and the user pressed the TAB key. |next|
|
||||
// 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.
|
||||
/// Called when the browser component is about to loose focus. For instance,
|
||||
/// if focus was on the last HTML element and the user pressed the TAB key.
|
||||
/// |next| will be true (1) if the browser is giving focus to the next
|
||||
/// component and false (0) if the browser is giving focus to the previous
|
||||
/// component.
|
||||
///
|
||||
void(CEF_CALLBACK* on_take_focus)(struct _cef_focus_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int next);
|
||||
|
||||
///
|
||||
// Called when the browser component is requesting focus. |source| indicates
|
||||
// where the focus request is originating from. Return false (0) to allow the
|
||||
// focus to be set or true (1) to cancel setting the focus.
|
||||
/// Called when the browser component is requesting focus. |source| indicates
|
||||
/// where the focus request is originating from. Return false (0) to allow the
|
||||
/// focus to be set or true (1) to cancel setting the focus.
|
||||
///
|
||||
int(CEF_CALLBACK* on_set_focus)(struct _cef_focus_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_focus_source_t source);
|
||||
|
||||
///
|
||||
// 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,
|
||||
struct _cef_browser_t* browser);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=8527ceea6b8778d6fabc1b4ef82e4faa06ba777a$
|
||||
// $hash=48bc345bb0971e3fcaaf839e9e4419b2aec0e33b$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
|
||||
@@ -57,100 +57,100 @@ struct _cef_urlrequest_t;
|
||||
struct _cef_v8context_t;
|
||||
|
||||
///
|
||||
// Structure used to represent a frame in the browser window. When used in the
|
||||
// browser process the functions of this structure may be called on any thread
|
||||
// unless otherwise indicated in the comments. When used in the render process
|
||||
// the functions of this structure may only be called on the main thread.
|
||||
/// Structure used to represent a frame in the browser window. When used in the
|
||||
/// browser process the functions of this structure may be called on any thread
|
||||
/// unless otherwise indicated in the comments. When used in the render process
|
||||
/// the functions of this structure may only be called on the main thread.
|
||||
///
|
||||
typedef struct _cef_frame_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Execute undo in this frame.
|
||||
/// Execute undo in this frame.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Execute cut in this frame.
|
||||
/// Execute cut in this frame.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Execute paste in this frame.
|
||||
/// Execute paste in this frame.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Execute select all in this frame.
|
||||
/// Execute select all in this frame.
|
||||
///
|
||||
void(CEF_CALLBACK* select_all)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Save this frame's HTML source to a temporary file and open it in the
|
||||
// default text viewing application. This function can only be called from the
|
||||
// browser process.
|
||||
/// Save this frame's HTML source to a temporary file and open it in the
|
||||
/// default text viewing application. This function can only be called from
|
||||
/// the browser process.
|
||||
///
|
||||
void(CEF_CALLBACK* view_source)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Retrieve this frame's HTML source as a string sent to the specified
|
||||
// visitor.
|
||||
/// Retrieve this frame's HTML source as a string sent to the specified
|
||||
/// visitor.
|
||||
///
|
||||
void(CEF_CALLBACK* get_source)(struct _cef_frame_t* self,
|
||||
struct _cef_string_visitor_t* visitor);
|
||||
|
||||
///
|
||||
// Retrieve this frame's display text as a string sent to the specified
|
||||
// visitor.
|
||||
/// Retrieve this frame's display text as a string sent to the specified
|
||||
/// visitor.
|
||||
///
|
||||
void(CEF_CALLBACK* get_text)(struct _cef_frame_t* self,
|
||||
struct _cef_string_visitor_t* visitor);
|
||||
|
||||
///
|
||||
// Load the request represented by the |request| object.
|
||||
//
|
||||
// WARNING: This function will fail with "bad IPC message" reason
|
||||
// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
|
||||
// origin using some other mechanism (LoadURL, link click, etc).
|
||||
/// Load the request represented by the |request| object.
|
||||
///
|
||||
/// WARNING: This function will fail with "bad IPC message" reason
|
||||
/// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
|
||||
/// origin using some other mechanism (LoadURL, link click, etc).
|
||||
///
|
||||
void(CEF_CALLBACK* load_request)(struct _cef_frame_t* self,
|
||||
struct _cef_request_t* request);
|
||||
|
||||
///
|
||||
// Load the specified |url|.
|
||||
/// Load the specified |url|.
|
||||
///
|
||||
void(CEF_CALLBACK* load_url)(struct _cef_frame_t* self,
|
||||
const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Execute a string of JavaScript code in this frame. The |script_url|
|
||||
// parameter is the URL where the script in question can be found, if any. The
|
||||
// renderer may request this URL to show the developer the source of the
|
||||
// error. The |start_line| parameter is the base line number to use for error
|
||||
// reporting.
|
||||
/// Execute a string of JavaScript code in this frame. The |script_url|
|
||||
/// parameter is the URL where the script in question can be found, if any.
|
||||
/// The renderer may request this URL to show the developer the source of the
|
||||
/// error. The |start_line| parameter is the base line number to use for
|
||||
/// error reporting.
|
||||
///
|
||||
void(CEF_CALLBACK* execute_java_script)(struct _cef_frame_t* self,
|
||||
const cef_string_t* code,
|
||||
@@ -158,83 +158,84 @@ typedef struct _cef_frame_t {
|
||||
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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// Returns the name for this frame. If the frame has an assigned name (for
|
||||
// example, set via the iframe "name" attribute) then that value will be
|
||||
// returned. Otherwise a unique name will be constructed based on the frame
|
||||
// parent hierarchy. The main (top-level) frame will always have an NULL name
|
||||
// value.
|
||||
/// Returns the name for this frame. If the frame has an assigned name (for
|
||||
/// example, set via the iframe "name" attribute) then that value will be
|
||||
/// returned. Otherwise a unique name will be constructed based on the frame
|
||||
/// parent hierarchy. The main (top-level) frame will always have an NULL name
|
||||
/// value.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Returns the globally unique identifier for this frame or < 0 if the
|
||||
// underlying frame does not yet exist.
|
||||
/// Returns the globally unique identifier for this frame or < 0 if the
|
||||
/// underlying frame does not yet exist.
|
||||
///
|
||||
int64(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Returns the parent of this frame or NULL if this is the main (top-level)
|
||||
// frame.
|
||||
/// Returns the parent of this frame or NULL if this is the main (top-level)
|
||||
/// frame.
|
||||
///
|
||||
struct _cef_frame_t*(CEF_CALLBACK* get_parent)(struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// 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().
|
||||
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);
|
||||
|
||||
///
|
||||
// Get the V8 context associated with the frame. This function can only be
|
||||
// called from the render process.
|
||||
/// Get the V8 context associated with the frame. This function can only be
|
||||
/// called from the render process.
|
||||
///
|
||||
struct _cef_v8context_t*(CEF_CALLBACK* get_v8context)(
|
||||
struct _cef_frame_t* self);
|
||||
|
||||
///
|
||||
// Visit the DOM document. This function can only be called from the render
|
||||
// process.
|
||||
/// Visit the DOM document. This function can only be called from the render
|
||||
/// process.
|
||||
///
|
||||
void(CEF_CALLBACK* visit_dom)(struct _cef_frame_t* self,
|
||||
struct _cef_domvisitor_t* visitor);
|
||||
|
||||
///
|
||||
// Create a new URL request that will be treated as originating from this
|
||||
// frame and the associated browser. This request may be intercepted by the
|
||||
// client via cef_resource_request_handler_t or cef_scheme_handler_factory_t.
|
||||
// Use cef_urlrequest_t::Create instead if you do not want the request to have
|
||||
// this association, in which case it may be handled differently (see
|
||||
// documentation on that function). Requests may originate from both the
|
||||
// browser process and the render process.
|
||||
//
|
||||
// For requests originating from the browser process:
|
||||
// - POST data may only contain a single element of type PDE_TYPE_FILE or
|
||||
// PDE_TYPE_BYTES.
|
||||
// For requests originating from the render process:
|
||||
// - POST data may only contain a single element of type PDE_TYPE_BYTES.
|
||||
// - If the response contains Content-Disposition or Mime-Type header values
|
||||
// that would not normally be rendered then the response may receive
|
||||
// special handling inside the browser (for example, via the file download
|
||||
// code path instead of the URL request code path).
|
||||
//
|
||||
// The |request| object will be marked as read-only after calling this
|
||||
// function.
|
||||
/// Create a new URL request that will be treated as originating from this
|
||||
/// frame and the associated browser. This request may be intercepted by the
|
||||
/// client via cef_resource_request_handler_t or cef_scheme_handler_factory_t.
|
||||
/// Use cef_urlrequest_t::Create instead if you do not want the request to
|
||||
/// have this association, in which case it may be handled differently (see
|
||||
/// documentation on that function). Requests may originate from both the
|
||||
/// browser process and the render process.
|
||||
///
|
||||
/// For requests originating from the browser process:
|
||||
/// - POST data may only contain a single element of type PDE_TYPE_FILE or
|
||||
/// PDE_TYPE_BYTES.
|
||||
///
|
||||
/// For requests originating from the render process:
|
||||
/// - POST data may only contain a single element of type PDE_TYPE_BYTES.
|
||||
/// - If the response contains Content-Disposition or Mime-Type header
|
||||
/// values that would not normally be rendered then the response may
|
||||
/// receive special handling inside the browser (for example, via the
|
||||
/// file download code path instead of the URL request code path).
|
||||
///
|
||||
/// The |request| object will be marked as read-only after calling this
|
||||
/// function.
|
||||
///
|
||||
struct _cef_urlrequest_t*(CEF_CALLBACK* create_urlrequest)(
|
||||
struct _cef_frame_t* self,
|
||||
@@ -242,12 +243,12 @@ typedef struct _cef_frame_t {
|
||||
struct _cef_urlrequest_client_t* client);
|
||||
|
||||
///
|
||||
// Send a message to the specified |target_process|. Ownership of the message
|
||||
// contents will be transferred and the |message| reference will be
|
||||
// invalidated. Message delivery is not guaranteed in all cases (for example,
|
||||
// if the browser is closing, navigating, or if the target process crashes).
|
||||
// Send an ACK message back from the target process if confirmation is
|
||||
// required.
|
||||
/// Send a message to the specified |target_process|. Ownership of the message
|
||||
/// contents will be transferred and the |message| reference will be
|
||||
/// invalidated. Message delivery is not guaranteed in all cases (for example,
|
||||
/// if the browser is closing, navigating, or if the target process crashes).
|
||||
/// Send an ACK message back from the target process if confirmation is
|
||||
/// required.
|
||||
///
|
||||
void(CEF_CALLBACK* send_process_message)(
|
||||
struct _cef_frame_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=8f791b2d1d5bea27f9e6ca5e0db731a0a76d181c$
|
||||
// $hash=3d97135fef535cc94aca6cf1afa4a9461c388b4f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_
|
||||
@@ -49,107 +49,113 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to cef_frame_t life span.
|
||||
// The order of callbacks is:
|
||||
//
|
||||
// (1) During initial cef_browser_host_t creation and navigation of the main
|
||||
// frame: - cef_frame_handler_t::OnFrameCreated => The initial main frame object
|
||||
// has been
|
||||
// created. Any commands will be queued until the frame is attached.
|
||||
// - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object
|
||||
// has
|
||||
// been assigned to the browser.
|
||||
// - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and can
|
||||
// be
|
||||
// used.
|
||||
// - cef_frame_handler_t::OnFrameAttached => The initial main frame object is
|
||||
// now
|
||||
// connected to its peer in the renderer process. Commands can be routed.
|
||||
//
|
||||
// (2) During further cef_browser_host_t navigation/loading of the main frame
|
||||
// and/or sub-frames: - cef_frame_handler_t::OnFrameCreated => A new main frame
|
||||
// or sub-frame object has
|
||||
// been created. Any commands will be queued until the frame is attached.
|
||||
// - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame
|
||||
// object is
|
||||
// now connected to its peer in the renderer process. Commands can be routed.
|
||||
// - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub-frame
|
||||
// object has lost its connection to the renderer process. If multiple objects
|
||||
// are detached at the same time then notifications will be sent for any
|
||||
// sub-frame objects before the main frame object. Commands can no longer be
|
||||
// routed and will be discarded.
|
||||
// - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has been
|
||||
// assigned to the browser. This will only occur with cross-origin navigation
|
||||
// or re-navigation after renderer process termination (due to crashes, etc).
|
||||
//
|
||||
// (3) During final cef_browser_host_t destruction of the main frame: -
|
||||
// cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost their
|
||||
// connection to the renderer process. Commands can no longer be routed and
|
||||
// will be discarded.
|
||||
// - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed. -
|
||||
// cef_frame_handler_t::OnFrameDetached => The main frame object have lost its
|
||||
// connection to the renderer process. Notifications will be sent for any
|
||||
// sub-frame objects before the main frame object. Commands can no longer be
|
||||
// routed and will be discarded.
|
||||
// - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has
|
||||
// been
|
||||
// removed from the browser.
|
||||
//
|
||||
// Cross-origin navigation and/or loading receives special handling.
|
||||
//
|
||||
// When the main frame navigates to a different origin the OnMainFrameChanged
|
||||
// callback (2) will be executed with the old and new main frame objects.
|
||||
//
|
||||
// When a new sub-frame is loaded in, or an existing sub-frame is navigated to,
|
||||
// a different origin from the parent frame, a temporary sub-frame object will
|
||||
// first be created in the parent's renderer process. That temporary sub-frame
|
||||
// will then be discarded after the real cross-origin sub-frame is created in
|
||||
// the new/target renderer process. The client will receive cross-origin
|
||||
// navigation callbacks (2) for the transition from the temporary sub-frame to
|
||||
// the real sub-frame. The temporary sub-frame will not recieve or execute
|
||||
// commands during this transitional period (any sent commands will be
|
||||
// discarded).
|
||||
//
|
||||
// When a new popup browser is created in a different origin from the parent
|
||||
// browser, a temporary main frame object for the popup will first be created in
|
||||
// the parent's renderer process. That temporary main frame will then be
|
||||
// discarded after the real cross-origin main frame is created in the new/target
|
||||
// renderer process. The client will recieve creation and initial navigation
|
||||
// callbacks (1) for the temporary main frame, followed by cross-origin
|
||||
// navigation callbacks (2) for the transition from the temporary main frame to
|
||||
// the real main frame. The temporary main frame may receive and execute
|
||||
// commands during this transitional period (any sent commands may be executed,
|
||||
// but the behavior is potentially undesirable since they execute in the parent
|
||||
// browser's renderer process and not the new/target renderer process).
|
||||
//
|
||||
// Callbacks will not be executed for placeholders that may be created during
|
||||
// pre-commit navigation for sub-frames that do not yet exist in the renderer
|
||||
// process. Placeholders will have cef_frame_t::get_identifier() == -4.
|
||||
//
|
||||
// The functions of this structure will be called on the UI thread unless
|
||||
// otherwise indicated.
|
||||
/// Implement this structure to handle events related to cef_frame_t life span.
|
||||
/// The order of callbacks is:
|
||||
///
|
||||
/// (1) During initial cef_browser_host_t creation and navigation of the main
|
||||
/// frame: - cef_frame_handler_t::OnFrameCreated => The initial main frame
|
||||
/// object has been
|
||||
/// created. Any commands will be queued until the frame is attached.
|
||||
/// - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object
|
||||
/// has
|
||||
/// been assigned to the browser.
|
||||
/// - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and
|
||||
/// can be
|
||||
/// used.
|
||||
/// - cef_frame_handler_t::OnFrameAttached => The initial main frame object is
|
||||
/// now
|
||||
/// connected to its peer in the renderer process. Commands can be routed.
|
||||
///
|
||||
/// (2) During further cef_browser_host_t navigation/loading of the main frame
|
||||
/// and/or sub-frames:
|
||||
/// - cef_frame_handler_t::OnFrameCreated => A new main frame or sub-frame
|
||||
/// object
|
||||
/// has been created. Any commands will be queued until the frame is attached.
|
||||
/// - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame
|
||||
/// object
|
||||
/// is now connected to its peer in the renderer process. Commands can be
|
||||
/// routed.
|
||||
/// - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub-
|
||||
/// frame
|
||||
/// object has lost its connection to the renderer process. If multiple
|
||||
/// objects are detached at the same time then notifications will be sent for
|
||||
/// any sub-frame objects before the main frame object. Commands can no longer
|
||||
/// be routed and will be discarded.
|
||||
/// - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has
|
||||
/// been
|
||||
/// assigned to the browser. This will only occur with cross-origin navigation
|
||||
/// or re-navigation after renderer process termination (due to crashes, etc).
|
||||
///
|
||||
/// (3) During final cef_browser_host_t destruction of the main frame: -
|
||||
/// cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost
|
||||
/// their
|
||||
/// connection to the renderer process. Commands can no longer be routed and
|
||||
/// will be discarded.
|
||||
/// - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed.
|
||||
/// - cef_frame_handler_t::OnFrameDetached => The main frame object have lost
|
||||
/// its
|
||||
/// connection to the renderer process. Notifications will be sent for any
|
||||
/// sub-frame objects before the main frame object. Commands can no longer be
|
||||
/// routed and will be discarded.
|
||||
/// - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has
|
||||
/// been removed from the browser.
|
||||
///
|
||||
/// Cross-origin navigation and/or loading receives special handling.
|
||||
///
|
||||
/// When the main frame navigates to a different origin the OnMainFrameChanged
|
||||
/// callback (2) will be executed with the old and new main frame objects.
|
||||
///
|
||||
/// When a new sub-frame is loaded in, or an existing sub-frame is navigated to,
|
||||
/// a different origin from the parent frame, a temporary sub-frame object will
|
||||
/// first be created in the parent's renderer process. That temporary sub-frame
|
||||
/// will then be discarded after the real cross-origin sub-frame is created in
|
||||
/// the new/target renderer process. The client will receive cross-origin
|
||||
/// navigation callbacks (2) for the transition from the temporary sub-frame to
|
||||
/// the real sub-frame. The temporary sub-frame will not recieve or execute
|
||||
/// commands during this transitional period (any sent commands will be
|
||||
/// discarded).
|
||||
///
|
||||
/// When a new popup browser is created in a different origin from the parent
|
||||
/// browser, a temporary main frame object for the popup will first be created
|
||||
/// in the parent's renderer process. That temporary main frame will then be
|
||||
/// discarded after the real cross-origin main frame is created in the
|
||||
/// new/target renderer process. The client will recieve creation and initial
|
||||
/// navigation callbacks (1) for the temporary main frame, followed by cross-
|
||||
/// origin navigation callbacks (2) for the transition from the temporary main
|
||||
/// frame to the real main frame. The temporary main frame may receive and
|
||||
/// execute commands during this transitional period (any sent commands may be
|
||||
/// executed, but the behavior is potentially undesirable since they execute in
|
||||
/// the parent browser's renderer process and not the new/target renderer
|
||||
/// process).
|
||||
///
|
||||
/// Callbacks will not be executed for placeholders that may be created during
|
||||
/// pre-commit navigation for sub-frames that do not yet exist in the renderer
|
||||
/// process. Placeholders will have cef_frame_t::get_identifier() == -4.
|
||||
///
|
||||
/// The functions of this structure will be called on the UI thread unless
|
||||
/// otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_frame_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called when a new frame is created. This will be the first notification
|
||||
// that references |frame|. Any commands that require transport to the
|
||||
// associated renderer process (LoadRequest, SendProcessMessage, GetSource,
|
||||
// etc.) will be queued until OnFrameAttached is called for |frame|.
|
||||
/// Called when a new frame is created. This will be the first notification
|
||||
/// that references |frame|. Any commands that require transport to the
|
||||
/// associated renderer process (LoadRequest, SendProcessMessage, GetSource,
|
||||
/// etc.) will be queued until OnFrameAttached is called for |frame|.
|
||||
///
|
||||
void(CEF_CALLBACK* on_frame_created)(struct _cef_frame_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame);
|
||||
|
||||
///
|
||||
// Called when a frame can begin routing commands to/from the associated
|
||||
// renderer process. |reattached| will be true (1) if the frame was re-
|
||||
// attached after exiting the BackForwardCache. Any commands that were queued
|
||||
// have now been dispatched.
|
||||
/// Called when a frame can begin routing commands to/from the associated
|
||||
/// renderer process. |reattached| will be true (1) if the frame was re-
|
||||
/// attached after exiting the BackForwardCache. Any commands that were queued
|
||||
/// have now been dispatched.
|
||||
///
|
||||
void(CEF_CALLBACK* on_frame_attached)(struct _cef_frame_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -157,29 +163,31 @@ typedef struct _cef_frame_handler_t {
|
||||
int reattached);
|
||||
|
||||
///
|
||||
// Called when a frame loses its connection to the renderer process and will
|
||||
// be destroyed. Any pending or future commands will be discarded and
|
||||
// cef_frame_t::is_valid() will now return false (0) for |frame|. If called
|
||||
// after cef_life_span_handler_t::on_before_close() during browser destruction
|
||||
// then cef_browser_t::is_valid() will return false (0) for |browser|.
|
||||
/// Called when a frame loses its connection to the renderer process and will
|
||||
/// be destroyed. Any pending or future commands will be discarded and
|
||||
/// cef_frame_t::is_valid() will now return false (0) for |frame|. If called
|
||||
/// after cef_life_span_handler_t::on_before_close() during browser
|
||||
/// destruction then cef_browser_t::is_valid() will return false (0) for
|
||||
/// |browser|.
|
||||
///
|
||||
void(CEF_CALLBACK* on_frame_detached)(struct _cef_frame_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame);
|
||||
|
||||
///
|
||||
// Called when the main frame changes due to (a) initial browser creation, (b)
|
||||
// final browser destruction, (c) cross-origin navigation or (d) re-navigation
|
||||
// after renderer process termination (due to crashes, etc). |old_frame| will
|
||||
// be NULL and |new_frame| will be non-NULL when a main frame is assigned to
|
||||
// |browser| for the first time. |old_frame| will be non-NULL and |new_frame|
|
||||
// will be NULL and when a main frame is removed from |browser| for the last
|
||||
// time. Both |old_frame| and |new_frame| will be non-NULL for cross-origin
|
||||
// navigations or re-navigation after renderer process termination. This
|
||||
// function will be called after on_frame_created() for |new_frame| and/or
|
||||
// after on_frame_detached() for |old_frame|. If called after
|
||||
// cef_life_span_handler_t::on_before_close() during browser destruction then
|
||||
// cef_browser_t::is_valid() will return false (0) for |browser|.
|
||||
/// Called when the main frame changes due to (a) initial browser creation,
|
||||
/// (b) final browser destruction, (c) cross-origin navigation or (d) re-
|
||||
/// navigation after renderer process termination (due to crashes, etc).
|
||||
/// |old_frame| will be NULL and |new_frame| will be non-NULL when a main
|
||||
/// frame is assigned to |browser| for the first time. |old_frame| will be
|
||||
/// non-NULL and |new_frame| will be NULL and when a main frame is removed
|
||||
/// from |browser| for the last time. Both |old_frame| and |new_frame| will be
|
||||
/// non-NULL for cross-origin navigations or re-navigation after renderer
|
||||
/// process termination. This function will be called after on_frame_created()
|
||||
/// for |new_frame| and/or after on_frame_detached() for |old_frame|. If
|
||||
/// called after cef_life_span_handler_t::on_before_close() during browser
|
||||
/// destruction then cef_browser_t::is_valid() will return false (0) for
|
||||
/// |browser|.
|
||||
///
|
||||
void(CEF_CALLBACK* on_main_frame_changed)(struct _cef_frame_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=c063e5f0e0c9fef71bdb56e7cc3ea775de17a3ea$
|
||||
// $hash=14f7f979f668fdae0f080daa39f3c1b2e92162f9$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_
|
||||
@@ -47,7 +47,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Returns true (1) if the application text direction is right-to-left.
|
||||
/// Returns true (1) if the application text direction is right-to-left.
|
||||
///
|
||||
CEF_EXPORT int cef_is_rtl(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=bbc87eb4ecaf92c900193afef7059caedbe8ab3a$
|
||||
// $hash=f679dc1ec87e99bed6843d4f4dbbe04585a827bd$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
||||
@@ -48,37 +48,37 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Container for a single image represented at different scale factors. All
|
||||
// image representations should be the same size in density independent pixel
|
||||
// (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels
|
||||
// then the image at scale factor 2.0 should be 200x200 pixels -- both images
|
||||
// will display with a DIP size of 100x100 units. The functions of this
|
||||
// structure can be called on any browser process thread.
|
||||
/// Container for a single image represented at different scale factors. All
|
||||
/// image representations should be the same size in density independent pixel
|
||||
/// (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels
|
||||
/// then the image at scale factor 2.0 should be 200x200 pixels -- both images
|
||||
/// will display with a DIP size of 100x100 units. The functions of this
|
||||
/// structure can be called on any browser process thread.
|
||||
///
|
||||
typedef struct _cef_image_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Returns true (1) if this Image and |that| Image share the same underlying
|
||||
// storage. Will also return true (1) if both images are NULL.
|
||||
/// Returns true (1) if this Image and |that| Image share the same underlying
|
||||
/// storage. Will also return true (1) if both images are NULL.
|
||||
///
|
||||
int(CEF_CALLBACK* is_same)(struct _cef_image_t* self,
|
||||
struct _cef_image_t* that);
|
||||
|
||||
///
|
||||
// Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA
|
||||
// formats are supported. |pixel_width| and |pixel_height| are the bitmap
|
||||
// representation size in pixel coordinates. |pixel_data| is the array of
|
||||
// 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.
|
||||
/// Add a bitmap image representation for |scale_factor|. Only 32-bit
|
||||
/// RGBA/BGRA formats are supported. |pixel_width| and |pixel_height| are the
|
||||
/// bitmap representation size in pixel coordinates. |pixel_data| is the array
|
||||
/// of pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in
|
||||
/// size. |color_type| and |alpha_type| values specify the pixel format.
|
||||
///
|
||||
int(CEF_CALLBACK* add_bitmap)(struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
@@ -90,9 +90,9 @@ typedef struct _cef_image_t {
|
||||
size_t pixel_data_size);
|
||||
|
||||
///
|
||||
// Add a PNG image representation for |scale_factor|. |png_data| is the image
|
||||
// data of size |png_data_size|. Any alpha transparency in the PNG data will
|
||||
// be maintained.
|
||||
/// Add a PNG image representation for |scale_factor|. |png_data| is the image
|
||||
/// data of size |png_data_size|. Any alpha transparency in the PNG data will
|
||||
/// be maintained.
|
||||
///
|
||||
int(CEF_CALLBACK* add_png)(struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
@@ -100,9 +100,9 @@ typedef struct _cef_image_t {
|
||||
size_t png_data_size);
|
||||
|
||||
///
|
||||
// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
|
||||
// image data of size |jpeg_data_size|. The JPEG format does not support
|
||||
// transparency so the alpha byte will be set to 0xFF for all pixels.
|
||||
/// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
|
||||
/// image data of size |jpeg_data_size|. The JPEG format does not support
|
||||
/// transparency so the alpha byte will be set to 0xFF for all pixels.
|
||||
///
|
||||
int(CEF_CALLBACK* add_jpeg)(struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
@@ -110,33 +110,34 @@ typedef struct _cef_image_t {
|
||||
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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// Returns true (1) if this image contains a representation for
|
||||
// |scale_factor|.
|
||||
/// Returns true (1) if this image contains a representation for
|
||||
/// |scale_factor|.
|
||||
///
|
||||
int(CEF_CALLBACK* has_representation)(struct _cef_image_t* self,
|
||||
float scale_factor);
|
||||
|
||||
///
|
||||
// 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,
|
||||
float scale_factor);
|
||||
|
||||
///
|
||||
// Returns information for the representation that most closely matches
|
||||
// |scale_factor|. |actual_scale_factor| is the actual scale factor for the
|
||||
// representation. |pixel_width| and |pixel_height| are the representation
|
||||
// size in pixel coordinates. Returns true (1) on success.
|
||||
/// Returns information for the representation that most closely matches
|
||||
/// |scale_factor|. |actual_scale_factor| is the actual scale factor for the
|
||||
/// representation. |pixel_width| and |pixel_height| are the representation
|
||||
/// size in pixel coordinates. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* get_representation_info)(struct _cef_image_t* self,
|
||||
float scale_factor,
|
||||
@@ -145,12 +146,12 @@ typedef struct _cef_image_t {
|
||||
int* pixel_height);
|
||||
|
||||
///
|
||||
// Returns the bitmap representation that most closely matches |scale_factor|.
|
||||
// Only 32-bit RGBA/BGRA formats are supported. |color_type| and |alpha_type|
|
||||
// values specify the desired output pixel format. |pixel_width| and
|
||||
// |pixel_height| are the output representation size in pixel coordinates.
|
||||
// Returns a cef_binary_value_t containing the pixel data on success or NULL
|
||||
// on failure.
|
||||
/// Returns the bitmap representation that most closely matches
|
||||
/// |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |color_type|
|
||||
/// and |alpha_type| values specify the desired output pixel format.
|
||||
/// |pixel_width| and |pixel_height| are the output representation size in
|
||||
/// pixel coordinates. Returns a cef_binary_value_t containing the pixel data
|
||||
/// on success or NULL on failure.
|
||||
///
|
||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_bitmap)(
|
||||
struct _cef_image_t* self,
|
||||
@@ -161,12 +162,12 @@ typedef struct _cef_image_t {
|
||||
int* pixel_height);
|
||||
|
||||
///
|
||||
// Returns the PNG representation that most closely matches |scale_factor|. If
|
||||
// |with_transparency| is true (1) any alpha transparency in the image will be
|
||||
// represented in the resulting PNG data. |pixel_width| and |pixel_height| are
|
||||
// the output representation size in pixel coordinates. Returns a
|
||||
// cef_binary_value_t containing the PNG image data on success or NULL on
|
||||
// failure.
|
||||
/// Returns the PNG representation that most closely matches |scale_factor|.
|
||||
/// If |with_transparency| is true (1) any alpha transparency in the image
|
||||
/// will be represented in the resulting PNG data. |pixel_width| and
|
||||
/// |pixel_height| are the output representation size in pixel coordinates.
|
||||
/// Returns a cef_binary_value_t containing the PNG image data on success or
|
||||
/// NULL on failure.
|
||||
///
|
||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_png)(
|
||||
struct _cef_image_t* self,
|
||||
@@ -176,13 +177,13 @@ typedef struct _cef_image_t {
|
||||
int* pixel_height);
|
||||
|
||||
///
|
||||
// Returns the JPEG representation that most closely matches |scale_factor|.
|
||||
// |quality| determines the compression level with 0 == lowest and 100 ==
|
||||
// highest. The JPEG format does not support alpha transparency and the alpha
|
||||
// channel, if any, will be discarded. |pixel_width| and |pixel_height| are
|
||||
// the output representation size in pixel coordinates. Returns a
|
||||
// cef_binary_value_t containing the JPEG image data on success or NULL on
|
||||
// failure.
|
||||
/// Returns the JPEG representation that most closely matches |scale_factor|.
|
||||
/// |quality| determines the compression level with 0 == lowest and 100 ==
|
||||
/// highest. The JPEG format does not support alpha transparency and the alpha
|
||||
/// channel, if any, will be discarded. |pixel_width| and |pixel_height| are
|
||||
/// the output representation size in pixel coordinates. Returns a
|
||||
/// cef_binary_value_t containing the JPEG image data on success or NULL on
|
||||
/// failure.
|
||||
///
|
||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_as_jpeg)(
|
||||
struct _cef_image_t* self,
|
||||
@@ -193,8 +194,8 @@ typedef struct _cef_image_t {
|
||||
} cef_image_t;
|
||||
|
||||
///
|
||||
// Create a new cef_image_t. It will initially be NULL. Use the Add*() functions
|
||||
// to add representations at different scale factors.
|
||||
/// Create a new cef_image_t. It will initially be NULL. Use the Add*()
|
||||
/// functions to add representations at different scale factors.
|
||||
///
|
||||
CEF_EXPORT cef_image_t* cef_image_create(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=942579315e4b8c0819cd2b06becb93670310cd09$
|
||||
// $hash=523a692475e912e4ecad89842596c3d6eac6f4aa$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
|
||||
@@ -48,18 +48,19 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of JavaScript dialog
|
||||
// requests.
|
||||
/// Callback structure used for asynchronous continuation of JavaScript dialog
|
||||
/// requests.
|
||||
///
|
||||
typedef struct _cef_jsdialog_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Continue the JS dialog request. Set |success| to true (1) if the OK button
|
||||
// was pressed. The |user_input| value should be specified for prompt dialogs.
|
||||
/// Continue the JS dialog request. Set |success| to true (1) if the OK button
|
||||
/// was pressed. The |user_input| value should be specified for prompt
|
||||
/// dialogs.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_jsdialog_callback_t* self,
|
||||
int success,
|
||||
@@ -67,31 +68,31 @@ typedef struct _cef_jsdialog_callback_t {
|
||||
} cef_jsdialog_callback_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to JavaScript dialogs. The
|
||||
// functions of this structure will be called on the UI thread.
|
||||
/// Implement this structure to handle events related to JavaScript dialogs. The
|
||||
/// functions of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_jsdialog_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
|
||||
// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
|
||||
// and user-friendly display string. The |default_prompt_text| value will be
|
||||
// specified for prompt dialogs only. Set |suppress_message| to true (1) and
|
||||
// return false (0) to suppress the message (suppressing messages is
|
||||
// preferable to immediately executing the callback as this is used to detect
|
||||
// presumably malicious behavior like spamming alert messages in
|
||||
// onbeforeunload). Set |suppress_message| to false (0) and return false (0)
|
||||
// to use the default implementation (the default implementation will show one
|
||||
// modal dialog at a time and suppress any additional dialog requests until
|
||||
// the displayed dialog is dismissed). Return true (1) if the application will
|
||||
// use a custom dialog or if the callback has been executed immediately.
|
||||
// Custom dialogs may be either modal or modeless. If a custom dialog is used
|
||||
// the application must execute |callback| once the custom dialog is
|
||||
// dismissed.
|
||||
/// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
|
||||
/// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
|
||||
/// and user-friendly display string. The |default_prompt_text| value will be
|
||||
/// specified for prompt dialogs only. Set |suppress_message| to true (1) and
|
||||
/// return false (0) to suppress the message (suppressing messages is
|
||||
/// preferable to immediately executing the callback as this is used to detect
|
||||
/// presumably malicious behavior like spamming alert messages in
|
||||
/// onbeforeunload). Set |suppress_message| to false (0) and return false (0)
|
||||
/// to use the default implementation (the default implementation will show
|
||||
/// one modal dialog at a time and suppress any additional dialog requests
|
||||
/// until the displayed dialog is dismissed). Return true (1) if the
|
||||
/// application will use a custom dialog or if the callback has been executed
|
||||
/// immediately. Custom dialogs may be either modal or modeless. If a custom
|
||||
/// dialog is used the application must execute |callback| once the custom
|
||||
/// dialog is dismissed.
|
||||
///
|
||||
int(CEF_CALLBACK* on_jsdialog)(struct _cef_jsdialog_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -103,12 +104,12 @@ typedef struct _cef_jsdialog_handler_t {
|
||||
int* suppress_message);
|
||||
|
||||
///
|
||||
// Called to run a dialog asking the user if they want to leave a page. Return
|
||||
// false (0) to use the default dialog implementation. Return true (1) if the
|
||||
// application will use a custom dialog or if the callback has been executed
|
||||
// immediately. Custom dialogs may be either modal or modeless. If a custom
|
||||
// dialog is used the application must execute |callback| once the custom
|
||||
// dialog is dismissed.
|
||||
/// Called to run a dialog asking the user if they want to leave a page.
|
||||
/// Return false (0) to use the default dialog implementation. Return true (1)
|
||||
/// if the application will use a custom dialog or if the callback has been
|
||||
/// executed immediately. Custom dialogs may be either modal or modeless. If a
|
||||
/// custom dialog is used the application must execute |callback| once the
|
||||
/// custom dialog is dismissed.
|
||||
///
|
||||
int(CEF_CALLBACK* on_before_unload_dialog)(
|
||||
struct _cef_jsdialog_handler_t* self,
|
||||
@@ -118,16 +119,16 @@ typedef struct _cef_jsdialog_handler_t {
|
||||
struct _cef_jsdialog_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called to cancel any pending dialogs and reset any saved dialog state. Will
|
||||
// be called due to events like page navigation irregardless of whether any
|
||||
// dialogs are currently pending.
|
||||
/// Called to cancel any pending dialogs and reset any saved dialog state.
|
||||
/// Will be called due to events like page navigation irregardless of whether
|
||||
/// any dialogs are currently pending.
|
||||
///
|
||||
void(CEF_CALLBACK* on_reset_dialog_state)(
|
||||
struct _cef_jsdialog_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called when the dialog is closed.
|
||||
/// Called when the dialog is closed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_dialog_closed)(struct _cef_jsdialog_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=78320536b0ba210f34a42d0508ce3cd023d7b039$
|
||||
// $hash=01d7f86c1304efe8dc8758624b74bafccf159e96$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
|
||||
@@ -48,21 +48,22 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to keyboard input. The
|
||||
// functions of this structure will be called on the UI thread.
|
||||
/// Implement this structure to handle events related to keyboard input. The
|
||||
/// functions of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_keyboard_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called before a keyboard event is sent to the renderer. |event| contains
|
||||
// information about the keyboard event. |os_event| is the operating system
|
||||
// event message, if any. Return true (1) if the event was handled or false
|
||||
// (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).
|
||||
/// Called before a keyboard event is sent to the renderer. |event| contains
|
||||
/// information about the keyboard event. |os_event| is the operating system
|
||||
/// event message, if any. Return true (1) if the event was handled or false
|
||||
/// (0) otherwise. If the event will be handled in on_key_event() as a
|
||||
/// keyboard shortcut set |is_keyboard_shortcut| to true (1) and return false
|
||||
/// (0).
|
||||
///
|
||||
int(CEF_CALLBACK* on_pre_key_event)(struct _cef_keyboard_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -71,10 +72,10 @@ typedef struct _cef_keyboard_handler_t {
|
||||
int* is_keyboard_shortcut);
|
||||
|
||||
///
|
||||
// Called after the renderer and JavaScript in the page has had a chance to
|
||||
// handle the event. |event| contains information about the keyboard event.
|
||||
// |os_event| is the operating system event message, if any. Return true (1)
|
||||
// if the keyboard event was handled or false (0) otherwise.
|
||||
/// Called after the renderer and JavaScript in the page has had a chance to
|
||||
/// handle the event. |event| contains information about the keyboard event.
|
||||
/// |os_event| is the operating system event message, if any. Return true (1)
|
||||
/// if the keyboard event was handled or false (0) otherwise.
|
||||
///
|
||||
int(CEF_CALLBACK* on_key_event)(struct _cef_keyboard_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5d576b7450a269dcd370e65a187b0c9596801162$
|
||||
// $hash=44555ceece9989dabfa57a520168fa874dcfe2df$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
|
||||
@@ -50,40 +50,40 @@ extern "C" {
|
||||
struct _cef_client_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser life span. The
|
||||
// functions of this structure will be called on the UI thread unless otherwise
|
||||
// indicated.
|
||||
/// Implement this structure to handle events related to browser life span. The
|
||||
/// functions of this structure will be called on the UI thread unless otherwise
|
||||
/// indicated.
|
||||
///
|
||||
typedef struct _cef_life_span_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the UI thread before a new popup browser is created. The
|
||||
// |browser| and |frame| values represent the source of the popup request. The
|
||||
// |target_url| and |target_frame_name| values indicate where the popup
|
||||
// browser should navigate and may be NULL if not specified with the request.
|
||||
// The |target_disposition| value indicates where the user intended to open
|
||||
// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
|
||||
// be true (1) if the popup was opened via explicit user gesture (e.g.
|
||||
// clicking a link) or false (0) if the popup opened automatically (e.g. via
|
||||
// the DomContentLoaded event). The |popupFeatures| structure contains
|
||||
// additional information about the requested popup window. To allow creation
|
||||
// of the popup browser optionally modify |windowInfo|, |client|, |settings|
|
||||
// and |no_javascript_access| and return false (0). To cancel creation of the
|
||||
// popup browser return true (1). The |client| and |settings| values will
|
||||
// default to the source browser's values. If the |no_javascript_access| value
|
||||
// is set to false (0) the new browser will not be scriptable and may not be
|
||||
// hosted in the same renderer process as the source browser. Any
|
||||
// modifications to |windowInfo| will be ignored if the parent browser is
|
||||
// wrapped in a cef_browser_view_t. Popup browser creation will be canceled if
|
||||
// the parent browser is destroyed before the popup browser creation completes
|
||||
// (indicated by a call to OnAfterCreated for the popup browser). The
|
||||
// |extra_info| parameter provides an opportunity to specify extra information
|
||||
// specific to the created popup browser that will be passed to
|
||||
// cef_render_process_handler_t::on_browser_created() in the render process.
|
||||
/// Called on the UI thread before a new popup browser is created. The
|
||||
/// |browser| and |frame| values represent the source of the popup request.
|
||||
/// The |target_url| and |target_frame_name| values indicate where the popup
|
||||
/// browser should navigate and may be NULL if not specified with the request.
|
||||
/// The |target_disposition| value indicates where the user intended to open
|
||||
/// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
|
||||
/// be true (1) if the popup was opened via explicit user gesture (e.g.
|
||||
/// clicking a link) or false (0) if the popup opened automatically (e.g. via
|
||||
/// the DomContentLoaded event). The |popupFeatures| structure contains
|
||||
/// additional information about the requested popup window. To allow creation
|
||||
/// of the popup browser optionally modify |windowInfo|, |client|, |settings|
|
||||
/// and |no_javascript_access| and return false (0). To cancel creation of the
|
||||
/// popup browser return true (1). The |client| and |settings| values will
|
||||
/// default to the source browser's values. If the |no_javascript_access|
|
||||
/// value is set to false (0) the new browser will not be scriptable and may
|
||||
/// not be hosted in the same renderer process as the source browser. Any
|
||||
/// modifications to |windowInfo| will be ignored if the parent browser is
|
||||
/// wrapped in a cef_browser_view_t. Popup browser creation will be canceled
|
||||
/// if the parent browser is destroyed before the popup browser creation
|
||||
/// completes (indicated by a call to OnAfterCreated for the popup browser).
|
||||
/// The |extra_info| parameter provides an opportunity to specify extra
|
||||
/// information specific to the created popup browser that will be passed to
|
||||
/// cef_render_process_handler_t::on_browser_created() in the render process.
|
||||
///
|
||||
int(CEF_CALLBACK* on_before_popup)(
|
||||
struct _cef_life_span_handler_t* self,
|
||||
@@ -101,117 +101,118 @@ typedef struct _cef_life_span_handler_t {
|
||||
int* no_javascript_access);
|
||||
|
||||
///
|
||||
// Called after a new browser is created. It is now safe to begin performing
|
||||
// actions with |browser|. cef_frame_handler_t callbacks related to initial
|
||||
// main frame creation will arrive before this callback. See
|
||||
// cef_frame_handler_t documentation for additional usage information.
|
||||
/// Called after a new browser is created. It is now safe to begin performing
|
||||
/// actions with |browser|. cef_frame_handler_t callbacks related to initial
|
||||
/// main frame creation will arrive before this callback. See
|
||||
/// cef_frame_handler_t documentation for additional usage information.
|
||||
///
|
||||
void(CEF_CALLBACK* on_after_created)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called when a browser has recieved a request to close. This may result
|
||||
// directly from a call to cef_browser_host_t::*close_browser() or indirectly
|
||||
// if the browser is parented to a top-level window created by CEF and the
|
||||
// user attempts to close that window (by clicking the 'X', for example). The
|
||||
// do_close() function will be called after the JavaScript 'onunload' event
|
||||
// has been fired.
|
||||
//
|
||||
// An application should handle top-level owner window close notifications by
|
||||
// calling cef_browser_host_t::try_close_browser() or
|
||||
// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
|
||||
// to close immediately (see the examples below). This gives CEF an
|
||||
// opportunity to process the 'onbeforeunload' event and optionally cancel the
|
||||
// close before do_close() is called.
|
||||
//
|
||||
// When windowed rendering is enabled CEF will internally create a window or
|
||||
// view to host the browser. In that case returning false (0) from do_close()
|
||||
// will send the standard close notification to the browser's top-level owner
|
||||
// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
|
||||
// Linux or cef_window_delegate_t::can_close() callback from Views). If the
|
||||
// browser's host window/view has already been destroyed (via view hierarchy
|
||||
// tear-down, for example) then do_close() will not be called for that browser
|
||||
// since is no longer possible to cancel the close.
|
||||
//
|
||||
// When windowed rendering is disabled returning false (0) from do_close()
|
||||
// will cause the browser object to be destroyed immediately.
|
||||
//
|
||||
// If the browser's top-level owner window requires a non-standard close
|
||||
// notification then send that notification from do_close() and return true
|
||||
// (1).
|
||||
//
|
||||
// The cef_life_span_handler_t::on_before_close() function will be called
|
||||
// after do_close() (if do_close() is called) and immediately before the
|
||||
// browser object is destroyed. The application should only exit after
|
||||
// on_before_close() has been called for all existing browsers.
|
||||
//
|
||||
// The below examples describe what should happen during window close when the
|
||||
// browser is parented to an application-provided top-level window.
|
||||
//
|
||||
// Example 1: Using cef_browser_host_t::try_close_browser(). This is
|
||||
// recommended for clients using standard close handling and windows created
|
||||
// on the browser process UI thread. 1. User clicks the window close button
|
||||
// which sends a close notification to
|
||||
// the application's top-level window.
|
||||
// 2. Application's top-level window receives the close notification and
|
||||
// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
|
||||
// TryCloseBrowser() returns false so the client cancels the window close.
|
||||
// 3. JavaScript 'onbeforeunload' handler executes and shows the close
|
||||
// confirmation dialog (which can be overridden via
|
||||
// CefJSDialogHandler::OnBeforeUnloadDialog()).
|
||||
// 4. User approves the close. 5. JavaScript 'onunload' handler executes. 6.
|
||||
// CEF sends a close notification to the application's top-level window
|
||||
// (because DoClose() returned false by default).
|
||||
// 7. Application's top-level window receives the close notification and
|
||||
// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
|
||||
// allows the window close.
|
||||
// 8. Application's top-level window is destroyed. 9. Application's
|
||||
// on_before_close() handler is called and the browser object
|
||||
// is destroyed.
|
||||
// 10. Application exits by calling cef_quit_message_loop() if no other
|
||||
// browsers
|
||||
// exist.
|
||||
//
|
||||
// Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and
|
||||
// implementing the do_close() callback. This is recommended for clients using
|
||||
// non-standard close handling or windows that were not created on the browser
|
||||
// process UI thread. 1. User clicks the window close button which sends a
|
||||
// close notification to
|
||||
// the application's top-level window.
|
||||
// 2. Application's top-level window receives the close notification and:
|
||||
// A. Calls CefBrowserHost::CloseBrowser(false).
|
||||
// B. Cancels the window close.
|
||||
// 3. JavaScript 'onbeforeunload' handler executes and shows the close
|
||||
// confirmation dialog (which can be overridden via
|
||||
// CefJSDialogHandler::OnBeforeUnloadDialog()).
|
||||
// 4. User approves the close. 5. JavaScript 'onunload' handler executes. 6.
|
||||
// Application's do_close() handler is called. Application will:
|
||||
// A. Set a flag to indicate that the next close attempt will be allowed.
|
||||
// B. Return false.
|
||||
// 7. CEF sends an close notification to the application's top-level window.
|
||||
// 8. Application's top-level window receives the close notification and
|
||||
// allows the window to close based on the flag from #6B.
|
||||
// 9. Application's top-level window is destroyed. 10. Application's
|
||||
// on_before_close() handler is called and the browser object
|
||||
// is destroyed.
|
||||
// 11. Application exits by calling cef_quit_message_loop() if no other
|
||||
// browsers
|
||||
// exist.
|
||||
/// Called when a browser has recieved a request to close. This may result
|
||||
/// directly from a call to cef_browser_host_t::*close_browser() or indirectly
|
||||
/// if the browser is parented to a top-level window created by CEF and the
|
||||
/// user attempts to close that window (by clicking the 'X', for example). The
|
||||
/// do_close() function will be called after the JavaScript 'onunload' event
|
||||
/// has been fired.
|
||||
///
|
||||
/// An application should handle top-level owner window close notifications by
|
||||
/// calling cef_browser_host_t::try_close_browser() or
|
||||
/// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
|
||||
/// to close immediately (see the examples below). This gives CEF an
|
||||
/// opportunity to process the 'onbeforeunload' event and optionally cancel
|
||||
/// the close before do_close() is called.
|
||||
///
|
||||
/// When windowed rendering is enabled CEF will internally create a window or
|
||||
/// view to host the browser. In that case returning false (0) from do_close()
|
||||
/// will send the standard close notification to the browser's top-level owner
|
||||
/// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
|
||||
/// Linux or cef_window_delegate_t::can_close() callback from Views). If the
|
||||
/// browser's host window/view has already been destroyed (via view hierarchy
|
||||
/// tear-down, for example) then do_close() will not be called for that
|
||||
/// browser since is no longer possible to cancel the close.
|
||||
///
|
||||
/// When windowed rendering is disabled returning false (0) from do_close()
|
||||
/// will cause the browser object to be destroyed immediately.
|
||||
///
|
||||
/// If the browser's top-level owner window requires a non-standard close
|
||||
/// notification then send that notification from do_close() and return true
|
||||
/// (1).
|
||||
///
|
||||
/// The cef_life_span_handler_t::on_before_close() function will be called
|
||||
/// after do_close() (if do_close() is called) and immediately before the
|
||||
/// browser object is destroyed. The application should only exit after
|
||||
/// on_before_close() has been called for all existing browsers.
|
||||
///
|
||||
/// The below examples describe what should happen during window close when
|
||||
/// the browser is parented to an application-provided top-level window.
|
||||
///
|
||||
/// Example 1: Using cef_browser_host_t::try_close_browser(). This is
|
||||
/// recommended for clients using standard close handling and windows created
|
||||
/// on the browser process UI thread. 1. User clicks the window close button
|
||||
/// which sends a close notification
|
||||
/// to the application's top-level window.
|
||||
/// 2. Application's top-level window receives the close notification and
|
||||
/// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
|
||||
/// TryCloseBrowser() returns false so the client cancels the window
|
||||
/// close.
|
||||
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
|
||||
/// confirmation dialog (which can be overridden via
|
||||
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
|
||||
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
|
||||
/// 6. CEF sends a close notification to the application's top-level window
|
||||
/// (because DoClose() returned false by default).
|
||||
/// 7. Application's top-level window receives the close notification and
|
||||
/// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
|
||||
/// allows the window close.
|
||||
/// 8. Application's top-level window is destroyed. 9. Application's
|
||||
/// on_before_close() handler is called and the browser object
|
||||
/// is destroyed.
|
||||
/// 10. Application exits by calling cef_quit_message_loop() if no other
|
||||
/// browsers
|
||||
/// exist.
|
||||
///
|
||||
/// Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and
|
||||
/// implementing the do_close() callback. This is recommended for clients
|
||||
/// using non-standard close handling or windows that were not created on the
|
||||
/// browser process UI thread. 1. User clicks the window close button which
|
||||
/// sends a close notification
|
||||
/// to the application's top-level window.
|
||||
/// 2. Application's top-level window receives the close notification and:
|
||||
/// A. Calls CefBrowserHost::CloseBrowser(false).
|
||||
/// B. Cancels the window close.
|
||||
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
|
||||
/// confirmation dialog (which can be overridden via
|
||||
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
|
||||
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
|
||||
/// 6. Application's do_close() handler is called. Application will:
|
||||
/// A. Set a flag to indicate that the next close attempt will be allowed.
|
||||
/// B. Return false.
|
||||
/// 7. CEF sends an close notification to the application's top-level window.
|
||||
/// 8. Application's top-level window receives the close notification and
|
||||
/// allows the window to close based on the flag from #6B.
|
||||
/// 9. Application's top-level window is destroyed. 10. Application's
|
||||
/// on_before_close() handler is called and the browser object
|
||||
/// is destroyed.
|
||||
/// 11. Application exits by calling cef_quit_message_loop() if no other
|
||||
/// browsers
|
||||
/// exist.
|
||||
///
|
||||
int(CEF_CALLBACK* do_close)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called just before a browser is destroyed. Release all references to the
|
||||
// browser object and do not attempt to execute any functions on the browser
|
||||
// object (other than IsValid, GetIdentifier or IsSame) after this callback
|
||||
// returns. cef_frame_handler_t callbacks related to final main frame
|
||||
// destruction will arrive after this callback and cef_browser_t::IsValid will
|
||||
// return false (0) at that time. Any in-progress network requests associated
|
||||
// with |browser| will be aborted when the browser is destroyed, and
|
||||
// cef_resource_request_handler_t callbacks related to those requests may
|
||||
// still arrive on the IO thread after this callback. See cef_frame_handler_t
|
||||
// and do_close() documentation for additional usage information.
|
||||
/// Called just before a browser is destroyed. Release all references to the
|
||||
/// browser object and do not attempt to execute any functions on the browser
|
||||
/// object (other than IsValid, GetIdentifier or IsSame) after this callback
|
||||
/// returns. cef_frame_handler_t callbacks related to final main frame
|
||||
/// destruction will arrive after this callback and cef_browser_t::IsValid
|
||||
/// will return false (0) at that time. Any in-progress network requests
|
||||
/// associated with |browser| will be aborted when the browser is destroyed,
|
||||
/// and cef_resource_request_handler_t callbacks related to those requests may
|
||||
/// still arrive on the IO thread after this callback. See cef_frame_handler_t
|
||||
/// and do_close() documentation for additional usage information.
|
||||
///
|
||||
void(CEF_CALLBACK* on_before_close)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f51b6a0dbf264fa43ea3199327a5adb1044bfc04$
|
||||
// $hash=2713381c9969d7039e6c1a1ed2527e5aeb5425ce$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
|
||||
@@ -49,22 +49,22 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser load status. The
|
||||
// functions of this structure will be called on the browser process UI thread
|
||||
// or render process main thread (TID_RENDERER).
|
||||
/// 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 or render process main thread (TID_RENDERER).
|
||||
///
|
||||
typedef struct _cef_load_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called when the loading state has changed. This callback will be executed
|
||||
// twice -- once when loading is initiated either programmatically or by user
|
||||
// action, and once when loading is terminated due to completion, cancellation
|
||||
// of failure. It will be called before any calls to OnLoadStart and after all
|
||||
// calls to OnLoadError and/or OnLoadEnd.
|
||||
/// Called when the loading state has changed. This callback will be executed
|
||||
/// twice -- once when loading is initiated either programmatically or by user
|
||||
/// action, and once when loading is terminated due to completion,
|
||||
/// cancellation of failure. It will be called before any calls to OnLoadStart
|
||||
/// and after all calls to OnLoadError and/or OnLoadEnd.
|
||||
///
|
||||
void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -73,16 +73,16 @@ typedef struct _cef_load_handler_t {
|
||||
int canGoForward);
|
||||
|
||||
///
|
||||
// Called after a navigation has been committed and before the browser begins
|
||||
// loading contents in the frame. The |frame| value will never be NULL -- call
|
||||
// the is_main() function to check if this frame is the main frame.
|
||||
// |transition_type| provides information about the source of the navigation
|
||||
// and an accurate value is only available in the browser process. Multiple
|
||||
// frames may be loading at the same time. Sub-frames may start or continue
|
||||
// loading after the main frame load has ended. This function will not be
|
||||
// called for same page navigations (fragments, history state, etc.) or for
|
||||
// navigations that fail or are canceled before commit. For notification of
|
||||
// overall browser load status use OnLoadingStateChange instead.
|
||||
/// Called after a navigation has been committed and before the browser begins
|
||||
/// loading contents in the frame. The |frame| value will never be NULL --
|
||||
/// call the is_main() function to check if this frame is the main frame.
|
||||
/// |transition_type| provides information about the source of the navigation
|
||||
/// and an accurate value is only available in the browser process. Multiple
|
||||
/// frames may be loading at the same time. Sub-frames may start or continue
|
||||
/// loading after the main frame load has ended. This function will not be
|
||||
/// called for same page navigations (fragments, history state, etc.) or for
|
||||
/// navigations that fail or are canceled before commit. For notification of
|
||||
/// overall browser load status use OnLoadingStateChange instead.
|
||||
///
|
||||
void(CEF_CALLBACK* on_load_start)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -90,14 +90,14 @@ typedef struct _cef_load_handler_t {
|
||||
cef_transition_type_t transition_type);
|
||||
|
||||
///
|
||||
// Called when the browser is done loading a frame. The |frame| value will
|
||||
// never be NULL -- call the is_main() function to check if this frame is the
|
||||
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
||||
// start or continue loading after the main frame load has ended. This
|
||||
// function will not be called for same page navigations (fragments, history
|
||||
// state, etc.) or for navigations that fail or are canceled before commit.
|
||||
// For notification of overall browser load status use OnLoadingStateChange
|
||||
// instead.
|
||||
/// Called when the browser is done loading a frame. The |frame| value will
|
||||
/// never be NULL -- call the is_main() function to check if this frame is the
|
||||
/// main frame. Multiple frames may be loading at the same time. Sub-frames
|
||||
/// may start or continue loading after the main frame load has ended. This
|
||||
/// function will not be called for same page navigations (fragments, history
|
||||
/// state, etc.) or for navigations that fail or are canceled before commit.
|
||||
/// For notification of overall browser load status use OnLoadingStateChange
|
||||
/// instead.
|
||||
///
|
||||
void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -105,11 +105,11 @@ typedef struct _cef_load_handler_t {
|
||||
int httpStatusCode);
|
||||
|
||||
///
|
||||
// Called when a navigation fails or is canceled. This function may be called
|
||||
// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
|
||||
// after commit. |errorCode| is the error code number, |errorText| is the
|
||||
// error text and |failedUrl| is the URL that failed to load. See
|
||||
// net\base\net_error_list.h for complete descriptions of the error codes.
|
||||
/// Called when a navigation fails or is canceled. This function may be called
|
||||
/// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
|
||||
/// after commit. |errorCode| is the error code number, |errorText| is the
|
||||
/// error text and |failedUrl| is the URL that failed to load. See
|
||||
/// net\base\net_error_list.h for complete descriptions of the error codes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_load_error)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=3db7459a1940c37898699cc97f69ba9249a6f1fd$
|
||||
// $hash=77920892e7d9e8b98106e0bc8dfcf4b4c52a24e6$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
|
||||
@@ -56,46 +56,46 @@ struct _cef_media_sink_t;
|
||||
struct _cef_media_source_t;
|
||||
|
||||
///
|
||||
// Supports discovery of and communication with media devices on the local
|
||||
// network via the Cast and DIAL protocols. The functions of this structure may
|
||||
// be called on any browser process thread unless otherwise indicated.
|
||||
/// Supports discovery of and communication with media devices on the local
|
||||
/// network via the Cast and DIAL protocols. The functions of this structure may
|
||||
/// be called on any browser process thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_media_router_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Add an observer for MediaRouter events. The observer will remain registered
|
||||
// until the returned Registration object is destroyed.
|
||||
/// Add an observer for MediaRouter events. The observer will remain
|
||||
/// registered until the returned Registration object is destroyed.
|
||||
///
|
||||
struct _cef_registration_t*(CEF_CALLBACK* add_observer)(
|
||||
struct _cef_media_router_t* self,
|
||||
struct _cef_media_observer_t* observer);
|
||||
|
||||
///
|
||||
// Returns a MediaSource object for the specified media source URN. Supported
|
||||
// URN schemes include "cast:" and "dial:", and will be already known by the
|
||||
// client application (e.g. "cast:<appId>?clientId=<clientId>").
|
||||
/// Returns a MediaSource object for the specified media source URN. Supported
|
||||
/// URN schemes include "cast:" and "dial:", and will be already known by the
|
||||
/// client application (e.g. "cast:<appId>?clientId=<clientId>").
|
||||
///
|
||||
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
|
||||
struct _cef_media_router_t* self,
|
||||
const cef_string_t* urn);
|
||||
|
||||
///
|
||||
// Trigger an asynchronous call to cef_media_observer_t::OnSinks on all
|
||||
// registered observers.
|
||||
/// Trigger an asynchronous call to cef_media_observer_t::OnSinks on all
|
||||
/// registered observers.
|
||||
///
|
||||
void(CEF_CALLBACK* notify_current_sinks)(struct _cef_media_router_t* self);
|
||||
|
||||
///
|
||||
// Create a new route between |source| and |sink|. Source and sink must be
|
||||
// valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and
|
||||
// a route between them must not already exist. |callback| will be executed on
|
||||
// success or failure. If route creation succeeds it will also trigger an
|
||||
// asynchronous call to cef_media_observer_t::OnRoutes on all registered
|
||||
// observers.
|
||||
/// Create a new route between |source| and |sink|. Source and sink must be
|
||||
/// valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and
|
||||
/// a route between them must not already exist. |callback| will be executed
|
||||
/// on success or failure. If route creation succeeds it will also trigger an
|
||||
/// asynchronous call to cef_media_observer_t::OnRoutes on all registered
|
||||
/// observers.
|
||||
///
|
||||
void(CEF_CALLBACK* create_route)(
|
||||
struct _cef_media_router_t* self,
|
||||
@@ -104,51 +104,51 @@ typedef struct _cef_media_router_t {
|
||||
struct _cef_media_route_create_callback_t* callback);
|
||||
|
||||
///
|
||||
// Trigger an asynchronous call to cef_media_observer_t::OnRoutes on all
|
||||
// registered observers.
|
||||
/// Trigger an asynchronous call to cef_media_observer_t::OnRoutes on all
|
||||
/// registered observers.
|
||||
///
|
||||
void(CEF_CALLBACK* notify_current_routes)(struct _cef_media_router_t* self);
|
||||
} cef_media_router_t;
|
||||
|
||||
///
|
||||
// Returns the MediaRouter object associated with the global request context. If
|
||||
// |callback| is non-NULL it will be executed asnychronously on the UI thread
|
||||
// after the manager's storage has been initialized. Equivalent to calling cef_r
|
||||
// equest_context_t::cef_request_context_get_global_context()->get_media_router(
|
||||
// ).
|
||||
/// Returns the MediaRouter object associated with the global request context.
|
||||
/// If |callback| is non-NULL it will be executed asnychronously on the UI
|
||||
/// thread after the manager's storage has been initialized. Equivalent to
|
||||
/// calling cef_request_context_t::cef_request_context_get_global_context()->get
|
||||
/// _media_router().
|
||||
///
|
||||
CEF_EXPORT cef_media_router_t* cef_media_router_get_global(
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Implemented by the client to observe MediaRouter events and registered via
|
||||
// cef_media_router_t::AddObserver. The functions of this structure will be
|
||||
// called on the browser process UI thread.
|
||||
/// Implemented by the client to observe MediaRouter events and registered via
|
||||
/// cef_media_router_t::AddObserver. The functions of this structure will be
|
||||
/// called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_media_observer_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// The list of available media sinks has changed or
|
||||
// cef_media_router_t::NotifyCurrentSinks was called.
|
||||
/// The list of available media sinks has changed or
|
||||
/// cef_media_router_t::NotifyCurrentSinks was called.
|
||||
///
|
||||
void(CEF_CALLBACK* on_sinks)(struct _cef_media_observer_t* self,
|
||||
size_t sinksCount,
|
||||
struct _cef_media_sink_t* const* sinks);
|
||||
|
||||
///
|
||||
// The list of available media routes has changed or
|
||||
// cef_media_router_t::NotifyCurrentRoutes was called.
|
||||
/// The list of available media routes has changed or
|
||||
/// cef_media_router_t::NotifyCurrentRoutes was called.
|
||||
///
|
||||
void(CEF_CALLBACK* on_routes)(struct _cef_media_observer_t* self,
|
||||
size_t routesCount,
|
||||
struct _cef_media_route_t* const* routes);
|
||||
|
||||
///
|
||||
// The connection state of |route| has changed.
|
||||
/// The connection state of |route| has changed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_route_state_changed)(
|
||||
struct _cef_media_observer_t* self,
|
||||
@@ -156,8 +156,8 @@ typedef struct _cef_media_observer_t {
|
||||
cef_media_route_connection_state_t state);
|
||||
|
||||
///
|
||||
// A message was recieved over |route|. |message| is only valid for the scope
|
||||
// of this callback and should be copied if necessary.
|
||||
/// A message was recieved over |route|. |message| is only valid for the scope
|
||||
/// of this callback and should be copied if necessary.
|
||||
///
|
||||
void(CEF_CALLBACK* on_route_message_received)(
|
||||
struct _cef_media_observer_t* self,
|
||||
@@ -167,65 +167,65 @@ typedef struct _cef_media_observer_t {
|
||||
} cef_media_observer_t;
|
||||
|
||||
///
|
||||
// Represents the route between a media source and sink. Instances of this
|
||||
// object are created via cef_media_router_t::CreateRoute and retrieved via
|
||||
// cef_media_observer_t::OnRoutes. Contains the status and metadata of a routing
|
||||
// operation. The functions of this structure may be called on any browser
|
||||
// process thread unless otherwise indicated.
|
||||
/// Represents the route between a media source and sink. Instances of this
|
||||
/// object are created via cef_media_router_t::CreateRoute and retrieved via
|
||||
/// cef_media_observer_t::OnRoutes. Contains the status and metadata of a
|
||||
/// routing operation. The functions of this structure may be called on any
|
||||
/// browser process thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_media_route_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns the ID for this route.
|
||||
/// Returns the ID for this route.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_route_t* self);
|
||||
|
||||
///
|
||||
// Returns the source associated with this route.
|
||||
/// Returns the source associated with this route.
|
||||
///
|
||||
struct _cef_media_source_t*(CEF_CALLBACK* get_source)(
|
||||
struct _cef_media_route_t* self);
|
||||
|
||||
///
|
||||
// Returns the sink associated with this route.
|
||||
/// Returns the sink associated with this route.
|
||||
///
|
||||
struct _cef_media_sink_t*(CEF_CALLBACK* get_sink)(
|
||||
struct _cef_media_route_t* self);
|
||||
|
||||
///
|
||||
// Send a message over this route. |message| will be copied if necessary.
|
||||
/// Send a message over this route. |message| will be copied if necessary.
|
||||
///
|
||||
void(CEF_CALLBACK* send_route_message)(struct _cef_media_route_t* self,
|
||||
const void* message,
|
||||
size_t message_size);
|
||||
|
||||
///
|
||||
// Terminate this route. Will result in an asynchronous call to
|
||||
// cef_media_observer_t::OnRoutes on all registered observers.
|
||||
/// Terminate this route. Will result in an asynchronous call to
|
||||
/// cef_media_observer_t::OnRoutes on all registered observers.
|
||||
///
|
||||
void(CEF_CALLBACK* terminate)(struct _cef_media_route_t* self);
|
||||
} cef_media_route_t;
|
||||
|
||||
///
|
||||
// Callback structure for cef_media_router_t::CreateRoute. The functions of this
|
||||
// structure will be called on the browser process UI thread.
|
||||
/// Callback structure for cef_media_router_t::CreateRoute. The functions of
|
||||
/// this structure will be called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_media_route_create_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Method that will be executed when the route creation has finished. |result|
|
||||
// will be CEF_MRCR_OK if the route creation succeeded. |error| will be a
|
||||
// description of the error if the route creation failed. |route| is the
|
||||
// resulting route, or NULL if the route creation failed.
|
||||
/// Method that will be executed when the route creation has finished.
|
||||
/// |result| will be CEF_MRCR_OK if the route creation succeeded. |error| will
|
||||
/// be a description of the error if the route creation failed. |route| is the
|
||||
/// resulting route, or NULL if the route creation failed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_media_route_create_finished)(
|
||||
struct _cef_media_route_create_callback_t* self,
|
||||
@@ -235,78 +235,78 @@ typedef struct _cef_media_route_create_callback_t {
|
||||
} cef_media_route_create_callback_t;
|
||||
|
||||
///
|
||||
// Represents a sink to which media can be routed. Instances of this object are
|
||||
// retrieved via cef_media_observer_t::OnSinks. The functions of this structure
|
||||
// may be called on any browser process thread unless otherwise indicated.
|
||||
/// Represents a sink to which media can be routed. Instances of this object are
|
||||
/// retrieved via cef_media_observer_t::OnSinks. The functions of this structure
|
||||
/// may be called on any browser process thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_media_sink_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns the ID for this sink.
|
||||
/// Returns the ID for this sink.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_sink_t* self);
|
||||
|
||||
///
|
||||
// Returns the name of this sink.
|
||||
/// Returns the name of this sink.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_media_sink_t* self);
|
||||
|
||||
///
|
||||
// Returns the description of this sink.
|
||||
/// Returns the description of this sink.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_description)(
|
||||
struct _cef_media_sink_t* self);
|
||||
|
||||
///
|
||||
// Returns the icon type for this sink.
|
||||
/// Returns the icon type for this sink.
|
||||
///
|
||||
cef_media_sink_icon_type_t(CEF_CALLBACK* get_icon_type)(
|
||||
struct _cef_media_sink_t* self);
|
||||
|
||||
///
|
||||
// Asynchronously retrieves device info.
|
||||
/// Asynchronously retrieves device info.
|
||||
///
|
||||
void(CEF_CALLBACK* get_device_info)(
|
||||
struct _cef_media_sink_t* self,
|
||||
struct _cef_media_sink_device_info_callback_t* callback);
|
||||
|
||||
///
|
||||
// Returns true (1) if this sink accepts content via Cast.
|
||||
/// Returns true (1) if this sink accepts content via Cast.
|
||||
///
|
||||
int(CEF_CALLBACK* is_cast_sink)(struct _cef_media_sink_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this sink accepts content via DIAL.
|
||||
/// Returns true (1) if this sink accepts content via DIAL.
|
||||
///
|
||||
int(CEF_CALLBACK* is_dial_sink)(struct _cef_media_sink_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this sink is compatible with |source|.
|
||||
/// Returns true (1) if this sink is compatible with |source|.
|
||||
///
|
||||
int(CEF_CALLBACK* is_compatible_with)(struct _cef_media_sink_t* self,
|
||||
struct _cef_media_source_t* source);
|
||||
} cef_media_sink_t;
|
||||
|
||||
///
|
||||
// Callback structure for cef_media_sink_t::GetDeviceInfo. The functions of this
|
||||
// structure will be called on the browser process UI thread.
|
||||
/// Callback structure for cef_media_sink_t::GetDeviceInfo. The functions of
|
||||
/// this structure will be called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_media_sink_device_info_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Method that will be executed asyncronously once device information has been
|
||||
// retrieved.
|
||||
/// Method that will be executed asyncronously once device information has
|
||||
/// been retrieved.
|
||||
///
|
||||
void(CEF_CALLBACK* on_media_sink_device_info)(
|
||||
struct _cef_media_sink_device_info_callback_t* self,
|
||||
@@ -314,30 +314,30 @@ typedef struct _cef_media_sink_device_info_callback_t {
|
||||
} cef_media_sink_device_info_callback_t;
|
||||
|
||||
///
|
||||
// Represents a source from which media can be routed. Instances of this object
|
||||
// are retrieved via cef_media_router_t::GetSource. The functions of this
|
||||
// structure may be called on any browser process thread unless otherwise
|
||||
// indicated.
|
||||
/// Represents a source from which media can be routed. Instances of this object
|
||||
/// are retrieved via cef_media_router_t::GetSource. The functions of this
|
||||
/// structure may be called on any browser process thread unless otherwise
|
||||
/// indicated.
|
||||
///
|
||||
typedef struct _cef_media_source_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns the ID (media source URN or URL) for this source.
|
||||
/// Returns the ID (media source URN or URL) for this source.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_id)(struct _cef_media_source_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this source outputs its content via Cast.
|
||||
/// Returns true (1) if this source outputs its content via Cast.
|
||||
///
|
||||
int(CEF_CALLBACK* is_cast_source)(struct _cef_media_source_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this source outputs its content via DIAL.
|
||||
/// Returns true (1) if this source outputs its content via DIAL.
|
||||
///
|
||||
int(CEF_CALLBACK* is_dial_source)(struct _cef_media_source_t* self);
|
||||
} cef_media_source_t;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=77ac3e0cda15dd166c24e3f94671d1f9c9776142$
|
||||
// $hash=4bf9250599e3ba26e7f74ec22338548492202625$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
|
||||
@@ -48,54 +48,54 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Supports creation and modification of menus. See cef_menu_id_t for the
|
||||
// command ids that have default implementations. All user-defined command ids
|
||||
// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of
|
||||
// this structure can only be accessed on the browser process the UI thread.
|
||||
/// Supports creation and modification of menus. See cef_menu_id_t for the
|
||||
/// command ids that have default implementations. All user-defined command ids
|
||||
/// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of
|
||||
/// this structure can only be accessed on the browser process the UI thread.
|
||||
///
|
||||
typedef struct _cef_menu_model_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this menu is a submenu.
|
||||
/// Returns true (1) if this menu is a submenu.
|
||||
///
|
||||
int(CEF_CALLBACK* is_sub_menu)(struct _cef_menu_model_t* self);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// Returns the number of items in this menu.
|
||||
/// Returns the number of items in this menu.
|
||||
///
|
||||
size_t(CEF_CALLBACK* get_count)(struct _cef_menu_model_t* self);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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,
|
||||
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 command_id,
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Add a radio item to the menu. Only a single item with the specified
|
||||
// |group_id| can be checked at a time. Returns true (1) on success.
|
||||
/// Add a radio item to the menu. Only a single item with the specified
|
||||
/// |group_id| can be checked at a time. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* add_radio_item)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
@@ -103,7 +103,7 @@ typedef struct _cef_menu_model_t {
|
||||
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* self,
|
||||
@@ -111,15 +111,15 @@ typedef struct _cef_menu_model_t {
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Insert a separator in the menu at the specified |index|. Returns true (1)
|
||||
// on success.
|
||||
/// Insert a separator in the menu at the specified |index|. Returns true (1)
|
||||
/// on success.
|
||||
///
|
||||
int(CEF_CALLBACK* insert_separator_at)(struct _cef_menu_model_t* self,
|
||||
size_t index);
|
||||
|
||||
///
|
||||
// Insert an item in the menu at the specified |index|. Returns true (1) on
|
||||
// success.
|
||||
/// Insert an item in the menu at the specified |index|. Returns true (1) on
|
||||
/// success.
|
||||
///
|
||||
int(CEF_CALLBACK* insert_item_at)(struct _cef_menu_model_t* self,
|
||||
size_t index,
|
||||
@@ -127,8 +127,8 @@ typedef struct _cef_menu_model_t {
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Insert a check item in the menu at the specified |index|. Returns true (1)
|
||||
// on success.
|
||||
/// Insert a check item in the menu at the specified |index|. Returns true (1)
|
||||
/// on success.
|
||||
///
|
||||
int(CEF_CALLBACK* insert_check_item_at)(struct _cef_menu_model_t* self,
|
||||
size_t index,
|
||||
@@ -136,9 +136,9 @@ typedef struct _cef_menu_model_t {
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Insert a radio item in the menu at the specified |index|. Only a single
|
||||
// item with the specified |group_id| can be checked at a time. Returns true
|
||||
// (1) on success.
|
||||
/// Insert a radio item in the menu at the specified |index|. Only a single
|
||||
/// item with the specified |group_id| can be checked at a time. Returns true
|
||||
/// (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* insert_radio_item_at)(struct _cef_menu_model_t* self,
|
||||
size_t index,
|
||||
@@ -147,8 +147,8 @@ typedef struct _cef_menu_model_t {
|
||||
int group_id);
|
||||
|
||||
///
|
||||
// Insert a sub-menu in the menu at the specified |index|. The new sub-menu is
|
||||
// returned.
|
||||
/// Insert a sub-menu in the menu at the specified |index|. The new sub-menu
|
||||
/// is returned.
|
||||
///
|
||||
struct _cef_menu_model_t*(CEF_CALLBACK* insert_sub_menu_at)(
|
||||
struct _cef_menu_model_t* self,
|
||||
@@ -157,219 +157,220 @@ typedef struct _cef_menu_model_t {
|
||||
const cef_string_t* label);
|
||||
|
||||
///
|
||||
// Removes the item with the specified |command_id|. Returns true (1) on
|
||||
// success.
|
||||
/// Removes the item with the specified |command_id|. Returns true (1) on
|
||||
/// success.
|
||||
///
|
||||
int(CEF_CALLBACK* remove)(struct _cef_menu_model_t* self, int command_id);
|
||||
|
||||
///
|
||||
// Removes the item at the specified |index|. Returns true (1) on success.
|
||||
/// Removes the item at the specified |index|. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* remove_at)(struct _cef_menu_model_t* self, size_t index);
|
||||
|
||||
///
|
||||
// Returns the index associated with the specified |command_id| or -1 if not
|
||||
// found due to the command id not existing in the menu.
|
||||
/// Returns the index associated with the specified |command_id| or -1 if not
|
||||
/// found due to the command id not existing in the menu.
|
||||
///
|
||||
int(CEF_CALLBACK* get_index_of)(struct _cef_menu_model_t* self,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
// Returns the command id at the specified |index| or -1 if not found due to
|
||||
// invalid range or the index being a separator.
|
||||
/// Returns the command id at the specified |index| or -1 if not found due to
|
||||
/// invalid range or the index being a separator.
|
||||
///
|
||||
int(CEF_CALLBACK* get_command_id_at)(struct _cef_menu_model_t* self,
|
||||
size_t 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,
|
||||
size_t 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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_label)(struct _cef_menu_model_t* self,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
// Returns the label at the specified |index| or NULL if not found due to
|
||||
// invalid range or the index being a separator.
|
||||
/// Returns the label at the specified |index| or NULL if not found due to
|
||||
/// invalid range or the index being a separator.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(
|
||||
CEF_CALLBACK* get_label_at)(struct _cef_menu_model_t* self, size_t 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,
|
||||
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,
|
||||
size_t 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,
|
||||
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)(struct _cef_menu_model_t* self, size_t 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 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,
|
||||
size_t index);
|
||||
|
||||
///
|
||||
// Sets the group id for the specified |command_id|. Returns true (1) on
|
||||
// success.
|
||||
/// Sets the group id for the specified |command_id|. Returns true (1) on
|
||||
/// success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_group_id)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
int group_id);
|
||||
|
||||
///
|
||||
// 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,
|
||||
size_t 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* 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* self,
|
||||
size_t index);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |command_id| is visible.
|
||||
/// Returns true (1) if the specified |command_id| is visible.
|
||||
///
|
||||
int(CEF_CALLBACK* is_visible)(struct _cef_menu_model_t* self, int command_id);
|
||||
|
||||
///
|
||||
// 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,
|
||||
size_t index);
|
||||
|
||||
///
|
||||
// Change the visibility of the specified |command_id|. Returns true (1) on
|
||||
// success.
|
||||
/// Change the visibility of the specified |command_id|. Returns true (1) on
|
||||
/// success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_visible)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
int visible);
|
||||
|
||||
///
|
||||
// Change the visibility at the specified |index|. Returns true (1) on
|
||||
// success.
|
||||
/// Change the visibility at the specified |index|. Returns true (1) on
|
||||
/// success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_visible_at)(struct _cef_menu_model_t* self,
|
||||
size_t 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 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,
|
||||
size_t index);
|
||||
|
||||
///
|
||||
// Change the enabled status of the specified |command_id|. Returns true (1)
|
||||
// on success.
|
||||
/// Change the enabled status of the specified |command_id|. Returns true (1)
|
||||
/// on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_enabled)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
int enabled);
|
||||
|
||||
///
|
||||
// Change the enabled status at the specified |index|. Returns true (1) on
|
||||
// success.
|
||||
/// Change the enabled status at the specified |index|. Returns true (1) on
|
||||
/// success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_enabled_at)(struct _cef_menu_model_t* self,
|
||||
size_t index,
|
||||
int enabled);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |command_id| is checked. Only applies to
|
||||
// check and radio items.
|
||||
/// Returns true (1) if the specified |command_id| is checked. Only applies to
|
||||
/// check and radio items.
|
||||
///
|
||||
int(CEF_CALLBACK* is_checked)(struct _cef_menu_model_t* self, int command_id);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |index| is checked. Only applies to check
|
||||
// and radio items.
|
||||
/// Returns true (1) if the specified |index| is checked. Only applies to
|
||||
/// check and radio items.
|
||||
///
|
||||
int(CEF_CALLBACK* is_checked_at)(struct _cef_menu_model_t* self,
|
||||
size_t index);
|
||||
|
||||
///
|
||||
// Check the specified |command_id|. Only applies to check and radio items.
|
||||
// Returns true (1) on success.
|
||||
/// Check the specified |command_id|. Only applies to check and radio items.
|
||||
/// Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_checked)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
int checked);
|
||||
|
||||
///
|
||||
// Check the specified |index|. Only applies to check and radio items. Returns
|
||||
// true (1) on success.
|
||||
/// Check the specified |index|. Only applies to check and radio items.
|
||||
/// Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_checked_at)(struct _cef_menu_model_t* self,
|
||||
size_t index,
|
||||
int checked);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |command_id| has a keyboard accelerator
|
||||
// assigned.
|
||||
/// Returns true (1) if the specified |command_id| has a keyboard accelerator
|
||||
/// assigned.
|
||||
///
|
||||
int(CEF_CALLBACK* has_accelerator)(struct _cef_menu_model_t* self,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
// Returns true (1) if the specified |index| has a keyboard accelerator
|
||||
// assigned.
|
||||
/// Returns true (1) if the specified |index| has a keyboard accelerator
|
||||
/// assigned.
|
||||
///
|
||||
int(CEF_CALLBACK* has_accelerator_at)(struct _cef_menu_model_t* self,
|
||||
size_t index);
|
||||
|
||||
///
|
||||
// Set the keyboard accelerator for the specified |command_id|. |key_code| can
|
||||
// be any virtual key or character value. Returns true (1) on success.
|
||||
/// Set the keyboard accelerator for the specified |command_id|. |key_code|
|
||||
/// can be any virtual key or character value. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_accelerator)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
@@ -379,8 +380,8 @@ typedef struct _cef_menu_model_t {
|
||||
int alt_pressed);
|
||||
|
||||
///
|
||||
// Set the keyboard accelerator at the specified |index|. |key_code| can be
|
||||
// any virtual key or character value. Returns true (1) on success.
|
||||
/// Set the keyboard accelerator at the specified |index|. |key_code| can be
|
||||
/// any virtual key or character value. Returns true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* set_accelerator_at)(struct _cef_menu_model_t* self,
|
||||
size_t index,
|
||||
@@ -390,22 +391,22 @@ typedef struct _cef_menu_model_t {
|
||||
int alt_pressed);
|
||||
|
||||
///
|
||||
// Remove the keyboard accelerator for the specified |command_id|. Returns
|
||||
// true (1) on success.
|
||||
/// Remove the keyboard accelerator for the specified |command_id|. Returns
|
||||
/// true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* remove_accelerator)(struct _cef_menu_model_t* self,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
// Remove the keyboard accelerator at the specified |index|. Returns true (1)
|
||||
// on success.
|
||||
/// Remove the keyboard accelerator at the specified |index|. Returns true (1)
|
||||
/// on success.
|
||||
///
|
||||
int(CEF_CALLBACK* remove_accelerator_at)(struct _cef_menu_model_t* self,
|
||||
size_t index);
|
||||
|
||||
///
|
||||
// Retrieves the keyboard accelerator for the specified |command_id|. Returns
|
||||
// true (1) on success.
|
||||
/// Retrieves the keyboard accelerator for the specified |command_id|. Returns
|
||||
/// true (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* get_accelerator)(struct _cef_menu_model_t* self,
|
||||
int command_id,
|
||||
@@ -415,8 +416,8 @@ typedef struct _cef_menu_model_t {
|
||||
int* alt_pressed);
|
||||
|
||||
///
|
||||
// Retrieves the keyboard accelerator for the specified |index|. Returns true
|
||||
// (1) on success.
|
||||
/// Retrieves the keyboard accelerator for the specified |index|. Returns true
|
||||
/// (1) on success.
|
||||
///
|
||||
int(CEF_CALLBACK* get_accelerator_at)(struct _cef_menu_model_t* self,
|
||||
size_t index,
|
||||
@@ -426,10 +427,10 @@ typedef struct _cef_menu_model_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -437,11 +438,11 @@ typedef struct _cef_menu_model_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -449,9 +450,9 @@ typedef struct _cef_menu_model_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -459,10 +460,10 @@ typedef struct _cef_menu_model_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -470,33 +471,33 @@ typedef struct _cef_menu_model_t {
|
||||
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"
|
||||
/// 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"
|
||||
/// 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,
|
||||
@@ -504,7 +505,7 @@ typedef struct _cef_menu_model_t {
|
||||
} cef_menu_model_t;
|
||||
|
||||
///
|
||||
// Create a new MenuModel with the specified |delegate|.
|
||||
/// Create a new MenuModel with the specified |delegate|.
|
||||
///
|
||||
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
|
||||
struct _cef_menu_model_delegate_t* delegate);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=bdb670bcaa9eb9f5748900ad25bcc061155d6076$
|
||||
// $hash=8254165498a527d40517c1bc8ec413ad7a0ed259$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
||||
@@ -49,19 +49,19 @@ extern "C" {
|
||||
struct _cef_menu_model_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle menu model events. The functions of this
|
||||
// structure will be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
/// Implement this structure to handle menu model events. The functions of this
|
||||
/// structure will be called on the browser process UI thread unless otherwise
|
||||
/// indicated.
|
||||
///
|
||||
typedef struct _cef_menu_model_delegate_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Perform the action associated with the specified |command_id| and optional
|
||||
// |event_flags|.
|
||||
/// Perform the action associated with the specified |command_id| and optional
|
||||
/// |event_flags|.
|
||||
///
|
||||
void(CEF_CALLBACK* execute_command)(struct _cef_menu_model_delegate_t* self,
|
||||
struct _cef_menu_model_t* menu_model,
|
||||
@@ -69,8 +69,8 @@ typedef struct _cef_menu_model_delegate_t {
|
||||
cef_event_flags_t event_flags);
|
||||
|
||||
///
|
||||
// Called when the user moves the mouse outside the menu and over the owning
|
||||
// window.
|
||||
/// 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,
|
||||
@@ -78,8 +78,8 @@ typedef struct _cef_menu_model_delegate_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -87,8 +87,8 @@ typedef struct _cef_menu_model_delegate_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -96,20 +96,20 @@ typedef struct _cef_menu_model_delegate_t {
|
||||
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,
|
||||
struct _cef_menu_model_t* menu_model);
|
||||
|
||||
///
|
||||
// The menu has closed.
|
||||
/// The menu has closed.
|
||||
///
|
||||
void(CEF_CALLBACK* menu_closed)(struct _cef_menu_model_delegate_t* self,
|
||||
struct _cef_menu_model_t* menu_model);
|
||||
|
||||
///
|
||||
// Optionally modify a menu item label. Return true (1) if |label| was
|
||||
// modified.
|
||||
/// 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,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=6f617dd09dc2abc0c2c7534db2b045aebb595f09$
|
||||
// $hash=2822d96d72b7df816c0fefb4ce1cbba18add50ac$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
|
||||
@@ -48,78 +48,79 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure used to represent an entry in navigation history.
|
||||
/// Structure used to represent an entry in navigation history.
|
||||
///
|
||||
typedef struct _cef_navigation_entry_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
||||
/// if this function returns false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* is_valid)(struct _cef_navigation_entry_t* self);
|
||||
|
||||
///
|
||||
// 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.
|
||||
/// Returns the actual URL of the page. For some pages this may be data: URL
|
||||
/// or similar. Use get_display_url() to return a display-friendly version.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_url)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_display_url)(
|
||||
struct _cef_navigation_entry_t* self);
|
||||
|
||||
///
|
||||
// Returns the original URL that was entered by the user before any redirects.
|
||||
/// Returns the original URL that was entered by the user before any
|
||||
/// redirects.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_original_url)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_title)(
|
||||
struct _cef_navigation_entry_t* self);
|
||||
|
||||
///
|
||||
// Returns the transition type which indicates what the user did to move to
|
||||
// this page from the previous page.
|
||||
/// Returns the transition type which indicates what the user did to move to
|
||||
/// this page from the previous page.
|
||||
///
|
||||
cef_transition_type_t(CEF_CALLBACK* get_transition_type)(
|
||||
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);
|
||||
|
||||
///
|
||||
// Returns the time for the last known successful navigation completion. A
|
||||
// navigation may be completed more than once if the page is reloaded. May be
|
||||
// 0 if the navigation has not yet completed.
|
||||
/// Returns the time for the last known successful navigation completion. A
|
||||
/// navigation may be completed more than once if the page is reloaded. May be
|
||||
/// 0 if the navigation has not yet completed.
|
||||
///
|
||||
cef_basetime_t(CEF_CALLBACK* get_completion_time)(
|
||||
struct _cef_navigation_entry_t* self);
|
||||
|
||||
///
|
||||
// Returns the HTTP status code for the last known successful navigation
|
||||
// response. May be 0 if the response has not yet been received or if the
|
||||
// navigation has not yet completed.
|
||||
/// Returns the HTTP status code for the last known successful navigation
|
||||
/// response. May be 0 if the response has not yet been received or if the
|
||||
/// navigation has not yet completed.
|
||||
///
|
||||
int(CEF_CALLBACK* get_http_status_code)(struct _cef_navigation_entry_t* self);
|
||||
|
||||
///
|
||||
// Returns the SSL information for this navigation entry.
|
||||
/// Returns the SSL information for this navigation entry.
|
||||
///
|
||||
struct _cef_sslstatus_t*(CEF_CALLBACK* get_sslstatus)(
|
||||
struct _cef_navigation_entry_t* self);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=26fdd1f18f30d9e2a48aeeb5c69607d9d22d69ca$
|
||||
// $hash=a40860835e6e693ed2f85eab5fa7990b7f2c7bbe$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
|
||||
@@ -47,40 +47,41 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Add an entry to the cross-origin access whitelist.
|
||||
//
|
||||
// The same-origin policy restricts how scripts hosted from different origins
|
||||
// (scheme + domain + port) can communicate. By default, scripts can only access
|
||||
// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes
|
||||
// (but no other schemes) can use the "Access-Control-Allow-Origin" header to
|
||||
// allow cross-origin requests. For example, https://source.example.com can make
|
||||
// XMLHttpRequest requests on http://target.example.com if the
|
||||
// http://target.example.com request returns an "Access-Control-Allow-Origin:
|
||||
// https://source.example.com" response header.
|
||||
//
|
||||
// Scripts in separate frames or iframes and hosted from the same protocol and
|
||||
// domain suffix can execute cross-origin JavaScript if both pages set the
|
||||
// document.domain value to the same domain suffix. For example,
|
||||
// scheme://foo.example.com and scheme://bar.example.com can communicate using
|
||||
// JavaScript if both domains set document.domain="example.com".
|
||||
//
|
||||
// This function is used to allow access to origins that would otherwise violate
|
||||
// the same-origin policy. Scripts hosted underneath the fully qualified
|
||||
// |source_origin| URL (like http://www.example.com) will be allowed access to
|
||||
// all resources hosted on the specified |target_protocol| and |target_domain|.
|
||||
// If |target_domain| is non-NULL and |allow_target_subdomains| if false (0)
|
||||
// only exact domain matches will be allowed. If |target_domain| contains a top-
|
||||
// level domain component (like "example.com") and |allow_target_subdomains| is
|
||||
// true (1) sub-domain matches will be allowed. If |target_domain| is NULL and
|
||||
// |allow_target_subdomains| if true (1) all domains and IP addresses will be
|
||||
// allowed.
|
||||
//
|
||||
// This function cannot be used to bypass the restrictions on local or display
|
||||
// isolated schemes. See the comments on CefRegisterCustomScheme for more
|
||||
// information.
|
||||
//
|
||||
// This function may be called on any thread. Returns false (0) if
|
||||
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||
/// Add an entry to the cross-origin access whitelist.
|
||||
///
|
||||
/// The same-origin policy restricts how scripts hosted from different origins
|
||||
/// (scheme + domain + port) can communicate. By default, scripts can only
|
||||
/// access resources with the same origin. Scripts hosted on the HTTP and HTTPS
|
||||
/// schemes (but no other schemes) can use the "Access-Control-Allow-Origin"
|
||||
/// header to allow cross-origin requests. For example,
|
||||
/// https://source.example.com can make XMLHttpRequest requests on
|
||||
/// http://target.example.com if the http://target.example.com request returns
|
||||
/// an "Access-Control-Allow-Origin: https://source.example.com" response
|
||||
/// header.
|
||||
///
|
||||
/// Scripts in separate frames or iframes and hosted from the same protocol and
|
||||
/// domain suffix can execute cross-origin JavaScript if both pages set the
|
||||
/// document.domain value to the same domain suffix. For example,
|
||||
/// scheme://foo.example.com and scheme://bar.example.com can communicate using
|
||||
/// JavaScript if both domains set document.domain="example.com".
|
||||
///
|
||||
/// This function is used to allow access to origins that would otherwise
|
||||
/// violate the same-origin policy. Scripts hosted underneath the fully
|
||||
/// qualified |source_origin| URL (like http://www.example.com) will be allowed
|
||||
/// access to all resources hosted on the specified |target_protocol| and
|
||||
/// |target_domain|. If |target_domain| is non-NULL and
|
||||
/// |allow_target_subdomains| if false (0) only exact domain matches will be
|
||||
/// allowed. If |target_domain| contains a top- level domain component (like
|
||||
/// "example.com") and |allow_target_subdomains| is true (1) sub-domain matches
|
||||
/// will be allowed. If |target_domain| is NULL and |allow_target_subdomains| if
|
||||
/// true (1) all domains and IP addresses will be allowed.
|
||||
///
|
||||
/// This function cannot be used to bypass the restrictions on local or display
|
||||
/// isolated schemes. See the comments on CefRegisterCustomScheme for more
|
||||
/// information.
|
||||
///
|
||||
/// This function may be called on any thread. Returns false (0) if
|
||||
/// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||
///
|
||||
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
||||
const cef_string_t* source_origin,
|
||||
@@ -89,8 +90,8 @@ CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
||||
int allow_target_subdomains);
|
||||
|
||||
///
|
||||
// Remove an entry from the cross-origin access whitelist. Returns false (0) if
|
||||
// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||
/// Remove an entry from the cross-origin access whitelist. Returns false (0) if
|
||||
/// |source_origin| is invalid or the whitelist cannot be accessed.
|
||||
///
|
||||
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
||||
const cef_string_t* source_origin,
|
||||
@@ -99,8 +100,8 @@ CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
||||
int allow_target_subdomains);
|
||||
|
||||
///
|
||||
// Remove all entries from the cross-origin access whitelist. Returns false (0)
|
||||
// if the whitelist cannot be accessed.
|
||||
/// Remove all entries from the cross-origin access whitelist. Returns false (0)
|
||||
/// if the whitelist cannot be accessed.
|
||||
///
|
||||
CEF_EXPORT int cef_clear_cross_origin_whitelist(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f5e1c0fc43c6e85dbafa66975d9dc5e2bc7be69f$
|
||||
// $hash=f6dfdfa5b8c77931d8e083a66f5a9445a2fdbf45$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
|
||||
@@ -47,84 +47,92 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Parse the specified |url| into its component parts. Returns false (0) if the
|
||||
// URL is NULL or invalid.
|
||||
/// Combines specified |base_url| and |relative_url| into |resolved_url|.
|
||||
/// Returns false (0) if one of the URLs is NULL or invalid.
|
||||
///
|
||||
CEF_EXPORT int cef_resolve_url(const cef_string_t* base_url,
|
||||
const cef_string_t* relative_url,
|
||||
cef_string_t* resolved_url);
|
||||
|
||||
///
|
||||
/// Parse the specified |url| into its component parts. Returns false (0) if the
|
||||
/// URL is NULL or invalid.
|
||||
///
|
||||
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
|
||||
struct _cef_urlparts_t* parts);
|
||||
|
||||
///
|
||||
// Creates a URL from the specified |parts|, which must contain a non-NULL spec
|
||||
// or a non-NULL host and path (at a minimum), but not both. Returns false (0)
|
||||
// if |parts| isn't initialized as described.
|
||||
/// Creates a URL from the specified |parts|, which must contain a non-NULL spec
|
||||
/// or a non-NULL host and path (at a minimum), but not both. Returns false (0)
|
||||
/// if |parts| isn't initialized as described.
|
||||
///
|
||||
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
|
||||
cef_string_t* url);
|
||||
|
||||
///
|
||||
// This is a convenience function for formatting a URL in a concise and human-
|
||||
// friendly way to help users make security-related decisions (or in other
|
||||
// circumstances when people need to distinguish sites, origins, or otherwise-
|
||||
// simplified URLs from each other). Internationalized domain names (IDN) may be
|
||||
// presented in Unicode if the conversion is considered safe. The returned value
|
||||
// will (a) omit the path for standard schemes, excepting file and filesystem,
|
||||
// and (b) omit the port if it is the default for the scheme. Do not use this
|
||||
// for URLs which will be parsed or sent to other applications.
|
||||
/// This is a convenience function for formatting a URL in a concise and human-
|
||||
/// friendly way to help users make security-related decisions (or in other
|
||||
/// circumstances when people need to distinguish sites, origins, or otherwise-
|
||||
/// simplified URLs from each other). Internationalized domain names (IDN) may
|
||||
/// be presented in Unicode if the conversion is considered safe. The returned
|
||||
/// value will (a) omit the path for standard schemes, excepting file and
|
||||
/// filesystem, and (b) omit the port if it is the default for the scheme. Do
|
||||
/// not use this for URLs which will be parsed or sent to other applications.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t
|
||||
cef_format_url_for_security_display(const cef_string_t* origin_url);
|
||||
|
||||
///
|
||||
// Returns the mime type for the specified file extension or an NULL string if
|
||||
// unknown.
|
||||
/// Returns the mime type for the specified file extension or an NULL string if
|
||||
/// unknown.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t
|
||||
cef_get_mime_type(const cef_string_t* extension);
|
||||
|
||||
///
|
||||
// Get the extensions associated with the given mime type. This should be passed
|
||||
// in lower case. There could be multiple extensions for a given mime type, like
|
||||
// "html,htm" for "text/html", or "txt,text,html,..." for "text/*". Any existing
|
||||
// elements in the provided vector will not be erased.
|
||||
/// Get the extensions associated with the given mime type. This should be
|
||||
/// passed in lower case. There could be multiple extensions for a given mime
|
||||
/// type, like "html,htm" for "text/html", or "txt,text,html,..." for "text/*".
|
||||
/// Any existing elements in the provided vector will not be erased.
|
||||
///
|
||||
CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type,
|
||||
cef_string_list_t extensions);
|
||||
|
||||
///
|
||||
// Encodes |data| as a base64 string.
|
||||
/// Encodes |data| as a base64 string.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data,
|
||||
size_t data_size);
|
||||
|
||||
///
|
||||
// Decodes the base64 encoded string |data|. The returned value will be NULL if
|
||||
// the decoding fails.
|
||||
/// Decodes the base64 encoded string |data|. The returned value will be NULL if
|
||||
/// the decoding fails.
|
||||
///
|
||||
CEF_EXPORT struct _cef_binary_value_t* cef_base64decode(
|
||||
const cef_string_t* data);
|
||||
|
||||
///
|
||||
// Escapes characters in |text| which are unsuitable for use as a query
|
||||
// parameter value. Everything except alphanumerics and -_.!~*'() will be
|
||||
// converted to "%XX". If |use_plus| is true (1) spaces will change to "+". The
|
||||
// result is basically the same as encodeURIComponent in Javacript.
|
||||
/// Escapes characters in |text| which are unsuitable for use as a query
|
||||
/// parameter value. Everything except alphanumerics and -_.!~*'() will be
|
||||
/// converted to "%XX". If |use_plus| is true (1) spaces will change to "+". The
|
||||
/// result is basically the same as encodeURIComponent in Javacript.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text,
|
||||
int use_plus);
|
||||
|
||||
///
|
||||
// Unescapes |text| and returns the result. Unescaping consists of looking for
|
||||
// the exact pattern "%XX" where each X is a hex digit and converting to the
|
||||
// character with the numerical value of those digits (e.g. "i%20=%203%3b"
|
||||
// unescapes to "i = 3;"). If |convert_to_utf8| is true (1) this function will
|
||||
// attempt to interpret the initial decoded result as UTF-8. If the result is
|
||||
// convertable into UTF-8 it will be returned as converted. Otherwise the
|
||||
// initial decoded result will be returned. The |unescape_rule| parameter
|
||||
// supports further customization the decoding process.
|
||||
/// Unescapes |text| and returns the result. Unescaping consists of looking for
|
||||
/// the exact pattern "%XX" where each X is a hex digit and converting to the
|
||||
/// character with the numerical value of those digits (e.g. "i%20=%203%3b"
|
||||
/// unescapes to "i = 3;"). If |convert_to_utf8| is true (1) this function will
|
||||
/// attempt to interpret the initial decoded result as UTF-8. If the result is
|
||||
/// convertable into UTF-8 it will be returned as converted. Otherwise the
|
||||
/// initial decoded result will be returned. The |unescape_rule| parameter
|
||||
/// supports further customization the decoding process.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t
|
||||
@@ -133,17 +141,17 @@ cef_uridecode(const cef_string_t* text,
|
||||
cef_uri_unescape_rule_t unescape_rule);
|
||||
|
||||
///
|
||||
// Parses the specified |json_string| and returns a dictionary or list
|
||||
// representation. If JSON parsing fails this function returns NULL.
|
||||
/// Parses the specified |json_string| and returns a dictionary or list
|
||||
/// representation. If JSON parsing fails this function returns NULL.
|
||||
///
|
||||
CEF_EXPORT struct _cef_value_t* cef_parse_json(
|
||||
const cef_string_t* json_string,
|
||||
cef_json_parser_options_t options);
|
||||
|
||||
///
|
||||
// Parses the specified UTF8-encoded |json| buffer of size |json_size| and
|
||||
// returns a dictionary or list representation. If JSON parsing fails this
|
||||
// function returns NULL.
|
||||
/// Parses the specified UTF8-encoded |json| buffer of size |json_size| and
|
||||
/// returns a dictionary or list representation. If JSON parsing fails this
|
||||
/// function returns NULL.
|
||||
///
|
||||
CEF_EXPORT struct _cef_value_t* cef_parse_json_buffer(
|
||||
const void* json,
|
||||
@@ -151,9 +159,9 @@ CEF_EXPORT struct _cef_value_t* cef_parse_json_buffer(
|
||||
cef_json_parser_options_t options);
|
||||
|
||||
///
|
||||
// Parses the specified |json_string| and returns a dictionary or list
|
||||
// representation. If JSON parsing fails this function returns NULL and
|
||||
// populates |error_msg_out| with a formatted error message.
|
||||
/// Parses the specified |json_string| and returns a dictionary or list
|
||||
/// representation. If JSON parsing fails this function returns NULL and
|
||||
/// populates |error_msg_out| with a formatted error message.
|
||||
///
|
||||
CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
|
||||
const cef_string_t* json_string,
|
||||
@@ -161,9 +169,9 @@ CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
|
||||
cef_string_t* error_msg_out);
|
||||
|
||||
///
|
||||
// Generates a JSON string from the specified root |node| which should be a
|
||||
// dictionary or list value. Returns an NULL string on failure. This function
|
||||
// requires exclusive access to |node| including any underlying data.
|
||||
/// Generates a JSON string from the specified root |node| which should be a
|
||||
/// dictionary or list value. Returns an NULL string on failure. This function
|
||||
/// requires exclusive access to |node| including any underlying data.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
CEF_EXPORT cef_string_userfree_t
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=41ddd04d4efb147b05eb93816af1591ec3b61b76$
|
||||
// $hash=0b3af613a60e4c74ec83c0bb8f5280464cbe7f48$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
|
||||
@@ -47,8 +47,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Retrieve the path associated with the specified |key|. Returns true (1) on
|
||||
// success. Can be called on any thread in the browser process.
|
||||
/// Retrieve the path associated with the specified |key|. Returns true (1) on
|
||||
/// success. Can be called on any thread in the browser process.
|
||||
///
|
||||
CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=e902fe011f8667b64989e57ad9e72aec74b22015$
|
||||
// $hash=8f2ae563306d1e4ba5fa84a5f9a60712c6fc585f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_
|
||||
@@ -48,69 +48,71 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of media access
|
||||
// permission requests.
|
||||
/// Callback structure used for asynchronous continuation of media access
|
||||
/// permission requests.
|
||||
///
|
||||
typedef struct _cef_media_access_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Call to allow or deny media access. If this callback was initiated in
|
||||
// response to a getUserMedia (indicated by
|
||||
// CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE and/or
|
||||
// CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE being set) then
|
||||
// |allowed_permissions| must match |required_permissions| passed to
|
||||
// OnRequestMediaAccessPermission.
|
||||
/// Call to allow or deny media access. If this callback was initiated in
|
||||
/// response to a getUserMedia (indicated by
|
||||
/// CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE and/or
|
||||
/// CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE being set) then
|
||||
/// |allowed_permissions| must match |required_permissions| passed to
|
||||
/// OnRequestMediaAccessPermission.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_media_access_callback_t* self,
|
||||
uint32 allowed_permissions);
|
||||
|
||||
///
|
||||
// Cancel the media access request.
|
||||
/// Cancel the media access request.
|
||||
///
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_media_access_callback_t* self);
|
||||
} cef_media_access_callback_t;
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of permission prompts.
|
||||
/// Callback structure used for asynchronous continuation of permission prompts.
|
||||
///
|
||||
typedef struct _cef_permission_prompt_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Complete the permissions request with the specified |result|.
|
||||
/// Complete the permissions request with the specified |result|.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_permission_prompt_callback_t* self,
|
||||
cef_permission_request_result_t result);
|
||||
} cef_permission_prompt_callback_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to permission requests. The
|
||||
// functions of this structure will be called on the browser process UI thread.
|
||||
/// Implement this structure to handle events related to permission requests.
|
||||
/// The functions of this structure will be called on the browser process UI
|
||||
/// thread.
|
||||
///
|
||||
typedef struct _cef_permission_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called when a page requests permission to access media. |requesting_origin|
|
||||
// is the URL origin requesting permission. |requested_permissions| is a
|
||||
// combination of values from cef_media_access_permission_types_t that
|
||||
// represent the requested permissions. Return true (1) and call
|
||||
// cef_media_access_callback_t functions either in this function or at a later
|
||||
// time to continue or cancel the request. Return false (0) to proceed with
|
||||
// default handling. With the Chrome runtime, default handling will display
|
||||
// the permission request UI. With the Alloy runtime, default handling will
|
||||
// deny the request. This function will not be called if the "--enable-media-
|
||||
// stream" command-line switch is used to grant all permissions.
|
||||
/// Called when a page requests permission to access media.
|
||||
/// |requesting_origin| is the URL origin requesting permission.
|
||||
/// |requested_permissions| is a combination of values from
|
||||
/// cef_media_access_permission_types_t that represent the requested
|
||||
/// permissions. Return true (1) and call cef_media_access_callback_t
|
||||
/// functions either in this function or at a later time to continue or cancel
|
||||
/// the request. Return false (0) to proceed with default handling. With the
|
||||
/// Chrome runtime, default handling will display the permission request UI.
|
||||
/// With the Alloy runtime, default handling will deny the request. This
|
||||
/// function will not be called if the "--enable-media-stream" command-line
|
||||
/// switch is used to grant all permissions.
|
||||
///
|
||||
int(CEF_CALLBACK* on_request_media_access_permission)(
|
||||
struct _cef_permission_handler_t* self,
|
||||
@@ -121,15 +123,15 @@ typedef struct _cef_permission_handler_t {
|
||||
struct _cef_media_access_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called when a page should show a permission prompt. |prompt_id| uniquely
|
||||
// identifies the prompt. |requesting_origin| is the URL origin requesting
|
||||
// permission. |requested_permissions| is a combination of values from
|
||||
// cef_permission_request_types_t that represent the requested permissions.
|
||||
// Return true (1) and call cef_permission_prompt_callback_t::Continue either
|
||||
// in this function or at a later time to continue or cancel the request.
|
||||
// Return false (0) to proceed with default handling. With the Chrome runtime,
|
||||
// default handling will display the permission prompt UI. With the Alloy
|
||||
// runtime, default handling is CEF_PERMISSION_RESULT_IGNORE.
|
||||
/// Called when a page should show a permission prompt. |prompt_id| uniquely
|
||||
/// identifies the prompt. |requesting_origin| is the URL origin requesting
|
||||
/// permission. |requested_permissions| is a combination of values from
|
||||
/// cef_permission_request_types_t that represent the requested permissions.
|
||||
/// Return true (1) and call cef_permission_prompt_callback_t::Continue either
|
||||
/// in this function or at a later time to continue or cancel the request.
|
||||
/// Return false (0) to proceed with default handling. With the Chrome
|
||||
/// runtime, default handling will display the permission prompt UI. With the
|
||||
/// Alloy runtime, default handling is CEF_PERMISSION_RESULT_IGNORE.
|
||||
///
|
||||
int(CEF_CALLBACK* on_show_permission_prompt)(
|
||||
struct _cef_permission_handler_t* self,
|
||||
@@ -140,13 +142,13 @@ typedef struct _cef_permission_handler_t {
|
||||
struct _cef_permission_prompt_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called when a permission prompt handled via OnShowPermissionPrompt is
|
||||
// dismissed. |prompt_id| will match the value that was passed to
|
||||
// OnShowPermissionPrompt. |result| will be the value passed to
|
||||
// cef_permission_prompt_callback_t::Continue or CEF_PERMISSION_RESULT_IGNORE
|
||||
// if the dialog was dismissed for other reasons such as navigation, browser
|
||||
// closure, etc. This function will not be called if OnShowPermissionPrompt
|
||||
// returned false (0) for |prompt_id|.
|
||||
/// Called when a permission prompt handled via OnShowPermissionPrompt is
|
||||
/// dismissed. |prompt_id| will match the value that was passed to
|
||||
/// OnShowPermissionPrompt. |result| will be the value passed to
|
||||
/// cef_permission_prompt_callback_t::Continue or CEF_PERMISSION_RESULT_IGNORE
|
||||
/// if the dialog was dismissed for other reasons such as navigation, browser
|
||||
/// closure, etc. This function will not be called if OnShowPermissionPrompt
|
||||
/// returned false (0) for |prompt_id|.
|
||||
///
|
||||
void(CEF_CALLBACK* on_dismiss_permission_prompt)(
|
||||
struct _cef_permission_handler_t* self,
|
||||
|
148
include/capi/cef_preference_capi.h
Normal file
148
include/capi/cef_preference_capi.h
Normal file
@@ -0,0 +1,148 @@
|
||||
// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=eac0782793e7b9c64668f2a22a859357257140ea$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Structure that manages custom preference registrations.
|
||||
///
|
||||
typedef struct _cef_preference_registrar_t {
|
||||
///
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_scoped_t base;
|
||||
|
||||
///
|
||||
/// Register a preference with the specified |name| and |default_value|. To
|
||||
/// avoid conflicts with built-in preferences the |name| value should contain
|
||||
/// an application-specific prefix followed by a period (e.g. "myapp.value").
|
||||
/// The contents of |default_value| will be copied. The data type for the
|
||||
/// preference will be inferred from |default_value|'s type and cannot be
|
||||
/// changed after registration. Returns true (1) on success. Returns false (0)
|
||||
/// if |name| is already registered or if |default_value| has an invalid type.
|
||||
/// This function must be called from within the scope of the
|
||||
/// cef_browser_process_handler_t::OnRegisterCustomPreferences callback.
|
||||
///
|
||||
int(CEF_CALLBACK* add_preference)(struct _cef_preference_registrar_t* self,
|
||||
const cef_string_t* name,
|
||||
struct _cef_value_t* default_value);
|
||||
} cef_preference_registrar_t;
|
||||
|
||||
///
|
||||
/// Manage access to preferences. Many built-in preferences are registered by
|
||||
/// Chromium. Custom preferences can be registered in
|
||||
/// cef_browser_process_handler_t::OnRegisterCustomPreferences.
|
||||
///
|
||||
typedef struct _cef_preference_manager_t {
|
||||
///
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
/// Returns true (1) if a preference with the specified |name| exists. This
|
||||
/// function must be called on the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* has_preference)(struct _cef_preference_manager_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
/// Returns the value for the preference with the specified |name|. Returns
|
||||
/// NULL if the preference does not exist. The returned object contains a copy
|
||||
/// of the underlying preference value and modifications to the returned
|
||||
/// object will not modify the underlying preference value. This function must
|
||||
/// be called on the browser process UI thread.
|
||||
///
|
||||
struct _cef_value_t*(CEF_CALLBACK* get_preference)(
|
||||
struct _cef_preference_manager_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
/// Returns all preferences as a dictionary. If |include_defaults| is true (1)
|
||||
/// then preferences currently at their default value will be included. The
|
||||
/// returned object contains a copy of the underlying preference values and
|
||||
/// modifications to the returned object will not modify the underlying
|
||||
/// preference values. This function must be called on the browser process UI
|
||||
/// thread.
|
||||
///
|
||||
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_all_preferences)(
|
||||
struct _cef_preference_manager_t* self,
|
||||
int include_defaults);
|
||||
|
||||
///
|
||||
/// Returns true (1) if the preference with the specified |name| can be
|
||||
/// modified using SetPreference. As one example preferences set via the
|
||||
/// command-line usually cannot be modified. This function must be called on
|
||||
/// the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* can_set_preference)(struct _cef_preference_manager_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
/// Set the |value| associated with preference |name|. Returns true (1) if the
|
||||
/// value is set successfully and false (0) otherwise. If |value| is NULL the
|
||||
/// preference will be restored to its default value. If setting the
|
||||
/// preference fails then |error| will be populated with a detailed
|
||||
/// description of the problem. This function must be called on the browser
|
||||
/// process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* set_preference)(struct _cef_preference_manager_t* self,
|
||||
const cef_string_t* name,
|
||||
struct _cef_value_t* value,
|
||||
cef_string_t* error);
|
||||
} cef_preference_manager_t;
|
||||
|
||||
///
|
||||
/// Returns the global preference manager object.
|
||||
///
|
||||
CEF_EXPORT cef_preference_manager_t* cef_preference_manager_get_global(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_PREFERENCE_CAPI_H_
|
116
include/capi/cef_preference_manager_capi.h
Normal file
116
include/capi/cef_preference_manager_capi.h
Normal file
@@ -0,0 +1,116 @@
|
||||
// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1f5dd49cfc5aeb4b673c10750de01768f5cd2694$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PREFERENCE_MANAGER_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_PREFERENCE_MANAGER_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Manage access to preferences.
|
||||
///
|
||||
typedef struct _cef_preference_manager_t {
|
||||
///
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
/// Returns true (1) if a preference with the specified |name| exists. This
|
||||
/// function must be called on the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* has_preference)(struct _cef_preference_manager_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
/// Returns the value for the preference with the specified |name|. Returns
|
||||
/// NULL if the preference does not exist. The returned object contains a copy
|
||||
/// of the underlying preference value and modifications to the returned
|
||||
/// object will not modify the underlying preference value. This function must
|
||||
/// be called on the browser process UI thread.
|
||||
///
|
||||
struct _cef_value_t*(CEF_CALLBACK* get_preference)(
|
||||
struct _cef_preference_manager_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
/// Returns all preferences as a dictionary. If |include_defaults| is true (1)
|
||||
/// then preferences currently at their default value will be included. The
|
||||
/// returned object contains a copy of the underlying preference values and
|
||||
/// modifications to the returned object will not modify the underlying
|
||||
/// preference values. This function must be called on the browser process UI
|
||||
/// thread.
|
||||
///
|
||||
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_all_preferences)(
|
||||
struct _cef_preference_manager_t* self,
|
||||
int include_defaults);
|
||||
|
||||
///
|
||||
/// Returns true (1) if the preference with the specified |name| can be
|
||||
/// modified using SetPreference. As one example preferences set via the
|
||||
/// command-line usually cannot be modified. This function must be called on
|
||||
/// the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* can_set_preference)(struct _cef_preference_manager_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
/// Set the |value| associated with preference |name|. Returns true (1) if the
|
||||
/// value is set successfully and false (0) otherwise. If |value| is NULL the
|
||||
/// preference will be restored to its default value. If setting the
|
||||
/// preference fails then |error| will be populated with a detailed
|
||||
/// description of the problem. This function must be called on the browser
|
||||
/// process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* set_preference)(struct _cef_preference_manager_t* self,
|
||||
const cef_string_t* name,
|
||||
struct _cef_value_t* value,
|
||||
cef_string_t* error);
|
||||
} cef_preference_manager_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_PREFERENCE_MANAGER_CAPI_H_
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=e26be3efc18d8c79d019c02b1d73a7ec2866b142$
|
||||
// $hash=0621c349d0ef1e5befe0dc653a5b8ba49e51a54e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
|
||||
@@ -49,65 +49,66 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Callback structure for asynchronous continuation of print dialog requests.
|
||||
/// Callback structure for asynchronous continuation of print dialog requests.
|
||||
///
|
||||
typedef struct _cef_print_dialog_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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,
|
||||
struct _cef_print_settings_t* settings);
|
||||
|
||||
///
|
||||
// Cancel the printing.
|
||||
/// Cancel the printing.
|
||||
///
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_print_dialog_callback_t* self);
|
||||
} cef_print_dialog_callback_t;
|
||||
|
||||
///
|
||||
// Callback structure for asynchronous continuation of print job requests.
|
||||
/// Callback structure for asynchronous continuation of print job requests.
|
||||
///
|
||||
typedef struct _cef_print_job_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
} cef_print_job_callback_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle printing on Linux. Each browser will have
|
||||
// only one print job in progress at a time. The functions of this structure
|
||||
// will be called on the browser process UI thread.
|
||||
/// Implement this structure to handle printing on Linux. Each browser will have
|
||||
/// only one print job in progress at a time. The functions of this structure
|
||||
/// will be called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_print_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called when printing has started for the specified |browser|. This function
|
||||
// will be called before the other OnPrint*() functions and irrespective of
|
||||
// how printing was initiated (e.g. cef_browser_host_t::print(), JavaScript
|
||||
// window.print() or PDF extension print button).
|
||||
/// Called when printing has started for the specified |browser|. This
|
||||
/// function will be called before the other OnPrint*() functions and
|
||||
/// irrespective of how printing was initiated (e.g.
|
||||
/// cef_browser_host_t::print(), JavaScript window.print() or PDF extension
|
||||
/// print button).
|
||||
///
|
||||
void(CEF_CALLBACK* on_print_start)(struct _cef_print_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Synchronize |settings| with client state. If |get_defaults| is true (1)
|
||||
// then populate |settings| with the default print settings. Do not keep a
|
||||
// reference to |settings| outside of this callback.
|
||||
/// Synchronize |settings| with client state. If |get_defaults| is true (1)
|
||||
/// then populate |settings| with the default print settings. Do not keep a
|
||||
/// reference to |settings| outside of this callback.
|
||||
///
|
||||
void(CEF_CALLBACK* on_print_settings)(struct _cef_print_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -115,9 +116,9 @@ typedef struct _cef_print_handler_t {
|
||||
int get_defaults);
|
||||
|
||||
///
|
||||
// Show the print dialog. Execute |callback| once the dialog is dismissed.
|
||||
// Return true (1) if the dialog will be displayed or false (0) to cancel the
|
||||
// printing immediately.
|
||||
/// Show the print dialog. Execute |callback| once the dialog is dismissed.
|
||||
/// Return true (1) if the dialog will be displayed or false (0) to cancel the
|
||||
/// printing immediately.
|
||||
///
|
||||
int(CEF_CALLBACK* on_print_dialog)(
|
||||
struct _cef_print_handler_t* self,
|
||||
@@ -126,9 +127,9 @@ typedef struct _cef_print_handler_t {
|
||||
struct _cef_print_dialog_callback_t* callback);
|
||||
|
||||
///
|
||||
// Send the print job to the printer. Execute |callback| once the job is
|
||||
// completed. Return true (1) if the job will proceed or false (0) to cancel
|
||||
// the job immediately.
|
||||
/// Send the print job to the printer. Execute |callback| once the job is
|
||||
/// completed. Return true (1) if the job will proceed or false (0) to cancel
|
||||
/// the job immediately.
|
||||
///
|
||||
int(CEF_CALLBACK* on_print_job)(struct _cef_print_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -137,14 +138,14 @@ typedef struct _cef_print_handler_t {
|
||||
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,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Return the PDF paper size in device units. Used in combination with
|
||||
// cef_browser_host_t::print_to_pdf().
|
||||
/// Return the PDF paper size in device units. Used in combination with
|
||||
/// cef_browser_host_t::print_to_pdf().
|
||||
///
|
||||
cef_size_t(CEF_CALLBACK* get_pdf_paper_size)(
|
||||
struct _cef_print_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1a9b9718367ec8d575fbb39b73b1085b17eb0a2b$
|
||||
// $hash=22959da4d5a2c94edc7647334507e38c44d40250$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
|
||||
@@ -47,41 +47,41 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure representing print settings.
|
||||
/// Structure representing print settings.
|
||||
///
|
||||
typedef struct _cef_print_settings_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
||||
/// if this function returns false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* is_valid)(struct _cef_print_settings_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
/// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
/// expose read-only objects.
|
||||
///
|
||||
int(CEF_CALLBACK* is_read_only)(struct _cef_print_settings_t* self);
|
||||
|
||||
///
|
||||
// Set the page orientation.
|
||||
/// Set the page orientation.
|
||||
///
|
||||
void(CEF_CALLBACK* set_orientation)(struct _cef_print_settings_t* self,
|
||||
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);
|
||||
|
||||
///
|
||||
// Set the printer printable area in device units. Some platforms already
|
||||
// provide flipped area. Set |landscape_needs_flip| to false (0) on those
|
||||
// platforms to avoid double flipping.
|
||||
/// Set the printer printable area in device units. Some platforms already
|
||||
/// provide flipped area. Set |landscape_needs_flip| to false (0) on those
|
||||
/// platforms to avoid double flipping.
|
||||
///
|
||||
void(CEF_CALLBACK* set_printer_printable_area)(
|
||||
struct _cef_print_settings_t* self,
|
||||
@@ -90,108 +90,108 @@ typedef struct _cef_print_settings_t {
|
||||
int landscape_needs_flip);
|
||||
|
||||
///
|
||||
// Set the device name.
|
||||
/// Set the device name.
|
||||
///
|
||||
void(CEF_CALLBACK* set_device_name)(struct _cef_print_settings_t* self,
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_device_name)(
|
||||
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);
|
||||
|
||||
///
|
||||
// Get the DPI (dots per inch).
|
||||
/// Get the DPI (dots per inch).
|
||||
///
|
||||
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,
|
||||
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)(
|
||||
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,
|
||||
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,
|
||||
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);
|
||||
|
||||
///
|
||||
// Set whether pages will be collated.
|
||||
/// Set whether pages will be collated.
|
||||
///
|
||||
void(CEF_CALLBACK* set_collate)(struct _cef_print_settings_t* self,
|
||||
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);
|
||||
|
||||
///
|
||||
// Set the color model.
|
||||
/// Set the color model.
|
||||
///
|
||||
void(CEF_CALLBACK* set_color_model)(struct _cef_print_settings_t* self,
|
||||
cef_color_model_t model);
|
||||
|
||||
///
|
||||
// Get the color model.
|
||||
/// Get the color model.
|
||||
///
|
||||
cef_color_model_t(CEF_CALLBACK* get_color_model)(
|
||||
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,
|
||||
int copies);
|
||||
|
||||
///
|
||||
// Get the number of copies.
|
||||
/// Get the number of copies.
|
||||
///
|
||||
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,
|
||||
cef_duplex_mode_t mode);
|
||||
|
||||
///
|
||||
// Get the duplex mode.
|
||||
/// Get the duplex mode.
|
||||
///
|
||||
cef_duplex_mode_t(CEF_CALLBACK* get_duplex_mode)(
|
||||
struct _cef_print_settings_t* self);
|
||||
} cef_print_settings_t;
|
||||
|
||||
///
|
||||
// Create a new cef_print_settings_t object.
|
||||
/// Create a new cef_print_settings_t object.
|
||||
///
|
||||
CEF_EXPORT cef_print_settings_t* cef_print_settings_create(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=026a7f827962222a1df8b62a8e7bdfbf4dce27e0$
|
||||
// $hash=7b8bbe145aa8d54d868b9d9e4ce6ff2e6a596e53$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
|
||||
@@ -49,57 +49,57 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure representing a message. Can be used on any process and thread.
|
||||
/// Structure representing a message. Can be used on any process and thread.
|
||||
///
|
||||
typedef struct _cef_process_message_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is valid. Do not call any other functions
|
||||
// if this function returns false (0).
|
||||
/// Returns true (1) if this object is valid. Do not call any other functions
|
||||
/// if this function returns false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* is_valid)(struct _cef_process_message_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
// expose read-only objects.
|
||||
/// Returns true (1) if the values of this object are read-only. Some APIs may
|
||||
/// expose read-only objects.
|
||||
///
|
||||
int(CEF_CALLBACK* is_read_only)(struct _cef_process_message_t* self);
|
||||
|
||||
///
|
||||
// Returns a writable copy of this object. Returns nullptr when message
|
||||
// contains a shared memory region.
|
||||
/// Returns a writable copy of this object. Returns nullptr when message
|
||||
/// contains a shared memory region.
|
||||
///
|
||||
struct _cef_process_message_t*(CEF_CALLBACK* copy)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_name)(
|
||||
struct _cef_process_message_t* self);
|
||||
|
||||
///
|
||||
// Returns the list of arguments. Returns nullptr when message contains a
|
||||
// shared memory region.
|
||||
/// Returns the list of arguments. Returns nullptr when message contains a
|
||||
/// shared memory region.
|
||||
///
|
||||
struct _cef_list_value_t*(CEF_CALLBACK* get_argument_list)(
|
||||
struct _cef_process_message_t* self);
|
||||
|
||||
///
|
||||
// Returns the shared memory region. Returns nullptr when message contains an
|
||||
// argument list.
|
||||
/// Returns the shared memory region. Returns nullptr when message contains an
|
||||
/// argument list.
|
||||
///
|
||||
struct _cef_shared_memory_region_t*(CEF_CALLBACK* get_shared_memory_region)(
|
||||
struct _cef_process_message_t* self);
|
||||
} cef_process_message_t;
|
||||
|
||||
///
|
||||
// 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(
|
||||
const cef_string_t* name);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1f2b752c4e314b240ce95cb3b87863c2f99534a8$
|
||||
// $hash=f6b215445a54f565a26f1a62d2671156635d6d46$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
|
||||
@@ -47,14 +47,14 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Launches the process specified via |command_line|. Returns true (1) upon
|
||||
// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
|
||||
//
|
||||
// Unix-specific notes: - All file descriptors open in the parent process will
|
||||
// be closed in the
|
||||
// child process except for stdin, stdout, and stderr.
|
||||
// - If the first argument on the command line does not contain a slash,
|
||||
// PATH will be searched. (See man execvp.)
|
||||
/// Launches the process specified via |command_line|. Returns true (1) upon
|
||||
/// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
|
||||
///
|
||||
/// Unix-specific notes: - All file descriptors open in the parent process will
|
||||
/// be closed in the
|
||||
/// child process except for stdin, stdout, and stderr.
|
||||
/// - If the first argument on the command line does not contain a slash,
|
||||
/// PATH will be searched. (See man execvp.)
|
||||
///
|
||||
CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=d5efa37953d0f0097fef20bc18f4938621c6b168$
|
||||
// $hash=28371116427e9457ea366c9f0546cd5eefd8f08a$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_
|
||||
@@ -47,11 +47,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Generic callback structure used for managing the lifespan of a registration.
|
||||
/// Generic callback structure used for managing the lifespan of a registration.
|
||||
///
|
||||
typedef struct _cef_registration_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
} cef_registration_t;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=5f56719342d8b07cc9cd9362fc3b506f2b8a0286$
|
||||
// $hash=931b329d62ea6461485b62b79f98165d7185b6e7$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
||||
@@ -50,44 +50,44 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to handle events when window rendering is disabled.
|
||||
// The functions of this structure will be called on the UI thread.
|
||||
/// Implement this structure to handle events when window rendering is disabled.
|
||||
/// The functions of this structure will be called on the UI thread.
|
||||
///
|
||||
typedef struct _cef_render_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Return the handler for accessibility notifications. If no handler is
|
||||
// provided the default implementation will be used.
|
||||
/// 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 DIP coordinates.
|
||||
// Return true (1) if the rectangle was provided. If this function returns
|
||||
// false (0) the rectangle from GetViewRect will be used.
|
||||
/// Called to retrieve the root window rectangle in screen DIP coordinates.
|
||||
/// Return true (1) if the rectangle was provided. If this function returns
|
||||
/// false (0) the rectangle from GetViewRect will be used.
|
||||
///
|
||||
int(CEF_CALLBACK* get_root_screen_rect)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_rect_t* rect);
|
||||
|
||||
///
|
||||
// Called to retrieve the view rectangle in screen DIP coordinates. This
|
||||
// function must always provide a non-NULL rectangle.
|
||||
/// Called to retrieve the view rectangle in screen DIP coordinates. This
|
||||
/// function must always provide a non-NULL rectangle.
|
||||
///
|
||||
void(CEF_CALLBACK* get_view_rect)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_rect_t* rect);
|
||||
|
||||
///
|
||||
// Called to retrieve the translation from view DIP coordinates to screen
|
||||
// coordinates. Windows/Linux should provide screen device (pixel) coordinates
|
||||
// and MacOS should provide screen DIP coordinates. Return true (1) if the
|
||||
// requested coordinates were provided.
|
||||
/// Called to retrieve the translation from view DIP coordinates to screen
|
||||
/// coordinates. Windows/Linux should provide screen device (pixel)
|
||||
/// coordinates and MacOS should provide screen DIP coordinates. Return true
|
||||
/// (1) if the requested coordinates were provided.
|
||||
///
|
||||
int(CEF_CALLBACK* get_screen_point)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -97,44 +97,44 @@ typedef struct _cef_render_handler_t {
|
||||
int* screenY);
|
||||
|
||||
///
|
||||
// Called to allow the client to fill in the CefScreenInfo object with
|
||||
// appropriate values. Return true (1) if the |screen_info| structure has been
|
||||
// modified.
|
||||
//
|
||||
// If the screen info rectangle is left NULL the rectangle from GetViewRect
|
||||
// will be used. If the rectangle is still NULL or invalid popups may not be
|
||||
// drawn correctly.
|
||||
/// Called to allow the client to fill in the CefScreenInfo object with
|
||||
/// appropriate values. Return true (1) if the |screen_info| structure has
|
||||
/// been modified.
|
||||
///
|
||||
/// If the screen info rectangle is left NULL the rectangle from GetViewRect
|
||||
/// will be used. If the rectangle is still NULL or invalid popups may not be
|
||||
/// drawn correctly.
|
||||
///
|
||||
int(CEF_CALLBACK* get_screen_info)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_screen_info_t* screen_info);
|
||||
|
||||
///
|
||||
// Called when the browser wants to show or hide the popup widget. The popup
|
||||
// should be shown if |show| is true (1) and hidden if |show| is false (0).
|
||||
/// Called when the browser wants to show or hide the popup widget. The popup
|
||||
/// should be shown if |show| is true (1) and hidden if |show| is false (0).
|
||||
///
|
||||
void(CEF_CALLBACK* on_popup_show)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int show);
|
||||
|
||||
///
|
||||
// Called when the browser wants to move or resize the popup widget. |rect|
|
||||
// contains the new location and size in view coordinates.
|
||||
/// Called when the browser wants to move or resize the popup widget. |rect|
|
||||
/// contains the new location and size in view coordinates.
|
||||
///
|
||||
void(CEF_CALLBACK* on_popup_size)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_rect_t* rect);
|
||||
|
||||
///
|
||||
// Called when an element should be painted. Pixel values passed to this
|
||||
// function are scaled relative to view coordinates based on the value of
|
||||
// CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type|
|
||||
// indicates whether the element is the view or the popup widget. |buffer|
|
||||
// contains the pixel data for the whole image. |dirtyRects| contains the set
|
||||
// of rectangles in pixel coordinates that need to be repainted. |buffer| will
|
||||
// be |width|*|height|*4 bytes in size and represents a BGRA image with an
|
||||
// upper-left origin. This function is only called when
|
||||
// cef_window_tInfo::shared_texture_enabled is set to false (0).
|
||||
/// Called when an element should be painted. Pixel values passed to this
|
||||
/// function are scaled relative to view coordinates based on the value of
|
||||
/// CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type|
|
||||
/// indicates whether the element is the view or the popup widget. |buffer|
|
||||
/// contains the pixel data for the whole image. |dirtyRects| contains the set
|
||||
/// of rectangles in pixel coordinates that need to be repainted. |buffer|
|
||||
/// will be |width|*|height|*4 bytes in size and represents a BGRA image with
|
||||
/// an upper-left origin. This function is only called when
|
||||
/// cef_window_tInfo::shared_texture_enabled is set to false (0).
|
||||
///
|
||||
void(CEF_CALLBACK* on_paint)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -146,13 +146,13 @@ typedef struct _cef_render_handler_t {
|
||||
int height);
|
||||
|
||||
///
|
||||
// Called when an element has been rendered to the shared texture handle.
|
||||
// |type| indicates whether the element is the view or the popup widget.
|
||||
// |dirtyRects| contains the set of rectangles in pixel coordinates that need
|
||||
// to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that
|
||||
// can be accessed via ID3D11Device using the OpenSharedResource function.
|
||||
// This function is only called when cef_window_tInfo::shared_texture_enabled
|
||||
// is set to true (1), and is currently only supported on Windows.
|
||||
/// Called when an element has been rendered to the shared texture handle.
|
||||
/// |type| indicates whether the element is the view or the popup widget.
|
||||
/// |dirtyRects| contains the set of rectangles in pixel coordinates that need
|
||||
/// to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that
|
||||
/// can be accessed via ID3D11Device using the OpenSharedResource function.
|
||||
/// This function is only called when cef_window_tInfo::shared_texture_enabled
|
||||
/// is set to true (1), and is currently only supported on Windows.
|
||||
///
|
||||
void(CEF_CALLBACK* on_accelerated_paint)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -162,8 +162,8 @@ typedef struct _cef_render_handler_t {
|
||||
void* shared_handle);
|
||||
|
||||
///
|
||||
// Called to retrieve the size of the touch handle for the specified
|
||||
// |orientation|.
|
||||
/// Called to retrieve the size of the touch handle for the specified
|
||||
/// |orientation|.
|
||||
///
|
||||
void(CEF_CALLBACK* get_touch_handle_size)(
|
||||
struct _cef_render_handler_t* self,
|
||||
@@ -172,8 +172,8 @@ typedef struct _cef_render_handler_t {
|
||||
cef_size_t* size);
|
||||
|
||||
///
|
||||
// Called when touch handle state is updated. The client is responsible for
|
||||
// rendering the touch handles.
|
||||
/// Called when touch handle state is updated. The client is responsible for
|
||||
/// rendering the touch handles.
|
||||
///
|
||||
void(CEF_CALLBACK* on_touch_handle_state_changed)(
|
||||
struct _cef_render_handler_t* self,
|
||||
@@ -181,18 +181,18 @@ typedef struct _cef_render_handler_t {
|
||||
const cef_touch_handle_state_t* state);
|
||||
|
||||
///
|
||||
// Called when the user starts dragging content in the web view. Contextual
|
||||
// information about the dragged content is supplied by |drag_data|. (|x|,
|
||||
// |y|) is the drag start location in screen coordinates. OS APIs that run a
|
||||
// system message loop may be used within the StartDragging call.
|
||||
//
|
||||
// Return false (0) to abort the drag operation. Don't call any of
|
||||
// cef_browser_host_t::DragSource*Ended* functions after returning false (0).
|
||||
//
|
||||
// Return true (1) to handle the drag operation. Call
|
||||
// cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either
|
||||
// synchronously or asynchronously to inform the web view that the drag
|
||||
// operation has ended.
|
||||
/// Called when the user starts dragging content in the web view. Contextual
|
||||
/// information about the dragged content is supplied by |drag_data|. (|x|,
|
||||
/// |y|) is the drag start location in screen coordinates. OS APIs that run a
|
||||
/// system message loop may be used within the StartDragging call.
|
||||
///
|
||||
/// Return false (0) to abort the drag operation. Don't call any of
|
||||
/// cef_browser_host_t::DragSource*Ended* functions after returning false (0).
|
||||
///
|
||||
/// Return true (1) to handle the drag operation. Call
|
||||
/// cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either
|
||||
/// synchronously or asynchronously to inform the web view that the drag
|
||||
/// operation has ended.
|
||||
///
|
||||
int(CEF_CALLBACK* start_dragging)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -202,16 +202,16 @@ typedef struct _cef_render_handler_t {
|
||||
int y);
|
||||
|
||||
///
|
||||
// Called when the web view wants to update the mouse cursor during a drag &
|
||||
// drop operation. |operation| describes the allowed operation (none, move,
|
||||
// copy, link).
|
||||
/// Called when the web view wants to update the mouse cursor during a drag &
|
||||
/// drop operation. |operation| describes the allowed operation (none, move,
|
||||
/// copy, link).
|
||||
///
|
||||
void(CEF_CALLBACK* update_drag_cursor)(struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_drag_operations_mask_t operation);
|
||||
|
||||
///
|
||||
// Called when the scroll offset has changed.
|
||||
/// Called when the scroll offset has changed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_scroll_offset_changed)(
|
||||
struct _cef_render_handler_t* self,
|
||||
@@ -220,9 +220,9 @@ typedef struct _cef_render_handler_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -232,9 +232,9 @@ typedef struct _cef_render_handler_t {
|
||||
cef_rect_t const* character_bounds);
|
||||
|
||||
///
|
||||
// Called when text selection has changed for the specified |browser|.
|
||||
// |selected_text| is the currently selected text and |selected_range| is the
|
||||
// character range.
|
||||
/// Called when text selection has changed for the specified |browser|.
|
||||
/// |selected_text| is the currently selected text and |selected_range| is the
|
||||
/// character range.
|
||||
///
|
||||
void(CEF_CALLBACK* on_text_selection_changed)(
|
||||
struct _cef_render_handler_t* self,
|
||||
@@ -243,10 +243,10 @@ typedef struct _cef_render_handler_t {
|
||||
const cef_range_t* selected_range);
|
||||
|
||||
///
|
||||
// Called when an on-screen keyboard should be shown or hidden for the
|
||||
// specified |browser|. |input_mode| specifies what kind of keyboard should be
|
||||
// opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing keyboard
|
||||
// for this browser should be hidden.
|
||||
/// Called when an on-screen keyboard should be shown or hidden for the
|
||||
/// specified |browser|. |input_mode| specifies what kind of keyboard should
|
||||
/// be opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing
|
||||
/// keyboard for this browser should be hidden.
|
||||
///
|
||||
void(CEF_CALLBACK* on_virtual_keyboard_requested)(
|
||||
struct _cef_render_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=0b8abb0e55cb56fcb778ced72a61a108c2b28011$
|
||||
// $hash=b74afb6f8003ed24256ce7359ea377596b4406d9$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
|
||||
@@ -54,30 +54,30 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure used to implement render process callbacks. The functions of this
|
||||
// structure will be called on the render process main thread (TID_RENDERER)
|
||||
// unless otherwise indicated.
|
||||
/// Structure used to implement render process callbacks. The functions of this
|
||||
/// structure will be called on the render process main thread (TID_RENDERER)
|
||||
/// unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_render_process_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called after WebKit has been initialized.
|
||||
/// Called after WebKit has been initialized.
|
||||
///
|
||||
void(CEF_CALLBACK* on_web_kit_initialized)(
|
||||
struct _cef_render_process_handler_t* self);
|
||||
|
||||
///
|
||||
// Called after a browser has been created. When browsing cross-origin a new
|
||||
// browser will be created before the old browser with the same identifier is
|
||||
// destroyed. |extra_info| is an optional read-only value originating from
|
||||
// cef_browser_host_t::cef_browser_host_create_browser(),
|
||||
// cef_browser_host_t::cef_browser_host_create_browser_sync(),
|
||||
// cef_life_span_handler_t::on_before_popup() or
|
||||
// cef_browser_view_t::cef_browser_view_create().
|
||||
/// Called after a browser has been created. When browsing cross-origin a new
|
||||
/// browser will be created before the old browser with the same identifier is
|
||||
/// destroyed. |extra_info| is an optional read-only value originating from
|
||||
/// cef_browser_host_t::cef_browser_host_create_browser(),
|
||||
/// cef_browser_host_t::cef_browser_host_create_browser_sync(),
|
||||
/// cef_life_span_handler_t::on_before_popup() or
|
||||
/// cef_browser_view_t::cef_browser_view_create().
|
||||
///
|
||||
void(CEF_CALLBACK* on_browser_created)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
@@ -85,25 +85,25 @@ typedef struct _cef_render_process_handler_t {
|
||||
struct _cef_dictionary_value_t* extra_info);
|
||||
|
||||
///
|
||||
// Called before a browser is destroyed.
|
||||
/// Called before a browser is destroyed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_browser_destroyed)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Return the handler for browser load status events.
|
||||
/// Return the handler for browser load status events.
|
||||
///
|
||||
struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)(
|
||||
struct _cef_render_process_handler_t* self);
|
||||
|
||||
///
|
||||
// Called immediately after the V8 context for a frame has been created. To
|
||||
// retrieve the JavaScript 'window' object use the
|
||||
// cef_v8context_t::get_global() function. V8 handles can only be accessed
|
||||
// from the thread on which they are created. A task runner for posting tasks
|
||||
// on the associated thread can be retrieved via the
|
||||
// cef_v8context_t::get_task_runner() function.
|
||||
/// Called immediately after the V8 context for a frame has been created. To
|
||||
/// retrieve the JavaScript 'window' object use the
|
||||
/// cef_v8context_t::get_global() function. V8 handles can only be accessed
|
||||
/// from the thread on which they are created. A task runner for posting tasks
|
||||
/// on the associated thread can be retrieved via the
|
||||
/// cef_v8context_t::get_task_runner() function.
|
||||
///
|
||||
void(CEF_CALLBACK* on_context_created)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
@@ -112,8 +112,8 @@ typedef struct _cef_render_process_handler_t {
|
||||
struct _cef_v8context_t* context);
|
||||
|
||||
///
|
||||
// Called immediately before the V8 context for a frame is released. No
|
||||
// references to the context should be kept after this function is called.
|
||||
/// Called immediately before the V8 context for a frame is released. No
|
||||
/// references to the context should be kept after this function is called.
|
||||
///
|
||||
void(CEF_CALLBACK* on_context_released)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
@@ -122,9 +122,9 @@ typedef struct _cef_render_process_handler_t {
|
||||
struct _cef_v8context_t* context);
|
||||
|
||||
///
|
||||
// Called for global uncaught exceptions in a frame. Execution of this
|
||||
// callback is disabled by default. To enable set
|
||||
// CefSettings.uncaught_exception_stack_size > 0.
|
||||
/// Called for global uncaught exceptions in a frame. Execution of this
|
||||
/// callback is disabled by default. To enable set
|
||||
/// cef_settings_t.uncaught_exception_stack_size > 0.
|
||||
///
|
||||
void(CEF_CALLBACK* on_uncaught_exception)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
@@ -135,12 +135,12 @@ typedef struct _cef_render_process_handler_t {
|
||||
struct _cef_v8stack_trace_t* stackTrace);
|
||||
|
||||
///
|
||||
// Called when a new node in the the browser gets focus. The |node| value may
|
||||
// be NULL if no specific node has gained focus. The node object passed to
|
||||
// this function represents a snapshot of the DOM at the time this function is
|
||||
// executed. DOM objects are only valid for the scope of this function. Do not
|
||||
// keep references to or attempt to access any DOM objects outside the scope
|
||||
// of this function.
|
||||
/// Called when a new node in the the browser gets focus. The |node| value may
|
||||
/// be NULL if no specific node has gained focus. The node object passed to
|
||||
/// this function represents a snapshot of the DOM at the time this function
|
||||
/// is executed. DOM objects are only valid for the scope of this function. Do
|
||||
/// not keep references to or attempt to access any DOM objects outside the
|
||||
/// scope of this function.
|
||||
///
|
||||
void(CEF_CALLBACK* on_focused_node_changed)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
@@ -149,9 +149,9 @@ typedef struct _cef_render_process_handler_t {
|
||||
struct _cef_domnode_t* node);
|
||||
|
||||
///
|
||||
// Called when a new message is received from a different process. Return true
|
||||
// (1) if the message was handled or false (0) otherwise. It is safe to keep a
|
||||
// reference to |message| outside of this callback.
|
||||
/// Called when a new message is received from a different process. Return
|
||||
/// true (1) if the message was handled or false (0) otherwise. It is safe to
|
||||
/// keep a reference to |message| outside of this callback.
|
||||
///
|
||||
int(CEF_CALLBACK* on_process_message_received)(
|
||||
struct _cef_render_process_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=246d07b9790ff6bd574c59b1c237c603deaf88bf$
|
||||
// $hash=041c1b4e6e57987ad547daff56f96c6ff7ab15c9$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
|
||||
@@ -50,96 +50,96 @@ struct _cef_post_data_element_t;
|
||||
struct _cef_post_data_t;
|
||||
|
||||
///
|
||||
// Structure used to represent a web request. The functions of this structure
|
||||
// may be called on any thread.
|
||||
/// Structure used to represent a web request. The functions of this structure
|
||||
/// may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_request_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Get the fully qualified URL.
|
||||
/// Get the fully qualified URL.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Set the fully qualified URL.
|
||||
/// Set the fully qualified URL.
|
||||
///
|
||||
void(CEF_CALLBACK* set_url)(struct _cef_request_t* self,
|
||||
const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Get the request function type. The value will default to POST if post data
|
||||
// is provided and GET otherwise.
|
||||
/// Get the request function type. The value will default to POST if post data
|
||||
/// is provided and GET otherwise.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_method)(struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Set the request function type.
|
||||
/// Set the request function type.
|
||||
///
|
||||
void(CEF_CALLBACK* set_method)(struct _cef_request_t* self,
|
||||
const cef_string_t* method);
|
||||
|
||||
///
|
||||
// Set the referrer URL and policy. If non-NULL the referrer URL must be fully
|
||||
// qualified with an HTTP or HTTPS scheme component. Any username, password or
|
||||
// ref component will be removed.
|
||||
/// Set the referrer URL and policy. If non-NULL the referrer URL must be
|
||||
/// fully qualified with an HTTP or HTTPS scheme component. Any username,
|
||||
/// password or ref component will be removed.
|
||||
///
|
||||
void(CEF_CALLBACK* set_referrer)(struct _cef_request_t* self,
|
||||
const cef_string_t* referrer_url,
|
||||
cef_referrer_policy_t policy);
|
||||
|
||||
///
|
||||
// Get the referrer URL.
|
||||
/// Get the referrer URL.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_referrer_url)(
|
||||
struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Get the referrer policy.
|
||||
/// Get the referrer policy.
|
||||
///
|
||||
cef_referrer_policy_t(CEF_CALLBACK* get_referrer_policy)(
|
||||
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_request_t* self);
|
||||
|
||||
///
|
||||
// Set the post data.
|
||||
/// Set the post data.
|
||||
///
|
||||
void(CEF_CALLBACK* set_post_data)(struct _cef_request_t* self,
|
||||
struct _cef_post_data_t* postData);
|
||||
|
||||
///
|
||||
// Get the header values. Will not include the Referer value if any.
|
||||
/// Get the header values. Will not include the Referer value if any.
|
||||
///
|
||||
void(CEF_CALLBACK* get_header_map)(struct _cef_request_t* self,
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
// Set the header values. If a Referer value exists in the header map it will
|
||||
// be removed and ignored.
|
||||
/// Set the header values. If a Referer value exists in the header map it will
|
||||
/// be removed and ignored.
|
||||
///
|
||||
void(CEF_CALLBACK* set_header_map)(struct _cef_request_t* self,
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
// Returns the first header value for |name| or an NULL string if not found.
|
||||
// Will not return the Referer value if any. Use GetHeaderMap instead if
|
||||
// |name| might have multiple values.
|
||||
/// Returns the first header value for |name| or an NULL string if not found.
|
||||
/// Will not return the Referer value if any. Use GetHeaderMap instead if
|
||||
/// |name| might have multiple values.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_header_by_name)(
|
||||
@@ -147,10 +147,10 @@ typedef struct _cef_request_t {
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Set the header |name| to |value|. If |overwrite| is true (1) any existing
|
||||
// values will be replaced with the new value. If |overwrite| is false (0) any
|
||||
// existing values will not be overwritten. The Referer value cannot be set
|
||||
// using this function.
|
||||
/// Set the header |name| to |value|. If |overwrite| is true (1) any existing
|
||||
/// values will be replaced with the new value. If |overwrite| is false (0)
|
||||
/// any existing values will not be overwritten. The Referer value cannot be
|
||||
/// set using this function.
|
||||
///
|
||||
void(CEF_CALLBACK* set_header_by_name)(struct _cef_request_t* self,
|
||||
const cef_string_t* name,
|
||||
@@ -158,7 +158,7 @@ typedef struct _cef_request_t {
|
||||
int overwrite);
|
||||
|
||||
///
|
||||
// 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,
|
||||
@@ -167,174 +167,176 @@ typedef struct _cef_request_t {
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
// Get the flags used in combination with cef_urlrequest_t. See
|
||||
// cef_urlrequest_flags_t for supported values.
|
||||
/// Get the flags used in combination with cef_urlrequest_t. See
|
||||
/// cef_urlrequest_flags_t for supported values.
|
||||
///
|
||||
int(CEF_CALLBACK* get_flags)(struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Set the flags used in combination with cef_urlrequest_t. See
|
||||
// cef_urlrequest_flags_t for supported values.
|
||||
/// Set the flags used in combination with cef_urlrequest_t. See
|
||||
/// cef_urlrequest_flags_t for supported values.
|
||||
///
|
||||
void(CEF_CALLBACK* set_flags)(struct _cef_request_t* self, int flags);
|
||||
|
||||
///
|
||||
// Get the URL to the first party for cookies used in combination with
|
||||
// cef_urlrequest_t.
|
||||
/// Get the URL to the first party for cookies used in combination with
|
||||
/// cef_urlrequest_t.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_first_party_for_cookies)(
|
||||
struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Set the URL to the first party for cookies used in combination with
|
||||
// cef_urlrequest_t.
|
||||
/// 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
|
||||
// process.
|
||||
/// Get the resource type for this request. Only available in the browser
|
||||
/// process.
|
||||
///
|
||||
cef_resource_type_t(CEF_CALLBACK* get_resource_type)(
|
||||
struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Get the transition type for this request. Only available in the browser
|
||||
// process and only applies to requests that represent a main frame or sub-
|
||||
// frame navigation.
|
||||
/// Get the transition type for this request. Only available in the browser
|
||||
/// process and only applies to requests that represent a main frame or sub-
|
||||
/// frame navigation.
|
||||
///
|
||||
cef_transition_type_t(CEF_CALLBACK* get_transition_type)(
|
||||
struct _cef_request_t* self);
|
||||
|
||||
///
|
||||
// Returns the globally unique identifier for this request or 0 if not
|
||||
// specified. Can be used by cef_resource_request_handler_t implementations in
|
||||
// the browser process to track a single request across multiple callbacks.
|
||||
/// Returns the globally unique identifier for this request or 0 if not
|
||||
/// specified. Can be used by cef_resource_request_handler_t implementations
|
||||
/// in the browser process to track a single request across multiple
|
||||
/// callbacks.
|
||||
///
|
||||
uint64(CEF_CALLBACK* get_identifier)(struct _cef_request_t* self);
|
||||
} cef_request_t;
|
||||
|
||||
///
|
||||
// Create a new cef_request_t object.
|
||||
/// Create a new cef_request_t object.
|
||||
///
|
||||
CEF_EXPORT cef_request_t* cef_request_create(void);
|
||||
|
||||
///
|
||||
// Structure used to represent post data for a web request. The functions of
|
||||
// this structure may be called on any thread.
|
||||
/// Structure used to represent post data for a web request. The functions of
|
||||
/// this structure may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_post_data_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Returns true (1) if the underlying POST data includes elements that are not
|
||||
// represented by this cef_post_data_t object (for example, multi-part file
|
||||
// upload data). Modifying cef_post_data_t objects with excluded elements may
|
||||
// result in the request failing.
|
||||
/// Returns true (1) if the underlying POST data includes elements that are
|
||||
/// not represented by this cef_post_data_t object (for example, multi-part
|
||||
/// file upload data). Modifying cef_post_data_t objects with excluded
|
||||
/// elements may result in the request failing.
|
||||
///
|
||||
int(CEF_CALLBACK* has_excluded_elements)(struct _cef_post_data_t* self);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// Retrieve the post data elements.
|
||||
/// Retrieve the post data elements.
|
||||
///
|
||||
void(CEF_CALLBACK* get_elements)(struct _cef_post_data_t* self,
|
||||
size_t* elementsCount,
|
||||
struct _cef_post_data_element_t** elements);
|
||||
|
||||
///
|
||||
// Remove the specified post data element. Returns true (1) if the removal
|
||||
// succeeds.
|
||||
/// Remove the specified post data element. Returns true (1) if the removal
|
||||
/// succeeds.
|
||||
///
|
||||
int(CEF_CALLBACK* remove_element)(struct _cef_post_data_t* self,
|
||||
struct _cef_post_data_element_t* element);
|
||||
|
||||
///
|
||||
// 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,
|
||||
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);
|
||||
} cef_post_data_t;
|
||||
|
||||
///
|
||||
// Create a new cef_post_data_t object.
|
||||
/// Create a new cef_post_data_t object.
|
||||
///
|
||||
CEF_EXPORT cef_post_data_t* cef_post_data_create(void);
|
||||
|
||||
///
|
||||
// Structure used to represent a single element in the request post data. The
|
||||
// functions of this structure may be called on any thread.
|
||||
/// Structure used to represent a single element in the request post data. The
|
||||
/// functions of this structure may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_post_data_element_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// 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,
|
||||
const cef_string_t* fileName);
|
||||
|
||||
///
|
||||
// The post data element will represent bytes. The bytes passed in will be
|
||||
// copied.
|
||||
/// The post data element will represent bytes. The bytes passed in will be
|
||||
/// copied.
|
||||
///
|
||||
void(CEF_CALLBACK* set_to_bytes)(struct _cef_post_data_element_t* self,
|
||||
size_t size,
|
||||
const void* bytes);
|
||||
|
||||
///
|
||||
// Return the type of this post data element.
|
||||
/// Return the type of this post data element.
|
||||
///
|
||||
cef_postdataelement_type_t(CEF_CALLBACK* get_type)(
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_file)(
|
||||
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);
|
||||
|
||||
///
|
||||
// Read up to |size| bytes into |bytes| and return the number of bytes
|
||||
// actually read.
|
||||
/// Read up to |size| bytes into |bytes| and return the number of bytes
|
||||
/// actually read.
|
||||
///
|
||||
size_t(CEF_CALLBACK* get_bytes)(struct _cef_post_data_element_t* self,
|
||||
size_t size,
|
||||
@@ -342,7 +344,7 @@ typedef struct _cef_post_data_element_t {
|
||||
} cef_post_data_element_t;
|
||||
|
||||
///
|
||||
// Create a new cef_post_data_element_t object.
|
||||
/// Create a new cef_post_data_element_t object.
|
||||
///
|
||||
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=dcff1eaa0563cfb48e0232bf78786bb0126c4255$
|
||||
// $hash=62f9dd603840149334ecd1f25222dbda0682b0e6$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
|
||||
@@ -45,7 +45,7 @@
|
||||
#include "include/capi/cef_extension_capi.h"
|
||||
#include "include/capi/cef_extension_handler_capi.h"
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
#include "include/capi/cef_preference_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -55,18 +55,18 @@ struct _cef_request_context_handler_t;
|
||||
struct _cef_scheme_handler_factory_t;
|
||||
|
||||
///
|
||||
// Callback structure for cef_request_context_t::ResolveHost.
|
||||
/// Callback structure for cef_request_context_t::ResolveHost.
|
||||
///
|
||||
typedef struct _cef_resolve_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the UI thread after the ResolveHost request has completed.
|
||||
// |result| will be the result code. |resolved_ips| will be the list of
|
||||
// resolved IP addresses or NULL if the resolution failed.
|
||||
/// Called on the UI thread after the ResolveHost request has completed.
|
||||
/// |result| will be the result code. |resolved_ips| will be the list of
|
||||
/// resolved IP addresses or NULL if the resolution failed.
|
||||
///
|
||||
void(CEF_CALLBACK* on_resolve_completed)(struct _cef_resolve_callback_t* self,
|
||||
cef_errorcode_t result,
|
||||
@@ -74,83 +74,83 @@ typedef struct _cef_resolve_callback_t {
|
||||
} cef_resolve_callback_t;
|
||||
|
||||
///
|
||||
// A request context provides request handling for a set of related browser or
|
||||
// URL request objects. A request context can be specified when creating a new
|
||||
// browser via the cef_browser_host_t static factory functions or when creating
|
||||
// a new URL request via the cef_urlrequest_t static factory functions. Browser
|
||||
// objects with different request contexts will never be hosted in the same
|
||||
// render process. Browser objects with the same request context may or may not
|
||||
// be hosted in the same render process depending on the process model. Browser
|
||||
// objects created indirectly via the JavaScript window.open function or
|
||||
// targeted links will share the same render process and the same request
|
||||
// context as the source browser. When running in single-process mode there is
|
||||
// only a single render process (the main process) and so all browsers created
|
||||
// in single-process mode will share the same request context. This will be the
|
||||
// first request context passed into a cef_browser_host_t static factory
|
||||
// function and all other request context objects will be ignored.
|
||||
/// 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
|
||||
/// browser via the cef_browser_host_t static factory functions or when creating
|
||||
/// a new URL request via the cef_urlrequest_t static factory functions. Browser
|
||||
/// objects with different request contexts will never be hosted in the same
|
||||
/// render process. Browser objects with the same request context may or may not
|
||||
/// be hosted in the same render process depending on the process model. Browser
|
||||
/// objects created indirectly via the JavaScript window.open function or
|
||||
/// targeted links will share the same render process and the same request
|
||||
/// context as the source browser. When running in single-process mode there is
|
||||
/// only a single render process (the main process) and so all browsers created
|
||||
/// in single-process mode will share the same request context. This will be the
|
||||
/// first request context passed into a cef_browser_host_t static factory
|
||||
/// function and all other request context objects will be ignored.
|
||||
///
|
||||
typedef struct _cef_request_context_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
cef_preference_manager_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is pointing to the same context as |that|
|
||||
// object.
|
||||
/// Returns true (1) if this object is pointing to the same context as |that|
|
||||
/// object.
|
||||
///
|
||||
int(CEF_CALLBACK* is_same)(struct _cef_request_context_t* self,
|
||||
struct _cef_request_context_t* other);
|
||||
|
||||
///
|
||||
// Returns true (1) if this object is sharing the same storage as |that|
|
||||
// object.
|
||||
/// Returns true (1) if this object is sharing the same storage as |that|
|
||||
/// object.
|
||||
///
|
||||
int(CEF_CALLBACK* is_sharing_with)(struct _cef_request_context_t* self,
|
||||
struct _cef_request_context_t* other);
|
||||
|
||||
///
|
||||
// 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
|
||||
// context argument.
|
||||
/// 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
|
||||
/// context argument.
|
||||
///
|
||||
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_t* self);
|
||||
|
||||
///
|
||||
// Returns the cache path for this object. If NULL an "incognito mode" in-
|
||||
// memory cache is being used.
|
||||
/// Returns the cache path for this object. If NULL an "incognito mode" in-
|
||||
/// memory cache is being used.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_cache_path)(
|
||||
struct _cef_request_context_t* self);
|
||||
|
||||
///
|
||||
// Returns the cookie manager for this object. If |callback| is non-NULL it
|
||||
// will be executed asnychronously on the UI thread after the manager's
|
||||
// storage has been initialized.
|
||||
/// Returns the cookie manager for this object. If |callback| is non-NULL it
|
||||
/// will be executed asnychronously on the UI thread after the manager's
|
||||
/// storage has been initialized.
|
||||
///
|
||||
struct _cef_cookie_manager_t*(CEF_CALLBACK* get_cookie_manager)(
|
||||
struct _cef_request_context_t* self,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Register a scheme handler factory for the specified |scheme_name| and
|
||||
// optional |domain_name|. An NULL |domain_name| value for a standard scheme
|
||||
// will cause the factory to match all domain names. The |domain_name| value
|
||||
// will be ignored for non-standard schemes. If |scheme_name| is a built-in
|
||||
// scheme and no handler is returned by |factory| then the built-in scheme
|
||||
// handler factory will be called. If |scheme_name| is a custom scheme then
|
||||
// you must also implement the cef_app_t::on_register_custom_schemes()
|
||||
// function in all processes. This function may be called multiple times to
|
||||
// change or remove the factory that matches the specified |scheme_name| and
|
||||
// optional |domain_name|. Returns false (0) if an error occurs. This function
|
||||
// may be called on any thread in the browser process.
|
||||
/// Register a scheme handler factory for the specified |scheme_name| and
|
||||
/// optional |domain_name|. An NULL |domain_name| value for a standard scheme
|
||||
/// will cause the factory to match all domain names. The |domain_name| value
|
||||
/// will be ignored for non-standard schemes. If |scheme_name| is a built-in
|
||||
/// scheme and no handler is returned by |factory| then the built-in scheme
|
||||
/// handler factory will be called. If |scheme_name| is a custom scheme then
|
||||
/// you must also implement the cef_app_t::on_register_custom_schemes()
|
||||
/// function in all processes. This function may be called multiple times to
|
||||
/// change or remove the factory that matches the specified |scheme_name| and
|
||||
/// optional |domain_name|. Returns false (0) if an error occurs. This
|
||||
/// function may be called on any thread in the browser process.
|
||||
///
|
||||
int(CEF_CALLBACK* register_scheme_handler_factory)(
|
||||
struct _cef_request_context_t* self,
|
||||
@@ -159,149 +159,98 @@ typedef struct _cef_request_context_t {
|
||||
struct _cef_scheme_handler_factory_t* factory);
|
||||
|
||||
///
|
||||
// Clear all registered scheme handler factories. Returns false (0) on error.
|
||||
// This function may be called on any thread in the browser process.
|
||||
/// Clear all registered scheme handler factories. Returns false (0) on error.
|
||||
/// This function may be called on any thread in the browser process.
|
||||
///
|
||||
int(CEF_CALLBACK* clear_scheme_handler_factories)(
|
||||
struct _cef_request_context_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if a preference with the specified |name| exists. This
|
||||
// function must be called on the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* has_preference)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Returns the value for the preference with the specified |name|. Returns
|
||||
// NULL if the preference does not exist. The returned object contains a copy
|
||||
// of the underlying preference value and modifications to the returned object
|
||||
// will not modify the underlying preference value. This function must be
|
||||
// called on the browser process UI thread.
|
||||
///
|
||||
struct _cef_value_t*(CEF_CALLBACK* get_preference)(
|
||||
struct _cef_request_context_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Returns all preferences as a dictionary. If |include_defaults| is true (1)
|
||||
// then preferences currently at their default value will be included. The
|
||||
// returned object contains a copy of the underlying preference values and
|
||||
// modifications to the returned object will not modify the underlying
|
||||
// preference values. This function must be called on the browser process UI
|
||||
// thread.
|
||||
///
|
||||
struct _cef_dictionary_value_t*(CEF_CALLBACK* get_all_preferences)(
|
||||
struct _cef_request_context_t* self,
|
||||
int include_defaults);
|
||||
|
||||
///
|
||||
// Returns true (1) if the preference with the specified |name| can be
|
||||
// modified using SetPreference. As one example preferences set via the
|
||||
// command-line usually cannot be modified. This function must be called on
|
||||
// the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* can_set_preference)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Set the |value| associated with preference |name|. Returns true (1) if the
|
||||
// value is set successfully and false (0) otherwise. If |value| is NULL the
|
||||
// preference will be restored to its default value. If setting the preference
|
||||
// fails then |error| will be populated with a detailed description of the
|
||||
// problem. This function must be called on the browser process UI thread.
|
||||
///
|
||||
int(CEF_CALLBACK* set_preference)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* name,
|
||||
struct _cef_value_t* value,
|
||||
cef_string_t* error);
|
||||
|
||||
///
|
||||
// Clears all certificate exceptions that were added as part of handling
|
||||
// cef_request_handler_t::on_certificate_error(). If you call this it is
|
||||
// recommended that you also call close_all_connections() or you risk not
|
||||
// being prompted again for server certificates if you reconnect quickly. If
|
||||
// |callback| is non-NULL it will be executed on the UI thread after
|
||||
// completion.
|
||||
/// Clears all certificate exceptions that were added as part of handling
|
||||
/// cef_request_handler_t::on_certificate_error(). If you call this it is
|
||||
/// recommended that you also call close_all_connections() or you risk not
|
||||
/// being prompted again for server certificates if you reconnect quickly. If
|
||||
/// |callback| is non-NULL it will be executed on the UI thread after
|
||||
/// completion.
|
||||
///
|
||||
void(CEF_CALLBACK* clear_certificate_exceptions)(
|
||||
struct _cef_request_context_t* self,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Clears all HTTP authentication credentials that were added as part of
|
||||
// handling GetAuthCredentials. If |callback| is non-NULL it will be executed
|
||||
// on the UI thread after completion.
|
||||
/// Clears all HTTP authentication credentials that were added as part of
|
||||
/// handling GetAuthCredentials. If |callback| is non-NULL it will be executed
|
||||
/// on the UI thread after completion.
|
||||
///
|
||||
void(CEF_CALLBACK* clear_http_auth_credentials)(
|
||||
struct _cef_request_context_t* self,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Clears all active and idle connections that Chromium currently has. This is
|
||||
// only recommended if you have released all other CEF objects but don't yet
|
||||
// want to call cef_shutdown(). If |callback| is non-NULL it will be executed
|
||||
// on the UI thread after completion.
|
||||
/// Clears all active and idle connections that Chromium currently has. This
|
||||
/// is only recommended if you have released all other CEF objects but don't
|
||||
/// yet want to call cef_shutdown(). If |callback| is non-NULL it will be
|
||||
/// executed on the UI thread after completion.
|
||||
///
|
||||
void(CEF_CALLBACK* close_all_connections)(
|
||||
struct _cef_request_context_t* self,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Attempts to resolve |origin| to a list of associated IP addresses.
|
||||
// |callback| will be executed on the UI thread after completion.
|
||||
/// Attempts to resolve |origin| to a list of associated IP addresses.
|
||||
/// |callback| will be executed on the UI thread after completion.
|
||||
///
|
||||
void(CEF_CALLBACK* resolve_host)(struct _cef_request_context_t* self,
|
||||
const cef_string_t* origin,
|
||||
struct _cef_resolve_callback_t* callback);
|
||||
|
||||
///
|
||||
// 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_handler_t
|
||||
// and/or cef_extension_handler_t) 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_context_handler_t
|
||||
// callbacks for the extension.
|
||||
//
|
||||
// cef_extension_handler_t::OnExtensionLoaded will be called on load success
|
||||
// or cef_extension_handler_t::OnExtensionLoadFailed will be called on load
|
||||
// failure.
|
||||
//
|
||||
// If the extension specifies a background script via the "background"
|
||||
// manifest key then cef_extension_handler_t::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.
|
||||
/// 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_handler_t
|
||||
/// and/or cef_extension_handler_t) 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_context_handler_t callbacks for the extension.
|
||||
///
|
||||
/// cef_extension_handler_t::OnExtensionLoaded will be called on load success
|
||||
/// or cef_extension_handler_t::OnExtensionLoadFailed will be called on load
|
||||
/// failure.
|
||||
///
|
||||
/// If the extension specifies a background script via the "background"
|
||||
/// manifest key then cef_extension_handler_t::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,
|
||||
@@ -309,45 +258,45 @@ typedef struct _cef_request_context_t {
|
||||
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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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);
|
||||
|
||||
///
|
||||
// Returns the MediaRouter object associated with this context. If |callback|
|
||||
// is non-NULL it will be executed asnychronously on the UI thread after the
|
||||
// manager's context has been initialized.
|
||||
/// Returns the MediaRouter object associated with this context. If
|
||||
/// |callback| is non-NULL it will be executed asnychronously on the UI thread
|
||||
/// after the manager's context has been initialized.
|
||||
///
|
||||
struct _cef_media_router_t*(CEF_CALLBACK* get_media_router)(
|
||||
struct _cef_request_context_t* self,
|
||||
@@ -355,21 +304,21 @@ typedef struct _cef_request_context_t {
|
||||
} cef_request_context_t;
|
||||
|
||||
///
|
||||
// Returns the global context object.
|
||||
/// Returns the global context object.
|
||||
///
|
||||
CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context(void);
|
||||
|
||||
///
|
||||
// Creates a new context object with the specified |settings| and optional
|
||||
// |handler|.
|
||||
/// Creates a new context object with the specified |settings| and optional
|
||||
/// |handler|.
|
||||
///
|
||||
CEF_EXPORT cef_request_context_t* cef_request_context_create_context(
|
||||
const struct _cef_request_context_settings_t* settings,
|
||||
struct _cef_request_context_handler_t* handler);
|
||||
|
||||
///
|
||||
// Creates a new context object that shares storage with |other| and uses an
|
||||
// optional |handler|.
|
||||
/// Creates a new context object that shares storage with |other| and uses an
|
||||
/// optional |handler|.
|
||||
///
|
||||
CEF_EXPORT cef_request_context_t* cef_create_context_shared(
|
||||
cef_request_context_t* other,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=b2657a441a701c5ddaca68dc604fd94153a3220f$
|
||||
// $hash=c25acf0c0dde9bbd8b9b3526e161aaa9e00445c8$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_browser_capi.h"
|
||||
#include "include/capi/cef_frame_capi.h"
|
||||
#include "include/capi/cef_preference_capi.h"
|
||||
#include "include/capi/cef_request_capi.h"
|
||||
#include "include/capi/cef_resource_request_handler_capi.h"
|
||||
|
||||
@@ -51,41 +52,42 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to provide handler implementations. The handler
|
||||
// instance will not be released until all objects related to the context have
|
||||
// been destroyed.
|
||||
/// Implement this structure to provide handler implementations. The handler
|
||||
/// instance will not be released until all objects related to the context have
|
||||
/// been destroyed.
|
||||
///
|
||||
typedef struct _cef_request_context_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the browser process UI thread immediately after the request
|
||||
// context has been initialized.
|
||||
/// 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 before a resource request is
|
||||
// initiated. The |browser| and |frame| values represent the source of the
|
||||
// request, and may be NULL for requests originating from service workers or
|
||||
// cef_urlrequest_t. |request| represents the request contents and cannot be
|
||||
// modified in this callback. |is_navigation| will be true (1) if the resource
|
||||
// request is a navigation. |is_download| will be true (1) if the resource
|
||||
// request is a download. |request_initiator| is the origin (scheme + domain)
|
||||
// of the page that initiated the request. Set |disable_default_handling| to
|
||||
// true (1) to disable default handling of the request, in which case it will
|
||||
// need to be handled via cef_resource_request_handler_t::GetResourceHandler
|
||||
// or it will be canceled. To allow the resource load to proceed with default
|
||||
// handling return NULL. To specify a handler for the resource return a
|
||||
// cef_resource_request_handler_t object. This function will not be called if
|
||||
// the client associated with |browser| returns a non-NULL value from
|
||||
// cef_request_handler_t::GetResourceRequestHandler for the same request
|
||||
// (identified by cef_request_t::GetIdentifier).
|
||||
/// Called on the browser process IO thread before a resource request is
|
||||
/// initiated. The |browser| and |frame| values represent the source of the
|
||||
/// request, and may be NULL for requests originating from service workers or
|
||||
/// cef_urlrequest_t. |request| represents the request contents and cannot be
|
||||
/// modified in this callback. |is_navigation| will be true (1) if the
|
||||
/// resource request is a navigation. |is_download| will be true (1) if the
|
||||
/// resource request is a download. |request_initiator| is the origin (scheme
|
||||
/// + domain) of the page that initiated the request. Set
|
||||
/// |disable_default_handling| to true (1) to disable default handling of the
|
||||
/// request, in which case it will need to be handled via
|
||||
/// cef_resource_request_handler_t::GetResourceHandler or it will be canceled.
|
||||
/// To allow the resource load to proceed with default handling return NULL.
|
||||
/// To specify a handler for the resource return a
|
||||
/// cef_resource_request_handler_t object. This function will not be called if
|
||||
/// the client associated with |browser| returns a non-NULL value from
|
||||
/// cef_request_handler_t::GetResourceRequestHandler for the same request
|
||||
/// (identified by cef_request_t::GetIdentifier).
|
||||
///
|
||||
struct _cef_resource_request_handler_t*(
|
||||
CEF_CALLBACK* get_resource_request_handler)(
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=4e19e04de13949f20e63e44542bc0a0eeed46b43$
|
||||
// $hash=0524a218f8cb54cfde70f2ec475520b11923c2f7$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||
@@ -55,17 +55,17 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Callback structure used to select a client certificate for authentication.
|
||||
/// Callback structure used to select a client certificate for authentication.
|
||||
///
|
||||
typedef struct _cef_select_client_certificate_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// 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.
|
||||
/// 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,
|
||||
@@ -73,26 +73,27 @@ typedef struct _cef_select_client_certificate_callback_t {
|
||||
} cef_select_client_certificate_callback_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser requests. The
|
||||
// functions of this structure will be called on the thread indicated.
|
||||
/// Implement this structure to handle events related to browser requests. The
|
||||
/// functions of this structure will be called on the thread indicated.
|
||||
///
|
||||
typedef struct _cef_request_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the UI thread before browser navigation. Return true (1) to
|
||||
// cancel the navigation or false (0) to allow the navigation to proceed. The
|
||||
// |request| object cannot be modified in this callback.
|
||||
// cef_load_handler_t::OnLoadingStateChange will be called twice in all cases.
|
||||
// If the navigation is allowed cef_load_handler_t::OnLoadStart and
|
||||
// cef_load_handler_t::OnLoadEnd will be called. If the navigation is canceled
|
||||
// cef_load_handler_t::OnLoadError will be called with an |errorCode| value of
|
||||
// ERR_ABORTED. The |user_gesture| value will be true (1) if the browser
|
||||
// navigated via explicit user gesture (e.g. clicking a link) or false (0) if
|
||||
// it navigated automatically (e.g. via the DomContentLoaded event).
|
||||
/// Called on the UI thread before browser navigation. Return true (1) to
|
||||
/// cancel the navigation or false (0) to allow the navigation to proceed. The
|
||||
/// |request| object cannot be modified in this callback.
|
||||
/// cef_load_handler_t::OnLoadingStateChange will be called twice in all
|
||||
/// cases. If the navigation is allowed cef_load_handler_t::OnLoadStart and
|
||||
/// cef_load_handler_t::OnLoadEnd will be called. If the navigation is
|
||||
/// canceled cef_load_handler_t::OnLoadError will be called with an
|
||||
/// |errorCode| value of ERR_ABORTED. The |user_gesture| value will be true
|
||||
/// (1) if the browser navigated via explicit user gesture (e.g. clicking a
|
||||
/// link) or false (0) if it navigated automatically (e.g. via the
|
||||
/// DomContentLoaded event).
|
||||
///
|
||||
int(CEF_CALLBACK* on_before_browse)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -102,20 +103,20 @@ typedef struct _cef_request_handler_t {
|
||||
int is_redirect);
|
||||
|
||||
///
|
||||
// Called on the UI thread before OnBeforeBrowse in certain limited cases
|
||||
// where navigating a new or different browser might be desirable. This
|
||||
// includes user-initiated navigation that might open in a special way (e.g.
|
||||
// links clicked via middle-click or ctrl + left-click) and certain types of
|
||||
// cross-origin navigation initiated from the renderer process (e.g.
|
||||
// navigating the top-level frame to/from a file URL). The |browser| and
|
||||
// |frame| values represent the source of the navigation. The
|
||||
// |target_disposition| value indicates where the user intended to navigate
|
||||
// the browser based on standard Chromium behaviors (e.g. current tab, new
|
||||
// tab, etc). The |user_gesture| value will be true (1) if the browser
|
||||
// navigated via explicit user gesture (e.g. clicking a link) or false (0) if
|
||||
// it navigated automatically (e.g. via the DomContentLoaded event). Return
|
||||
// true (1) to cancel the navigation or false (0) to allow the navigation to
|
||||
// proceed in the source browser's top-level frame.
|
||||
/// Called on the UI thread before OnBeforeBrowse in certain limited cases
|
||||
/// where navigating a new or different browser might be desirable. This
|
||||
/// includes user-initiated navigation that might open in a special way (e.g.
|
||||
/// links clicked via middle-click or ctrl + left-click) and certain types of
|
||||
/// cross-origin navigation initiated from the renderer process (e.g.
|
||||
/// navigating the top-level frame to/from a file URL). The |browser| and
|
||||
/// |frame| values represent the source of the navigation. The
|
||||
/// |target_disposition| value indicates where the user intended to navigate
|
||||
/// the browser based on standard Chromium behaviors (e.g. current tab, new
|
||||
/// tab, etc). The |user_gesture| value will be true (1) if the browser
|
||||
/// navigated via explicit user gesture (e.g. clicking a link) or false (0) if
|
||||
/// it navigated automatically (e.g. via the DomContentLoaded event). Return
|
||||
/// true (1) to cancel the navigation or false (0) to allow the navigation to
|
||||
/// proceed in the source browser's top-level frame.
|
||||
///
|
||||
int(CEF_CALLBACK* on_open_urlfrom_tab)(
|
||||
struct _cef_request_handler_t* self,
|
||||
@@ -126,20 +127,20 @@ typedef struct _cef_request_handler_t {
|
||||
int user_gesture);
|
||||
|
||||
///
|
||||
// Called on the browser process IO thread before a resource request is
|
||||
// initiated. The |browser| and |frame| values represent the source of the
|
||||
// request. |request| represents the request contents and cannot be modified
|
||||
// in this callback. |is_navigation| will be true (1) if the resource request
|
||||
// is a navigation. |is_download| will be true (1) if the resource request is
|
||||
// a download. |request_initiator| is the origin (scheme + domain) of the page
|
||||
// that initiated the request. Set |disable_default_handling| to true (1) to
|
||||
// disable default handling of the request, in which case it will need to be
|
||||
// handled via cef_resource_request_handler_t::GetResourceHandler or it will
|
||||
// be canceled. To allow the resource load to proceed with default handling
|
||||
// return NULL. To specify a handler for the resource return a
|
||||
// cef_resource_request_handler_t object. If this callback returns NULL the
|
||||
// same function will be called on the associated
|
||||
// cef_request_context_handler_t, if any.
|
||||
/// Called on the browser process IO thread before a resource request is
|
||||
/// initiated. The |browser| and |frame| values represent the source of the
|
||||
/// request. |request| represents the request contents and cannot be modified
|
||||
/// in this callback. |is_navigation| will be true (1) if the resource request
|
||||
/// is a navigation. |is_download| will be true (1) if the resource request is
|
||||
/// a download. |request_initiator| is the origin (scheme + domain) of the
|
||||
/// page that initiated the request. Set |disable_default_handling| to true
|
||||
/// (1) to disable default handling of the request, in which case it will need
|
||||
/// to be handled via cef_resource_request_handler_t::GetResourceHandler or it
|
||||
/// will be canceled. To allow the resource load to proceed with default
|
||||
/// handling return NULL. To specify a handler for the resource return a
|
||||
/// cef_resource_request_handler_t object. If this callback returns NULL the
|
||||
/// same function will be called on the associated
|
||||
/// cef_request_context_handler_t, if any.
|
||||
///
|
||||
struct _cef_resource_request_handler_t*(
|
||||
CEF_CALLBACK* get_resource_request_handler)(
|
||||
@@ -153,16 +154,16 @@ typedef struct _cef_request_handler_t {
|
||||
int* disable_default_handling);
|
||||
|
||||
///
|
||||
// Called on the IO thread when the browser needs credentials from the user.
|
||||
// |origin_url| is the origin making this authentication request. |isProxy|
|
||||
// indicates whether the host is a proxy server. |host| contains the hostname
|
||||
// and |port| contains the port number. |realm| is the realm of the challenge
|
||||
// and may be NULL. |scheme| is the authentication scheme used, such as
|
||||
// "basic" or "digest", and will be NULL if the source of the request is an
|
||||
// FTP server. Return true (1) to continue the request and call
|
||||
// cef_auth_callback_t::cont() either in this function or at a later time when
|
||||
// the authentication information is available. Return false (0) to cancel the
|
||||
// request immediately.
|
||||
/// Called on the IO thread when the browser needs credentials from the user.
|
||||
/// |origin_url| is the origin making this authentication request. |isProxy|
|
||||
/// indicates whether the host is a proxy server. |host| contains the hostname
|
||||
/// and |port| contains the port number. |realm| is the realm of the challenge
|
||||
/// and may be NULL. |scheme| is the authentication scheme used, such as
|
||||
/// "basic" or "digest", and will be NULL if the source of the request is an
|
||||
/// FTP server. Return true (1) to continue the request and call
|
||||
/// cef_auth_callback_t::cont() either in this function or at a later time
|
||||
/// when the authentication information is available. Return false (0) to
|
||||
/// cancel the request immediately.
|
||||
///
|
||||
int(CEF_CALLBACK* get_auth_credentials)(
|
||||
struct _cef_request_handler_t* self,
|
||||
@@ -176,13 +177,13 @@ typedef struct _cef_request_handler_t {
|
||||
struct _cef_auth_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the IO thread when JavaScript requests a specific storage quota
|
||||
// size via the webkitStorageInfo.requestQuota function. |origin_url| is the
|
||||
// origin of the page making the request. |new_size| is the requested quota
|
||||
// size in bytes. Return true (1) to continue the request and call
|
||||
// cef_callback_t functions either in this function or at a later time to
|
||||
// grant or deny the request. Return false (0) to cancel the request
|
||||
// immediately.
|
||||
/// Called on the IO thread when JavaScript requests a specific storage quota
|
||||
/// size via the webkitStorageInfo.requestQuota function. |origin_url| is the
|
||||
/// origin of the page making the request. |new_size| is the requested quota
|
||||
/// size in bytes. Return true (1) to continue the request and call
|
||||
/// cef_callback_t functions either in this function or at a later time to
|
||||
/// grant or deny the request. Return false (0) to cancel the request
|
||||
/// immediately.
|
||||
///
|
||||
int(CEF_CALLBACK* on_quota_request)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -191,12 +192,12 @@ typedef struct _cef_request_handler_t {
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the UI thread to handle requests for URLs with an invalid SSL
|
||||
// certificate. Return true (1) and call cef_callback_t functions either in
|
||||
// this function or at a later time to continue or cancel the request. Return
|
||||
// false (0) to cancel the request immediately. If
|
||||
// CefSettings.ignore_certificate_errors is set all invalid certificates will
|
||||
// be accepted without calling this function.
|
||||
/// Called on the UI thread to handle requests for URLs with an invalid SSL
|
||||
/// certificate. Return true (1) and call cef_callback_t functions either in
|
||||
/// this function or at a later time to continue or cancel the request. Return
|
||||
/// false (0) to cancel the request immediately. If
|
||||
/// cef_settings_t.ignore_certificate_errors is set all invalid certificates
|
||||
/// will be accepted without calling this function.
|
||||
///
|
||||
int(CEF_CALLBACK* on_certificate_error)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -206,17 +207,17 @@ typedef struct _cef_request_handler_t {
|
||||
struct _cef_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.
|
||||
/// 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,
|
||||
@@ -229,16 +230,16 @@ typedef struct _cef_request_handler_t {
|
||||
struct _cef_select_client_certificate_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the browser process UI thread when the render view associated
|
||||
// with |browser| is ready to receive/handle IPC messages in the render
|
||||
// process.
|
||||
/// Called on the browser process UI thread when the render view associated
|
||||
/// with |browser| is ready to receive/handle IPC messages in the render
|
||||
/// process.
|
||||
///
|
||||
void(CEF_CALLBACK* on_render_view_ready)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called on the browser process UI thread when the render process terminates
|
||||
// unexpectedly. |status| indicates how the process terminated.
|
||||
/// Called on the browser process UI thread when the render process terminates
|
||||
/// unexpectedly. |status| indicates how the process terminated.
|
||||
///
|
||||
void(CEF_CALLBACK* on_render_process_terminated)(
|
||||
struct _cef_request_handler_t* self,
|
||||
@@ -246,8 +247,8 @@ typedef struct _cef_request_handler_t {
|
||||
cef_termination_status_t status);
|
||||
|
||||
///
|
||||
// Called on the browser process UI thread when the window.document object of
|
||||
// the main frame has been created.
|
||||
/// Called on the browser process UI thread when the window.document object of
|
||||
/// the main frame has been created.
|
||||
///
|
||||
void(CEF_CALLBACK* on_document_available_in_main_frame)(
|
||||
struct _cef_request_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=6d8a7e3c0ed66cad10e8a0c59fed51431ec82ce5$
|
||||
// $hash=4350dcf46e2fcd18bea2c45446e448e588795afb$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
|
||||
@@ -48,22 +48,22 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure used for retrieving resources from the resource bundle (*.pak)
|
||||
// files loaded by CEF during startup or via the cef_resource_bundle_handler_t
|
||||
// returned from cef_app_t::GetResourceBundleHandler. See CefSettings for
|
||||
// additional options related to resource bundle loading. The functions of this
|
||||
// structure may be called on any thread unless otherwise indicated.
|
||||
/// Structure used for retrieving resources from the resource bundle (*.pak)
|
||||
/// files loaded by CEF during startup or via the cef_resource_bundle_handler_t
|
||||
/// returned from cef_app_t::GetResourceBundleHandler. See CefSettings for
|
||||
/// additional options related to resource bundle loading. The functions of this
|
||||
/// structure may be called on any thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_resource_bundle_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns the localized string for the specified |string_id| or an NULL
|
||||
// string if the value is not found. Include cef_pack_strings.h for a listing
|
||||
// of valid string ID values.
|
||||
/// Returns the localized string for the specified |string_id| or an NULL
|
||||
/// string if the value is not found. Include cef_pack_strings.h for a listing
|
||||
/// of valid string ID values.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_localized_string)(
|
||||
@@ -71,20 +71,20 @@ typedef struct _cef_resource_bundle_t {
|
||||
int string_id);
|
||||
|
||||
///
|
||||
// Returns a cef_binary_value_t containing the decompressed contents of the
|
||||
// specified scale independent |resource_id| or NULL if not found. Include
|
||||
// cef_pack_resources.h for a listing of valid resource ID values.
|
||||
/// Returns a cef_binary_value_t containing the decompressed contents of the
|
||||
/// specified scale independent |resource_id| or NULL if not found. Include
|
||||
/// cef_pack_resources.h for a listing of valid resource ID values.
|
||||
///
|
||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_data_resource)(
|
||||
struct _cef_resource_bundle_t* self,
|
||||
int resource_id);
|
||||
|
||||
///
|
||||
// Returns a cef_binary_value_t containing the decompressed contents of the
|
||||
// specified |resource_id| nearest the scale factor |scale_factor| or NULL if
|
||||
// not found. Use a |scale_factor| value of SCALE_FACTOR_NONE for scale
|
||||
// independent resources or call GetDataResource instead.Include
|
||||
// cef_pack_resources.h for a listing of valid resource ID values.
|
||||
/// Returns a cef_binary_value_t containing the decompressed contents of the
|
||||
/// specified |resource_id| nearest the scale factor |scale_factor| or NULL if
|
||||
/// not found. Use a |scale_factor| value of SCALE_FACTOR_NONE for scale
|
||||
/// independent resources or call GetDataResource instead.Include
|
||||
/// cef_pack_resources.h for a listing of valid resource ID values.
|
||||
///
|
||||
struct _cef_binary_value_t*(CEF_CALLBACK* get_data_resource_for_scale)(
|
||||
struct _cef_resource_bundle_t* self,
|
||||
@@ -93,7 +93,7 @@ typedef struct _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(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=3d7b3d4702c8d35dc8780f9e87eb7560d6ce1dee$
|
||||
// $hash=5f8c2d1e11779072e83610190ed7215324028d07$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
|
||||
@@ -47,21 +47,21 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure used to implement a custom resource bundle structure. See
|
||||
// CefSettings for additional options related to resource bundle loading. The
|
||||
// functions of this structure may be called on multiple threads.
|
||||
/// Structure used to implement a custom resource bundle structure. See
|
||||
/// CefSettings for additional options related to resource bundle loading. The
|
||||
/// functions of this structure may be called on multiple threads.
|
||||
///
|
||||
typedef struct _cef_resource_bundle_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called to retrieve a localized translation for the specified |string_id|.
|
||||
// To provide the translation set |string| to the translation string and
|
||||
// return true (1). To use the default translation return false (0). Include
|
||||
// cef_pack_strings.h for a listing of valid string ID values.
|
||||
/// Called to retrieve a localized translation for the specified |string_id|.
|
||||
/// To provide the translation set |string| to the translation string and
|
||||
/// return true (1). To use the default translation return false (0). Include
|
||||
/// cef_pack_strings.h for a listing of valid string ID values.
|
||||
///
|
||||
int(CEF_CALLBACK* get_localized_string)(
|
||||
struct _cef_resource_bundle_handler_t* self,
|
||||
@@ -69,12 +69,12 @@ typedef struct _cef_resource_bundle_handler_t {
|
||||
cef_string_t* string);
|
||||
|
||||
///
|
||||
// Called to retrieve data for the specified scale independent |resource_id|.
|
||||
// To provide the resource data set |data| and |data_size| to the data pointer
|
||||
// and size respectively and return true (1). To use the default resource data
|
||||
// return false (0). The resource data will not be copied and must remain
|
||||
// resident in memory. Include cef_pack_resources.h for a listing of valid
|
||||
// resource ID values.
|
||||
/// Called to retrieve data for the specified scale independent |resource_id|.
|
||||
/// To provide the resource data set |data| and |data_size| to the data
|
||||
/// pointer and size respectively and return true (1). To use the default
|
||||
/// resource data return false (0). The resource data will not be copied and
|
||||
/// must remain resident in memory. Include cef_pack_resources.h for a listing
|
||||
/// of valid resource ID values.
|
||||
///
|
||||
int(CEF_CALLBACK* get_data_resource)(
|
||||
struct _cef_resource_bundle_handler_t* self,
|
||||
@@ -83,12 +83,12 @@ typedef struct _cef_resource_bundle_handler_t {
|
||||
size_t* data_size);
|
||||
|
||||
///
|
||||
// Called to retrieve data for the specified |resource_id| nearest the scale
|
||||
// factor |scale_factor|. To provide the resource data set |data| and
|
||||
// |data_size| to the data pointer and size respectively and return true (1).
|
||||
// To use the default resource data return false (0). The resource data will
|
||||
// not be copied and must remain resident in memory. Include
|
||||
// cef_pack_resources.h for a listing of valid resource ID values.
|
||||
/// Called to retrieve data for the specified |resource_id| nearest the scale
|
||||
/// factor |scale_factor|. To provide the resource data set |data| and
|
||||
/// |data_size| to the data pointer and size respectively and return true (1).
|
||||
/// To use the default resource data return false (0). The resource data will
|
||||
/// not be copied and must remain resident in memory. Include
|
||||
/// cef_pack_resources.h for a listing of valid resource ID values.
|
||||
///
|
||||
int(CEF_CALLBACK* get_data_resource_for_scale)(
|
||||
struct _cef_resource_bundle_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=67df3d56f0cc0f58d2b0a2fe884bbb2c1c39813f$
|
||||
// $hash=3373cc29becf60303d1f01774c1ed8017c3f0da3$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
||||
@@ -52,63 +52,64 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Callback for asynchronous continuation of cef_resource_handler_t::skip().
|
||||
/// Callback for asynchronous continuation of cef_resource_handler_t::skip().
|
||||
///
|
||||
typedef struct _cef_resource_skip_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Callback for asynchronous continuation of skip(). If |bytes_skipped| > 0
|
||||
// then either skip() will be called again until the requested number of bytes
|
||||
// have been skipped or the request will proceed. If |bytes_skipped| <= 0 the
|
||||
// request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE.
|
||||
/// Callback for asynchronous continuation of skip(). If |bytes_skipped| > 0
|
||||
/// then either skip() will be called again until the requested number of
|
||||
/// bytes have been skipped or the request will proceed. If |bytes_skipped| <=
|
||||
/// 0 the request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_resource_skip_callback_t* self,
|
||||
int64 bytes_skipped);
|
||||
} cef_resource_skip_callback_t;
|
||||
|
||||
///
|
||||
// Callback for asynchronous continuation of cef_resource_handler_t::read().
|
||||
/// Callback for asynchronous continuation of cef_resource_handler_t::read().
|
||||
///
|
||||
typedef struct _cef_resource_read_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Callback for asynchronous continuation of read(). If |bytes_read| == 0 the
|
||||
// response will be considered complete. If |bytes_read| > 0 then read() will
|
||||
// be called again until the request is complete (based on either the result
|
||||
// or the expected content length). If |bytes_read| < 0 then the request will
|
||||
// fail and the |bytes_read| value will be treated as the error code.
|
||||
/// Callback for asynchronous continuation of read(). If |bytes_read| == 0 the
|
||||
/// response will be considered complete. If |bytes_read| > 0 then read() will
|
||||
/// be called again until the request is complete (based on either the result
|
||||
/// or the expected content length). If |bytes_read| < 0 then the request will
|
||||
/// fail and the |bytes_read| value will be treated as the error code.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_resource_read_callback_t* self,
|
||||
int bytes_read);
|
||||
} cef_resource_read_callback_t;
|
||||
|
||||
///
|
||||
// Structure used to implement a custom request handler structure. The functions
|
||||
// of this structure will be called on the IO thread unless otherwise indicated.
|
||||
/// Structure used to implement a custom request handler structure. The
|
||||
/// functions of this structure will be called on the IO thread unless otherwise
|
||||
/// indicated.
|
||||
///
|
||||
typedef struct _cef_resource_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Open the response stream. To handle the request immediately set
|
||||
// |handle_request| to true (1) and return true (1). To decide at a later time
|
||||
// set |handle_request| to false (0), return true (1), and execute |callback|
|
||||
// to continue or cancel the request. To cancel the request immediately set
|
||||
// |handle_request| to true (1) and return false (0). This function will be
|
||||
// called in sequence but not from a dedicated thread. For backwards
|
||||
// compatibility set |handle_request| to false (0) and return false (0) and
|
||||
// the ProcessRequest function will be called.
|
||||
/// Open the response stream. To handle the request immediately set
|
||||
/// |handle_request| to true (1) and return true (1). To decide at a later
|
||||
/// time set |handle_request| to false (0), return true (1), and execute
|
||||
/// |callback| to continue or cancel the request. To cancel the request
|
||||
/// immediately set |handle_request| to true (1) and return false (0). This
|
||||
/// function will be called in sequence but not from a dedicated thread. For
|
||||
/// backwards compatibility set |handle_request| to false (0) and return false
|
||||
/// (0) and the ProcessRequest function will be called.
|
||||
///
|
||||
int(CEF_CALLBACK* open)(struct _cef_resource_handler_t* self,
|
||||
struct _cef_request_t* request,
|
||||
@@ -116,32 +117,32 @@ typedef struct _cef_resource_handler_t {
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Begin processing the request. To handle the request return true (1) and
|
||||
// call cef_callback_t::cont() once the response header information is
|
||||
// available (cef_callback_t::cont() can also be called from inside this
|
||||
// function if header information is available immediately). To cancel the
|
||||
// request return false (0).
|
||||
//
|
||||
// WARNING: This function is deprecated. Use Open instead.
|
||||
/// Begin processing the request. To handle the request return true (1) and
|
||||
/// call cef_callback_t::cont() once the response header information is
|
||||
/// available (cef_callback_t::cont() can also be called from inside this
|
||||
/// function if header information is available immediately). To cancel the
|
||||
/// request return false (0).
|
||||
///
|
||||
/// WARNING: This function is deprecated. Use Open instead.
|
||||
///
|
||||
int(CEF_CALLBACK* process_request)(struct _cef_resource_handler_t* self,
|
||||
struct _cef_request_t* request,
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Retrieve response header information. If the response length is not known
|
||||
// set |response_length| to -1 and read_response() will be called until it
|
||||
// returns false (0). If the response length is known set |response_length| to
|
||||
// a positive value and read_response() will be called until it returns false
|
||||
// (0) or the specified number of bytes have been read. Use the |response|
|
||||
// object to set the mime type, http status code and other optional header
|
||||
// values. To redirect the request to a new URL set |redirectUrl| to the new
|
||||
// URL. |redirectUrl| can be either a relative or fully qualified URL. It is
|
||||
// also possible to set |response| to a redirect http status code and pass the
|
||||
// new URL via a Location header. Likewise with |redirectUrl| it is valid to
|
||||
// set a relative or fully qualified URL as the Location header value. If an
|
||||
// error occured while setting up the request you can call set_error() on
|
||||
// |response| to indicate the error condition.
|
||||
/// Retrieve response header information. If the response length is not known
|
||||
/// set |response_length| to -1 and read_response() will be called until it
|
||||
/// returns false (0). If the response length is known set |response_length|
|
||||
/// to a positive value and read_response() will be called until it returns
|
||||
/// false (0) or the specified number of bytes have been read. Use the
|
||||
/// |response| object to set the mime type, http status code and other
|
||||
/// optional header values. To redirect the request to a new URL set
|
||||
/// |redirectUrl| to the new URL. |redirectUrl| can be either a relative or
|
||||
/// fully qualified URL. It is also possible to set |response| to a redirect
|
||||
/// http status code and pass the new URL via a Location header. Likewise with
|
||||
/// |redirectUrl| it is valid to set a relative or fully qualified URL as the
|
||||
/// Location header value. If an error occured while setting up the request
|
||||
/// you can call set_error() on |response| to indicate the error condition.
|
||||
///
|
||||
void(CEF_CALLBACK* get_response_headers)(struct _cef_resource_handler_t* self,
|
||||
struct _cef_response_t* response,
|
||||
@@ -149,13 +150,13 @@ typedef struct _cef_resource_handler_t {
|
||||
cef_string_t* redirectUrl);
|
||||
|
||||
///
|
||||
// Skip response data when requested by a Range header. Skip over and discard
|
||||
// |bytes_to_skip| bytes of response data. If data is available immediately
|
||||
// set |bytes_skipped| to the number of bytes skipped and return true (1). To
|
||||
// read the data at a later time set |bytes_skipped| to 0, return true (1) and
|
||||
// execute |callback| when the data is available. To indicate failure set
|
||||
// |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
|
||||
// function will be called in sequence but not from a dedicated thread.
|
||||
/// Skip response data when requested by a Range header. Skip over and discard
|
||||
/// |bytes_to_skip| bytes of response data. If data is available immediately
|
||||
/// set |bytes_skipped| to the number of bytes skipped and return true (1). To
|
||||
/// read the data at a later time set |bytes_skipped| to 0, return true (1)
|
||||
/// and execute |callback| when the data is available. To indicate failure set
|
||||
/// |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
|
||||
/// function will be called in sequence but not from a dedicated thread.
|
||||
///
|
||||
int(CEF_CALLBACK* skip)(struct _cef_resource_handler_t* self,
|
||||
int64 bytes_to_skip,
|
||||
@@ -163,17 +164,17 @@ typedef struct _cef_resource_handler_t {
|
||||
struct _cef_resource_skip_callback_t* callback);
|
||||
|
||||
///
|
||||
// Read response data. If data is available immediately copy up to
|
||||
// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
|
||||
// bytes copied, and return true (1). To read the data at a later time keep a
|
||||
// pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute
|
||||
// |callback| when the data is available (|data_out| will remain valid until
|
||||
// the callback is executed). To indicate response completion set |bytes_read|
|
||||
// to 0 and return false (0). To indicate failure set |bytes_read| to < 0
|
||||
// (e.g. -2 for ERR_FAILED) and return false (0). This function will be called
|
||||
// in sequence but not from a dedicated thread. For backwards compatibility
|
||||
// set |bytes_read| to -1 and return false (0) and the ReadResponse function
|
||||
// will be called.
|
||||
/// Read response data. If data is available immediately copy up to
|
||||
/// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
|
||||
/// bytes copied, and return true (1). To read the data at a later time keep a
|
||||
/// pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute
|
||||
/// |callback| when the data is available (|data_out| will remain valid until
|
||||
/// the callback is executed). To indicate response completion set
|
||||
/// |bytes_read| to 0 and return false (0). To indicate failure set
|
||||
/// |bytes_read| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
|
||||
/// function will be called in sequence but not from a dedicated thread. For
|
||||
/// backwards compatibility set |bytes_read| to -1 and return false (0) and
|
||||
/// the ReadResponse function will be called.
|
||||
///
|
||||
int(CEF_CALLBACK* read)(struct _cef_resource_handler_t* self,
|
||||
void* data_out,
|
||||
@@ -182,13 +183,13 @@ typedef struct _cef_resource_handler_t {
|
||||
struct _cef_resource_read_callback_t* callback);
|
||||
|
||||
///
|
||||
// Read response data. If data is available immediately copy up to
|
||||
// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
|
||||
// bytes copied, and return true (1). To read the data at a later time set
|
||||
// |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).
|
||||
//
|
||||
// WARNING: This function is deprecated. Use Skip and Read instead.
|
||||
/// Read response data. If data is available immediately copy up to
|
||||
/// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
|
||||
/// bytes copied, and return true (1). To read the data at a later time set
|
||||
/// |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).
|
||||
///
|
||||
/// WARNING: This function is deprecated. Use Skip and Read instead.
|
||||
///
|
||||
int(CEF_CALLBACK* read_response)(struct _cef_resource_handler_t* self,
|
||||
void* data_out,
|
||||
@@ -197,7 +198,7 @@ typedef struct _cef_resource_handler_t {
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Request processing has been canceled.
|
||||
/// Request processing has been canceled.
|
||||
///
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_resource_handler_t* self);
|
||||
} cef_resource_handler_t;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=3d5c3c54c9f7eedc5cd1dd61c0f69edcd6a1143a$
|
||||
// $hash=64d090faf64e2ffb99da110840af383b757e113b$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_
|
||||
@@ -56,23 +56,23 @@ extern "C" {
|
||||
struct _cef_cookie_access_filter_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser requests. The
|
||||
// functions of this structure will be called on the IO thread unless otherwise
|
||||
// indicated.
|
||||
/// Implement this structure to handle events related to browser requests. The
|
||||
/// functions of this structure will be called on the IO thread unless otherwise
|
||||
/// indicated.
|
||||
///
|
||||
typedef struct _cef_resource_request_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the IO thread before a resource request is loaded. The |browser|
|
||||
// and |frame| values represent the source of the request, and may be NULL for
|
||||
// requests originating from service workers or cef_urlrequest_t. To
|
||||
// optionally filter cookies for the request return a
|
||||
// cef_cookie_access_filter_t object. The |request| object cannot not be
|
||||
// modified in this callback.
|
||||
/// Called on the IO thread before a resource request is loaded. The |browser|
|
||||
/// and |frame| values represent the source of the request, and may be NULL
|
||||
/// for requests originating from service workers or cef_urlrequest_t. To
|
||||
/// optionally filter cookies for the request return a
|
||||
/// cef_cookie_access_filter_t object. The |request| object cannot not be
|
||||
/// modified in this callback.
|
||||
///
|
||||
struct _cef_cookie_access_filter_t*(CEF_CALLBACK* get_cookie_access_filter)(
|
||||
struct _cef_resource_request_handler_t* self,
|
||||
@@ -81,15 +81,15 @@ typedef struct _cef_resource_request_handler_t {
|
||||
struct _cef_request_t* request);
|
||||
|
||||
///
|
||||
// Called on the IO thread before a resource request is loaded. The |browser|
|
||||
// and |frame| values represent the source of the request, and may be NULL for
|
||||
// requests originating from service workers or cef_urlrequest_t. To redirect
|
||||
// or change the resource load optionally modify |request|. Modification of
|
||||
// the request URL will be treated as a redirect. Return RV_CONTINUE to
|
||||
// continue the request immediately. Return RV_CONTINUE_ASYNC and call
|
||||
// cef_callback_t functions at a later time to continue or cancel the request
|
||||
// asynchronously. Return RV_CANCEL to cancel the request immediately.
|
||||
//
|
||||
/// Called on the IO thread before a resource request is loaded. The |browser|
|
||||
/// and |frame| values represent the source of the request, and may be NULL
|
||||
/// for requests originating from service workers or cef_urlrequest_t. To
|
||||
/// redirect or change the resource load optionally modify |request|.
|
||||
/// Modification of the request URL will be treated as a redirect. Return
|
||||
/// RV_CONTINUE to continue the request immediately. Return RV_CONTINUE_ASYNC
|
||||
/// and call cef_callback_t functions at a later time to continue or cancel
|
||||
/// the request asynchronously. Return RV_CANCEL to cancel the request
|
||||
/// immediately.
|
||||
///
|
||||
cef_return_value_t(CEF_CALLBACK* on_before_resource_load)(
|
||||
struct _cef_resource_request_handler_t* self,
|
||||
@@ -99,12 +99,12 @@ typedef struct _cef_resource_request_handler_t {
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the IO thread before a resource is loaded. The |browser| and
|
||||
// |frame| values represent the source of the request, and may be NULL for
|
||||
// requests originating from service workers or cef_urlrequest_t. To allow the
|
||||
// resource to load using the default network loader return NULL. To specify a
|
||||
// handler for the resource return a cef_resource_handler_t object. The
|
||||
// |request| object cannot not be modified in this callback.
|
||||
/// Called on the IO thread before a resource is loaded. The |browser| and
|
||||
/// |frame| values represent the source of the request, and may be NULL for
|
||||
/// requests originating from service workers or cef_urlrequest_t. To allow
|
||||
/// the resource to load using the default network loader return NULL. To
|
||||
/// specify a handler for the resource return a cef_resource_handler_t object.
|
||||
/// The |request| object cannot not be modified in this callback.
|
||||
///
|
||||
struct _cef_resource_handler_t*(CEF_CALLBACK* get_resource_handler)(
|
||||
struct _cef_resource_request_handler_t* self,
|
||||
@@ -113,14 +113,14 @@ typedef struct _cef_resource_request_handler_t {
|
||||
struct _cef_request_t* request);
|
||||
|
||||
///
|
||||
// Called on the IO thread when a resource load is redirected. The |browser|
|
||||
// and |frame| values represent the source of the request, and may be NULL for
|
||||
// requests originating from service workers or cef_urlrequest_t. The
|
||||
// |request| parameter will contain the old URL and other request-related
|
||||
// information. The |response| parameter will contain the response that
|
||||
// resulted in the redirect. The |new_url| parameter will contain the new URL
|
||||
// and can be changed if desired. The |request| and |response| objects cannot
|
||||
// be modified in this callback.
|
||||
/// Called on the IO thread when a resource load is redirected. The |browser|
|
||||
/// and |frame| values represent the source of the request, and may be NULL
|
||||
/// for requests originating from service workers or cef_urlrequest_t. The
|
||||
/// |request| parameter will contain the old URL and other request-related
|
||||
/// information. The |response| parameter will contain the response that
|
||||
/// resulted in the redirect. The |new_url| parameter will contain the new URL
|
||||
/// and can be changed if desired. The |request| and |response| objects cannot
|
||||
/// be modified in this callback.
|
||||
///
|
||||
void(CEF_CALLBACK* on_resource_redirect)(
|
||||
struct _cef_resource_request_handler_t* self,
|
||||
@@ -131,17 +131,18 @@ typedef struct _cef_resource_request_handler_t {
|
||||
cef_string_t* new_url);
|
||||
|
||||
///
|
||||
// Called on the IO thread when a resource response is received. The |browser|
|
||||
// and |frame| values represent the source of the request, and may be NULL for
|
||||
// requests originating from service workers or cef_urlrequest_t. To allow the
|
||||
// resource load to proceed without modification return false (0). To redirect
|
||||
// or retry the resource load optionally modify |request| and return true (1).
|
||||
// Modification of the request URL will be treated as a redirect. Requests
|
||||
// handled using the default network loader cannot be redirected in this
|
||||
// callback. The |response| object cannot be modified in this callback.
|
||||
//
|
||||
// WARNING: Redirecting using this function is deprecated. Use
|
||||
// OnBeforeResourceLoad or GetResourceHandler to perform redirects.
|
||||
/// Called on the IO thread when a resource response is received. The
|
||||
/// |browser| and |frame| values represent the source of the request, and may
|
||||
/// be NULL for requests originating from service workers or cef_urlrequest_t.
|
||||
/// To allow the resource load to proceed without modification return false
|
||||
/// (0). To redirect or retry the resource load optionally modify |request|
|
||||
/// and return true (1). Modification of the request URL will be treated as a
|
||||
/// redirect. Requests handled using the default network loader cannot be
|
||||
/// redirected in this callback. The |response| object cannot be modified in
|
||||
/// this callback.
|
||||
///
|
||||
/// WARNING: Redirecting using this function is deprecated. Use
|
||||
/// OnBeforeResourceLoad or GetResourceHandler to perform redirects.
|
||||
///
|
||||
int(CEF_CALLBACK* on_resource_response)(
|
||||
struct _cef_resource_request_handler_t* self,
|
||||
@@ -151,11 +152,11 @@ typedef struct _cef_resource_request_handler_t {
|
||||
struct _cef_response_t* response);
|
||||
|
||||
///
|
||||
// Called on the IO thread to optionally filter resource response content. The
|
||||
// |browser| and |frame| values represent the source of the request, and may
|
||||
// be NULL for requests originating from service workers or cef_urlrequest_t.
|
||||
// |request| and |response| represent the request and response respectively
|
||||
// and cannot be modified in this callback.
|
||||
/// Called on the IO thread to optionally filter resource response content.
|
||||
/// The |browser| and |frame| values represent the source of the request, and
|
||||
/// may be NULL for requests originating from service workers or
|
||||
/// cef_urlrequest_t. |request| and |response| represent the request and
|
||||
/// response respectively and cannot be modified in this callback.
|
||||
///
|
||||
struct _cef_response_filter_t*(CEF_CALLBACK* get_resource_response_filter)(
|
||||
struct _cef_resource_request_handler_t* self,
|
||||
@@ -165,20 +166,20 @@ typedef struct _cef_resource_request_handler_t {
|
||||
struct _cef_response_t* response);
|
||||
|
||||
///
|
||||
// Called on the IO thread when a resource load has completed. The |browser|
|
||||
// and |frame| values represent the source of the request, and may be NULL for
|
||||
// requests originating from service workers or cef_urlrequest_t. |request|
|
||||
// and |response| represent the request and response respectively and cannot
|
||||
// be modified in this callback. |status| indicates the load completion
|
||||
// status. |received_content_length| is the number of response bytes actually
|
||||
// read. This function will be called for all requests, including requests
|
||||
// that are aborted due to CEF shutdown or destruction of the associated
|
||||
// browser. In cases where the associated browser is destroyed this callback
|
||||
// may arrive after the cef_life_span_handler_t::OnBeforeClose callback for
|
||||
// that browser. The cef_frame_t::IsValid function can be used to test for
|
||||
// this situation, and care should be taken not to call |browser| or |frame|
|
||||
// functions that modify state (like LoadURL, SendProcessMessage, etc.) if the
|
||||
// frame is invalid.
|
||||
/// Called on the IO thread when a resource load has completed. The |browser|
|
||||
/// and |frame| values represent the source of the request, and may be NULL
|
||||
/// for requests originating from service workers or cef_urlrequest_t.
|
||||
/// |request| and |response| represent the request and response respectively
|
||||
/// and cannot be modified in this callback. |status| indicates the load
|
||||
/// completion status. |received_content_length| is the number of response
|
||||
/// bytes actually read. This function will be called for all requests,
|
||||
/// including requests that are aborted due to CEF shutdown or destruction of
|
||||
/// the associated browser. In cases where the associated browser is destroyed
|
||||
/// this callback may arrive after the cef_life_span_handler_t::OnBeforeClose
|
||||
/// callback for that browser. The cef_frame_t::IsValid function can be used
|
||||
/// to test for this situation, and care should be taken not to call |browser|
|
||||
/// or |frame| functions that modify state (like LoadURL, SendProcessMessage,
|
||||
/// etc.) if the frame is invalid.
|
||||
///
|
||||
void(CEF_CALLBACK* on_resource_load_complete)(
|
||||
struct _cef_resource_request_handler_t* self,
|
||||
@@ -190,14 +191,14 @@ typedef struct _cef_resource_request_handler_t {
|
||||
int64 received_content_length);
|
||||
|
||||
///
|
||||
// Called on the IO thread to handle requests for URLs with an unknown
|
||||
// protocol component. The |browser| and |frame| values represent the source
|
||||
// of the request, and may be NULL for requests originating from service
|
||||
// workers or cef_urlrequest_t. |request| cannot be modified in this callback.
|
||||
// Set |allow_os_execution| to true (1) to attempt execution via the
|
||||
// registered OS protocol handler, if any. SECURITY WARNING: YOU SHOULD USE
|
||||
// THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR OTHER URL
|
||||
// ANALYSIS BEFORE ALLOWING OS EXECUTION.
|
||||
/// Called on the IO thread to handle requests for URLs with an unknown
|
||||
/// protocol component. The |browser| and |frame| values represent the source
|
||||
/// of the request, and may be NULL for requests originating from service
|
||||
/// workers or cef_urlrequest_t. |request| cannot be modified in this
|
||||
/// callback. Set |allow_os_execution| to true (1) to attempt execution via
|
||||
/// the registered OS protocol handler, if any. SECURITY WARNING: YOU SHOULD
|
||||
/// USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR OTHER URL
|
||||
/// ANALYSIS BEFORE ALLOWING OS EXECUTION.
|
||||
///
|
||||
void(CEF_CALLBACK* on_protocol_execution)(
|
||||
struct _cef_resource_request_handler_t* self,
|
||||
@@ -208,22 +209,22 @@ typedef struct _cef_resource_request_handler_t {
|
||||
} cef_resource_request_handler_t;
|
||||
|
||||
///
|
||||
// Implement this structure to filter cookies that may be sent or received from
|
||||
// resource requests. The functions of this structure will be called on the IO
|
||||
// thread unless otherwise indicated.
|
||||
/// Implement this structure to filter cookies that may be sent or received from
|
||||
/// resource requests. The functions of this structure will be called on the IO
|
||||
/// thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_cookie_access_filter_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called on the IO thread before a resource request is sent. The |browser|
|
||||
// and |frame| values represent the source of the request, and may be NULL for
|
||||
// requests originating from service workers or cef_urlrequest_t. |request|
|
||||
// cannot be modified in this callback. Return true (1) if the specified
|
||||
// cookie can be sent with the request or false (0) otherwise.
|
||||
/// Called on the IO thread before a resource request is sent. The |browser|
|
||||
/// and |frame| values represent the source of the request, and may be NULL
|
||||
/// for requests originating from service workers or cef_urlrequest_t.
|
||||
/// |request| cannot be modified in this callback. Return true (1) if the
|
||||
/// specified cookie can be sent with the request or false (0) otherwise.
|
||||
///
|
||||
int(CEF_CALLBACK* can_send_cookie)(struct _cef_cookie_access_filter_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
@@ -232,12 +233,12 @@ typedef struct _cef_cookie_access_filter_t {
|
||||
const struct _cef_cookie_t* cookie);
|
||||
|
||||
///
|
||||
// Called on the IO thread after a resource response is received. The
|
||||
// |browser| and |frame| values represent the source of the request, and may
|
||||
// be NULL for requests originating from service workers or cef_urlrequest_t.
|
||||
// |request| cannot be modified in this callback. Return true (1) if the
|
||||
// specified cookie returned with the response can be saved or false (0)
|
||||
// otherwise.
|
||||
/// Called on the IO thread after a resource response is received. The
|
||||
/// |browser| and |frame| values represent the source of the request, and may
|
||||
/// be NULL for requests originating from service workers or cef_urlrequest_t.
|
||||
/// |request| cannot be modified in this callback. Return true (1) if the
|
||||
/// specified cookie returned with the response can be saved or false (0)
|
||||
/// otherwise.
|
||||
///
|
||||
int(CEF_CALLBACK* can_save_cookie)(struct _cef_cookie_access_filter_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ab8832420572dae95a601fb3170fcd3693473619$
|
||||
// $hash=21354bc7b20a18eb0c25d2aa0abf1211fd9ebcaa$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
||||
@@ -47,83 +47,83 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure used to represent a web response. The functions of this structure
|
||||
// may be called on any thread.
|
||||
/// Structure used to represent a web response. The functions of this structure
|
||||
/// may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_response_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// 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);
|
||||
|
||||
///
|
||||
// Set the response error code. This can be used by custom scheme handlers to
|
||||
// return errors during initial request processing.
|
||||
/// Set the response error code. This can be used by custom scheme handlers to
|
||||
/// return errors during initial request processing.
|
||||
///
|
||||
void(CEF_CALLBACK* set_error)(struct _cef_response_t* self,
|
||||
cef_errorcode_t error);
|
||||
|
||||
///
|
||||
// Get the response status code.
|
||||
/// Get the response status code.
|
||||
///
|
||||
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);
|
||||
|
||||
///
|
||||
// Get the response status text.
|
||||
/// Get the response status text.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_status_text)(
|
||||
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,
|
||||
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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_mime_type)(
|
||||
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,
|
||||
const cef_string_t* mimeType);
|
||||
|
||||
///
|
||||
// Get the response charset.
|
||||
/// Get the response charset.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_charset)(
|
||||
struct _cef_response_t* self);
|
||||
|
||||
///
|
||||
// Set the response charset.
|
||||
/// Set the response charset.
|
||||
///
|
||||
void(CEF_CALLBACK* set_charset)(struct _cef_response_t* self,
|
||||
const cef_string_t* charset);
|
||||
|
||||
///
|
||||
// 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().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_header_by_name)(
|
||||
@@ -131,9 +131,9 @@ typedef struct _cef_response_t {
|
||||
const cef_string_t* name);
|
||||
|
||||
///
|
||||
// Set the header |name| to |value|. If |overwrite| is true (1) any existing
|
||||
// values will be replaced with the new value. If |overwrite| is false (0) any
|
||||
// existing values will not be overwritten.
|
||||
/// Set the header |name| to |value|. If |overwrite| is true (1) any existing
|
||||
/// values will be replaced with the new value. If |overwrite| is false (0)
|
||||
/// any existing values will not be overwritten.
|
||||
///
|
||||
void(CEF_CALLBACK* set_header_by_name)(struct _cef_response_t* self,
|
||||
const cef_string_t* name,
|
||||
@@ -141,32 +141,32 @@ typedef struct _cef_response_t {
|
||||
int overwrite);
|
||||
|
||||
///
|
||||
// Get all response header fields.
|
||||
/// Get all response header fields.
|
||||
///
|
||||
void(CEF_CALLBACK* get_header_map)(struct _cef_response_t* self,
|
||||
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,
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
// Get the resolved URL after redirects or changed as a result of HSTS.
|
||||
/// Get the resolved URL after redirects or changed as a result of HSTS.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_response_t* self);
|
||||
|
||||
///
|
||||
// Set the resolved URL after redirects or changed as a result of HSTS.
|
||||
/// Set the resolved URL after redirects or changed as a result of HSTS.
|
||||
///
|
||||
void(CEF_CALLBACK* set_url)(struct _cef_response_t* self,
|
||||
const cef_string_t* url);
|
||||
} cef_response_t;
|
||||
|
||||
///
|
||||
// Create a new cef_response_t object.
|
||||
/// Create a new cef_response_t object.
|
||||
///
|
||||
CEF_EXPORT cef_response_t* cef_response_create(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=fb06b9630b95fedb5d202aab7814d914ab7c943b$
|
||||
// $hash=cbcb379f7ed86b58e271089a4117267a50f72814$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_
|
||||
@@ -47,51 +47,51 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to filter resource response content. The functions
|
||||
// of this structure will be called on the browser process IO thread.
|
||||
/// Implement this structure to filter resource response content. The functions
|
||||
/// of this structure will be called on the browser process IO thread.
|
||||
///
|
||||
typedef struct _cef_response_filter_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Initialize the response filter. Will only be called a single time. The
|
||||
// filter will not be installed if this function returns false (0).
|
||||
/// Initialize the response filter. Will only be called a single time. The
|
||||
/// filter will not be installed if this function returns false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* init_filter)(struct _cef_response_filter_t* self);
|
||||
|
||||
///
|
||||
// Called to filter a chunk of data. Expected usage is as follows:
|
||||
//
|
||||
// A. Read input data from |data_in| and set |data_in_read| to the number of
|
||||
// bytes that were read up to a maximum of |data_in_size|. |data_in| will
|
||||
// be NULL if |data_in_size| is zero.
|
||||
// B. Write filtered output data to |data_out| and set |data_out_written| to
|
||||
// the number of bytes that were written up to a maximum of
|
||||
// |data_out_size|. If no output data was written then all data must be
|
||||
// read from |data_in| (user must set |data_in_read| = |data_in_size|).
|
||||
// C. Return RESPONSE_FILTER_DONE if all output data was written or
|
||||
// RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending.
|
||||
//
|
||||
// This function will be called repeatedly until the input buffer has been
|
||||
// fully read (user sets |data_in_read| = |data_in_size|) and there is no more
|
||||
// input data to filter (the resource response is complete). This function may
|
||||
// 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.
|
||||
/// Called to filter a chunk of data. Expected usage is as follows:
|
||||
///
|
||||
/// 1. Read input data from |data_in| and set |data_in_read| to the number of
|
||||
/// bytes that were read up to a maximum of |data_in_size|. |data_in| will
|
||||
/// be NULL if |data_in_size| is zero.
|
||||
/// 2. Write filtered output data to |data_out| and set |data_out_written| to
|
||||
/// the number of bytes that were written up to a maximum of
|
||||
/// |data_out_size|. If no output data was written then all data must be
|
||||
/// read from |data_in| (user must set |data_in_read| = |data_in_size|).
|
||||
/// 3. Return RESPONSE_FILTER_DONE if all output data was written or
|
||||
/// RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending.
|
||||
///
|
||||
/// This function will be called repeatedly until the input buffer has been
|
||||
/// fully read (user sets |data_in_read| = |data_in_size|) and there is no
|
||||
/// more input data to filter (the resource response is complete). This
|
||||
/// function may 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:
|
||||
///
|
||||
/// 1. 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;
|
||||
/// 2. 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)(
|
||||
struct _cef_response_filter_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=83cbe91e85d7ab2413f733b75457ce6689d3d0ae$
|
||||
// $hash=1b6cd9a13f93867b1f20418bfa4c7db8b5e6725d$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
|
||||
@@ -54,23 +54,23 @@ extern "C" {
|
||||
struct _cef_scheme_handler_factory_t;
|
||||
|
||||
///
|
||||
// Structure that manages custom scheme registrations.
|
||||
/// Structure that manages custom scheme registrations.
|
||||
///
|
||||
typedef struct _cef_scheme_registrar_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_scoped_t base;
|
||||
|
||||
///
|
||||
// Register a custom scheme. This function should not be called for the built-
|
||||
// in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
|
||||
//
|
||||
// See cef_scheme_options_t for possible values for |options|.
|
||||
//
|
||||
// This function may be called on any thread. It should only be called once
|
||||
// per unique |scheme_name| value. If |scheme_name| is already registered or
|
||||
// if an error occurs this function will return false (0).
|
||||
/// Register a custom scheme. This function should not be called for the
|
||||
/// built-in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
|
||||
///
|
||||
/// See cef_scheme_options_t for possible values for |options|.
|
||||
///
|
||||
/// This function may be called on any thread. It should only be called once
|
||||
/// per unique |scheme_name| value. If |scheme_name| is already registered or
|
||||
/// if an error occurs this function will return false (0).
|
||||
///
|
||||
int(CEF_CALLBACK* add_custom_scheme)(struct _cef_scheme_registrar_t* self,
|
||||
const cef_string_t* scheme_name,
|
||||
@@ -78,23 +78,23 @@ typedef struct _cef_scheme_registrar_t {
|
||||
} cef_scheme_registrar_t;
|
||||
|
||||
///
|
||||
// Structure that creates cef_resource_handler_t instances for handling scheme
|
||||
// requests. The functions of this structure will always be called on the IO
|
||||
// thread.
|
||||
/// Structure that creates cef_resource_handler_t instances for handling scheme
|
||||
/// requests. The functions of this structure will always be called on the IO
|
||||
/// thread.
|
||||
///
|
||||
typedef struct _cef_scheme_handler_factory_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Return a new resource handler instance to handle the request or an NULL
|
||||
// reference to allow default handling of the request. |browser| and |frame|
|
||||
// will be the browser window and frame respectively that originated the
|
||||
// request or NULL if the request did not originate from a browser window (for
|
||||
// example, if the request came from cef_urlrequest_t). The |request| object
|
||||
// passed to this function cannot be modified.
|
||||
/// Return a new resource handler instance to handle the request or an NULL
|
||||
/// reference to allow default handling of the request. |browser| and |frame|
|
||||
/// will be the browser window and frame respectively that originated the
|
||||
/// request or NULL if the request did not originate from a browser window
|
||||
/// (for example, if the request came from cef_urlrequest_t). The |request|
|
||||
/// object passed to this function cannot be modified.
|
||||
///
|
||||
struct _cef_resource_handler_t*(CEF_CALLBACK* create)(
|
||||
struct _cef_scheme_handler_factory_t* self,
|
||||
@@ -105,19 +105,19 @@ typedef struct _cef_scheme_handler_factory_t {
|
||||
} cef_scheme_handler_factory_t;
|
||||
|
||||
///
|
||||
// Register a scheme handler factory with the global request context. An NULL
|
||||
// |domain_name| value for a standard scheme will cause the factory to match all
|
||||
// domain names. The |domain_name| value will be ignored for non-standard
|
||||
// schemes. If |scheme_name| is a built-in scheme and no handler is returned by
|
||||
// |factory| then the built-in scheme handler factory will be called. If
|
||||
// |scheme_name| is a custom scheme then you must also implement the
|
||||
// cef_app_t::on_register_custom_schemes() function in all processes. This
|
||||
// function may be called multiple times to change or remove the factory that
|
||||
// matches the specified |scheme_name| and optional |domain_name|. Returns false
|
||||
// (0) if an error occurs. This function may be called on any thread in the
|
||||
// browser process. Using this function is equivalent to calling cef_request_con
|
||||
// text_t::cef_request_context_get_global_context()->register_scheme_handler_fac
|
||||
// tory().
|
||||
/// 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 names. The |domain_name| value will be ignored for non-standard
|
||||
/// schemes. If |scheme_name| is a built-in scheme and no handler is returned by
|
||||
/// |factory| then the built-in scheme handler factory will be called. If
|
||||
/// |scheme_name| is a custom scheme then you must also implement the
|
||||
/// cef_app_t::on_register_custom_schemes() function in all processes. This
|
||||
/// function may be called multiple times to change or remove the factory that
|
||||
/// matches the specified |scheme_name| and optional |domain_name|. Returns
|
||||
/// false (0) if an error occurs. This function may be called on any thread in
|
||||
/// the browser process. Using this function is equivalent to calling cef_reques
|
||||
/// t_context_t::cef_request_context_get_global_context()->register_scheme_handl
|
||||
/// er_factory().
|
||||
///
|
||||
CEF_EXPORT int cef_register_scheme_handler_factory(
|
||||
const cef_string_t* scheme_name,
|
||||
@@ -125,11 +125,11 @@ CEF_EXPORT int cef_register_scheme_handler_factory(
|
||||
cef_scheme_handler_factory_t* factory);
|
||||
|
||||
///
|
||||
// Clear all scheme handler factories registered with the global request
|
||||
// context. Returns false (0) on error. This function may be called on any
|
||||
// thread in the browser process. Using this function is equivalent to calling c
|
||||
// ef_request_context_t::cef_request_context_get_global_context()->clear_scheme_
|
||||
// handler_factories().
|
||||
/// Clear all scheme handler factories registered with the global request
|
||||
/// context. Returns false (0) on error. This function may be called on any
|
||||
/// thread in the browser process. Using this function is equivalent to calling
|
||||
/// cef_request_context_t::cef_request_context_get_global_context()->clear_schem
|
||||
/// e_handler_factories().
|
||||
///
|
||||
CEF_EXPORT int cef_clear_scheme_handler_factories(void);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=72c2b4f976016cea50e54a386c09a786973c01a3$
|
||||
// $hash=4d76765604a96b026076f1c930a33d616f23b4ad$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_
|
||||
@@ -52,64 +52,64 @@ extern "C" {
|
||||
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.
|
||||
/// 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.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns the task runner for the dedicated server thread.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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,
|
||||
@@ -118,36 +118,36 @@ typedef struct _cef_server_t {
|
||||
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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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,
|
||||
@@ -157,12 +157,12 @@ typedef struct _cef_server_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -170,17 +170,17 @@ typedef struct _cef_server_t {
|
||||
size_t data_size);
|
||||
|
||||
///
|
||||
// Close the connection identified by |connection_id|. See SendHttpResponse
|
||||
// documentation for intended usage.
|
||||
/// 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.
|
||||
/// 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,
|
||||
@@ -189,18 +189,18 @@ typedef struct _cef_server_t {
|
||||
} 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.
|
||||
/// 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,
|
||||
@@ -208,66 +208,67 @@ CEF_EXPORT void cef_server_create(const cef_string_t* address,
|
||||
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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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,
|
||||
@@ -276,18 +277,18 @@ typedef struct _cef_server_handler_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -297,9 +298,9 @@ typedef struct _cef_server_handler_t {
|
||||
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.
|
||||
/// 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,
|
||||
@@ -307,11 +308,11 @@ typedef struct _cef_server_handler_t {
|
||||
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.
|
||||
/// 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,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=212f13ac6baeeefb86f1648d1e18ccba95fd5f79$
|
||||
// $hash=5f69190b21f9fa17e6fb4c2284968f8ec5b147ed$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SHARED_MEMORY_REGION_CAPI_H_
|
||||
@@ -47,27 +47,27 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure that wraps platform-dependent share memory region mapping.
|
||||
/// Structure that wraps platform-dependent share memory region mapping.
|
||||
///
|
||||
typedef struct _cef_shared_memory_region_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if the mapping is valid.
|
||||
/// Returns true (1) if the mapping is valid.
|
||||
///
|
||||
int(CEF_CALLBACK* is_valid)(struct _cef_shared_memory_region_t* self);
|
||||
|
||||
///
|
||||
// Returns the size of the mapping in bytes. Returns 0 for invalid instances.
|
||||
/// Returns the size of the mapping in bytes. Returns 0 for invalid instances.
|
||||
///
|
||||
size_t(CEF_CALLBACK* size)(struct _cef_shared_memory_region_t* self);
|
||||
|
||||
///
|
||||
// Returns the pointer to the memory. Returns nullptr for invalid instances.
|
||||
// The returned pointer is only valid for the life span of this object.
|
||||
/// Returns the pointer to the memory. Returns nullptr for invalid instances.
|
||||
/// The returned pointer is only valid for the life span of this object.
|
||||
///
|
||||
const void*(CEF_CALLBACK* memory)(struct _cef_shared_memory_region_t* self);
|
||||
} cef_shared_memory_region_t;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=0ed88d26dab045ebef0f4f4ae209e7f11206a242$
|
||||
// $hash=66198e92ec123e753bb427a0b92d73672610136e$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SHARED_PROCESS_MESSAGE_BUILDER_CAPI_H_
|
||||
@@ -47,48 +47,48 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure that builds a cef_process_message_t containing a shared memory
|
||||
// region. This structure is not thread-safe but may be used exclusively on a
|
||||
// different thread from the one which constructed it.
|
||||
/// Structure that builds a cef_process_message_t containing a shared memory
|
||||
/// region. This structure is not thread-safe but may be used exclusively on a
|
||||
/// different thread from the one which constructed it.
|
||||
///
|
||||
typedef struct _cef_shared_process_message_builder_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if the builder is valid.
|
||||
/// Returns true (1) if the builder is valid.
|
||||
///
|
||||
int(CEF_CALLBACK* is_valid)(
|
||||
struct _cef_shared_process_message_builder_t* self);
|
||||
|
||||
///
|
||||
// Returns the size of the shared memory region in bytes. Returns 0 for
|
||||
// invalid instances.
|
||||
/// Returns the size of the shared memory region in bytes. Returns 0 for
|
||||
/// invalid instances.
|
||||
///
|
||||
size_t(CEF_CALLBACK* size)(
|
||||
struct _cef_shared_process_message_builder_t* self);
|
||||
|
||||
///
|
||||
// Returns the pointer to the writable memory. Returns nullptr for invalid
|
||||
// instances. The returned pointer is only valid for the life span of this
|
||||
// object.
|
||||
/// Returns the pointer to the writable memory. Returns nullptr for invalid
|
||||
/// instances. The returned pointer is only valid for the life span of this
|
||||
/// object.
|
||||
///
|
||||
void*(CEF_CALLBACK* memory)(
|
||||
struct _cef_shared_process_message_builder_t* self);
|
||||
|
||||
///
|
||||
// Creates a new cef_process_message_t from the data provided to the builder.
|
||||
// Returns nullptr for invalid instances. Invalidates the builder instance.
|
||||
/// Creates a new cef_process_message_t from the data provided to the builder.
|
||||
/// Returns nullptr for invalid instances. Invalidates the builder instance.
|
||||
///
|
||||
struct _cef_process_message_t*(CEF_CALLBACK* build)(
|
||||
struct _cef_shared_process_message_builder_t* self);
|
||||
} cef_shared_process_message_builder_t;
|
||||
|
||||
///
|
||||
// Creates a new cef_shared_process_message_builder_t with the specified |name|
|
||||
// and shared memory region of specified |byte_size|.
|
||||
/// Creates a new cef_shared_process_message_builder_t with the specified |name|
|
||||
/// and shared memory region of specified |byte_size|.
|
||||
///
|
||||
CEF_EXPORT cef_shared_process_message_builder_t*
|
||||
cef_shared_process_message_builder_create(const cef_string_t* name,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=d72f3b34b4150f29f1491b2c729f4a8afc4a33f4$
|
||||
// $hash=64d6affe3e8e45869403f829c2aa86026773a17b$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_
|
||||
@@ -49,29 +49,29 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure representing SSL information.
|
||||
/// Structure representing SSL information.
|
||||
///
|
||||
typedef struct _cef_sslinfo_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns a bitmask containing any and all problems verifying the server
|
||||
// certificate.
|
||||
/// Returns a bitmask containing any and all problems verifying the server
|
||||
/// certificate.
|
||||
///
|
||||
cef_cert_status_t(CEF_CALLBACK* get_cert_status)(struct _cef_sslinfo_t* self);
|
||||
|
||||
///
|
||||
// Returns the X.509 certificate.
|
||||
/// Returns the X.509 certificate.
|
||||
///
|
||||
struct _cef_x509certificate_t*(CEF_CALLBACK* get_x509certificate)(
|
||||
struct _cef_sslinfo_t* self);
|
||||
} cef_sslinfo_t;
|
||||
|
||||
///
|
||||
// Returns true (1) if the certificate status represents an error.
|
||||
/// Returns true (1) if the certificate status represents an error.
|
||||
///
|
||||
CEF_EXPORT int cef_is_cert_status_error(cef_cert_status_t status);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1bc8a73a196fbbb6cec3dd1738b817575b17706d$
|
||||
// $hash=b40ab326a1bf140859db9288b809a4038833f014$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_
|
||||
@@ -49,40 +49,40 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure representing the SSL information for a navigation entry.
|
||||
/// Structure representing the SSL information for a navigation entry.
|
||||
///
|
||||
typedef struct _cef_sslstatus_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if the status is related to a secure SSL/TLS connection.
|
||||
/// Returns true (1) if the status is related to a secure SSL/TLS connection.
|
||||
///
|
||||
int(CEF_CALLBACK* is_secure_connection)(struct _cef_sslstatus_t* self);
|
||||
|
||||
///
|
||||
// Returns a bitmask containing any and all problems verifying the server
|
||||
// certificate.
|
||||
/// Returns a bitmask containing any and all problems verifying the server
|
||||
/// certificate.
|
||||
///
|
||||
cef_cert_status_t(CEF_CALLBACK* get_cert_status)(
|
||||
struct _cef_sslstatus_t* self);
|
||||
|
||||
///
|
||||
// Returns the SSL version used for the SSL connection.
|
||||
/// Returns the SSL version used for the SSL connection.
|
||||
///
|
||||
cef_ssl_version_t(CEF_CALLBACK* get_sslversion)(
|
||||
struct _cef_sslstatus_t* self);
|
||||
|
||||
///
|
||||
// Returns a bitmask containing the page security content status.
|
||||
/// Returns a bitmask containing the page security content status.
|
||||
///
|
||||
cef_ssl_content_status_t(CEF_CALLBACK* get_content_status)(
|
||||
struct _cef_sslstatus_t* self);
|
||||
|
||||
///
|
||||
// Returns the X.509 certificate.
|
||||
/// Returns the X.509 certificate.
|
||||
///
|
||||
struct _cef_x509certificate_t*(CEF_CALLBACK* get_x509certificate)(
|
||||
struct _cef_sslstatus_t* self);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=87f6cad177614ece33d9574f0f2964e5bb97d613$
|
||||
// $hash=9ccb4e6ea821c1b98adcc934429d2bf43cf9d8a2$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_
|
||||
@@ -47,17 +47,17 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Structure the client can implement to provide a custom stream reader. The
|
||||
// functions of this structure may be called on any thread.
|
||||
/// Structure the client can implement to provide a custom stream reader. The
|
||||
/// functions of this structure may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_read_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Read raw binary data.
|
||||
/// Read raw binary data.
|
||||
///
|
||||
size_t(CEF_CALLBACK* read)(struct _cef_read_handler_t* self,
|
||||
void* ptr,
|
||||
@@ -65,43 +65,44 @@ typedef struct _cef_read_handler_t {
|
||||
size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Return zero on success and non-zero on failure.
|
||||
/// Seek to the specified offset position. |whence| may be any one of
|
||||
/// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
|
||||
/// failure.
|
||||
///
|
||||
int(CEF_CALLBACK* seek)(struct _cef_read_handler_t* self,
|
||||
int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
/// Return the current offset position.
|
||||
///
|
||||
int64(CEF_CALLBACK* tell)(struct _cef_read_handler_t* self);
|
||||
|
||||
///
|
||||
// Return non-zero if at end of file.
|
||||
/// Return non-zero if at end of file.
|
||||
///
|
||||
int(CEF_CALLBACK* eof)(struct _cef_read_handler_t* self);
|
||||
|
||||
///
|
||||
// Return true (1) if this handler performs work like accessing the file
|
||||
// system which may block. Used as a hint for determining the thread to access
|
||||
// the handler from.
|
||||
/// Return true (1) if this handler performs work like accessing the file
|
||||
/// system which may block. Used as a hint for determining the thread to
|
||||
/// access the handler from.
|
||||
///
|
||||
int(CEF_CALLBACK* may_block)(struct _cef_read_handler_t* self);
|
||||
} cef_read_handler_t;
|
||||
|
||||
///
|
||||
// Structure used to read data from a stream. The functions of this structure
|
||||
// may be called on any thread.
|
||||
/// Structure used to read data from a stream. The functions of this structure
|
||||
/// may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_stream_reader_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Read raw binary data.
|
||||
/// Read raw binary data.
|
||||
///
|
||||
size_t(CEF_CALLBACK* read)(struct _cef_stream_reader_t* self,
|
||||
void* ptr,
|
||||
@@ -109,61 +110,62 @@ typedef struct _cef_stream_reader_t {
|
||||
size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure.
|
||||
/// Seek to the specified offset position. |whence| may be any one of
|
||||
/// SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on
|
||||
/// failure.
|
||||
///
|
||||
int(CEF_CALLBACK* seek)(struct _cef_stream_reader_t* self,
|
||||
int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
/// Return the current offset position.
|
||||
///
|
||||
int64(CEF_CALLBACK* tell)(struct _cef_stream_reader_t* self);
|
||||
|
||||
///
|
||||
// Return non-zero if at end of file.
|
||||
/// Return non-zero if at end of file.
|
||||
///
|
||||
int(CEF_CALLBACK* eof)(struct _cef_stream_reader_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this reader performs work like accessing the file
|
||||
// system which may block. Used as a hint for determining the thread to access
|
||||
// the reader from.
|
||||
/// Returns true (1) if this reader performs work like accessing the file
|
||||
/// system which may block. Used as a hint for determining the thread to
|
||||
/// access the reader from.
|
||||
///
|
||||
int(CEF_CALLBACK* may_block)(struct _cef_stream_reader_t* self);
|
||||
} cef_stream_reader_t;
|
||||
|
||||
///
|
||||
// Create a new cef_stream_reader_t object from a file.
|
||||
/// Create a new cef_stream_reader_t object from a file.
|
||||
///
|
||||
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file(
|
||||
const cef_string_t* fileName);
|
||||
|
||||
///
|
||||
// Create a new cef_stream_reader_t object from data.
|
||||
/// Create a new cef_stream_reader_t object from data.
|
||||
///
|
||||
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data,
|
||||
size_t size);
|
||||
|
||||
///
|
||||
// Create a new cef_stream_reader_t object from a custom handler.
|
||||
/// Create a new cef_stream_reader_t object from a custom handler.
|
||||
///
|
||||
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler(
|
||||
cef_read_handler_t* handler);
|
||||
|
||||
///
|
||||
// Structure the client can implement to provide a custom stream writer. The
|
||||
// functions of this structure may be called on any thread.
|
||||
/// Structure the client can implement to provide a custom stream writer. The
|
||||
/// functions of this structure may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_write_handler_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Write raw binary data.
|
||||
/// Write raw binary data.
|
||||
///
|
||||
size_t(CEF_CALLBACK* write)(struct _cef_write_handler_t* self,
|
||||
const void* ptr,
|
||||
@@ -171,43 +173,44 @@ typedef struct _cef_write_handler_t {
|
||||
size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Return zero on success and non-zero on failure.
|
||||
/// Seek to the specified offset position. |whence| may be any one of
|
||||
/// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
|
||||
/// failure.
|
||||
///
|
||||
int(CEF_CALLBACK* seek)(struct _cef_write_handler_t* self,
|
||||
int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
/// Return the current offset position.
|
||||
///
|
||||
int64(CEF_CALLBACK* tell)(struct _cef_write_handler_t* self);
|
||||
|
||||
///
|
||||
// Flush the stream.
|
||||
/// Flush the stream.
|
||||
///
|
||||
int(CEF_CALLBACK* flush)(struct _cef_write_handler_t* self);
|
||||
|
||||
///
|
||||
// Return true (1) if this handler performs work like accessing the file
|
||||
// system which may block. Used as a hint for determining the thread to access
|
||||
// the handler from.
|
||||
/// Return true (1) if this handler performs work like accessing the file
|
||||
/// system which may block. Used as a hint for determining the thread to
|
||||
/// access the handler from.
|
||||
///
|
||||
int(CEF_CALLBACK* may_block)(struct _cef_write_handler_t* self);
|
||||
} cef_write_handler_t;
|
||||
|
||||
///
|
||||
// Structure used to write data to a stream. The functions of this structure may
|
||||
// be called on any thread.
|
||||
/// Structure used to write data to a stream. The functions of this structure
|
||||
/// may be called on any thread.
|
||||
///
|
||||
typedef struct _cef_stream_writer_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Write raw binary data.
|
||||
/// Write raw binary data.
|
||||
///
|
||||
size_t(CEF_CALLBACK* write)(struct _cef_stream_writer_t* self,
|
||||
const void* ptr,
|
||||
@@ -215,39 +218,40 @@ typedef struct _cef_stream_writer_t {
|
||||
size_t n);
|
||||
|
||||
///
|
||||
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
||||
// SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure.
|
||||
/// Seek to the specified offset position. |whence| may be any one of
|
||||
/// SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on
|
||||
/// failure.
|
||||
///
|
||||
int(CEF_CALLBACK* seek)(struct _cef_stream_writer_t* self,
|
||||
int64 offset,
|
||||
int whence);
|
||||
|
||||
///
|
||||
// Return the current offset position.
|
||||
/// Return the current offset position.
|
||||
///
|
||||
int64(CEF_CALLBACK* tell)(struct _cef_stream_writer_t* self);
|
||||
|
||||
///
|
||||
// Flush the stream.
|
||||
/// Flush the stream.
|
||||
///
|
||||
int(CEF_CALLBACK* flush)(struct _cef_stream_writer_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this writer performs work like accessing the file
|
||||
// system which may block. Used as a hint for determining the thread to access
|
||||
// the writer from.
|
||||
/// Returns true (1) if this writer performs work like accessing the file
|
||||
/// system which may block. Used as a hint for determining the thread to
|
||||
/// access the writer from.
|
||||
///
|
||||
int(CEF_CALLBACK* may_block)(struct _cef_stream_writer_t* self);
|
||||
} cef_stream_writer_t;
|
||||
|
||||
///
|
||||
// Create a new cef_stream_writer_t object for a file.
|
||||
/// Create a new cef_stream_writer_t object for a file.
|
||||
///
|
||||
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file(
|
||||
const cef_string_t* fileName);
|
||||
|
||||
///
|
||||
// Create a new cef_stream_writer_t object for a custom handler.
|
||||
/// Create a new cef_stream_writer_t object for a custom handler.
|
||||
///
|
||||
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler(
|
||||
cef_write_handler_t* handler);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=398537ec88bfe902c49908db4a549da297594b70$
|
||||
// $hash=3940b4c999764eae305984a16c401e302aefddc6$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_
|
||||
@@ -47,16 +47,16 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Implement this structure to receive string values asynchronously.
|
||||
/// Implement this structure to receive string values asynchronously.
|
||||
///
|
||||
typedef struct _cef_string_visitor_t {
|
||||
///
|
||||
// Base structure.
|
||||
/// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Method that will be executed.
|
||||
/// Method that will be executed.
|
||||
///
|
||||
void(CEF_CALLBACK* visit)(struct _cef_string_visitor_t* self,
|
||||
const cef_string_t* string);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user