Compare commits

..

21 Commits
5938 ... 5735

Author SHA1 Message Date
Marshall Greenblatt
dc18c542a2 Update to Chromium version 114.0.5735.201 2023-07-21 02:00:59 +00:00
Marshall Greenblatt
6792e13230 Update to Chromium version 114.0.5735.200 2023-07-17 15:04:13 +00:00
Marshall Greenblatt
7c09f21d73 Update to Chromium version 114.0.5735.199 2023-06-28 07:31:32 +00:00
Marshall Greenblatt
87c88072bb Update to Chromium version 114.0.5735.134 2023-06-14 07:45:10 +00:00
Marshall Greenblatt
398e3c3a2a Update to Chromium version 114.0.5735.110 2023-06-07 08:20:02 +00:00
Chris Frank
1a97a28b0f linux: alloy: Fix window resize after context menu dismissal (fixes #3466) 2023-06-06 15:36:25 +03:00
Marshall Greenblatt
8746aab738 Update to Chromium version 114.0.5735.91 2023-06-04 10:50:53 +00:00
Marshall Greenblatt
778aa851a9 mac: cefclient: Fix compile error with Xcode 14.3.1 2023-06-02 17:27:20 +03:00
Marshall Greenblatt
c4d256c286 win: Ship d3dcompiler_47.dll on ARM64 (fixes #3515)
Use the same file from the Windows SDK as Chromium on all architectures
("$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll").
2023-06-01 13:37:31 +03:00
Marshall Greenblatt
4a5500fcb9 win: cmake: VS2022 is now required (fixes #3516) 2023-06-01 13:09:47 +03:00
Marshall Greenblatt
3d7ef76b75 win: Fix ambiguous max() usage (fixes #3524, see #3422) 2023-06-01 12:51:24 +03:00
Marshall Greenblatt
8251119be4 win: Update msvs_env.bat to prefer VS2022 (fixes #3509) 2023-06-01 12:51:18 +03:00
Marshall Greenblatt
11d21f100f win: Fix MSVC compile errors in registry.cc (fixes #3519) 2023-05-29 13:01:36 +03:00
Marshall Greenblatt
d70a0a832d Update to Chromium version 114.0.5735.45 2023-05-27 12:44:16 +03:00
Nik Pavlov
f3083218af alloy: views: mac: Add three-finger-swipe navigation gesture support
This adds support for the three-finger-swipe navigation gesture with
Alloy/Views. The default implementation matches the Chrome runtime
and navigates the browser back/forward. We also add an Alloy/Views-
specific client callback in CefBrowserViewDelegate for optional
custom handling of the gesture event.
2023-05-26 12:09:59 +03:00
Marshall Greenblatt
8ff65ec09f Add missing include for std::numeric_limits (see #3422) 2023-05-26 12:09:12 +03:00
Vladimir Kharitonov
8381105f52 Update CefRange type to match gfx::Range (fixes #3422) 2023-05-26 12:08:48 +03:00
Marshall Greenblatt
cbd0dfcdee tools: Fix incorrect SharedMemoryRegion translation (fixes #3498) 2023-05-09 12:39:57 +03:00
Marshall Greenblatt
ad726a0a40 Replace NOTREACHED() with DCHECK(false) in generated files (see #3500)
Restores the old behavior of assertion in Debug build only.
2023-05-08 18:36:45 +03:00
Marshall Greenblatt
0b98db28bb Replace NOTREACHED() with DCHECK(false) (fixes #3500)
Restores the old behavior of assertion in Debug build only.
2023-05-08 18:36:45 +03:00
Marshall Greenblatt
c05ff2847d Update to Chromium version 114.0.5735.9 2023-05-06 16:46:11 +03:00
490 changed files with 3963 additions and 6030 deletions

View File

@@ -801,7 +801,6 @@ source_set("libcef_static") {
"libcef/browser/views/view_util.cc",
"libcef/browser/views/view_util.h",
"libcef/browser/views/view_view.h",
"libcef/browser/views/widget_destruction_observer.h",
"libcef/browser/views/window_impl.cc",
"libcef/browser/views/window_impl.h",
"libcef/browser/views/window_view.cc",
@@ -1352,10 +1351,9 @@ make_pack_header("resources") {
"$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
"$root_gen_dir/content/browser/webrtc/resources/grit/webrtc_internals_resources.h",
"$root_gen_dir/content/grit/content_resources.h",
"$root_gen_dir/content/grit/dev_ui_content_resources.h",
"$root_gen_dir/content/grit/gpu_resources.h",
"$root_gen_dir/content/grit/histograms_resources.h",
"$root_gen_dir/content/grit/process_resources.h",
"$root_gen_dir/content/grit/service_worker_resources.h",
"$root_gen_dir/extensions/grit/extensions_browser_resources.h",
"$root_gen_dir/extensions/grit/extensions_renderer_resources.h",
"$root_gen_dir/extensions/grit/extensions_resources.h",
@@ -1381,11 +1379,10 @@ make_pack_header("resources") {
"//content/browser/devtools:devtools_resources",
"//content/browser/resources/gpu:resources",
"//content/browser/resources/histograms:resources",
"//content/browser/resources/process:resources",
"//content/browser/resources/service_worker:resources",
"//content/browser/tracing:resources",
"//content/browser/webrtc/resources",
"//content:content_resources",
"//content:dev_ui_content_resources",
"//extensions:extensions_browser_resources",
"//extensions:extensions_renderer_resources",
"//extensions:extensions_resources_grd",
@@ -1671,10 +1668,6 @@ if (is_mac) {
# ResourceBundle. See crbug.com/147663.
"//ui/resources:ui_unscaled_resources_grd",
]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [ "//build/config/win:delayloads" ]
}
if (is_linux && !is_debug && !use_partition_alloc_as_malloc) {
@@ -2177,10 +2170,6 @@ if (is_mac) {
configs -= [ "//build/config/win:console" ]
configs += [ "//build/config/win:windowed" ]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [ "//build/config/win:delayloads" ]
defines += [
"CEF_USE_ATL",
]
@@ -2269,10 +2258,6 @@ if (is_mac) {
configs -= [ "//build/config/win:console" ]
configs += [ "//build/config/win:windowed" ]
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [ "//build/config/win:delayloads" ]
deps += [
":cef_sandbox",
"//build/win:default_exe_manifest",
@@ -2340,10 +2325,6 @@ if (is_mac) {
sources += gypi_paths2.shared_sources_win +
gypi_paths2.ceftests_sources_win
# Delay-load as many DLLs as possible for sandbox and startup perf
# improvements.
configs += [ "//build/config/win:delayloads" ]
deps += [
":cef_sandbox",
"//build/win:default_exe_manifest",

View File

@@ -7,6 +7,6 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/117.0.5938.152',
'depot_tools_checkout': 'd9011c559b'
'chromium_checkout': 'refs/tags/114.0.5735.201',
'depot_tools_checkout': '7ee8e6c7cb'
}

View File

@@ -1,2 +1,2 @@
@echo off
python3.bat tools\gclient_hook.py
python.bat tools\gclient_hook.py

View File

@@ -8,6 +8,7 @@
'include/base/cef_atomic_flag.h',
'include/base/cef_atomic_ref_count.h',
'include/base/cef_auto_reset.h',
'include/base/cef_basictypes.h',
'include/base/cef_bind.h',
'include/base/cef_build.h',
'include/base/cef_callback.h',
@@ -23,6 +24,7 @@
'include/base/cef_ptr_util.h',
'include/base/cef_ref_counted.h',
'include/base/cef_scoped_refptr.h',
'include/base/cef_template_util.h',
'include/base/cef_thread_checker.h',
'include/base/cef_trace_event.h',
'include/base/cef_tuple.h',
@@ -53,7 +55,6 @@
'include/internal/cef_time.h',
'include/internal/cef_trace_event_internal.h',
'include/internal/cef_types.h',
'include/internal/cef_types_content_settings.h',
'include/internal/cef_types_geometry.h',
],
'includes_capi': [

View File

@@ -436,56 +436,6 @@ if(OS_WINDOWS)
list(APPEND CEF_EXE_LINKER_FLAGS
/MANIFEST:NO # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
/LARGEADDRESSAWARE # Allow 32-bit processes to access 3GB of RAM
# Delayload most libraries as the dlls are simply not required at startup (or
# at all, depending on the process type). Some dlls open handles when they are
# loaded, and we may not want them to be loaded in renderers or other sandboxed
# processes. Conversely, some dlls must be loaded before sandbox lockdown. In
# unsandboxed processes they will load when first needed. The linker will
# automatically ignore anything which is not linked to the binary at all (it is
# harmless to have an unmatched /delayload). This list should be kept in sync
# with Chromium's "delayloads" target from the //build/config/win/BUILD.gn file.
/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll
/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll
/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll
/DELAYLOAD:advapi32.dll
/DELAYLOAD:comctl32.dll
/DELAYLOAD:comdlg32.dll
/DELAYLOAD:credui.dll
/DELAYLOAD:cryptui.dll
/DELAYLOAD:d3d11.dll
/DELAYLOAD:d3d9.dll
/DELAYLOAD:dwmapi.dll
/DELAYLOAD:dxgi.dll
/DELAYLOAD:dxva2.dll
/DELAYLOAD:esent.dll
/DELAYLOAD:gdi32.dll
/DELAYLOAD:hid.dll
/DELAYLOAD:imagehlp.dll
/DELAYLOAD:imm32.dll
/DELAYLOAD:msi.dll
/DELAYLOAD:netapi32.dll
/DELAYLOAD:ncrypt.dll
/DELAYLOAD:ole32.dll
/DELAYLOAD:oleacc.dll
/DELAYLOAD:propsys.dll
/DELAYLOAD:psapi.dll
/DELAYLOAD:rpcrt4.dll
/DELAYLOAD:rstrtmgr.dll
/DELAYLOAD:setupapi.dll
/DELAYLOAD:shell32.dll
/DELAYLOAD:shlwapi.dll
/DELAYLOAD:uiautomationcore.dll
/DELAYLOAD:urlmon.dll
/DELAYLOAD:user32.dll
/DELAYLOAD:usp10.dll
/DELAYLOAD:uxtheme.dll
/DELAYLOAD:wer.dll
/DELAYLOAD:wevtapi.dll
/DELAYLOAD:wininet.dll
/DELAYLOAD:winusb.dll
/DELAYLOAD:wsock32.dll
/DELAYLOAD:wtsapi32.dll
)
list(APPEND CEF_COMPILER_DEFINES
WIN32 _WIN32 _WINDOWS # Windows platform

View File

@@ -0,0 +1,86 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
#define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
#pragma once
#include <limits.h> // For UINT_MAX
#include <stddef.h> // For size_t
#include "include/base/cef_build.h"
// The NSPR system headers define 64-bit as |long| when possible, except on
// Mac OS X. In order to not have typedef mismatches, we do the same on LP64.
//
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
// <inttypes.h> format macros even in the LP64 model.
#if defined(__LP64__) && !defined(OS_MAC) && !defined(OS_OPENBSD)
typedef long int64;
typedef unsigned long uint64;
#else
typedef long long int64;
typedef unsigned long long uint64;
#endif
// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _INT32
#define _INT32
typedef int int32;
#endif
// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _UINT32
#define _UINT32
typedef unsigned int uint32;
#endif
#ifndef _INT16
#define _INT16
typedef short int16;
#endif
#ifndef _UINT16
#define _UINT16
typedef unsigned short uint16;
#endif
// UTF-16 character type.
#ifndef char16
#if defined(WCHAR_T_IS_UTF16)
typedef wchar_t char16;
#elif defined(WCHAR_T_IS_UTF32)
typedef unsigned short char16;
#endif
#endif
#endif // CEF_INCLUDE_BASE_CEF_BASICTYPES_H_

View File

@@ -84,6 +84,7 @@
#include "include/base/cef_build.h"
#include "include/base/cef_compiler_specific.h"
#include "include/base/cef_template_util.h"
#include "include/base/internal/cef_bind_internal.h"
#if defined(OS_APPLE) && !HAS_FEATURE(objc_arc)
@@ -104,7 +105,7 @@ BindOnce(Functor&& functor, Args&&... args) {
"BindOnce requires non-const rvalue for OnceCallback binding."
" I.e.: base::BindOnce(std::move(callback)).");
static_assert(
std::conjunction<cef_internal::AssertBindArgIsNotBasePassed<
conjunction<cef_internal::AssertBindArgIsNotBasePassed<
std::decay_t<Args>>...>::value,
"Use std::move() instead of base::Passed() with base::BindOnce()");

View File

@@ -253,7 +253,7 @@
// The compiler thinks std::string::const_iterator and "const char*" are
// equivalent types.
#define STD_STRING_ITERATOR_IS_CHAR_POINTER
// The compiler thinks std::u16string::const_iterator and "char16_t*" are
// The compiler thinks std::u16string::const_iterator and "char16*" are
// equivalent types.
#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
#endif

View File

@@ -723,13 +723,6 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
return out << wstr.c_str();
}
#if defined(WCHAR_T_IS_UTF32)
std::ostream& operator<<(std::ostream& out, const char16_t* wstr);
#elif defined(WCHAR_T_IS_UTF16)
inline std::ostream& operator<<(std::ostream& out, const char16_t* wstr) {
return operator<<(out, reinterpret_cast<const wchar_t*>(wstr));
}
#endif
// The NOTIMPLEMENTED() macro annotates codepaths which have
// not been implemented yet.

View File

@@ -43,6 +43,7 @@
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/cef_basictypes.h"
#include "include/base/cef_build.h"
#include "include/internal/cef_thread_internal.h"

View File

@@ -50,6 +50,7 @@
#include "include/base/cef_compiler_specific.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_scoped_refptr.h"
#include "include/base/cef_template_util.h"
#include "include/base/cef_thread_checker.h"
namespace base {
@@ -484,7 +485,7 @@ class RefCountedData
RefCountedData(const T& in_value) : data(in_value) {}
RefCountedData(T&& in_value) : data(std::move(in_value)) {}
template <typename... Args>
explicit RefCountedData(std::in_place_t, Args&&... args)
explicit RefCountedData(in_place_t, Args&&... args)
: data(std::forward<Args>(args)...) {}
T data;

View File

@@ -0,0 +1,417 @@
// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011
// Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_
#define CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/template_util.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <stddef.h>
#include <iosfwd>
#include <iterator>
#include <type_traits>
#include <utility>
#include <vector>
#include "include/base/cef_build.h"
// Some versions of libstdc++ have partial support for type_traits, but misses
// a smaller subset while removing some of the older non-standard stuff. Assume
// that all versions below 5.0 fall in this category, along with one 5.0
// experimental release. Test for this by consulting compiler major version,
// the only reliable option available, so theoretically this could fail should
// you attempt to mix an earlier version of libstdc++ with >= GCC5. But
// that's unlikely to work out, especially as GCC5 changed ABI.
#define CR_GLIBCXX_5_0_0 20150123
#if (defined(__GNUC__) && __GNUC__ < 5) || \
(defined(__GLIBCXX__) && __GLIBCXX__ == CR_GLIBCXX_5_0_0)
#define CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX
#endif
// This hacks around using gcc with libc++ which has some incompatibilies.
// - is_trivially_* doesn't work: https://llvm.org/bugs/show_bug.cgi?id=27538
// TODO(danakj): Remove this when android builders are all using a newer version
// of gcc, or the android ndk is updated to a newer libc++ that works with older
// gcc versions.
#if !defined(__clang__) && defined(_LIBCPP_VERSION)
#define CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX
#endif
namespace base {
template <class T>
struct is_non_const_reference : std::false_type {};
template <class T>
struct is_non_const_reference<T&> : std::true_type {};
template <class T>
struct is_non_const_reference<const T&> : std::false_type {};
namespace internal {
// Implementation detail of base::void_t below.
template <typename...>
struct make_void {
using type = void;
};
} // namespace internal
// base::void_t is an implementation of std::void_t from C++17.
//
// We use |base::internal::make_void| as a helper struct to avoid a C++14
// defect:
// http://en.cppreference.com/w/cpp/types/void_t
// http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1558
template <typename... Ts>
using void_t = typename ::base::internal::make_void<Ts...>::type;
namespace internal {
// Uses expression SFINAE to detect whether using operator<< would work.
template <typename T, typename = void>
struct SupportsOstreamOperator : std::false_type {};
template <typename T>
struct SupportsOstreamOperator<T,
decltype(void(std::declval<std::ostream&>()
<< std::declval<T>()))>
: std::true_type {};
template <typename T, typename = void>
struct SupportsToString : std::false_type {};
template <typename T>
struct SupportsToString<T, decltype(void(std::declval<T>().ToString()))>
: std::true_type {};
// Used to detect whether the given type is an iterator. This is normally used
// with std::enable_if to provide disambiguation for functions that take
// templatzed iterators as input.
template <typename T, typename = void>
struct is_iterator : std::false_type {};
template <typename T>
struct is_iterator<T,
void_t<typename std::iterator_traits<T>::iterator_category>>
: std::true_type {};
// Helper to express preferences in an overload set. If more than one overload
// are available for a given set of parameters the overload with the higher
// priority will be chosen.
template <size_t I>
struct priority_tag : priority_tag<I - 1> {};
template <>
struct priority_tag<0> {};
} // namespace internal
// is_trivially_copyable is especially hard to get right.
// - Older versions of libstdc++ will fail to have it like they do for other
// type traits. This has become a subset of the second point, but used to be
// handled independently.
// - An experimental release of gcc includes most of type_traits but misses
// is_trivially_copyable, so we still have to avoid using libstdc++ in this
// case, which is covered by CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX.
// - When compiling libc++ from before r239653, with a gcc compiler, the
// std::is_trivially_copyable can fail. So we need to work around that by not
// using the one in libc++ in this case. This is covered by the
// CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX define, and is discussed in
// https://llvm.org/bugs/show_bug.cgi?id=27538#c1 where they point out that
// in libc++'s commit r239653 this is fixed by libc++ checking for gcc 5.1.
// - In both of the above cases we are using the gcc compiler. When defining
// this ourselves on compiler intrinsics, the __is_trivially_copyable()
// intrinsic is not available on gcc before version 5.1 (see the discussion in
// https://llvm.org/bugs/show_bug.cgi?id=27538#c1 again), so we must check for
// that version.
// - When __is_trivially_copyable() is not available because we are on gcc older
// than 5.1, we need to fall back to something, so we use __has_trivial_copy()
// instead based on what was done one-off in bit_cast() previously.
// TODO(crbug.com/554293): Remove this when all platforms have this in the std
// namespace and it works with gcc as needed.
#if defined(CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX) || \
defined(CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX)
template <typename T>
struct is_trivially_copyable {
// TODO(danakj): Remove this when android builders are all using a newer version
// of gcc, or the android ndk is updated to a newer libc++ that does this for
// us.
#if _GNUC_VER >= 501
static constexpr bool value = __is_trivially_copyable(T);
#else
static constexpr bool value =
__has_trivial_copy(T) && __has_trivial_destructor(T);
#endif
};
#else
template <class T>
using is_trivially_copyable = std::is_trivially_copyable<T>;
#endif
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 7
// Workaround for g++7 and earlier family.
// Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80654, without this
// Optional<std::vector<T>> where T is non-copyable causes a compile error.
// As we know it is not trivially copy constructible, explicitly declare so.
template <typename T>
struct is_trivially_copy_constructible
: std::is_trivially_copy_constructible<T> {};
template <typename... T>
struct is_trivially_copy_constructible<std::vector<T...>> : std::false_type {};
#else
// Otherwise use std::is_trivially_copy_constructible as is.
template <typename T>
using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
#endif
// base::in_place_t is an implementation of std::in_place_t from
// C++17. A tag type used to request in-place construction in template vararg
// constructors.
// Specification:
// https://en.cppreference.com/w/cpp/utility/in_place
struct in_place_t {};
constexpr in_place_t in_place = {};
// base::in_place_type_t is an implementation of std::in_place_type_t from
// C++17. A tag type used for in-place construction when the type to construct
// needs to be specified, such as with base::unique_any, designed to be a
// drop-in replacement.
// Specification:
// http://en.cppreference.com/w/cpp/utility/in_place
template <typename T>
struct in_place_type_t {};
template <typename T>
struct is_in_place_type_t {
static constexpr bool value = false;
};
template <typename... Ts>
struct is_in_place_type_t<in_place_type_t<Ts...>> {
static constexpr bool value = true;
};
// C++14 implementation of C++17's std::bool_constant.
//
// Reference: https://en.cppreference.com/w/cpp/types/integral_constant
// Specification: https://wg21.link/meta.type.synop
template <bool B>
using bool_constant = std::integral_constant<bool, B>;
// C++14 implementation of C++17's std::conjunction.
//
// Reference: https://en.cppreference.com/w/cpp/types/conjunction
// Specification: https://wg21.link/meta.logical#1.itemdecl:1
template <typename...>
struct conjunction : std::true_type {};
template <typename B1>
struct conjunction<B1> : B1 {};
template <typename B1, typename... Bn>
struct conjunction<B1, Bn...>
: std::conditional_t<static_cast<bool>(B1::value), conjunction<Bn...>, B1> {
};
// C++14 implementation of C++17's std::disjunction.
//
// Reference: https://en.cppreference.com/w/cpp/types/disjunction
// Specification: https://wg21.link/meta.logical#itemdecl:2
template <typename...>
struct disjunction : std::false_type {};
template <typename B1>
struct disjunction<B1> : B1 {};
template <typename B1, typename... Bn>
struct disjunction<B1, Bn...>
: std::conditional_t<static_cast<bool>(B1::value), B1, disjunction<Bn...>> {
};
// C++14 implementation of C++17's std::negation.
//
// Reference: https://en.cppreference.com/w/cpp/types/negation
// Specification: https://wg21.link/meta.logical#itemdecl:3
template <typename B>
struct negation : bool_constant<!static_cast<bool>(B::value)> {};
// Implementation of C++17's invoke_result.
//
// This implementation adds references to `Functor` and `Args` to work around
// some quirks of std::result_of. See the #Notes section of [1] for details.
//
// References:
// [1] https://en.cppreference.com/w/cpp/types/result_of
// [2] https://wg21.link/meta.trans.other#lib:invoke_result
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
template <typename Functor, typename... Args>
using invoke_result = std::invoke_result<Functor, Args...>;
#else
template <typename Functor, typename... Args>
using invoke_result = std::result_of<Functor && (Args && ...)>;
#endif
// Implementation of C++17's std::invoke_result_t.
//
// Reference: https://wg21.link/meta.type.synop#lib:invoke_result_t
template <typename Functor, typename... Args>
using invoke_result_t = typename invoke_result<Functor, Args...>::type;
namespace internal {
// Base case, `InvokeResult` does not have a nested type member. This means `F`
// could not be invoked with `Args...` and thus is not invocable.
template <typename InvokeResult, typename R, typename = void>
struct IsInvocableImpl : std::false_type {};
// Happy case, `InvokeResult` does have a nested type member. Now check whether
// `InvokeResult::type` is convertible to `R`. Short circuit in case
// `std::is_void<R>`.
template <typename InvokeResult, typename R>
struct IsInvocableImpl<InvokeResult, R, void_t<typename InvokeResult::type>>
: disjunction<std::is_void<R>,
std::is_convertible<typename InvokeResult::type, R>> {};
} // namespace internal
// Implementation of C++17's std::is_invocable_r.
//
// Returns whether `F` can be invoked with `Args...` and the result is
// convertible to `R`.
//
// Reference: https://wg21.link/meta.rel#lib:is_invocable_r
template <typename R, typename F, typename... Args>
struct is_invocable_r
: internal::IsInvocableImpl<invoke_result<F, Args...>, R> {};
// Implementation of C++17's std::is_invocable.
//
// Returns whether `F` can be invoked with `Args...`.
//
// Reference: https://wg21.link/meta.rel#lib:is_invocable
template <typename F, typename... Args>
struct is_invocable : is_invocable_r<void, F, Args...> {};
namespace internal {
// The indirection with std::is_enum<T> is required, because instantiating
// std::underlying_type_t<T> when T is not an enum is UB prior to C++20.
template <typename T, bool = std::is_enum<T>::value>
struct IsScopedEnumImpl : std::false_type {};
template <typename T>
struct IsScopedEnumImpl<T, /*std::is_enum<T>::value=*/true>
: negation<std::is_convertible<T, std::underlying_type_t<T>>> {};
} // namespace internal
// Implementation of C++23's std::is_scoped_enum
//
// Reference: https://en.cppreference.com/w/cpp/types/is_scoped_enum
template <typename T>
struct is_scoped_enum : internal::IsScopedEnumImpl<T> {};
// Implementation of C++20's std::remove_cvref.
//
// References:
// - https://en.cppreference.com/w/cpp/types/remove_cvref
// - https://wg21.link/meta.trans.other#lib:remove_cvref
template <typename T>
struct remove_cvref {
using type = std::remove_cv_t<std::remove_reference_t<T>>;
};
// Implementation of C++20's std::remove_cvref_t.
//
// References:
// - https://en.cppreference.com/w/cpp/types/remove_cvref
// - https://wg21.link/meta.type.synop#lib:remove_cvref_t
template <typename T>
using remove_cvref_t = typename remove_cvref<T>::type;
// Simplified implementation of C++20's std::iter_value_t.
// As opposed to std::iter_value_t, this implementation does not restrict
// the type of `Iter` and does not consider specializations of
// `indirectly_readable_traits`.
//
// Reference: https://wg21.link/readable.traits#2
template <typename Iter>
using iter_value_t =
typename std::iterator_traits<remove_cvref_t<Iter>>::value_type;
// Simplified implementation of C++20's std::iter_reference_t.
// As opposed to std::iter_reference_t, this implementation does not restrict
// the type of `Iter`.
//
// Reference: https://wg21.link/iterator.synopsis#:~:text=iter_reference_t
template <typename Iter>
using iter_reference_t = decltype(*std::declval<Iter&>());
// Simplified implementation of C++20's std::indirect_result_t. As opposed to
// std::indirect_result_t, this implementation does not restrict the type of
// `Func` and `Iters`.
//
// Reference: https://wg21.link/iterator.synopsis#:~:text=indirect_result_t
template <typename Func, typename... Iters>
using indirect_result_t = invoke_result_t<Func, iter_reference_t<Iters>...>;
// Simplified implementation of C++20's std::projected. As opposed to
// std::projected, this implementation does not explicitly restrict the type of
// `Iter` and `Proj`, but rather does so implicitly by requiring
// `indirect_result_t<Proj, Iter>` is a valid type. This is required for SFINAE
// friendliness.
//
// Reference: https://wg21.link/projected
template <typename Iter,
typename Proj,
typename IndirectResultT = indirect_result_t<Proj, Iter>>
struct projected {
using value_type = remove_cvref_t<IndirectResultT>;
IndirectResultT operator*() const; // not defined
};
} // namespace base
#undef CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX
#undef CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_

View File

@@ -145,6 +145,14 @@
/// 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.
@@ -171,15 +179,15 @@
/// - 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); \
#define TRACE_EVENT0(category, name) \
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false); \
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0); \
#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false); \
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val); \
arg2_val, false); \
CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name)
// Implementation detail: trace event macros create temporary variable names.
@@ -203,13 +211,21 @@
/// literals). They may not include " chars.
///
#define TRACE_EVENT_INSTANT0(category, name) \
cef_trace_event_instant(category, name, NULL, 0, NULL, 0)
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0)
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, false)
#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val)
arg2_val, false)
#define TRACE_EVENT_COPY_INSTANT0(category, name) \
cef_trace_event_instant(category, name, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, true)
#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, true)
///
/// Records a single BEGIN event called "name" immediately, with 0, 1 or 2
@@ -219,13 +235,21 @@
/// literals). They may not include " chars.
///
#define TRACE_EVENT_BEGIN0(category, name) \
cef_trace_event_begin(category, name, NULL, 0, NULL, 0)
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0)
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false)
#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val)
arg2_val, false)
#define TRACE_EVENT_COPY_BEGIN0(category, name) \
cef_trace_event_begin(category, name, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, true)
#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, true)
///
/// Records a single END event for "name" immediately. If the category
@@ -234,12 +258,21 @@
/// literals). They may not include " chars.
///
#define TRACE_EVENT_END0(category, name) \
cef_trace_event_end(category, name, NULL, 0, NULL, 0)
cef_trace_event_end(category, name, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0)
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, false)
#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, arg2_val)
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, false)
#define TRACE_EVENT_COPY_END0(category, name) \
cef_trace_event_end(category, name, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, true)
#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val) \
cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \
arg2_val, true)
///
/// Records the value of a counter called "name" immediately. Value
@@ -248,7 +281,9 @@
/// literals). They may not include " chars.
///
#define TRACE_COUNTER1(category, name, value) \
cef_trace_counter(category, name, NULL, value, NULL, 0)
cef_trace_counter(category, name, NULL, value, NULL, 0, false)
#define TRACE_COPY_COUNTER1(category, name, value) \
cef_trace_counter(category, name, NULL, value, NULL, 0, true)
///
/// Records the values of a multi-parted counter called "name" immediately.
@@ -260,7 +295,11 @@
#define TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, \
value2_val) \
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
value2_val)
value2_val, false)
#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \
value2_name, value2_val) \
cef_trace_counter(category, name, value1_name, value1_val, value2_name, \
value2_val, true)
///
/// Records the value of a counter called "name" immediately. Value
@@ -273,7 +312,9 @@
/// 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)
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.
@@ -289,7 +330,11 @@
#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \
value2_name, value2_val) \
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
value2_name, value2_val)
value2_name, value2_val, false)
#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val, \
value2_name, value2_val) \
cef_trace_counter_id(category, name, id, value1_name, value1_val, \
value2_name, value2_val, true)
///
/// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
@@ -310,13 +355,23 @@
/// args.
///
#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0)
#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, 0)
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
0, false)
#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val)
arg2_name, arg2_val, false)
#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \
cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \
0, true)
#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, true)
///
/// Records a single ASYNC_STEP_INTO event for |step| immediately. If the
@@ -327,10 +382,17 @@
/// 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)
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false)
#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_into(category, name, id, step, arg1_name, arg1_val)
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
arg1_val, false)
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO0(category, name, id, step) \
cef_trace_event_async_step_into(category, name, id, step, NULL, 0, true)
#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_into(category, name, id, step, arg1_name, \
arg1_val, true)
///
/// Records a single ASYNC_STEP_PAST event for |step| immediately. If the
@@ -341,23 +403,40 @@
/// 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)
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false)
#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_past(category, name, id, step, arg1_name, arg1_val)
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
arg1_val, false)
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST0(category, name, id, step) \
cef_trace_event_async_step_past(category, name, id, step, NULL, 0, true)
#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \
arg1_val) \
cef_trace_event_async_step_past(category, name, id, step, arg1_name, \
arg1_val, true)
///
/// Records a single ASYNC_END event for "name" immediately. If the category
/// 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)
#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0)
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, false)
#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
false)
#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val)
arg2_name, arg2_val, false)
#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \
cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, true)
#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \
true)
#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val) \
cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \
arg2_name, arg2_val, true)
namespace cef_trace_event {
@@ -369,7 +448,7 @@ class CefTraceEndOnScopeClose {
CefTraceEndOnScopeClose(const char* category, const char* name)
: category_(category), name_(name) {}
~CefTraceEndOnScopeClose() {
cef_trace_event_end(category_, name_, NULL, 0, NULL, 0);
cef_trace_event_end(category_, name_, NULL, 0, NULL, 0, false);
}
private:

View File

@@ -68,6 +68,7 @@
#include "include/base/cef_build.h"
#include "include/base/cef_compiler_specific.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_template_util.h"
#include "include/base/cef_weak_ptr.h"
#include "include/base/internal/cef_callback_internal.h"
#include "include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h"
@@ -355,14 +356,14 @@ template <typename Functor, typename SFINAE = void>
struct IsCallableObject : std::false_type {};
template <typename Callable>
struct IsCallableObject<Callable, std::void_t<decltype(&Callable::operator())>>
struct IsCallableObject<Callable, void_t<decltype(&Callable::operator())>>
: std::true_type {};
// HasRefCountedTypeAsRawPtr inherits from true_type when any of the |Args| is a
// raw pointer to a RefCounted type.
template <typename... Ts>
struct HasRefCountedTypeAsRawPtr
: std::disjunction<NeedsScopedRefptrButGetsRawPtr<Ts>...> {};
: disjunction<NeedsScopedRefptrButGetsRawPtr<Ts>...> {};
// ForceVoidReturn<>
//
@@ -877,7 +878,7 @@ BanUnconstructedRefCountedReceiver(const Receiver& receiver, Unused&&...) {
// This stores all the state passed into Bind().
template <typename Functor, typename... BoundArgs>
struct BindState final : BindStateBase {
using IsCancellable = std::bool_constant<
using IsCancellable = bool_constant<
CallbackCancellationTraits<Functor,
std::tuple<BoundArgs...>>::is_cancellable>;
template <typename ForwardFunctor, typename... ForwardBoundArgs>
@@ -1251,7 +1252,7 @@ decltype(auto) BindImpl(Functor&& functor, Args&&... args) {
// PolymorphicInvoke, to which CallbackType will cast back.
using PolymorphicInvoke = typename CallbackType::PolymorphicInvoke;
PolymorphicInvoke invoke_func =
GetInvokeFunc<Invoker>(std::bool_constant<kIsOnce>());
GetInvokeFunc<Invoker>(bool_constant<kIsOnce>());
using InvokeFuncStorage = BindStateBase::InvokeFuncStorage;
return CallbackType(BindState::Create(

View File

@@ -34,6 +34,8 @@
#include <type_traits>
#include "include/base/cef_template_util.h"
// It is dangerous to post a task with a T* argument where T is a subtype of
// RefCounted(Base|ThreadSafeBase), since by the time the parameter is used, the
// object may already have been deleted since it was not held with a
@@ -52,16 +54,16 @@ struct IsRefCountedType : std::false_type {};
template <typename T>
struct IsRefCountedType<T,
std::void_t<decltype(std::declval<T*>()->AddRef()),
decltype(std::declval<T*>()->Release())>>
void_t<decltype(std::declval<T*>()->AddRef()),
decltype(std::declval<T*>()->Release())>>
: std::true_type {};
// Human readable translation: you needed to be a scoped_refptr if you are a raw
// pointer type and are convertible to a RefCounted(Base|ThreadSafeBase) type.
template <typename T>
struct NeedsScopedRefptrButGetsRawPtr
: std::conjunction<std::is_pointer<T>,
IsRefCountedType<std::remove_pointer_t<T>>> {
: conjunction<std::is_pointer<T>,
IsRefCountedType<std::remove_pointer_t<T>>> {
static_assert(!std::is_reference<T>::value,
"NeedsScopedRefptrButGetsRawPtr requires non-reference type.");
};

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=932c3ecb22fd26322d96d0e01459122aadafd302$
// $hash=936274d5539f225ff7adb7e0acba517fd9a8e2f8$
//
#ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
@@ -93,7 +93,7 @@ typedef struct _cef_audio_handler_t {
struct _cef_browser_t* browser,
const float** data,
int frames,
int64_t pts);
int64 pts);
///
/// Called on the UI thread when the stream has stopped. OnAudioSteamStopped

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=683d7bff8da04826eee83c7e23cf9c5a701ae265$
// $hash=7254c050cd7db2ff7d40a1f54c99e941dc592692$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
@@ -167,7 +167,7 @@ typedef struct _cef_browser_t {
///
struct _cef_frame_t*(CEF_CALLBACK* get_frame_byident)(
struct _cef_browser_t* self,
int64_t identifier);
int64 identifier);
///
/// Returns the frame with the specified name, or NULL if not found.
@@ -185,7 +185,7 @@ typedef struct _cef_browser_t {
///
void(CEF_CALLBACK* get_frame_identifiers)(struct _cef_browser_t* self,
size_t* identifiersCount,
int64_t* identifiers);
int64* identifiers);
///
/// Returns the names of all existing frames.
@@ -424,7 +424,7 @@ typedef struct _cef_browser_host_t {
struct _cef_browser_host_t* self,
const cef_string_t* image_url,
int is_favicon,
uint32_t max_image_size,
uint32 max_image_size,
int bypass_cache,
struct _cef_download_image_callback_t* callback);

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a146316e075450f0a6f37cb45d14e15e0ac7be08$
// $hash=4ef8b73a5218531b370fdd76c23153a1f83b7f7b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
@@ -121,7 +121,7 @@ typedef struct _cef_browser_process_handler_t {
///
void(CEF_CALLBACK* on_schedule_message_pump_work)(
struct _cef_browser_process_handler_t* self,
int64_t delay_ms);
int64 delay_ms);
///
/// Return the default client for use with a newly created browser window. If

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=22cfd717df9032a01214d9abfe3e0e51949b3319$
// $hash=5c6e0b9e37b8103a182f200fccdf5973104fcd70$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
@@ -90,7 +90,7 @@ extern "C" {
/// If "AppName" is set on Windows then crash report information (metrics,
/// database and dumps) will be stored locally on disk under the
/// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other
/// platforms the cef_settings_t.root_cache_path value will be used.
/// 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

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5374127458a7cac3ee9b4d2b4ad8a6f5ca81ec52$
// $hash=1de3354bd0a042cc28199f1f56753b1df9e279a2$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
@@ -84,13 +84,8 @@ typedef struct _cef_display_handler_t {
/// 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. With the Alloy
/// runtime the client is responsible for triggering the fullscreen transition
/// (for example, by calling cef_window_t::SetFullscreen when using Views).
/// With the Chrome runtime the fullscreen transition will be triggered
/// automatically. The cef_window_delegate_t::OnWindowFullscreenTransition
/// function will be called during the fullscreen transition for notification
/// purposes.
/// 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,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c4ecfde5d6791400c4b3fd466e7d3676d51cf8d8$
// $hash=d9e9f4b914ae2d3b1ed83ae0d9e2e46e9e736af5$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
@@ -90,7 +90,7 @@ typedef struct _cef_download_item_t {
///
/// Returns a simple speed estimate in bytes/s.
///
int64_t(CEF_CALLBACK* get_current_speed)(struct _cef_download_item_t* self);
int64(CEF_CALLBACK* get_current_speed)(struct _cef_download_item_t* self);
///
/// Returns the rough percent complete or -1 if the receive total size is
@@ -101,12 +101,12 @@ typedef struct _cef_download_item_t {
///
/// Returns the total number of bytes.
///
int64_t(CEF_CALLBACK* get_total_bytes)(struct _cef_download_item_t* self);
int64(CEF_CALLBACK* get_total_bytes)(struct _cef_download_item_t* self);
///
/// Returns the number of received bytes.
///
int64_t(CEF_CALLBACK* get_received_bytes)(struct _cef_download_item_t* self);
int64(CEF_CALLBACK* get_received_bytes)(struct _cef_download_item_t* self);
///
/// Returns the time that the download started.
@@ -129,7 +129,7 @@ typedef struct _cef_download_item_t {
///
/// Returns the unique identifier for this download.
///
uint32_t(CEF_CALLBACK* get_id)(struct _cef_download_item_t* self);
uint32(CEF_CALLBACK* get_id)(struct _cef_download_item_t* self);
///
/// Returns the URL.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1ad87e4addc2f05497671bc59dc7fd315e0603f3$
// $hash=5bed8359f09a821f4b5ec8ebfad0aa5720bf39f9$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
@@ -181,7 +181,7 @@ typedef struct _cef_frame_t {
/// Returns the globally unique identifier for this frame or < 0 if the
/// underlying frame does not yet exist.
///
int64_t(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self);
int64(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self);
///
/// Returns the parent of this frame or NULL if this is the main (top-level)

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=012d76416d19b590f29c013c44ceec1674593022$
// $hash=bc44eb70b7f0b48e0646825e919cb9996ac99781$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_
@@ -66,7 +66,7 @@ typedef struct _cef_media_access_callback_t {
/// OnRequestMediaAccessPermission.
///
void(CEF_CALLBACK* cont)(struct _cef_media_access_callback_t* self,
uint32_t allowed_permissions);
uint32 allowed_permissions);
///
/// Cancel the media access request.
@@ -119,7 +119,7 @@ typedef struct _cef_permission_handler_t {
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_string_t* requesting_origin,
uint32_t requested_permissions,
uint32 requested_permissions,
struct _cef_media_access_callback_t* callback);
///
@@ -136,9 +136,9 @@ typedef struct _cef_permission_handler_t {
int(CEF_CALLBACK* on_show_permission_prompt)(
struct _cef_permission_handler_t* self,
struct _cef_browser_t* browser,
uint64_t prompt_id,
uint64 prompt_id,
const cef_string_t* requesting_origin,
uint32_t requested_permissions,
uint32 requested_permissions,
struct _cef_permission_prompt_callback_t* callback);
///
@@ -153,7 +153,7 @@ typedef struct _cef_permission_handler_t {
void(CEF_CALLBACK* on_dismiss_permission_prompt)(
struct _cef_permission_handler_t* self,
struct _cef_browser_t* browser,
uint64_t prompt_id,
uint64 prompt_id,
cef_permission_request_result_t result);
} cef_permission_handler_t;

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=241f8b8ba0a4555f8ad8ed1d60345ae83d4d62f4$
// $hash=3339290cad3a77c8b0b07d422f0faf902a047838$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
@@ -214,7 +214,7 @@ typedef struct _cef_request_t {
/// in the browser process to track a single request across multiple
/// callbacks.
///
uint64_t(CEF_CALLBACK* get_identifier)(struct _cef_request_t* self);
uint64(CEF_CALLBACK* get_identifier)(struct _cef_request_t* self);
} cef_request_t;
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1c3c3dfb4bde6cd45278c6a80fbc53f624017c44$
// $hash=c2a6265e8e9acce475a8b5755a8c58b97b495207$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
@@ -46,7 +46,6 @@
#include "include/capi/cef_extension_handler_capi.h"
#include "include/capi/cef_media_router_capi.h"
#include "include/capi/cef_preference_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
@@ -302,72 +301,6 @@ typedef struct _cef_request_context_t {
struct _cef_media_router_t*(CEF_CALLBACK* get_media_router)(
struct _cef_request_context_t* self,
struct _cef_completion_callback_t* callback);
///
/// Returns the current value for |content_type| that applies for the
/// specified URLs. If both URLs are NULL the default value will be returned.
/// Returns nullptr if no value is configured. Must be called on the browser
/// process UI thread.
///
struct _cef_value_t*(CEF_CALLBACK* get_website_setting)(
struct _cef_request_context_t* self,
const cef_string_t* requesting_url,
const cef_string_t* top_level_url,
cef_content_setting_types_t content_type);
///
/// Sets the current value for |content_type| for the specified URLs in the
/// default scope. If both URLs are NULL, and the context is not incognito,
/// the default value will be set. Pass nullptr for |value| to remove the
/// default value for this content type.
///
/// WARNING: Incorrect usage of this function may cause instability or
/// security issues in Chromium. Make sure that you first understand the
/// potential impact of any changes to |content_type| by reviewing the related
/// source code in Chromium. For example, if you plan to modify
/// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
/// ContentSettingsType::POPUPS in Chromium:
/// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
///
void(CEF_CALLBACK* set_website_setting)(
struct _cef_request_context_t* self,
const cef_string_t* requesting_url,
const cef_string_t* top_level_url,
cef_content_setting_types_t content_type,
struct _cef_value_t* value);
///
/// Returns the current value for |content_type| that applies for the
/// specified URLs. If both URLs are NULL the default value will be returned.
/// Returns CEF_CONTENT_SETTING_VALUE_DEFAULT if no value is configured. Must
/// be called on the browser process UI thread.
///
cef_content_setting_values_t(CEF_CALLBACK* get_content_setting)(
struct _cef_request_context_t* self,
const cef_string_t* requesting_url,
const cef_string_t* top_level_url,
cef_content_setting_types_t content_type);
///
/// Sets the current value for |content_type| for the specified URLs in the
/// default scope. If both URLs are NULL, and the context is not incognito,
/// the default value will be set. Pass CEF_CONTENT_SETTING_VALUE_DEFAULT for
/// |value| to use the default value for this content type.
///
/// WARNING: Incorrect usage of this function may cause instability or
/// security issues in Chromium. Make sure that you first understand the
/// potential impact of any changes to |content_type| by reviewing the related
/// source code in Chromium. For example, if you plan to modify
/// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
/// ContentSettingsType::POPUPS in Chromium:
/// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
///
void(CEF_CALLBACK* set_content_setting)(
struct _cef_request_context_t* self,
const cef_string_t* requesting_url,
const cef_string_t* top_level_url,
cef_content_setting_types_t content_type,
cef_content_setting_values_t value);
} cef_request_context_t;
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ca5c224b373452158904b0f859f126f36c927f93$
// $hash=93e5c4f5e93f56b63b5944208300669dcecba972$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
@@ -67,7 +67,7 @@ typedef struct _cef_resource_skip_callback_t {
/// 0 the request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE.
///
void(CEF_CALLBACK* cont)(struct _cef_resource_skip_callback_t* self,
int64_t bytes_skipped);
int64 bytes_skipped);
} cef_resource_skip_callback_t;
///
@@ -146,7 +146,7 @@ typedef struct _cef_resource_handler_t {
///
void(CEF_CALLBACK* get_response_headers)(struct _cef_resource_handler_t* self,
struct _cef_response_t* response,
int64_t* response_length,
int64* response_length,
cef_string_t* redirectUrl);
///
@@ -159,8 +159,8 @@ typedef struct _cef_resource_handler_t {
/// function will be called in sequence but not from a dedicated thread.
///
int(CEF_CALLBACK* skip)(struct _cef_resource_handler_t* self,
int64_t bytes_to_skip,
int64_t* bytes_skipped,
int64 bytes_to_skip,
int64* bytes_skipped,
struct _cef_resource_skip_callback_t* callback);
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=757155e6dbceef47938fd562f7f5f48a609ce288$
// $hash=70d6b393cbdc96a75864911d7ca3568cc8dcdebf$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_
@@ -188,7 +188,7 @@ typedef struct _cef_resource_request_handler_t {
struct _cef_request_t* request,
struct _cef_response_t* response,
cef_urlrequest_status_t status,
int64_t received_content_length);
int64 received_content_length);
///
/// Called on the IO thread to handle requests for URLs with an unknown

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d0563a0850f6118c850ab01c553142d2e890703e$
// $hash=64e9ebc0e01acca0333ca3419e379d4053892270$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_
@@ -153,7 +153,7 @@ typedef struct _cef_server_t {
int connection_id,
int response_code,
const cef_string_t* content_type,
int64_t content_length,
int64 content_length,
cef_string_multimap_t extra_headers);
///
@@ -203,7 +203,7 @@ typedef struct _cef_server_t {
/// server lifespan.
///
CEF_EXPORT void cef_server_create(const cef_string_t* address,
uint16_t port,
uint16 port,
int backlog,
struct _cef_server_handler_t* handler);

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5632e62f83aac60e62db9d7f308563fed3285c65$
// $hash=bbb4153d5d7325ac9a410d7f85a8d47eadcfaf6e$
//
#ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_
@@ -70,13 +70,13 @@ typedef struct _cef_read_handler_t {
/// failure.
///
int(CEF_CALLBACK* seek)(struct _cef_read_handler_t* self,
int64_t offset,
int64 offset,
int whence);
///
/// Return the current offset position.
///
int64_t(CEF_CALLBACK* tell)(struct _cef_read_handler_t* self);
int64(CEF_CALLBACK* tell)(struct _cef_read_handler_t* self);
///
/// Return non-zero if at end of file.
@@ -115,13 +115,13 @@ typedef struct _cef_stream_reader_t {
/// failure.
///
int(CEF_CALLBACK* seek)(struct _cef_stream_reader_t* self,
int64_t offset,
int64 offset,
int whence);
///
/// Return the current offset position.
///
int64_t(CEF_CALLBACK* tell)(struct _cef_stream_reader_t* self);
int64(CEF_CALLBACK* tell)(struct _cef_stream_reader_t* self);
///
/// Return non-zero if at end of file.
@@ -178,13 +178,13 @@ typedef struct _cef_write_handler_t {
/// failure.
///
int(CEF_CALLBACK* seek)(struct _cef_write_handler_t* self,
int64_t offset,
int64 offset,
int whence);
///
/// Return the current offset position.
///
int64_t(CEF_CALLBACK* tell)(struct _cef_write_handler_t* self);
int64(CEF_CALLBACK* tell)(struct _cef_write_handler_t* self);
///
/// Flush the stream.
@@ -223,13 +223,13 @@ typedef struct _cef_stream_writer_t {
/// failure.
///
int(CEF_CALLBACK* seek)(struct _cef_stream_writer_t* self,
int64_t offset,
int64 offset,
int whence);
///
/// Return the current offset position.
///
int64_t(CEF_CALLBACK* tell)(struct _cef_stream_writer_t* self);
int64(CEF_CALLBACK* tell)(struct _cef_stream_writer_t* self);
///
/// Flush the stream.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=fc609ce5aa3bc51e5cef1f9174dbfc5cff0a0689$
// $hash=273a6abfd4ac030701be00c45811c19e74e128bd$
//
#ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_
@@ -114,7 +114,7 @@ typedef struct _cef_task_runner_t {
///
int(CEF_CALLBACK* post_delayed_task)(struct _cef_task_runner_t* self,
struct _cef_task_t* task,
int64_t delay_ms);
int64 delay_ms);
} cef_task_runner_t;
///
@@ -149,7 +149,7 @@ CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, cef_task_t* task);
///
CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId,
cef_task_t* task,
int64_t delay_ms);
int64 delay_ms);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=28e2d2d86dffdfdad0f275a444656a0638b44d0e$
// $hash=8d275bd73854b2b8d5a7a5bc55fa737e020705ee$
//
#ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_
@@ -109,7 +109,7 @@ CEF_EXPORT int cef_end_tracing(const cef_string_t* tracing_file,
/// high-res time. Can be used by clients to synchronize with the time
/// information in trace events.
///
CEF_EXPORT int64_t cef_now_from_system_trace_time(void);
CEF_EXPORT int64 cef_now_from_system_trace_time(void);
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b038ad859f1dad2d8ba63589da118898350b309c$
// $hash=91c121d4353a80d7fff3ef582c5a56ac86e0a34c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_
@@ -158,8 +158,8 @@ typedef struct _cef_urlrequest_client_t {
///
void(CEF_CALLBACK* on_upload_progress)(struct _cef_urlrequest_client_t* self,
struct _cef_urlrequest_t* request,
int64_t current,
int64_t total);
int64 current,
int64 total);
///
/// Notifies the client of download progress. |current| denotes the number of
@@ -169,8 +169,8 @@ typedef struct _cef_urlrequest_client_t {
void(CEF_CALLBACK* on_download_progress)(
struct _cef_urlrequest_client_t* self,
struct _cef_urlrequest_t* request,
int64_t current,
int64_t total);
int64 current,
int64 total);
///
/// Called when some part of the response is read. |data| contains the current

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=42de7c0e6f5ec529d9182fe4cbf2c1edfacd7392$
// $hash=0d787ac7676ba90d3a1fe68d5e2494b985b1db0e$
//
#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
@@ -474,12 +474,12 @@ typedef struct _cef_v8value_t {
///
/// Return an int value.
///
int32_t(CEF_CALLBACK* get_int_value)(struct _cef_v8value_t* self);
int32(CEF_CALLBACK* get_int_value)(struct _cef_v8value_t* self);
///
/// Return an unsigned int value.
///
uint32_t(CEF_CALLBACK* get_uint_value)(struct _cef_v8value_t* self);
uint32(CEF_CALLBACK* get_uint_value)(struct _cef_v8value_t* self);
///
/// Return a double value.
@@ -764,12 +764,12 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value);
///
/// Create a new cef_v8value_t object of type int.
///
CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int32_t value);
CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int32 value);
///
/// Create a new cef_v8value_t object of type unsigned int.
///
CEF_EXPORT cef_v8value_t* cef_v8value_create_uint(uint32_t value);
CEF_EXPORT cef_v8value_t* cef_v8value_create_uint(uint32 value);
///
/// Create a new cef_v8value_t object of type double.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=be3741396459ccf1337f319965ba1dc509142536$
// $hash=683d592a2405ada0a9c46c004f003d640a3298ad$
//
#ifndef CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_
@@ -96,7 +96,7 @@ typedef struct _cef_waitable_event_t {
/// called on the browser process UI or IO threads.
///
int(CEF_CALLBACK* timed_wait)(struct _cef_waitable_event_t* self,
int64_t max_ms);
int64 max_ms);
} cef_waitable_event_t;
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a4b62b20f30552fef5d522bdd00ebf9a8f12464c$
// $hash=7a541729b4ac664b22cdea625f19f1dba1b6a685$
//
#ifndef CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_
@@ -93,6 +93,13 @@ typedef struct _cef_x509cert_principal_t {
cef_string_userfree_t(CEF_CALLBACK* get_country_name)(
struct _cef_x509cert_principal_t* self);
///
/// Retrieve the list of street addresses.
///
void(CEF_CALLBACK* get_street_addresses)(
struct _cef_x509cert_principal_t* self,
cef_string_list_t addresses);
///
/// Retrieve the list of organization names.
///
@@ -106,6 +113,13 @@ typedef struct _cef_x509cert_principal_t {
void(CEF_CALLBACK* get_organization_unit_names)(
struct _cef_x509cert_principal_t* self,
cef_string_list_t names);
///
/// Retrieve the list of domain components.
///
void(CEF_CALLBACK* get_domain_components)(
struct _cef_x509cert_principal_t* self,
cef_string_list_t components);
} cef_x509cert_principal_t;
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d082d724164cb0b1da12d49b080c599934f08b9d$
// $hash=83debac545c04a630270665b391f52b15484b5d3$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_
@@ -95,7 +95,7 @@ typedef struct _cef_zip_reader_t {
///
/// Returns the uncompressed size of the file.
///
int64_t(CEF_CALLBACK* get_file_size)(struct _cef_zip_reader_t* self);
int64(CEF_CALLBACK* get_file_size)(struct _cef_zip_reader_t* self);
///
/// Returns the last modified timestamp for the file.
@@ -126,7 +126,7 @@ typedef struct _cef_zip_reader_t {
///
/// Returns the current offset in the uncompressed file contents.
///
int64_t(CEF_CALLBACK* tell)(struct _cef_zip_reader_t* self);
int64(CEF_CALLBACK* tell)(struct _cef_zip_reader_t* self);
///
/// Returns true (1) if at end of the file contents.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f5731d0fffb953f1269b63b478a89bb6b842ac94$
// $hash=df532eb91caf9de44b077abdf00620dd2508402b$
//
#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TEST_SERVER_CAPI_H_
@@ -104,7 +104,7 @@ typedef struct _cef_test_server_t {
/// started. The server will continue running until Stop is called.
///
CEF_EXPORT cef_test_server_t* cef_test_server_create_and_start(
uint16_t port,
uint16 port,
int https_server,
cef_test_cert_type_t https_cert_type,
struct _cef_test_server_handler_t* handler);

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=9e8dd2187d592f7556cbee0db3ceab851f9aae13$
// $hash=94e93810316b74e54eb315d97c6fc6f1cc0c9cc5$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
@@ -119,23 +119,14 @@ typedef struct _cef_browser_view_delegate_t {
/// documentation.
///
cef_chrome_toolbar_type_t(CEF_CALLBACK* get_chrome_toolbar_type)(
struct _cef_browser_view_delegate_t* self,
struct _cef_browser_view_t* browser_view);
///
/// Return true (1) to create frameless windows for Document picture-in-
/// picture popups. Content in frameless windows should specify draggable
/// regions using "-webkit-app-region: drag" CSS.
///
int(CEF_CALLBACK* use_frameless_window_for_picture_in_picture)(
struct _cef_browser_view_delegate_t* self,
struct _cef_browser_view_t* browser_view);
struct _cef_browser_view_delegate_t* self);
///
/// Called when |browser_view| receives a gesture command. Return true (1) to
/// handle (or disable) a |gesture_command| or false (0) to propagate the
/// gesture to the browser for default handling. With the Chrome runtime these
/// commands can also be handled via cef_command_handler_t::OnChromeCommand.
/// gesture to the browser for default handling. This function will only be
/// called with the Alloy runtime. To handle these commands with the Chrome
/// runtime implement cef_command_handler_t::OnChromeCommand instead.
///
int(CEF_CALLBACK* on_gesture_command)(
struct _cef_browser_view_delegate_t* self,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2e9acfffaf1dbc70f0c76fcf58a5190326b131ba$
// $hash=7674d3af52dd4272b454b2028e7a4ee72fb3c9ff$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_
@@ -63,7 +63,7 @@ typedef struct _cef_display_t {
///
/// Returns the unique identifier for this Display.
///
int64_t(CEF_CALLBACK* get_id)(struct _cef_display_t* self);
int64(CEF_CALLBACK* get_id)(struct _cef_display_t* self);
///
/// Returns this Display's device pixel scale factor. This specifies how much

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=4b43fe0b493d860e8b28d7a6d892db49d1135b34$
// $hash=04aa6e193cc5d5658c0ef28a42c0777c0a955409$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_
@@ -51,8 +51,6 @@
extern "C" {
#endif
struct _cef_browser_view_t;
///
/// A Window is a top-level Window/widget in the Views hierarchy. By default it
/// will have a non-client area with title bar, icon and buttons that supports
@@ -71,21 +69,6 @@ typedef struct _cef_window_t {
///
void(CEF_CALLBACK* show)(struct _cef_window_t* self);
///
/// Show the Window as a browser modal dialog relative to |browser_view|. A
/// parent Window must be returned via
/// cef_window_delegate_t::get_parent_window() and |browser_view| must belong
/// to that parent Window. While this Window is visible, |browser_view| will
/// be disabled while other controls in the parent Window remain enabled.
/// Navigating or destroying the |browser_view| will close this Window
/// automatically. Alternately, use show() and return true (1) from
/// cef_window_delegate_t::is_window_modal_dialog() for a window modal dialog
/// where all controls in the parent Window are disabled.
///
void(CEF_CALLBACK* show_as_browser_modal_dialog)(
struct _cef_window_t* self,
struct _cef_browser_view_t* browser_view);
///
/// Hide the Window.
///
@@ -155,9 +138,7 @@ typedef struct _cef_window_t {
void(CEF_CALLBACK* restore)(struct _cef_window_t* self);
///
/// Set fullscreen Window state. The
/// cef_window_delegate_t::OnWindowFullscreenTransition function will be
/// called during the fullscreen transition for notification purposes.
/// Set fullscreen Window state.
///
void(CEF_CALLBACK* set_fullscreen)(struct _cef_window_t* self,
int fullscreen);
@@ -305,7 +286,7 @@ typedef struct _cef_window_t {
///
void(CEF_CALLBACK* send_key_press)(struct _cef_window_t* self,
int key_code,
uint32_t event_flags);
uint32 event_flags);
///
/// Simulate a mouse move. The mouse cursor will be moved to the specified

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=456f00f7afbac910cf36feecd38399a2fb16960d$
// $hash=7201d268e16fc89f255b6ccd00d043f34fe77584$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
@@ -96,20 +96,6 @@ typedef struct _cef_window_delegate_t {
struct _cef_window_t* window,
const cef_rect_t* new_bounds);
///
/// Called when |window| is transitioning to or from fullscreen mode. On MacOS
/// the transition occurs asynchronously with |is_competed| set to false (0)
/// when the transition starts and true (1) after the transition completes. On
/// other platforms the transition occurs synchronously with |is_completed|
/// set to true (1) after the transition completes. With the Alloy runtime you
/// must also implement cef_display_handler_t::OnFullscreenModeChange to
/// handle fullscreen transitions initiated by browser content.
///
void(CEF_CALLBACK* on_window_fullscreen_transition)(
struct _cef_window_delegate_t* self,
struct _cef_window_t* window,
int is_completed);
///
/// Return the parent for |window| or NULL if the |window| does not have a
/// parent. Windows with parents will not get a taskbar button. Set |is_menu|
@@ -124,18 +110,6 @@ typedef struct _cef_window_delegate_t {
int* is_menu,
int* can_activate_menu);
///
/// Return true (1) if |window| should be created as a window modal dialog.
/// Only called when a Window is returned via get_parent_window() with
/// |is_menu| set to false (0). All controls in the parent Window will be
/// disabled while |window| is visible. This functionality is not supported by
/// all Linux window managers. Alternately, use
/// cef_window_t::show_as_browser_modal_dialog() for a browser modal dialog
/// that works on all platforms.
///
int(CEF_CALLBACK* is_window_modal_dialog)(struct _cef_window_delegate_t* self,
struct _cef_window_t* window);
///
/// Return the initial bounds for |window| in density independent pixel (DIP)
/// coordinates. If this function returns an NULL CefRect then
@@ -224,6 +198,17 @@ typedef struct _cef_window_delegate_t {
int(CEF_CALLBACK* on_key_event)(struct _cef_window_delegate_t* self,
struct _cef_window_t* window,
const cef_key_event_t* event);
///
/// Called when the |window| is transitioning to or from fullscreen mode. The
/// transition occurs in two stages, with |is_competed| set to false (0) when
/// the transition starts and true (1) when the transition completes. This
/// function is only supported on macOS.
///
void(CEF_CALLBACK* on_window_fullscreen_transition)(
struct _cef_window_delegate_t* self,
struct _cef_window_t* window,
int is_completed);
} cef_window_delegate_t;
#ifdef __cplusplus

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "133bd59744d82162591d93434cb6ff146717a3f7"
#define CEF_API_HASH_UNIVERSAL "eb6257d3e4894dd51617d20588b7f0c3c8717301"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "a39ec0ef3643f91abe7dc529def454336016478d"
#define CEF_API_HASH_PLATFORM "3c99a150153b982d4d8b1a19e33b66a1d93fec21"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "35b5f3657fe9f203a7852235b85b5f2a7501d59e"
#define CEF_API_HASH_PLATFORM "b63aacf68a1fda1164948c24bab4f74abe046137"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "5623b2222e7b39b014c821d941c280e29b8693d3"
#define CEF_API_HASH_PLATFORM "b12c839a3ea0dcb9705e543fc17fd3c1d9fa1e7c"
#endif
#ifdef __cplusplus

View File

@@ -87,7 +87,7 @@ class CefAudioHandler : public virtual CefBaseRefCounted {
virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser,
const float** data,
int frames,
int64_t pts) = 0;
int64 pts) = 0;
///
/// Called on the UI thread when the stream has stopped. OnAudioSteamStopped

View File

@@ -170,7 +170,7 @@ class CefBrowser : public virtual CefBaseRefCounted {
/// Returns the frame with the specified identifier, or NULL if not found.
///
/*--cef(capi_name=get_frame_byident)--*/
virtual CefRefPtr<CefFrame> GetFrame(int64_t identifier) = 0;
virtual CefRefPtr<CefFrame> GetFrame(int64 identifier) = 0;
///
/// Returns the frame with the specified name, or NULL if not found.
@@ -188,7 +188,7 @@ class CefBrowser : public virtual CefBaseRefCounted {
/// Returns the identifiers of all existing frames.
///
/*--cef(count_func=identifiers:GetFrameCount)--*/
virtual void GetFrameIdentifiers(std::vector<int64_t>& identifiers) = 0;
virtual void GetFrameIdentifiers(std::vector<int64>& identifiers) = 0;
///
/// Returns the names of all existing frames.
@@ -456,7 +456,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual void DownloadImage(const CefString& image_url,
bool is_favicon,
uint32_t max_image_size,
uint32 max_image_size,
bool bypass_cache,
CefRefPtr<CefDownloadImageCallback> callback) = 0;

View File

@@ -111,7 +111,7 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
/// pending scheduled call should be cancelled.
///
/*--cef()--*/
virtual void OnScheduleMessagePumpWork(int64_t delay_ms) {}
virtual void OnScheduleMessagePumpWork(int64 delay_ms) {}
///
/// Return the default client for use with a newly created browser window. If

View File

@@ -82,7 +82,7 @@
/// If "AppName" is set on Windows then crash report information (metrics,
/// database and dumps) will be stored locally on disk under the
/// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other
/// platforms the cef_settings_t.root_cache_path value will be used.
/// 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

View File

@@ -75,12 +75,8 @@ class CefDisplayHandler : public virtual CefBaseRefCounted {
/// Called when web content in the page has toggled fullscreen mode. If
/// |fullscreen| is true the content will automatically be sized to fill the
/// browser content area. If |fullscreen| is false the content will
/// automatically return to its original size and position. With the Alloy
/// runtime the client is responsible for triggering the fullscreen transition
/// (for example, by calling CefWindow::SetFullscreen when using Views). With
/// the Chrome runtime the fullscreen transition will be triggered
/// automatically. The CefWindowDelegate::OnWindowFullscreenTransition method
/// will be called during the fullscreen transition for notification purposes.
/// automatically return to its original size and position. The client is
/// responsible for resizing the browser if desired.
///
/*--cef()--*/
virtual void OnFullscreenModeChange(CefRefPtr<CefBrowser> browser,

View File

@@ -87,7 +87,7 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns a simple speed estimate in bytes/s.
///
/*--cef()--*/
virtual int64_t GetCurrentSpeed() = 0;
virtual int64 GetCurrentSpeed() = 0;
///
/// Returns the rough percent complete or -1 if the receive total size is
@@ -100,13 +100,13 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns the total number of bytes.
///
/*--cef()--*/
virtual int64_t GetTotalBytes() = 0;
virtual int64 GetTotalBytes() = 0;
///
/// Returns the number of received bytes.
///
/*--cef()--*/
virtual int64_t GetReceivedBytes() = 0;
virtual int64 GetReceivedBytes() = 0;
///
/// Returns the time that the download started.
@@ -130,7 +130,7 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns the unique identifier for this download.
///
/*--cef()--*/
virtual uint32_t GetId() = 0;
virtual uint32 GetId() = 0;
///
/// Returns the URL.

View File

@@ -184,7 +184,7 @@ class CefFrame : public virtual CefBaseRefCounted {
/// underlying frame does not yet exist.
///
/*--cef()--*/
virtual int64_t GetIdentifier() = 0;
virtual int64 GetIdentifier() = 0;
///
/// Returns the parent of this frame or NULL if this is the main (top-level)

View File

@@ -57,7 +57,7 @@ class CefMediaAccessCallback : public virtual CefBaseRefCounted {
/// OnRequestMediaAccessPermission.
///
/*--cef(capi_name=cont)--*/
virtual void Continue(uint32_t allowed_permissions) = 0;
virtual void Continue(uint32 allowed_permissions) = 0;
///
/// Cancel the media access request.
@@ -104,7 +104,7 @@ class CefPermissionHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& requesting_origin,
uint32_t requested_permissions,
uint32 requested_permissions,
CefRefPtr<CefMediaAccessCallback> callback) {
return false;
}
@@ -123,9 +123,9 @@ class CefPermissionHandler : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual bool OnShowPermissionPrompt(
CefRefPtr<CefBrowser> browser,
uint64_t prompt_id,
uint64 prompt_id,
const CefString& requesting_origin,
uint32_t requested_permissions,
uint32 requested_permissions,
CefRefPtr<CefPermissionPromptCallback> callback) {
return false;
}
@@ -142,7 +142,7 @@ class CefPermissionHandler : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual void OnDismissPermissionPrompt(
CefRefPtr<CefBrowser> browser,
uint64_t prompt_id,
uint64 prompt_id,
cef_permission_request_result_t result) {}
};

View File

@@ -217,7 +217,7 @@ class CefRequest : public virtual CefBaseRefCounted {
/// browser process to track a single request across multiple callbacks.
///
/*--cef()--*/
virtual uint64_t GetIdentifier() = 0;
virtual uint64 GetIdentifier() = 0;
};
///

View File

@@ -46,7 +46,6 @@
#include "include/cef_extension_handler.h"
#include "include/cef_media_router.h"
#include "include/cef_preference.h"
#include "include/cef_values.h"
class CefRequestContextHandler;
class CefSchemeHandlerFactory;
@@ -315,72 +314,6 @@ class CefRequestContext : public CefPreferenceManager {
/*--cef(optional_param=callback)--*/
virtual CefRefPtr<CefMediaRouter> GetMediaRouter(
CefRefPtr<CefCompletionCallback> callback) = 0;
///
/// Returns the current value for |content_type| that applies for the
/// specified URLs. If both URLs are empty the default value will be returned.
/// Returns nullptr if no value is configured. Must be called on the browser
/// process UI thread.
///
/*--cef(optional_param=requesting_url,optional_param=top_level_url)--*/
virtual CefRefPtr<CefValue> GetWebsiteSetting(
const CefString& requesting_url,
const CefString& top_level_url,
cef_content_setting_types_t content_type) = 0;
///
/// Sets the current value for |content_type| for the specified URLs in the
/// default scope. If both URLs are empty, and the context is not incognito,
/// the default value will be set. Pass nullptr for |value| to remove the
/// default value for this content type.
///
/// WARNING: Incorrect usage of this method may cause instability or security
/// issues in Chromium. Make sure that you first understand the potential
/// impact of any changes to |content_type| by reviewing the related source
/// code in Chromium. For example, if you plan to modify
/// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
/// ContentSettingsType::POPUPS in Chromium:
/// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
///
/*--cef(optional_param=requesting_url,optional_param=top_level_url,
optional_param=value)--*/
virtual void SetWebsiteSetting(const CefString& requesting_url,
const CefString& top_level_url,
cef_content_setting_types_t content_type,
CefRefPtr<CefValue> value) = 0;
///
/// Returns the current value for |content_type| that applies for the
/// specified URLs. If both URLs are empty the default value will be returned.
/// Returns CEF_CONTENT_SETTING_VALUE_DEFAULT if no value is configured. Must
/// be called on the browser process UI thread.
///
/*--cef(optional_param=requesting_url,optional_param=top_level_url,
default_retval=CEF_CONTENT_SETTING_VALUE_DEFAULT)--*/
virtual cef_content_setting_values_t GetContentSetting(
const CefString& requesting_url,
const CefString& top_level_url,
cef_content_setting_types_t content_type) = 0;
///
/// Sets the current value for |content_type| for the specified URLs in the
/// default scope. If both URLs are empty, and the context is not incognito,
/// the default value will be set. Pass CEF_CONTENT_SETTING_VALUE_DEFAULT for
/// |value| to use the default value for this content type.
///
/// WARNING: Incorrect usage of this method may cause instability or security
/// issues in Chromium. Make sure that you first understand the potential
/// impact of any changes to |content_type| by reviewing the related source
/// code in Chromium. For example, if you plan to modify
/// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
/// ContentSettingsType::POPUPS in Chromium:
/// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
///
/*--cef(optional_param=requesting_url,optional_param=top_level_url)--*/
virtual void SetContentSetting(const CefString& requesting_url,
const CefString& top_level_url,
cef_content_setting_types_t content_type,
cef_content_setting_values_t value) = 0;
};
#endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_

View File

@@ -58,7 +58,7 @@ class CefResourceSkipCallback : public virtual CefBaseRefCounted {
/// <= 0 the request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE.
///
/*--cef(capi_name=cont)--*/
virtual void Continue(int64_t bytes_skipped) = 0;
virtual void Continue(int64 bytes_skipped) = 0;
};
///
@@ -136,7 +136,7 @@ class CefResourceHandler : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64_t& response_length,
int64& response_length,
CefString& redirectUrl) = 0;
///
@@ -149,8 +149,8 @@ class CefResourceHandler : public virtual CefBaseRefCounted {
/// method will be called in sequence but not from a dedicated thread.
///
/*--cef()--*/
virtual bool Skip(int64_t bytes_to_skip,
int64_t& bytes_skipped,
virtual bool Skip(int64 bytes_to_skip,
int64& bytes_skipped,
CefRefPtr<CefResourceSkipCallback> callback) {
bytes_skipped = -2;
return false;

View File

@@ -187,7 +187,7 @@ class CefResourceRequestHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefRequest> request,
CefRefPtr<CefResponse> response,
URLRequestStatus status,
int64_t received_content_length) {}
int64 received_content_length) {}
///
/// Called on the IO thread to handle requests for URLs with an unknown

View File

@@ -74,7 +74,7 @@ class CefServer : public CefBaseRefCounted {
///
/*--cef()--*/
static void CreateServer(const CefString& address,
uint16_t port,
uint16 port,
int backlog,
CefRefPtr<CefServerHandler> handler);
@@ -170,7 +170,7 @@ class CefServer : public CefBaseRefCounted {
virtual void SendHttpResponse(int connection_id,
int response_code,
const CefString& content_type,
int64_t content_length,
int64 content_length,
const HeaderMap& extra_headers) = 0;
///

View File

@@ -58,13 +58,13 @@ class CefReadHandler : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64_t offset, int whence) = 0;
virtual int Seek(int64 offset, int whence) = 0;
///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64_t Tell() = 0;
virtual int64 Tell() = 0;
///
/// Return non-zero if at end of file.
@@ -119,13 +119,13 @@ class CefStreamReader : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64_t offset, int whence) = 0;
virtual int Seek(int64 offset, int whence) = 0;
///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64_t Tell() = 0;
virtual int64 Tell() = 0;
///
/// Return non-zero if at end of file.
@@ -161,13 +161,13 @@ class CefWriteHandler : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64_t offset, int whence) = 0;
virtual int Seek(int64 offset, int whence) = 0;
///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64_t Tell() = 0;
virtual int64 Tell() = 0;
///
/// Flush the stream.
@@ -215,13 +215,13 @@ class CefStreamWriter : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64_t offset, int whence) = 0;
virtual int Seek(int64 offset, int whence) = 0;
///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64_t Tell() = 0;
virtual int64 Tell() = 0;
///
/// Flush the stream.

View File

@@ -118,7 +118,7 @@ class CefTaskRunner : public virtual CefBaseRefCounted {
/// specified delay.
///
/*--cef()--*/
virtual bool PostDelayedTask(CefRefPtr<CefTask> task, int64_t delay_ms) = 0;
virtual bool PostDelayedTask(CefRefPtr<CefTask> task, int64 delay_ms) = 0;
};
///
@@ -143,6 +143,6 @@ bool CefPostTask(CefThreadId threadId, CefRefPtr<CefTask> task);
/*--cef()--*/
bool CefPostDelayedTask(CefThreadId threadId,
CefRefPtr<CefTask> task,
int64_t delay_ms);
int64 delay_ms);
#endif // CEF_INCLUDE_CEF_TASK_H_

View File

@@ -106,6 +106,6 @@ bool CefEndTracing(const CefString& tracing_file,
/// information in trace events.
///
/*--cef()--*/
int64_t CefNowFromSystemTraceTime();
int64 CefNowFromSystemTraceTime();
#endif // CEF_INCLUDE_CEF_TRACE_H_

View File

@@ -152,8 +152,8 @@ class CefURLRequestClient : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void OnUploadProgress(CefRefPtr<CefURLRequest> request,
int64_t current,
int64_t total) = 0;
int64 current,
int64 total) = 0;
///
/// Notifies the client of download progress. |current| denotes the number of
@@ -162,8 +162,8 @@ class CefURLRequestClient : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void OnDownloadProgress(CefRefPtr<CefURLRequest> request,
int64_t current,
int64_t total) = 0;
int64 current,
int64 total) = 0;
///
/// Called when some part of the response is read. |data| contains the current

View File

@@ -459,13 +459,13 @@ class CefV8Value : public virtual CefBaseRefCounted {
/// Create a new CefV8Value object of type int.
///
/*--cef()--*/
static CefRefPtr<CefV8Value> CreateInt(int32_t value);
static CefRefPtr<CefV8Value> CreateInt(int32 value);
///
/// Create a new CefV8Value object of type unsigned int.
///
/*--cef()--*/
static CefRefPtr<CefV8Value> CreateUInt(uint32_t value);
static CefRefPtr<CefV8Value> CreateUInt(uint32 value);
///
/// Create a new CefV8Value object of type double.
@@ -648,13 +648,13 @@ class CefV8Value : public virtual CefBaseRefCounted {
/// Return an int value.
///
/*--cef()--*/
virtual int32_t GetIntValue() = 0;
virtual int32 GetIntValue() = 0;
///
/// Return an unsigned int value.
///
/*--cef()--*/
virtual uint32_t GetUIntValue() = 0;
virtual uint32 GetUIntValue() = 0;
///
/// Return a double value.

View File

@@ -103,7 +103,7 @@ class CefWaitableEvent : public CefBaseRefCounted {
/// called on the browser process UI or IO threads.
///
/*--cef()--*/
virtual bool TimedWait(int64_t max_ms) = 0;
virtual bool TimedWait(int64 max_ms) = 0;
};
#endif // CEF_INCLUDE_CEF_WAITABLE_EVENT_H_

View File

@@ -81,6 +81,12 @@ class CefX509CertPrincipal : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual CefString GetCountryName() = 0;
///
/// Retrieve the list of street addresses.
///
/*--cef()--*/
virtual void GetStreetAddresses(std::vector<CefString>& addresses) = 0;
///
/// Retrieve the list of organization names.
///
@@ -92,6 +98,12 @@ class CefX509CertPrincipal : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void GetOrganizationUnitNames(std::vector<CefString>& names) = 0;
///
/// Retrieve the list of domain components.
///
/*--cef()--*/
virtual void GetDomainComponents(std::vector<CefString>& components) = 0;
};
///

View File

@@ -96,7 +96,7 @@ class CefZipReader : public virtual CefBaseRefCounted {
/// Returns the uncompressed size of the file.
///
/*--cef()--*/
virtual int64_t GetFileSize() = 0;
virtual int64 GetFileSize() = 0;
///
/// Returns the last modified timestamp for the file.
@@ -128,7 +128,7 @@ class CefZipReader : public virtual CefBaseRefCounted {
/// Returns the current offset in the uncompressed file contents.
///
/*--cef()--*/
virtual int64_t Tell() = 0;
virtual int64 Tell() = 0;
///
/// Returns true if at end of the file contents.

View File

@@ -74,7 +74,7 @@ typedef cef_string_userfree_utf8_t cef_string_userfree_t;
#define cef_string_to_wide cef_string_utf8_to_wide
#define cef_string_from_wide cef_string_wide_to_utf8
#elif defined(CEF_STRING_TYPE_UTF16)
typedef char16_t cef_char_t;
typedef char16 cef_char_t;
typedef cef_string_userfree_utf16_t cef_string_userfree_t;
typedef cef_string_utf16_t cef_string_t;
#define cef_string_set cef_string_utf16_set

View File

@@ -33,18 +33,7 @@
#include <stddef.h>
#ifdef __clang__
// On macOS, <uchar.h> is only available with Xcode 14.3+.
#if __has_include(<uchar.h>)
#include <uchar.h>
#elif !defined(__cplusplus)
#include <stdint.h>
typedef uint_least16_t char16_t;
#endif
#else
#include <uchar.h>
#endif
#include "include/base/cef_basictypes.h"
#include "include/internal/cef_export.h"
///
@@ -81,9 +70,9 @@ typedef struct _cef_string_utf8_t {
} cef_string_utf8_t;
typedef struct _cef_string_utf16_t {
char16_t* str;
char16* str;
size_t length;
void (*dtor)(char16_t* str);
void (*dtor)(char16* str);
} cef_string_utf16_t;
///
@@ -100,7 +89,7 @@ CEF_EXPORT int cef_string_utf8_set(const char* src,
size_t src_len,
cef_string_utf8_t* output,
int copy);
CEF_EXPORT int cef_string_utf16_set(const char16_t* src,
CEF_EXPORT int cef_string_utf16_set(const char16* src,
size_t src_len,
cef_string_utf16_t* output,
int copy);
@@ -152,14 +141,14 @@ CEF_EXPORT int cef_string_utf8_to_wide(const char* src,
CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src,
size_t src_len,
cef_string_utf16_t* output);
CEF_EXPORT int cef_string_utf16_to_wide(const char16_t* src,
CEF_EXPORT int cef_string_utf16_to_wide(const char16* src,
size_t src_len,
cef_string_wide_t* output);
CEF_EXPORT int cef_string_utf8_to_utf16(const char* src,
size_t src_len,
cef_string_utf16_t* output);
CEF_EXPORT int cef_string_utf16_to_utf8(const char16_t* src,
CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src,
size_t src_len,
cef_string_utf8_t* output);
@@ -209,10 +198,10 @@ CEF_EXPORT void cef_string_userfree_utf16_free(cef_string_userfree_utf16_t str);
/// may change the length of the string in some cases.
///
CEF_EXPORT int cef_string_utf16_to_lower(const char16_t* src,
CEF_EXPORT int cef_string_utf16_to_lower(const char16* src,
size_t src_len,
cef_string_utf16_t* output);
CEF_EXPORT int cef_string_utf16_to_upper(const char16_t* src,
CEF_EXPORT int cef_string_utf16_to_upper(const char16* src,
size_t src_len,
cef_string_utf16_t* output);

View File

@@ -115,7 +115,7 @@ struct CefStringTraitsWide {
static inline bool from_string16(const std::u16string::value_type* data,
size_t length,
struct_type* s) {
return cef_string_utf16_to_wide(reinterpret_cast<const char16_t*>(data),
return cef_string_utf16_to_wide(reinterpret_cast<const char16*>(data),
length, s)
? true
: false;
@@ -213,7 +213,7 @@ struct CefStringTraitsUTF8 {
static inline bool from_string16(const std::u16string::value_type* data,
size_t length,
struct_type* s) {
return cef_string_utf16_to_utf8(reinterpret_cast<const char16_t*>(data),
return cef_string_utf16_to_utf8(reinterpret_cast<const char16*>(data),
length, s)
? true
: false;
@@ -227,7 +227,7 @@ struct CefStringTraitsUTF8 {
/// Traits implementation for utf16 character strings.
///
struct CefStringTraitsUTF16 {
typedef char16_t char_type;
typedef char16 char_type;
typedef cef_string_utf16_t struct_type;
typedef cef_string_userfree_utf16_t userfree_struct_type;
@@ -290,15 +290,12 @@ struct CefStringTraitsUTF16 {
}
#else // WCHAR_T_IS_UTF32
static inline std::wstring to_wstring(const struct_type* s) {
return std::wstring(reinterpret_cast<wchar_t*>(s->str), s->length);
return std::wstring(s->str, s->length);
}
static inline bool from_wstring(const std::wstring::value_type* data,
size_t length,
struct_type* s) {
return cef_string_utf16_set(reinterpret_cast<const char16_t*>(data), length,
s, true)
? true
: false;
return cef_string_utf16_set(data, length, s, true) ? true : false;
}
#endif // WCHAR_T_IS_UTF32
static inline bool from_wstring(const std::wstring& str, struct_type* s) {
@@ -311,7 +308,7 @@ struct CefStringTraitsUTF16 {
static inline bool from_string16(const std::u16string::value_type* data,
size_t length,
struct_type* s) {
return cef_string_utf16_set(reinterpret_cast<const char16_t*>(data), length,
return cef_string_utf16_set(reinterpret_cast<const char16*>(data), length,
s, true)
? true
: false;
@@ -415,6 +412,15 @@ class CefStringBase {
FromString16(src, length);
}
}
#if defined(WCHAR_T_IS_UTF32)
CefStringBase(const char16* src, size_t length = 0)
: string_(NULL), owner_(false) {
if (src) {
FromString16(reinterpret_cast<const std::u16string::value_type*>(src),
length);
}
}
#endif // WCHAR_T_IS_UTF32
///
/// Create a new string from an existing character array. If |copy| is true
@@ -820,6 +826,12 @@ class CefStringBase {
FromString16(str);
return *this;
}
#if defined(WCHAR_T_IS_UTF32)
CefStringBase& operator=(const char16* str) {
FromString16(reinterpret_cast<const std::u16string::value_type*>(str));
return *this;
}
#endif // WCHAR_T_IS_UTF32
#if defined(USING_CHROMIUM_INCLUDES)
// The base::FilePath constructor is marked as explicit so provide the
// conversion here for convenience.

View File

@@ -35,9 +35,8 @@
extern "C" {
#endif
#include <stdint.h>
#include <time.h>
#include "include/base/cef_basictypes.h"
#include "include/internal/cef_export.h"
///
@@ -48,7 +47,7 @@ extern "C" {
/// This is equivalent of Chromium `base::Time` (see base/time/time.h).
///
typedef struct _cef_basetime_t {
int64_t val;
int64 val;
} cef_basetime_t;
///

View File

@@ -45,66 +45,77 @@ extern "C" {
// may not include "(quotes) chars.
// - |argX_name|, |argX_val|, |valueX_name|, |valeX_val| are optional parameters
// and represent pairs of name and values of arguments
// - |copy| is used to avoid memory scoping issues with the |name| and
// |arg_name| parameters by copying them
// - |id| is used to disambiguate counters with the same name, or match async
// trace events
CEF_EXPORT void cef_trace_event_instant(const char* category,
const char* name,
const char* arg1_name,
uint64_t arg1_val,
uint64 arg1_val,
const char* arg2_name,
uint64_t arg2_val);
uint64 arg2_val,
int copy);
CEF_EXPORT void cef_trace_event_begin(const char* category,
const char* name,
const char* arg1_name,
uint64_t arg1_val,
uint64 arg1_val,
const char* arg2_name,
uint64_t arg2_val);
uint64 arg2_val,
int copy);
CEF_EXPORT void cef_trace_event_end(const char* category,
const char* name,
const char* arg1_name,
uint64_t arg1_val,
uint64 arg1_val,
const char* arg2_name,
uint64_t arg2_val);
uint64 arg2_val,
int copy);
CEF_EXPORT void cef_trace_counter(const char* category,
const char* name,
const char* value1_name,
uint64_t value1_val,
uint64 value1_val,
const char* value2_name,
uint64_t value2_val);
uint64 value2_val,
int copy);
CEF_EXPORT void cef_trace_counter_id(const char* category,
const char* name,
uint64_t id,
uint64 id,
const char* value1_name,
uint64_t value1_val,
uint64 value1_val,
const char* value2_name,
uint64_t value2_val);
uint64 value2_val,
int copy);
CEF_EXPORT void cef_trace_event_async_begin(const char* category,
const char* name,
uint64_t id,
uint64 id,
const char* arg1_name,
uint64_t arg1_val,
uint64 arg1_val,
const char* arg2_name,
uint64_t arg2_val);
uint64 arg2_val,
int copy);
CEF_EXPORT void cef_trace_event_async_step_into(const char* category,
const char* name,
uint64_t id,
uint64_t step,
uint64 id,
uint64 step,
const char* arg1_name,
uint64_t arg1_val);
uint64 arg1_val,
int copy);
CEF_EXPORT void cef_trace_event_async_step_past(const char* category,
const char* name,
uint64_t id,
uint64_t step,
uint64 id,
uint64 step,
const char* arg1_name,
uint64_t arg1_val);
uint64 arg1_val,
int copy);
CEF_EXPORT void cef_trace_event_async_end(const char* category,
const char* name,
uint64_t id,
uint64 id,
const char* arg1_name,
uint64_t arg1_val,
uint64 arg1_val,
const char* arg2_name,
uint64_t arg2_val);
uint64 arg2_val,
int copy);
#ifdef __cplusplus
}

View File

@@ -31,14 +31,10 @@
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
#pragma once
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include "include/base/cef_basictypes.h"
#include "include/internal/cef_string.h"
#include "include/internal/cef_string_list.h"
#include "include/internal/cef_time.h"
#include "include/internal/cef_types_content_settings.h"
#include "include/internal/cef_types_geometry.h"
// Bring in platform-specific definitions.
@@ -52,7 +48,7 @@
// 32-bit ARGB color value, not premultiplied. The color components are always
// in a known order. Equivalent to the SkColor type.
typedef uint32_t cef_color_t;
typedef uint32 cef_color_t;
// Return the alpha byte from a cef_color_t value.
#define CefColorGetA(color) (((color) >> 24) & 0xFF)
@@ -69,18 +65,17 @@ typedef uint32_t cef_color_t;
(static_cast<unsigned>(a) << 24) | (static_cast<unsigned>(r) << 16) | \
(static_cast<unsigned>(g) << 8) | (static_cast<unsigned>(b) << 0))
// Return an int64_t value with the specified low and high int32_t component
// values.
#define CefInt64Set(int32_low, int32_high) \
static_cast<int64_t>( \
(static_cast<uint32_t>(int32_low)) | \
(static_cast<int64_t>(static_cast<int32_t>(int32_high))) << 32)
// Return an int64 value with the specified low and high int32 component values.
#define CefInt64Set(int32_low, int32_high) \
static_cast<int64>((static_cast<uint32>(int32_low)) | \
(static_cast<int64>(static_cast<int32>(int32_high))) \
<< 32)
// Return the low int32_t value from an int64_t value.
#define CefInt64GetLow(int64_val) static_cast<int32_t>(int64_val)
// Return the high int32_t value from an int64_t value.
// Return the low int32 value from an int64 value.
#define CefInt64GetLow(int64_val) static_cast<int32>(int64_val)
// Return the high int32 value from an int64 value.
#define CefInt64GetHigh(int64_val) \
static_cast<int32_t>((static_cast<int64_t>(int64_val) >> 32) & 0xFFFFFFFFL)
static_cast<int32>((static_cast<int64>(int64_val) >> 32) & 0xFFFFFFFFL)
#ifdef __cplusplus
extern "C" {
@@ -132,42 +127,6 @@ typedef enum {
LOGSEVERITY_DISABLE = 99
} cef_log_severity_t;
///
/// Log items prepended to each log line.
///
typedef enum {
///
/// Prepend the default list of items.
///
LOG_ITEMS_DEFAULT = 0,
///
/// Prepend no items.
///
LOG_ITEMS_NONE = 1,
///
/// Prepend the process ID.
///
LOG_ITEMS_FLAG_PROCESS_ID = 1 << 1,
///
/// Prepend the thread ID.
///
LOG_ITEMS_FLAG_THREAD_ID = 1 << 2,
///
/// Prepend the timestamp.
///
LOG_ITEMS_FLAG_TIME_STAMP = 1 << 3,
///
/// Prepend the tickcount.
///
LOG_ITEMS_FLAG_TICK_COUNT = 1 << 4,
} cef_log_items_t;
///
/// Represents the state of a setting.
///
@@ -296,16 +255,24 @@ typedef struct _cef_settings_t {
/// The root directory that all CefSettings.cache_path and
/// CefRequestContextSettings.cache_path values must have in common. If this
/// value is empty and CefSettings.cache_path is non-empty then it will
/// default to the CefSettings.cache_path value. If both values are empty
/// then the default platform-specific directory will be used
/// default to the CefSettings.cache_path value. If this value is non-empty
/// then it must be an absolute path. Failure to set this value correctly may
/// result in the sandbox blocking read/write access to the cache_path
/// directory.
///
cef_string_t root_cache_path;
///
/// The location where user data such as the Widevine CDM module and spell
/// checking dictionary files will be stored on disk. If this value is empty
/// then the default platform-specific user data directory will be used
/// ("~/.config/cef_user_data" directory on Linux, "~/Library/Application
/// Support/CEF/User Data" directory on MacOS, "AppData\Local\CEF\User Data"
/// directory under the user profile directory on Windows). If this value is
/// non-empty then it must be an absolute path. Failure to set this value
/// correctly may result in the sandbox blocking read/write access to certain
/// files.
/// non-empty then it must be an absolute path. When using the Chrome runtime
/// this value will be ignored in favor of the |root_cache_path| value.
///
cef_string_t root_cache_path;
cef_string_t user_data_path;
///
/// To persist session cookies (cookies without an expiry date or validity
@@ -372,14 +339,6 @@ typedef struct _cef_settings_t {
///
cef_log_severity_t log_severity;
///
/// The log items prepended to each log line. If not set the default log items
/// will be used. Also configurable using the "log-items" command-line switch
/// with a value of "none" for no log items, or a comma-delimited list of
/// values "pid", "tid", "timestamp" or "tickcount" for custom log items.
///
cef_log_items_t log_items;
///
/// Custom flags that will be used when initializing the V8 JavaScript engine.
/// The consequences of using custom flags may not be well tested. Also
@@ -1819,7 +1778,7 @@ typedef struct _cef_mouse_event_t {
/// Bit flags describing any pressed modifier keys. See
/// cef_event_flags_t for values.
///
uint32_t modifiers;
uint32 modifiers;
} cef_mouse_event_t;
///
@@ -1897,7 +1856,7 @@ typedef struct _cef_touch_event_t {
/// Bit flags describing any pressed modifier keys. See
/// cef_event_flags_t for values.
///
uint32_t modifiers;
uint32 modifiers;
///
/// The device type that caused the event.
@@ -2110,7 +2069,7 @@ typedef struct _cef_key_event_t {
/// Bit flags describing any pressed modifier keys. See
/// cef_event_flags_t for values.
///
uint32_t modifiers;
uint32 modifiers;
///
/// The Windows key code for the key event. This value is used by the DOM
@@ -2135,13 +2094,13 @@ typedef struct _cef_key_event_t {
///
/// The character generated by the keystroke.
///
char16_t character;
char16 character;
///
/// Same as |character| but unmodified by any concurrently-held modifiers
/// (except shift). This is useful for working out shortcut keys.
///
char16_t unmodified_character;
char16 unmodified_character;
///
/// True if the focus is currently on an editable field on the page. This is
@@ -2624,11 +2583,6 @@ typedef struct _cef_pdf_print_settings_t {
/// |header_template|.
///
cef_string_t footer_template;
///
/// Set to true (1) to generate tagged (accessible) PDF.
///
int generate_tagged_pdf;
} cef_pdf_print_settings_t;
///
@@ -3335,9 +3289,7 @@ typedef enum {
CEF_CPAIT_VIRTUAL_CARD_MANUAL_FALLBACK,
CEF_CPAIT_ZOOM,
CEF_CPAIT_SAVE_IBAN,
CEF_CPAIT_MANDATORY_REAUTH,
CEF_CPAIT_PRICE_INSIGHTS,
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_PRICE_INSIGHTS,
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_SAVE_IBAN,
} cef_chrome_page_action_icon_type_t;
///
@@ -3394,7 +3346,7 @@ typedef struct _cef_touch_handle_state_t {
/// Combination of cef_touch_handle_state_flags_t values indicating what state
/// is set.
///
uint32_t flags;
uint32 flags;
///
/// Enabled state. Only set if |flags| contains CEF_THS_FLAG_ENABLED.
@@ -3467,15 +3419,16 @@ typedef enum {
CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 8,
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 9,
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 10,
CEF_PERMISSION_TYPE_MIDI = 1 << 11,
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 12,
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 13,
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 14,
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 15,
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 16,
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 11,
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 12,
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 13,
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 14,
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 15,
CEF_PERMISSION_TYPE_SECURITY_ATTESTATION = 1 << 16,
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 17,
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 18,
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 19,
CEF_PERMISSION_TYPE_U2F_API_REQUEST = 1 << 18,
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 19,
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 20,
} cef_permission_request_types_t;
///

View File

@@ -1,374 +0,0 @@
// Copyright (c) 2023 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.
#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_CONTENT_SETTINGS_H_
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_CONTENT_SETTINGS_H_
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
///
/// Supported content setting types. Some types are platform-specific or only
/// supported with the Chrome runtime. Should be kept in sync with Chromium's
/// ContentSettingsType type.
///
typedef enum {
CEF_CONTENT_SETTING_TYPE_COOKIES = 0,
CEF_CONTENT_SETTING_TYPE_IMAGES,
CEF_CONTENT_SETTING_TYPE_JAVASCRIPT,
/// This setting governs both popups and unwanted redirects like tab-unders
/// and framebusting.
CEF_CONTENT_SETTING_TYPE_POPUPS,
CEF_CONTENT_SETTING_TYPE_GEOLOCATION,
CEF_CONTENT_SETTING_TYPE_NOTIFICATIONS,
CEF_CONTENT_SETTING_TYPE_AUTO_SELECT_CERTIFICATE,
CEF_CONTENT_SETTING_TYPE_MIXEDSCRIPT,
CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_MIC,
CEF_CONTENT_SETTING_TYPE_MEDIASTREAM_CAMERA,
CEF_CONTENT_SETTING_TYPE_PROTOCOL_HANDLERS,
CEF_CONTENT_SETTING_TYPE_DEPRECATED_PPAPI_BROKER,
CEF_CONTENT_SETTING_TYPE_AUTOMATIC_DOWNLOADS,
CEF_CONTENT_SETTING_TYPE_MIDI_SYSEX,
CEF_CONTENT_SETTING_TYPE_SSL_CERT_DECISIONS,
CEF_CONTENT_SETTING_TYPE_PROTECTED_MEDIA_IDENTIFIER,
CEF_CONTENT_SETTING_TYPE_APP_BANNER,
CEF_CONTENT_SETTING_TYPE_SITE_ENGAGEMENT,
CEF_CONTENT_SETTING_TYPE_DURABLE_STORAGE,
CEF_CONTENT_SETTING_TYPE_USB_CHOOSER_DATA,
CEF_CONTENT_SETTING_TYPE_BLUETOOTH_GUARD,
CEF_CONTENT_SETTING_TYPE_BACKGROUND_SYNC,
CEF_CONTENT_SETTING_TYPE_AUTOPLAY,
CEF_CONTENT_SETTING_TYPE_IMPORTANT_SITE_INFO,
CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOBLOCKER_DATA,
CEF_CONTENT_SETTING_TYPE_ADS,
/// Website setting which stores metadata for the subresource filter to aid in
/// decisions for whether or not to show the UI.
CEF_CONTENT_SETTING_TYPE_ADS_DATA,
/// This is special-cased in the permissions layer to always allow, and as
/// such doesn't have associated prefs data.
CEF_CONTENT_SETTING_TYPE_MIDI,
/// This content setting type is for caching password protection service's
/// verdicts of each origin.
CEF_CONTENT_SETTING_TYPE_PASSWORD_PROTECTION,
/// Website setting which stores engagement data for media related to a
/// specific origin.
CEF_CONTENT_SETTING_TYPE_MEDIA_ENGAGEMENT,
/// Content setting which stores whether or not the site can play audible
/// sound. This will not block playback but instead the user will not hear it.
CEF_CONTENT_SETTING_TYPE_SOUND,
/// Website setting which stores the list of client hints that the origin
/// requested the browser to remember. The browser is expected to send all
/// client hints in the HTTP request headers for every resource requested
/// from that origin.
CEF_CONTENT_SETTING_TYPE_CLIENT_HINTS,
/// Generic Sensor API covering ambient-light-sensor, accelerometer, gyroscope
/// and magnetometer are all mapped to a single content_settings_type.
/// Setting for the Generic Sensor API covering ambient-light-sensor,
/// accelerometer, gyroscope and magnetometer. These are all mapped to a
/// single ContentSettingsType.
CEF_CONTENT_SETTING_TYPE_SENSORS,
/// Content setting which stores whether or not the user has granted the site
/// permission to respond to accessibility events, which can be used to
/// provide a custom accessibility experience. Requires explicit user consent
/// because some users may not want sites to know they're using assistive
/// technology.
CEF_CONTENT_SETTING_TYPE_ACCESSIBILITY_EVENTS,
/// Used to store whether to allow a website to install a payment handler.
CEF_CONTENT_SETTING_TYPE_PAYMENT_HANDLER,
/// Content setting which stores whether to allow sites to ask for permission
/// to access USB devices. If this is allowed specific device permissions are
/// stored under USB_CHOOSER_DATA.
CEF_CONTENT_SETTING_TYPE_USB_GUARD,
/// Nothing is stored in this setting at present. Please refer to
/// BackgroundFetchPermissionContext for details on how this permission
/// is ascertained.
CEF_CONTENT_SETTING_TYPE_BACKGROUND_FETCH,
/// Website setting which stores the amount of times the user has dismissed
/// intent picker UI without explicitly choosing an option.
CEF_CONTENT_SETTING_TYPE_INTENT_PICKER_DISPLAY,
/// Used to store whether to allow a website to detect user active/idle state.
CEF_CONTENT_SETTING_TYPE_IDLE_DETECTION,
/// Setting for enabling auto-select of all screens for getDisplayMediaSet.
CEF_CONTENT_SETTING_TYPE_GET_DISPLAY_MEDIA_SET_SELECT_ALL_SCREENS,
/// Content settings for access to serial ports. The "guard" content setting
/// stores whether to allow sites to ask for permission to access a port. The
/// permissions granted to access particular ports are stored in the "chooser
/// data" website setting.
CEF_CONTENT_SETTING_TYPE_SERIAL_GUARD,
CEF_CONTENT_SETTING_TYPE_SERIAL_CHOOSER_DATA,
/// Nothing is stored in this setting at present. Please refer to
/// PeriodicBackgroundSyncPermissionContext for details on how this permission
/// is ascertained.
/// This content setting is not registered because it does not require access
/// to any existing providers.
CEF_CONTENT_SETTING_TYPE_PERIODIC_BACKGROUND_SYNC,
/// Content setting which stores whether to allow sites to ask for permission
/// to do Bluetooth scanning.
CEF_CONTENT_SETTING_TYPE_BLUETOOTH_SCANNING,
/// Content settings for access to HID devices. The "guard" content setting
/// stores whether to allow sites to ask for permission to access a device.
/// The permissions granted to access particular devices are stored in the
/// "chooser data" website setting.
CEF_CONTENT_SETTING_TYPE_HID_GUARD,
CEF_CONTENT_SETTING_TYPE_HID_CHOOSER_DATA,
/// Wake Lock API, which has two lock types: screen and system locks.
/// Currently, screen locks do not need any additional permission, and system
/// locks are always denied while the right UI is worked out.
CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SCREEN,
CEF_CONTENT_SETTING_TYPE_WAKE_LOCK_SYSTEM,
/// Legacy SameSite cookie behavior. This disables SameSite=Lax-by-default,
/// SameSite=None requires Secure, and Schemeful Same-Site, forcing the
/// legacy behavior wherein 1) cookies that don't specify SameSite are treated
/// as SameSite=None, 2) SameSite=None cookies are not required to be Secure,
/// and 3) schemeful same-site is not active.
///
/// This will also be used to revert to legacy behavior when future changes
/// in cookie handling are introduced.
CEF_CONTENT_SETTING_TYPE_LEGACY_COOKIE_ACCESS,
/// Content settings which stores whether to allow sites to ask for permission
/// to save changes to an original file selected by the user through the
/// File System Access API.
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_WRITE_GUARD,
/// Used to store whether to allow a website to exchange data with NFC
/// devices.
CEF_CONTENT_SETTING_TYPE_NFC,
/// Website setting to store permissions granted to access particular
/// Bluetooth devices.
CEF_CONTENT_SETTING_TYPE_BLUETOOTH_CHOOSER_DATA,
/// Full access to the system clipboard (sanitized read without user gesture,
/// and unsanitized read and write with user gesture).
CEF_CONTENT_SETTING_TYPE_CLIPBOARD_READ_WRITE,
/// This is special-cased in the permissions layer to always allow, and as
/// such doesn't have associated prefs data.
CEF_CONTENT_SETTING_TYPE_CLIPBOARD_SANITIZED_WRITE,
/// This content setting type is for caching safe browsing real time url
/// check's verdicts of each origin.
CEF_CONTENT_SETTING_TYPE_SAFE_BROWSING_URL_CHECK_DATA,
/// Used to store whether a site is allowed to request AR or VR sessions with
/// the WebXr Device API.
CEF_CONTENT_SETTING_TYPE_VR,
CEF_CONTENT_SETTING_TYPE_AR,
/// Content setting which stores whether to allow site to open and read files
/// and directories selected through the File System Access API.
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_READ_GUARD,
/// Access to first party storage in a third-party context. Exceptions are
/// scoped to the combination of requesting/top-level origin, and are managed
/// through the Storage Access API. For the time being, this content setting
/// exists in parallel to third-party cookie rules stored in COOKIES.
CEF_CONTENT_SETTING_TYPE_STORAGE_ACCESS,
/// Content setting which stores whether to allow a site to control camera
/// movements. It does not give access to camera.
CEF_CONTENT_SETTING_TYPE_CAMERA_PAN_TILT_ZOOM,
/// Content setting for Screen Enumeration and Screen Detail functionality.
/// Permits access to detailed multi-screen information, like size and
/// position. Permits placing fullscreen and windowed content on specific
/// screens. See also: https://w3c.github.io/window-placement
CEF_CONTENT_SETTING_TYPE_WINDOW_MANAGEMENT,
/// Stores whether to allow insecure websites to make local network requests.
/// See also: https://wicg.github.io/local-network-access
/// Set through enterprise policies only.
CEF_CONTENT_SETTING_TYPE_INSECURE_LOCAL_NETWORK,
/// Content setting which stores whether or not a site can access low-level
/// locally installed font data using the Local Fonts Access API.
CEF_CONTENT_SETTING_TYPE_LOCAL_FONTS,
/// Stores per-origin state for permission auto-revocation (for all permission
/// types).
CEF_CONTENT_SETTING_TYPE_PERMISSION_AUTOREVOCATION_DATA,
/// Stores per-origin state of the most recently selected directory for the
/// use by the File System Access API.
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_LAST_PICKED_DIRECTORY,
/// Controls access to the getDisplayMedia API when {preferCurrentTab: true}
/// is specified.
CEF_CONTENT_SETTING_TYPE_DISPLAY_CAPTURE,
/// Website setting to store permissions metadata granted to paths on the
/// local file system via the File System Access API.
/// |FILE_SYSTEM_WRITE_GUARD| is the corresponding "guard" setting.
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_CHOOSER_DATA,
/// Stores a grant that allows a relying party to send a request for identity
/// information to specified identity providers, potentially through any
/// anti-tracking measures that would otherwise prevent it. This setting is
/// associated with the relying party's origin.
CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_SHARING,
/// Whether to use the v8 optimized JIT for running JavaScript on the page.
CEF_CONTENT_SETTING_TYPE_JAVASCRIPT_JIT,
/// Content setting which stores user decisions to allow loading a site over
/// HTTP. Entries are added by hostname when a user bypasses the HTTPS-First
/// Mode interstitial warning when a site does not support HTTPS. Allowed
/// hosts are exact hostname matches -- subdomains of a host on the allowlist
/// must be separately allowlisted.
CEF_CONTENT_SETTING_TYPE_HTTP_ALLOWED,
/// Stores metadata related to form fill, such as e.g. whether user data was
/// autofilled on a specific website.
CEF_CONTENT_SETTING_TYPE_FORMFILL_METADATA,
/// Setting to indicate that there is an active federated sign-in session
/// between a specified relying party and a specified identity provider for
/// a specified account. When this is present it allows access to session
/// management capabilities between the sites. This setting is associated
/// with the relying party's origin.
CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_ACTIVE_SESSION,
/// Setting to indicate whether Chrome should automatically apply darkening to
/// web content.
CEF_CONTENT_SETTING_TYPE_AUTO_DARK_WEB_CONTENT,
/// Setting to indicate whether Chrome should request the desktop view of a
/// site instead of the mobile one.
CEF_CONTENT_SETTING_TYPE_REQUEST_DESKTOP_SITE,
/// Setting to indicate whether browser should allow signing into a website
/// via the browser FedCM API.
CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_API,
/// Stores notification interactions per origin for the past 90 days.
/// Interactions per origin are pre-aggregated over seven-day windows: A
/// notification interaction or display is assigned to the last Monday
/// midnight in local time.
CEF_CONTENT_SETTING_TYPE_NOTIFICATION_INTERACTIONS,
/// Website setting which stores the last reduced accept language negotiated
/// for a given origin, to be used on future visits to the origin.
CEF_CONTENT_SETTING_TYPE_REDUCED_ACCEPT_LANGUAGE,
/// Website setting which is used for NotificationPermissionReviewService to
/// store origin blocklist from review notification permissions feature.
CEF_CONTENT_SETTING_TYPE_NOTIFICATION_PERMISSION_REVIEW,
/// Website setting to store permissions granted to access particular devices
/// in private network.
CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_GUARD,
CEF_CONTENT_SETTING_TYPE_PRIVATE_NETWORK_CHOOSER_DATA,
/// Website setting which stores whether the browser has observed the user
/// signing into an identity-provider based on observing the IdP-SignIn-Status
/// HTTP header.
CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_SIGNIN_STATUS,
/// Website setting which is used for UnusedSitePermissionsService to
/// store revoked permissions of unused sites from unused site permissions
/// feature.
CEF_CONTENT_SETTING_TYPE_REVOKED_UNUSED_SITE_PERMISSIONS,
/// Similar to STORAGE_ACCESS, but applicable at the page-level rather than
/// being specific to a frame.
CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_STORAGE_ACCESS,
/// Setting to indicate whether user has opted in to allowing auto re-authn
/// via the FedCM API.
CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION,
/// Website setting which stores whether the user has explicitly registered
/// a website as an identity-provider.
CEF_CONTENT_SETTING_TYPE_FEDERATED_IDENTITY_IDENTITY_PROVIDER_REGISTRATION,
/// Content setting which is used to indicate whether anti-abuse functionality
/// should be enabled.
CEF_CONTENT_SETTING_TYPE_ANTI_ABUSE,
/// Content setting used to indicate whether third-party storage partitioning
/// should be enabled.
CEF_CONTENT_SETTING_TYPE_THIRD_PARTY_STORAGE_PARTITIONING,
/// Used to indicate whether HTTPS-First Mode is enabled on the hostname.
CEF_CONTENT_SETTING_TYPE_HTTPS_ENFORCED,
/// Stores per origin metadata for cookie controls.
CEF_CONTENT_SETTING_TYPE_COOKIE_CONTROLS_METADATA,
/// Setting for supporting 3PCD.
CEF_CONTENT_SETTING_TYPE_TPCD_SUPPORT,
CEF_CONTENT_SETTING_TYPE_NUM_TYPES,
} cef_content_setting_types_t;
///
/// Supported content setting values. Should be kept in sync with Chromium's
/// ContentSetting type.
///
typedef enum {
CEF_CONTENT_SETTING_VALUE_DEFAULT = 0,
CEF_CONTENT_SETTING_VALUE_ALLOW,
CEF_CONTENT_SETTING_VALUE_BLOCK,
CEF_CONTENT_SETTING_VALUE_ASK,
CEF_CONTENT_SETTING_VALUE_SESSION_ONLY,
CEF_CONTENT_SETTING_VALUE_DETECT_IMPORTANT_CONTENT,
CEF_CONTENT_SETTING_VALUE_NUM_VALUES
} cef_content_setting_values_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_CONTENT_SETTINGS_H_

View File

@@ -364,6 +364,7 @@ struct CefSettingsTraits {
cef_string_clear(&s->main_bundle_path);
cef_string_clear(&s->cache_path);
cef_string_clear(&s->root_cache_path);
cef_string_clear(&s->user_data_path);
cef_string_clear(&s->user_agent);
cef_string_clear(&s->user_agent_product);
cef_string_clear(&s->locale);
@@ -396,6 +397,8 @@ struct CefSettingsTraits {
&target->cache_path, copy);
cef_string_set(src->root_cache_path.str, src->root_cache_path.length,
&target->root_cache_path, copy);
cef_string_set(src->user_data_path.str, src->user_data_path.length,
&target->user_data_path, copy);
target->persist_session_cookies = src->persist_session_cookies;
target->persist_user_preferences = src->persist_user_preferences;
@@ -408,7 +411,6 @@ struct CefSettingsTraits {
cef_string_set(src->log_file.str, src->log_file.length, &target->log_file,
copy);
target->log_severity = src->log_severity;
target->log_items = src->log_items;
cef_string_set(src->javascript_flags.str, src->javascript_flags.length,
&target->javascript_flags, copy);
@@ -680,8 +682,6 @@ struct CefPdfPrintSettingsTraits {
&target->header_template, copy);
cef_string_set(src->footer_template.str, src->footer_template.length,
&target->footer_template, copy);
target->generate_tagged_pdf = src->generate_tagged_pdf;
}
};

View File

@@ -86,7 +86,7 @@ class CefTestServer : public CefBaseRefCounted {
///
/*--cef()--*/
static CefRefPtr<CefTestServer> CreateAndStart(
uint16_t port,
uint16 port,
bool https_server,
cef_test_cert_type_t https_cert_type,
CefRefPtr<CefTestServerHandler> handler);

View File

@@ -113,27 +113,14 @@ class CefBrowserViewDelegate : public CefViewDelegate {
/// documentation.
///
/*--cef(default_retval=CEF_CTT_NONE)--*/
virtual ChromeToolbarType GetChromeToolbarType(
CefRefPtr<CefBrowserView> browser_view) {
return CEF_CTT_NONE;
}
///
/// Return true to create frameless windows for Document picture-in-picture
/// popups. Content in frameless windows should specify draggable regions
/// using "-webkit-app-region: drag" CSS.
///
/*--cef()--*/
virtual bool UseFramelessWindowForPictureInPicture(
CefRefPtr<CefBrowserView> browser_view) {
return false;
}
virtual ChromeToolbarType GetChromeToolbarType() { return CEF_CTT_NONE; }
///
/// Called when |browser_view| receives a gesture command. Return true to
/// handle (or disable) a |gesture_command| or false to propagate the gesture
/// to the browser for default handling. With the Chrome runtime these
/// commands can also be handled via CefCommandHandler::OnChromeCommand.
/// to the browser for default handling. This method will only be called with
/// the Alloy runtime. To handle these commands with the Chrome runtime
/// implement CefCommandHandler::OnChromeCommand instead.
///
/*--cef()--*/
virtual bool OnGestureCommand(CefRefPtr<CefBrowserView> browser_view,

View File

@@ -123,7 +123,7 @@ class CefDisplay : public CefBaseRefCounted {
/// Returns the unique identifier for this Display.
///
/*--cef()--*/
virtual int64_t GetID() = 0;
virtual int64 GetID() = 0;
///
/// Returns this Display's device pixel scale factor. This specifies how much

View File

@@ -45,8 +45,6 @@
#include "include/views/cef_panel.h"
#include "include/views/cef_window_delegate.h"
class CefBrowserView;
///
/// A Window is a top-level Window/widget in the Views hierarchy. By default it
/// will have a non-client area with title bar, icon and buttons that supports
@@ -70,20 +68,6 @@ class CefWindow : public CefPanel {
/*--cef()--*/
virtual void Show() = 0;
///
/// Show the Window as a browser modal dialog relative to |browser_view|. A
/// parent Window must be returned via CefWindowDelegate::GetParentWindow()
/// and |browser_view| must belong to that parent Window. While this Window is
/// visible, |browser_view| will be disabled while other controls in the
/// parent Window remain enabled. Navigating or destroying the |browser_view|
/// will close this Window automatically. Alternately, use Show() and return
/// true from CefWindowDelegate::IsWindowModalDialog() for a window modal
/// dialog where all controls in the parent Window are disabled.
///
/*--cef()--*/
virtual void ShowAsBrowserModalDialog(
CefRefPtr<CefBrowserView> browser_view) = 0;
///
/// Hide the Window.
///
@@ -165,9 +149,7 @@ class CefWindow : public CefPanel {
virtual void Restore() = 0;
///
/// Set fullscreen Window state. The
/// CefWindowDelegate::OnWindowFullscreenTransition method will be called
/// during the fullscreen transition for notification purposes.
/// Set fullscreen Window state.
///
/*--cef()--*/
virtual void SetFullscreen(bool fullscreen) = 0;
@@ -318,7 +300,7 @@ class CefWindow : public CefPanel {
/// primarily for testing purposes.
///
/*--cef()--*/
virtual void SendKeyPress(int key_code, uint32_t event_flags) = 0;
virtual void SendKeyPress(int key_code, uint32 event_flags) = 0;
///
/// Simulate a mouse move. The mouse cursor will be moved to the specified

View File

@@ -84,19 +84,6 @@ class CefWindowDelegate : public CefPanelDelegate {
virtual void OnWindowBoundsChanged(CefRefPtr<CefWindow> window,
const CefRect& new_bounds) {}
///
/// Called when |window| is transitioning to or from fullscreen mode. On MacOS
/// the transition occurs asynchronously with |is_competed| set to false when
/// the transition starts and true after the transition completes. On other
/// platforms the transition occurs synchronously with |is_completed| set to
/// true after the transition completes. With the Alloy runtime you must also
/// implement CefDisplayHandler::OnFullscreenModeChange to handle fullscreen
/// transitions initiated by browser content.
///
/*--cef()--*/
virtual void OnWindowFullscreenTransition(CefRefPtr<CefWindow> window,
bool is_completed) {}
///
/// Return the parent for |window| or NULL if the |window| does not have a
/// parent. Windows with parents will not get a taskbar button. Set |is_menu|
@@ -112,19 +99,6 @@ class CefWindowDelegate : public CefPanelDelegate {
return nullptr;
}
///
/// Return true if |window| should be created as a window modal dialog. Only
/// called when a Window is returned via GetParentWindow() with |is_menu| set
/// to false. All controls in the parent Window will be disabled while
/// |window| is visible. This functionality is not supported by all Linux
/// window managers. Alternately, use CefWindow::ShowAsBrowserModalDialog()
/// for a browser modal dialog that works on all platforms.
///
/*--cef()--*/
virtual bool IsWindowModalDialog(CefRefPtr<CefWindow> window) {
return false;
}
///
/// Return the initial bounds for |window| in density independent pixel (DIP)
/// coordinates. If this method returns an empty CefRect then
@@ -222,6 +196,16 @@ class CefWindowDelegate : public CefPanelDelegate {
const CefKeyEvent& event) {
return false;
}
///
/// Called when the |window| is transitioning to or from fullscreen mode. The
/// transition occurs in two stages, with |is_competed| set to false when the
/// transition starts and true when the transition completes.
/// This method is only supported on macOS.
///
/*--cef()--*/
virtual void OnWindowFullscreenTransition(CefRefPtr<CefWindow> window,
bool is_completed) {}
};
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_

View File

@@ -61,15 +61,15 @@ class CefByteReadHandler : public CefReadHandler {
// CefReadHandler methods.
virtual size_t Read(void* ptr, size_t size, size_t n) override;
virtual int Seek(int64_t offset, int whence) override;
virtual int64_t Tell() override;
virtual int Seek(int64 offset, int whence) override;
virtual int64 Tell() override;
virtual int Eof() override;
virtual bool MayBlock() override { return false; }
private:
const unsigned char* bytes_;
int64_t size_;
int64_t offset_;
int64 size_;
int64 offset_;
CefRefPtr<CefBaseRefCounted> source_;
base::Lock lock_;

View File

@@ -109,9 +109,9 @@ bool CefPostTask(CefThreadId threadId, const base::RepeatingClosure& closure);
///
bool CefPostDelayedTask(CefThreadId threadId,
base::OnceClosure closure,
int64_t delay_ms);
int64 delay_ms);
bool CefPostDelayedTask(CefThreadId threadId,
const base::RepeatingClosure& closure,
int64_t delay_ms);
int64 delay_ms);
#endif // CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_

View File

@@ -177,7 +177,7 @@
// 8. Handle the query in your Handler::OnQuery implementation and execute the
// appropriate callback either immediately or asynchronously.
//
// void MyHandler::OnQuery(int64_t query_id,
// void MyHandler::OnQuery(int64 query_id,
// CefRefPtr<CefBrowser> browser,
// CefRefPtr<CefFrame> frame,
// const CefString& request,
@@ -269,7 +269,7 @@ class CefMessageRouterBrowserSide
///
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64_t query_id,
int64 query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) {
@@ -287,7 +287,7 @@ class CefMessageRouterBrowserSide
///
virtual void OnQueryCanceled(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64_t query_id) {}
int64 query_id) {}
virtual ~Handler() {}
};

View File

@@ -361,7 +361,7 @@ class CefResourceManager
ProviderEntryList providers_;
// Map of response ID to pending CefResourceHandler object.
using PendingHandlersMap = std::map<uint64_t, CefRefPtr<CefResourceHandler>>;
using PendingHandlersMap = std::map<uint64, CefRefPtr<CefResourceHandler>>;
PendingHandlersMap pending_handlers_;
UrlFilter url_filter_;

View File

@@ -68,7 +68,7 @@ class CefStreamResourceHandler : public CefResourceHandler {
bool& handle_request,
CefRefPtr<CefCallback> callback) override;
void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64_t& response_length,
int64& response_length,
CefString& redirectUrl) override;
bool Read(void* data_out,
int bytes_to_read,

View File

@@ -21,6 +21,7 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "chrome/browser/font_family_cache.h"
#include "chrome/browser/media/media_device_id_salt.h"
#include "chrome/browser/permissions/permission_manager_factory.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/profiles/profile_key.h"
@@ -189,6 +190,8 @@ void AlloyBrowserContext::Initialize() {
}
ChromePluginServiceFilter::GetInstance()->RegisterProfile(this);
media_device_id_salt_ = new MediaDeviceIDSalt(pref_service);
}
void AlloyBrowserContext::Shutdown() {
@@ -418,6 +421,10 @@ AlloyBrowserContext::GetReduceAcceptLanguageControllerDelegate() {
return ReduceAcceptLanguageFactory::GetForProfile(this);
}
std::string AlloyBrowserContext::GetMediaDeviceIDSalt() {
return media_device_id_salt_->GetSalt();
}
PrefService* AlloyBrowserContext::GetPrefs() {
return pref_service_.get();
}

View File

@@ -18,6 +18,7 @@
class CefDownloadManagerDelegate;
class CefSSLHostStateDelegate;
class CefVisitedLinkListener;
class MediaDeviceIDSalt;
class PrefService;
namespace extensions {
@@ -82,6 +83,7 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
override;
content::ReduceAcceptLanguageControllerDelegate*
GetReduceAcceptLanguageControllerDelegate() override;
std::string GetMediaDeviceIDSalt() override;
// Profile overrides.
ChromeZoomLevelPrefs* GetZoomLevelPrefs() override;
@@ -144,6 +146,8 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
std::unique_ptr<DownloadPrefs> download_prefs_;
std::unique_ptr<content::ResourceContext> resource_context_;
scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_;
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_

View File

@@ -32,7 +32,6 @@
#include "chrome/browser/ui/color/chrome_color_mixers.h"
#include "chrome/browser/ui/javascript_dialogs/chrome_javascript_app_modal_dialog_view_factory.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "components/constrained_window/constrained_window_views.h"
#include "content/public/browser/gpu_data_manager.h"
@@ -43,7 +42,6 @@
#include "net/base/net_module.h"
#include "third_party/widevine/cdm/buildflags.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/color/color_provider_manager.h"
#include "ui/native_theme/native_theme.h"
#if BUILDFLAG(IS_LINUX)
@@ -60,7 +58,6 @@
#if BUILDFLAG(IS_WIN)
#include "base/enterprise_util.h"
#include "base/files/file_util.h"
#include "chrome/browser/chrome_browser_main_win.h"
#include "chrome/browser/win/parental_controls.h"
#endif
@@ -85,6 +82,7 @@
#include "base/path_service.h"
#include "chrome/browser/themes/theme_service_aura_linux.h"
#include "chrome/browser/ui/views/theme_profile_key.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/grit/chromium_strings.h"
#include "components/os_crypt/sync/key_storage_config_linux.h"
#include "libcef/browser/printing/print_dialog_linux.h"
@@ -234,6 +232,8 @@ void AlloyBrowserMainParts::PostCreateMainMessageLoop() {
config->store = command_line->GetSwitchValueASCII(switches::kPasswordStore);
// Forward the product name (defaults to "Chromium").
config->product_name = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME);
// OSCrypt may target keyring, which requires calls from the main thread.
config->main_thread_runner = content::GetUIThreadTaskRunner({});
// OSCrypt can be disabled in a special settings file.
config->should_use_preference =
command_line->HasSwitch(switches::kEnableEncryptionSelection);
@@ -241,10 +241,6 @@ void AlloyBrowserMainParts::PostCreateMainMessageLoop() {
DCHECK(!config->user_data_path.empty());
OSCrypt::SetConfig(std::move(config));
#endif // BUILDFLAG(IS_LINUX)
#if BUILDFLAG(IS_WIN)
base::SetExtraNoExecuteAllowedPath(chrome::DIR_USER_DATA);
#endif
}
int AlloyBrowserMainParts::PreCreateThreads() {

View File

@@ -55,7 +55,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
#include "chrome/browser/media/webrtc/media_device_salt_service_factory.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/profile_network_context_service_factory.h"
#include "chrome/browser/net/system_network_context_manager.h"
@@ -86,7 +85,6 @@
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/embedder_support/switches.h"
#include "components/embedder_support/user_agent_utils.h"
#include "components/media_device_salt/media_device_salt_service.h"
#include "components/pdf/browser/pdf_navigation_throttle.h"
#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
#include "components/pdf/browser/pdf_web_contents_helper.h"
@@ -302,11 +300,11 @@ void BindNetworkHintsHandler(
predictors::NetworkHintsHandlerImpl::Create(frame_host, std::move(receiver));
}
base::FilePath GetUserDataPath() {
base::FilePath user_data_path;
base::PathService::Get(chrome::DIR_USER_DATA, &user_data_path);
DCHECK(!user_data_path.empty());
return user_data_path;
base::FilePath GetRootCachePath() {
// The CefContext::ValidateCachePath method enforces the requirement that all
// cache_path values be either equal to or a child of root_cache_path.
return base::FilePath(
CefString(&CefContext::Get()->settings().root_cache_path));
}
const extensions::Extension* GetEnabledExtensionFromSiteURL(
@@ -324,25 +322,6 @@ const extensions::Extension* GetEnabledExtensionFromSiteURL(
return registry->enabled_extensions().GetByID(site_url.host());
}
std::unique_ptr<blink::URLLoaderThrottle> CreateGoogleURLLoaderThrottle(
Profile* profile) {
chrome::mojom::DynamicParamsPtr dynamic_params =
chrome::mojom::DynamicParams::New(
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
/*bound_session_params=*/nullptr,
#endif
profile->GetPrefs()->GetBoolean(
policy::policy_prefs::kForceGoogleSafeSearch),
profile->GetPrefs()->GetInteger(
policy::policy_prefs::kForceYouTubeRestrict),
profile->GetPrefs()->GetString(prefs::kAllowedDomainsForApps));
return std::make_unique<GoogleURLLoaderThrottle>(
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
/*bound_session_request_throttled_listener=*/nullptr,
#endif
std::move(dynamic_params));
}
} // namespace
AlloyContentBrowserClient::AlloyContentBrowserClient() = default;
@@ -527,7 +506,35 @@ void AlloyContentBrowserClient::SiteInstanceGotProcess(
}
extensions::ProcessMap::Get(context)->Insert(
extension->id(), site_instance->GetProcess()->GetID());
extension->id(), site_instance->GetProcess()->GetID(),
site_instance->GetId());
}
void AlloyContentBrowserClient::SiteInstanceDeleting(
content::SiteInstance* site_instance) {
if (!extensions::ExtensionsEnabled()) {
return;
}
if (!site_instance->HasProcess()) {
return;
}
auto context = site_instance->GetBrowserContext();
auto registry = extensions::ExtensionRegistry::Get(context);
if (!registry) {
return;
}
auto extension = registry->enabled_extensions().GetExtensionOrAppByURL(
site_instance->GetSiteURL());
if (!extension) {
return;
}
extensions::ProcessMap::Get(context)->Remove(
extension->id(), site_instance->GetProcess()->GetID(),
site_instance->GetId());
}
void AlloyContentBrowserClient::BindHostReceiverForRenderer(
@@ -564,13 +571,13 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kMainBundlePath,
#endif
switches::kLocalesDirPath,
switches::kLogItems,
switches::kLogSeverity,
switches::kResourcesDirPath,
embedder_support::kUserAgent,
switches::kUserAgentProductAndVersion,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
}
const std::string& process_type =
@@ -588,7 +595,8 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kUncaughtExceptionStackSize,
network::switches::kUnsafelyTreatInsecureOriginAsSecure,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
if (extensions::ExtensionsEnabled()) {
content::RenderProcessHost* process =
@@ -616,7 +624,8 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
static const char* const kSwitchNames[] = {
switches::kLang,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
}
// Necessary to populate DIR_USER_DATA in sub-processes.
@@ -642,7 +651,8 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
static const char* const kSwitchNames[] = {
switches::kLogFile,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
}
if (crash_reporting::Enabled()) {
@@ -736,7 +746,6 @@ void AlloyContentBrowserClient::AllowCertificateError(
}
base::OnceClosure AlloyContentBrowserClient::SelectClientCertificate(
content::BrowserContext* browser_context,
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
@@ -913,28 +922,21 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles(
Profile* profile = Profile::FromBrowserContext(browser_context);
if (auto google_throttle = CreateGoogleURLLoaderThrottle(profile)) {
result.push_back(std::move(google_throttle));
}
return result;
}
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
AlloyContentBrowserClient::CreateURLLoaderThrottlesForKeepAlive(
const network::ResourceRequest& request,
content::BrowserContext* browser_context,
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
int frame_tree_node_id) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result;
Profile* profile = Profile::FromBrowserContext(browser_context);
if (auto google_throttle = CreateGoogleURLLoaderThrottle(profile)) {
result.push_back(std::move(google_throttle));
}
chrome::mojom::DynamicParamsPtr dynamic_params =
chrome::mojom::DynamicParams::New(
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
/*bound_session_params=*/nullptr,
#endif
profile->GetPrefs()->GetBoolean(
policy::policy_prefs::kForceGoogleSafeSearch),
profile->GetPrefs()->GetInteger(
policy::policy_prefs::kForceYouTubeRestrict),
profile->GetPrefs()->GetString(prefs::kAllowedDomainsForApps));
result.push_back(std::make_unique<GoogleURLLoaderThrottle>(
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
/*bound_session_request_throttled_listener=*/nullptr,
#endif
std::move(dynamic_params)));
return result;
}
@@ -942,9 +944,7 @@ AlloyContentBrowserClient::CreateURLLoaderThrottlesForKeepAlive(
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
AlloyContentBrowserClient::WillCreateURLLoaderRequestInterceptors(
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id,
int64_t navigation_id,
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) {
int frame_tree_node_id) {
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
interceptors;
@@ -1119,8 +1119,7 @@ bool AlloyContentBrowserClient::WillCreateURLLoaderFactory(
header_client,
bool* bypass_redirect_checks,
bool* disable_secure_dns,
network::mojom::URLLoaderFactoryOverridePtr* factory_override,
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) {
network::mojom::URLLoaderFactoryOverridePtr* factory_override) {
auto request_handler = net_service::CreateInterceptedRequestHandler(
browser_context, frame, render_process_id,
type == URLLoaderFactoryType::kNavigation,
@@ -1177,9 +1176,9 @@ bool AlloyContentBrowserClient::ConfigureNetworkContextParams(
network_context_params->cookieable_schemes =
cef_context->GetCookieableSchemes();
// TODO(cef): Remove this and add required NetworkAnonymizationKey,
// TODO(cef): Remove this and add required NetworkIsolationKeys,
// this is currently not the case and this was not required pre M84.
network_context_params->require_network_anonymization_key = false;
network_context_params->require_network_isolation_key = false;
return true;
}
@@ -1188,7 +1187,19 @@ bool AlloyContentBrowserClient::ConfigureNetworkContextParams(
// directories that are not returned by this method.
std::vector<base::FilePath>
AlloyContentBrowserClient::GetNetworkContextsParentDirectory() {
return {GetUserDataPath()};
base::FilePath user_data_path;
base::PathService::Get(chrome::DIR_USER_DATA, &user_data_path);
DCHECK(!user_data_path.empty());
const auto& root_cache_path = GetRootCachePath();
// root_cache_path may sometimes be empty or a child of user_data_path, so
// only return the one path in that case.
if (root_cache_path.empty() || user_data_path.IsParent(root_cache_path)) {
return {user_data_path};
}
return {user_data_path, root_cache_path};
}
bool AlloyContentBrowserClient::HandleExternalProtocol(
@@ -1299,7 +1310,7 @@ void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForServiceWorker(
base::FilePath
AlloyContentBrowserClient::GetSandboxedStorageServiceDataDirectory() {
return GetUserDataPath();
return GetRootCachePath();
}
std::string AlloyContentBrowserClient::GetProduct() {
@@ -1307,13 +1318,21 @@ std::string AlloyContentBrowserClient::GetProduct() {
}
std::string AlloyContentBrowserClient::GetChromeProduct() {
return std::string(version_info::GetProductNameAndVersionForUserAgent());
return version_info::GetProductNameAndVersionForUserAgent();
}
std::string AlloyContentBrowserClient::GetUserAgent() {
return embedder_support::GetUserAgent();
}
std::string AlloyContentBrowserClient::GetFullUserAgent() {
return embedder_support::GetFullUserAgent();
}
std::string AlloyContentBrowserClient::GetReducedUserAgent() {
return embedder_support::GetReducedUserAgent();
}
std::unique_ptr<content::WebContentsViewDelegate>
AlloyContentBrowserClient::GetWebContentsViewDelegate(
content::WebContents* web_contents) {
@@ -1321,8 +1340,18 @@ AlloyContentBrowserClient::GetWebContentsViewDelegate(
}
blink::UserAgentMetadata AlloyContentBrowserClient::GetUserAgentMetadata() {
return embedder_support::GetUserAgentMetadata(
g_browser_process->local_state());
blink::UserAgentMetadata metadata;
metadata.brand_version_list = {blink::UserAgentBrandVersion{
version_info::GetProductName(), version_info::GetMajorVersionNumber()}};
metadata.full_version = version_info::GetVersionNumber();
metadata.platform = version_info::GetOSType();
// TODO(mkwst): Poke at BuildUserAgentFromProduct to split out these pieces.
metadata.architecture = "";
metadata.model = "";
return metadata;
}
base::flat_set<std::string>
@@ -1337,32 +1366,16 @@ AlloyContentBrowserClient::GetPluginMimeTypesWithExternalHandlers(
return mime_types;
}
void AlloyContentBrowserClient::GetMediaDeviceIDSalt(
content::RenderFrameHost* rfh,
bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed(
content::BrowserContext* browser_context,
const GURL& url,
const net::SiteForCookies& site_for_cookies,
const blink::StorageKey& storage_key,
base::OnceCallback<void(bool, const std::string&)> callback) {
GURL url = rfh->GetLastCommittedURL();
url::Origin top_frame_origin = rfh->GetMainFrame()->GetLastCommittedOrigin();
content::BrowserContext* browser_context = rfh->GetBrowserContext();
const absl::optional<url::Origin>& top_frame_origin) {
// Persistent MediaDevice IDs are allowed if cookies are allowed.
scoped_refptr<content_settings::CookieSettings> cookie_settings =
CookieSettingsFactory::GetForProfile(
Profile::FromBrowserContext(browser_context));
bool allowed = cookie_settings->IsFullCookieAccessAllowed(
url, site_for_cookies, top_frame_origin,
cookie_settings->SettingOverridesForStorage());
media_device_salt::MediaDeviceSaltService* salt_service =
MediaDeviceSaltServiceFactory::GetInstance()->GetForBrowserContext(
browser_context);
if (!salt_service) {
std::move(callback).Run(allowed, browser_context->UniqueId());
return;
}
salt_service->GetSalt(rfh->GetStorageKey(),
base::BindOnce(std::move(callback), allowed));
return CookieSettingsFactory::GetForProfile(
Profile::FromBrowserContext(browser_context))
->IsFullCookieAccessAllowed(url, site_for_cookies, top_frame_origin,
net::CookieSettingOverrides());
}
void AlloyContentBrowserClient::OnWebContentsCreated(

View File

@@ -65,6 +65,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
bool IsWebUIAllowedToMakeNetworkRequests(const url::Origin& origin) override;
bool IsHandledURL(const GURL& url) override;
void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
void BindHostReceiverForRenderer(
content::RenderProcessHost* render_process_host,
mojo::GenericPendingReceiver receiver) override;
@@ -89,7 +90,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
base::OnceCallback<void(content::CertificateRequestResultType)> callback)
override;
base::OnceClosure SelectClientCertificate(
content::BrowserContext* browser_context,
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
@@ -130,19 +130,10 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id) override;
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
CreateURLLoaderThrottlesForKeepAlive(
const network::ResourceRequest& request,
content::BrowserContext* browser_context,
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
int frame_tree_node_id) override;
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
WillCreateURLLoaderRequestInterceptors(
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id,
int64_t navigation_id,
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner)
override;
int frame_tree_node_id) override;
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
void GetAdditionalMappedFilesForChildProcess(
@@ -188,9 +179,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
header_client,
bool* bypass_redirect_checks,
bool* disable_secure_dns,
network::mojom::URLLoaderFactoryOverridePtr* factory_override,
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner)
override;
network::mojom::URLLoaderFactoryOverridePtr* factory_override) override;
void OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) override;
bool ConfigureNetworkContextParams(
@@ -242,16 +231,18 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
std::string GetProduct() override;
std::string GetChromeProduct() override;
std::string GetUserAgent() override;
std::string GetFullUserAgent() override;
std::string GetReducedUserAgent() override;
std::unique_ptr<content::WebContentsViewDelegate> GetWebContentsViewDelegate(
content::WebContents* web_contents) override;
blink::UserAgentMetadata GetUserAgentMetadata() override;
base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(
content::BrowserContext* browser_context) override;
void GetMediaDeviceIDSalt(
content::RenderFrameHost* rfh,
bool ArePersistentMediaDeviceIDsAllowed(
content::BrowserContext* browser_context,
const GURL& scope,
const net::SiteForCookies& site_for_cookies,
const blink::StorageKey& storage_key,
base::OnceCallback<void(bool, const std::string&)> callback) override;
const absl::optional<url::Origin>& top_frame_origin) override;
void OnWebContentsCreated(content::WebContents* web_contents) override;
bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override;

View File

@@ -16,7 +16,6 @@
#include "libcef/common/extensions/extensions_util.h"
#include "base/command_line.h"
#include "base/path_service.h"
#include "chrome/browser/component_updater/chrome_component_updater_configurator.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/permissions/chrome_permissions_client.h"
@@ -25,7 +24,6 @@
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "chrome/browser/ui/prefs/pref_watcher.h"
#include "chrome/common/chrome_paths.h"
#include "components/component_updater/component_updater_service.h"
#include "components/component_updater/timer_update_scheduler.h"
#include "components/net_log/chrome_net_log.h"
@@ -34,6 +32,7 @@
#include "content/public/browser/network_service_instance.h"
#include "content/public/common/content_switches.h"
#include "net/log/net_log_capture_mode.h"
#include "services/device/public/cpp/geolocation/geolocation_manager.h"
#include "services/network/public/cpp/network_switches.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
@@ -145,6 +144,11 @@ void ChromeBrowserProcessAlloy::FlushLocalStateAndReply(
DCHECK(false);
}
device::GeolocationManager* ChromeBrowserProcessAlloy::geolocation_manager() {
DCHECK(false);
return nullptr;
}
metrics_services_manager::MetricsServicesManager*
ChromeBrowserProcessAlloy::GetMetricsServicesManager() {
DCHECK(false);
@@ -168,12 +172,6 @@ ChromeBrowserProcessAlloy::network_quality_tracker() {
return nullptr;
}
embedder_support::OriginTrialsSettingsStorage*
ChromeBrowserProcessAlloy::GetOriginTrialsSettingsStorage() {
DCHECK(false);
return nullptr;
}
ProfileManager* ChromeBrowserProcessAlloy::profile_manager() {
DCHECK(context_initialized_);
return profile_manager_.get();
@@ -182,15 +180,16 @@ ProfileManager* ChromeBrowserProcessAlloy::profile_manager() {
PrefService* ChromeBrowserProcessAlloy::local_state() {
DCHECK(initialized_);
if (!local_state_) {
base::FilePath user_data_path;
base::PathService::Get(chrome::DIR_USER_DATA, &user_data_path);
DCHECK(!user_data_path.empty());
// Use a location that is shared by all request contexts.
const CefSettings& settings = CefContext::Get()->settings();
const base::FilePath& root_cache_path =
base::FilePath(CefString(&settings.root_cache_path));
// Used for very early NetworkService initialization.
// Always persist preferences for this PrefService if possible because it
// contains the cookie encryption key on Windows.
local_state_ =
browser_prefs::CreatePrefService(nullptr /* profile */, user_data_path,
browser_prefs::CreatePrefService(nullptr /* profile */, root_cache_path,
true /* persist_user_preferences */);
}
return local_state_.get();
@@ -229,6 +228,11 @@ ChromeBrowserProcessAlloy::notification_platform_bridge() {
return nullptr;
}
void ChromeBrowserProcessAlloy::SetGeolocationManager(
std::unique_ptr<device::GeolocationManager> geolocation_manager) {
DCHECK(false);
}
policy::ChromeBrowserPolicyConnector*
ChromeBrowserProcessAlloy::browser_policy_connector() {
if (!browser_policy_connector_) {
@@ -417,12 +421,13 @@ ChromeBrowserProcessAlloy::serial_policy_allowed_ports() {
return nullptr;
}
HidSystemTrayIcon* ChromeBrowserProcessAlloy::hid_system_tray_icon() {
HidPolicyAllowedDevices*
ChromeBrowserProcessAlloy::hid_policy_allowed_devices() {
DCHECK(false);
return nullptr;
}
UsbSystemTrayIcon* ChromeBrowserProcessAlloy::usb_system_tray_icon() {
HidSystemTrayIcon* ChromeBrowserProcessAlloy::hid_system_tray_icon() {
DCHECK(false);
return nullptr;
}

View File

@@ -51,13 +51,12 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
// BrowserProcess implementation.
void EndSession() override;
void FlushLocalStateAndReply(base::OnceClosure reply) override;
device::GeolocationManager* geolocation_manager() override;
metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager()
override;
metrics::MetricsService* metrics_service() override;
SystemNetworkContextManager* system_network_context_manager() override;
network::NetworkQualityTracker* network_quality_tracker() override;
embedder_support::OriginTrialsSettingsStorage*
GetOriginTrialsSettingsStorage() override;
ProfileManager* profile_manager() override;
PrefService* local_state() override;
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory()
@@ -67,6 +66,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
extensions::EventRouterForwarder* extension_event_router_forwarder() override;
NotificationUIManager* notification_ui_manager() override;
NotificationPlatformBridge* notification_platform_bridge() override;
void SetGeolocationManager(
std::unique_ptr<device::GeolocationManager> geolocation_manager) override;
policy::ChromeBrowserPolicyConnector* browser_policy_connector() override;
policy::PolicyService* policy_service() override;
IconManager* icon_manager() override;
@@ -108,8 +109,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
override;
BuildState* GetBuildState() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
HidPolicyAllowedDevices* hid_policy_allowed_devices() override;
HidSystemTrayIcon* hid_system_tray_icon() override;
UsbSystemTrayIcon* usb_system_tray_icon() override;
private:
bool initialized_;

View File

@@ -8,7 +8,6 @@
#include "base/feature_list.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/media/router/chrome_media_router_factory.h"
#include "chrome/browser/media/webrtc/media_device_salt_service_factory.h"
#include "chrome/browser/plugins/plugin_prefs_factory.h"
#include "chrome/browser/profiles/renderer_updater_factory.h"
#include "chrome/browser/reduce_accept_language/reduce_accept_language_factory.h"
@@ -25,7 +24,6 @@ namespace cef {
void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
CookieSettingsFactory::GetInstance();
MediaDeviceSaltServiceFactory::GetInstance();
media_router::ChromeMediaRouterFactory::GetInstance();
PluginPrefsFactory::GetInstance();
PrefsTabHelper::GetServiceInstance();

View File

@@ -28,7 +28,6 @@
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/navigation_entry.h"
#include "ui/base/resource/resource_scale_factor.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/shell_dialogs/select_file_policy.h"
@@ -316,7 +315,7 @@ void CefBrowserHostBase::StartDownload(const CefString& url) {
void CefBrowserHostBase::DownloadImage(
const CefString& image_url,
bool is_favicon,
uint32_t max_image_size,
uint32 max_image_size,
bool bypass_cache,
CefRefPtr<CefDownloadImageCallback> callback) {
if (!CEF_CURRENTLY_ON_UIT()) {
@@ -341,12 +340,11 @@ void CefBrowserHostBase::DownloadImage(
return;
}
const float scale = ui::GetScaleForMaxSupportedResourceScaleFactor();
web_contents->DownloadImage(
gurl, is_favicon, gfx::Size(max_image_size, max_image_size),
max_image_size * scale, bypass_cache,
max_image_size * gfx::ImageSkia::GetMaxSupportedScale(), bypass_cache,
base::BindOnce(
[](uint32_t max_image_size,
[](uint32 max_image_size,
CefRefPtr<CefDownloadImageCallback> callback, int id,
int http_status_code, const GURL& image_url,
const std::vector<SkBitmap>& bitmaps,
@@ -765,7 +763,7 @@ CefRefPtr<CefFrame> CefBrowserHostBase::GetFocusedFrame() {
return GetFrame(CefFrameHostImpl::kFocusedFrameId);
}
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrame(int64_t identifier) {
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrame(int64 identifier) {
if (identifier == CefFrameHostImpl::kInvalidFrameId) {
return nullptr;
} else if (identifier == CefFrameHostImpl::kMainFrameId) {
@@ -796,8 +794,7 @@ size_t CefBrowserHostBase::GetFrameCount() {
return browser_info_->GetAllFrames().size();
}
void CefBrowserHostBase::GetFrameIdentifiers(
std::vector<int64_t>& identifiers) {
void CefBrowserHostBase::GetFrameIdentifiers(std::vector<int64>& identifiers) {
if (identifiers.size() > 0) {
identifiers.clear();
}

View File

@@ -179,7 +179,7 @@ class CefBrowserHostBase : public CefBrowserHost,
void StartDownload(const CefString& url) override;
void DownloadImage(const CefString& image_url,
bool is_favicon,
uint32_t max_image_size,
uint32 max_image_size,
bool bypass_cache,
CefRefPtr<CefDownloadImageCallback> callback) override;
void Print() override;
@@ -225,10 +225,10 @@ class CefBrowserHostBase : public CefBrowserHost,
bool IsPopup() override;
CefRefPtr<CefFrame> GetMainFrame() override;
CefRefPtr<CefFrame> GetFocusedFrame() override;
CefRefPtr<CefFrame> GetFrame(int64_t identifier) override;
CefRefPtr<CefFrame> GetFrame(int64 identifier) override;
CefRefPtr<CefFrame> GetFrame(const CefString& name) override;
size_t GetFrameCount() override;
void GetFrameIdentifiers(std::vector<int64_t>& identifiers) override;
void GetFrameIdentifiers(std::vector<int64>& identifiers) override;
void GetFrameNames(std::vector<CefString>& names) override;
// CefBrowserContentsDelegate::Observer methods:

View File

@@ -115,7 +115,7 @@ std::unique_ptr<base::MessagePump> MessagePumpFactoryForUI() {
}
#if BUILDFLAG(IS_MAC)
return base::message_pump_mac::Create();
return base::MessagePumpMac::Create();
#else
return std::make_unique<base::MessagePumpForUI>();
#endif

View File

@@ -5,30 +5,12 @@
#include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/thread_util.h"
#include "base/logging.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/shell_integration.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
namespace {
void ExecuteExternalProtocol(const GURL& url) {
CEF_REQUIRE_BLOCKING();
// Check that an application is associated with the scheme.
if (shell_integration::GetApplicationNameForScheme(url).empty()) {
return;
}
CEF_POST_TASK(TID_UI, base::BindOnce(&platform_util::OpenExternal, url));
}
} // namespace
CefBrowserPlatformDelegate::CefBrowserPlatformDelegate() = default;
CefBrowserPlatformDelegate::~CefBrowserPlatformDelegate() {
@@ -243,11 +225,6 @@ bool CefBrowserPlatformDelegate::IsNeverComposited(
return false;
}
// static
void CefBrowserPlatformDelegate::HandleExternalProtocol(const GURL& url) {
CEF_POST_USER_VISIBLE_TASK(base::BindOnce(ExecuteExternalProtocol, url));
}
CefEventHandle CefBrowserPlatformDelegate::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
DCHECK(false);
@@ -431,7 +408,7 @@ void CefBrowserPlatformDelegate::StopFinding(bool clearSelection) {
// static
int CefBrowserPlatformDelegate::TranslateWebEventModifiers(
uint32_t cef_modifiers) {
uint32 cef_modifiers) {
int result = 0;
// Set modifiers based on key state.
if (cef_modifiers & EVENTFLAG_CAPS_LOCK_ON) {

View File

@@ -379,7 +379,7 @@ class CefBrowserPlatformDelegate {
CefBrowserPlatformDelegate();
virtual ~CefBrowserPlatformDelegate();
static int TranslateWebEventModifiers(uint32_t cef_modifiers);
static int TranslateWebEventModifiers(uint32 cef_modifiers);
// Not owned by this object.
content::WebContents* web_contents_ = nullptr;

View File

@@ -11,8 +11,6 @@
#include "base/memory/scoped_refptr.h"
#include "chrome/browser/ui/page_action/page_action_icon_type.h"
#include "content/public/browser/web_contents_delegate.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/base/window_open_disposition.h"
class Browser;
@@ -35,8 +33,7 @@ class BrowserDelegate : public content::WebContentsDelegate {
// Called from the Browser constructor to create a new delegate.
static std::unique_ptr<BrowserDelegate> Create(
Browser* browser,
scoped_refptr<CreateParams> cef_params,
const Browser* opener);
scoped_refptr<CreateParams> cef_params);
~BrowserDelegate() override {}
@@ -106,29 +103,6 @@ class BrowserDelegate : public content::WebContentsDelegate {
content::MediaResponseCallback callback) {
return callback;
}
// Optionally override support for the specified window feature of type
// Browser::WindowFeature.
virtual absl::optional<bool> SupportsWindowFeature(int feature) const {
return absl::nullopt;
}
// Returns true if draggable regions are supported.
virtual bool SupportsDraggableRegion() const { return false; }
// Returns the draggable region, if any, relative to the web contents.
// Called from PictureInPictureBrowserFrameView::NonClientHitTest and
// BrowserView::ShouldDescendIntoChildForEventHandling.
virtual const absl::optional<SkRegion> GetDraggableRegion() const {
return absl::nullopt;
}
// Set the draggable region relative to web contents.
// Called from DraggableRegionsHostImpl::UpdateDraggableRegions.
virtual void UpdateDraggableRegion(const SkRegion& region) {}
// Called at the end of a fullscreen transition.
virtual void WindowFullscreenStateChanged() {}
};
} // namespace cef

View File

@@ -4,7 +4,6 @@
#include "libcef/browser/chrome/chrome_browser_context.h"
#include "libcef/browser/prefs/browser_prefs.h"
#include "libcef/browser/thread_util.h"
#include "base/threading/thread_restrictions.h"
@@ -168,8 +167,6 @@ void ChromeBrowserContext::ProfileCreated(Profile::CreateStatus status,
: SessionStartupPref::kPrefValueNewTab);
}
browser_prefs::SetInitialProfilePrefs(profile_);
if (!init_callbacks_.empty()) {
for (auto& callback : init_callbacks_) {
std::move(callback).Run();

View File

@@ -11,11 +11,8 @@
#include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/chrome/chrome_browser_host_impl.h"
#include "libcef/browser/chrome/views/chrome_browser_view.h"
#include "libcef/browser/media_access_query.h"
#include "libcef/browser/request_context_impl.h"
#include "libcef/browser/views/browser_view_impl.h"
#include "libcef/browser/views/window_impl.h"
#include "libcef/common/app_manager.h"
#include "libcef/common/frame_util.h"
@@ -30,19 +27,9 @@ using content::KeyboardEventProcessingResult;
ChromeBrowserDelegate::ChromeBrowserDelegate(
Browser* browser,
const CefBrowserCreateParams& create_params,
const Browser* opener)
const CefBrowserCreateParams& create_params)
: browser_(browser), create_params_(create_params) {
DCHECK(browser_);
if (opener) {
DCHECK(browser->is_type_picture_in_picture());
auto opener_host = ChromeBrowserHostImpl::GetBrowserForBrowser(opener);
DCHECK(opener_host);
if (opener_host) {
opener_host_ = opener_host->GetWeakPtr();
}
}
}
ChromeBrowserDelegate::~ChromeBrowserDelegate() = default;
@@ -208,73 +195,6 @@ ChromeBrowserDelegate::RequestMediaAccessPermissionEx(
return callback;
}
bool ChromeBrowserDelegate::SupportsFramelessPictureInPicture() const {
if (!browser_->is_type_picture_in_picture()) {
return false;
}
if (frameless_pip_.has_value()) {
return *frameless_pip_;
}
frameless_pip_ = false;
if (opener_host_) {
if (auto chrome_browser_view = opener_host_->chrome_browser_view()) {
if (auto cef_delegate = chrome_browser_view->cef_delegate()) {
frameless_pip_ = cef_delegate->UseFramelessWindowForPictureInPicture(
chrome_browser_view->cef_browser_view());
}
}
}
return *frameless_pip_;
}
absl::optional<bool> ChromeBrowserDelegate::SupportsWindowFeature(
int feature) const {
// Override the default value from
// Browser::PictureInPictureBrowserSupportsWindowFeature.
if (feature == Browser::FEATURE_TITLEBAR &&
browser_->is_type_picture_in_picture()) {
// Return false to hide titlebar and enable draggable regions.
return !SupportsFramelessPictureInPicture();
}
return absl::nullopt;
}
bool ChromeBrowserDelegate::SupportsDraggableRegion() const {
return SupportsFramelessPictureInPicture();
}
const absl::optional<SkRegion> ChromeBrowserDelegate::GetDraggableRegion()
const {
DCHECK(SupportsDraggableRegion());
return draggable_region_;
}
void ChromeBrowserDelegate::UpdateDraggableRegion(const SkRegion& region) {
DCHECK(SupportsDraggableRegion());
draggable_region_ = region;
}
void ChromeBrowserDelegate::WindowFullscreenStateChanged() {
// Use a synchronous callback for notification on Windows/Linux. MacOS gets
// notified asynchronously via CefNativeWidgetMac callbacks.
#if !BUILDFLAG(IS_MAC)
if (auto browser = ChromeBrowserHostImpl::GetBrowserForBrowser(browser_)) {
if (auto chrome_browser_view = browser->chrome_browser_view()) {
auto* cef_window = chrome_browser_view->cef_browser_view()->cef_window();
if (auto* delegate = cef_window->delegate()) {
// Give the CefWindowDelegate a chance to handle the event.
delegate->OnWindowFullscreenTransition(cef_window,
/*is_completed=*/true);
}
}
}
#endif
}
void ChromeBrowserDelegate::WebContentsCreated(
content::WebContents* source_contents,
int opener_render_process_id,
@@ -477,12 +397,7 @@ namespace cef {
// static
std::unique_ptr<BrowserDelegate> BrowserDelegate::Create(
Browser* browser,
scoped_refptr<CreateParams> cef_params,
const Browser* opener) {
if (!cef::IsChromeRuntimeEnabled()) {
return nullptr;
}
scoped_refptr<CreateParams> cef_params) {
CefBrowserCreateParams create_params;
// Parameters from ChromeBrowserHostImpl::Create, or nullptr if the Browser
@@ -497,8 +412,7 @@ std::unique_ptr<BrowserDelegate> BrowserDelegate::Create(
params->create_params_.browser_view = nullptr;
}
return std::make_unique<ChromeBrowserDelegate>(browser, create_params,
opener);
return std::make_unique<ChromeBrowserDelegate>(browser, create_params);
}
} // namespace cef

View File

@@ -40,8 +40,7 @@ class ChromeBrowserHostImpl;
class ChromeBrowserDelegate : public cef::BrowserDelegate {
public:
ChromeBrowserDelegate(Browser* browser,
const CefBrowserCreateParams& create_params,
const Browser* opener);
const CefBrowserCreateParams& create_params);
ChromeBrowserDelegate(const ChromeBrowserDelegate&) = delete;
ChromeBrowserDelegate& operator=(const ChromeBrowserDelegate&) = delete;
@@ -66,11 +65,6 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
content::MediaResponseCallback callback) override;
absl::optional<bool> SupportsWindowFeature(int feature) const override;
bool SupportsDraggableRegion() const override;
const absl::optional<SkRegion> GetDraggableRegion() const override;
void UpdateDraggableRegion(const SkRegion& region) override;
void WindowFullscreenStateChanged() override;
// WebContentsDelegate methods:
void WebContentsCreated(content::WebContents* source_contents,
@@ -119,17 +113,12 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
CefBrowserContentsDelegate* GetDelegateForWebContents(
content::WebContents* web_contents);
bool SupportsFramelessPictureInPicture() const;
Browser* const browser_;
base::WeakPtr<ChromeBrowserHostImpl> opener_host_;
// Used when creating a new browser host.
const CefBrowserCreateParams create_params_;
absl::optional<bool> show_status_bubble_;
absl::optional<SkRegion> draggable_region_;
mutable absl::optional<bool> frameless_pip_;
};
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_DELEGATE_H_

View File

@@ -332,13 +332,6 @@ bool ChromeBrowserHostImpl::IsBackgroundHost() {
return false;
}
ChromeBrowserView* ChromeBrowserHostImpl::chrome_browser_view() const {
if (browser_ && is_views_hosted_) {
return static_cast<ChromeBrowserView*>(browser_->window());
}
return nullptr;
}
bool ChromeBrowserHostImpl::Navigate(const content::OpenURLParams& params) {
CEF_REQUIRE_UIT();
if (GetCurrentTabIndex() == TabStripModel::kNoTab) {
@@ -420,7 +413,8 @@ Browser* ChromeBrowserHostImpl::CreateBrowser(
auto view_impl =
static_cast<CefBrowserViewImpl*>(params.browser_view.get());
chrome_browser_view = view_impl->chrome_browser_view();
chrome_browser_view =
static_cast<ChromeBrowserView*>(view_impl->root_view());
chrome_params.window = chrome_browser_view;
auto chrome_widget =
@@ -439,7 +433,8 @@ Browser* ChromeBrowserHostImpl::CreateBrowser(
if (chrome_browser_view) {
// Initialize the BrowserFrame and BrowserView and create the controls that
// require access to the Browser.
chrome_browser_view->InitBrowser(base::WrapUnique(browser));
chrome_browser_view->InitBrowser(base::WrapUnique(browser),
params.browser_view);
// Don't set theme colors in ContentsWebView::UpdateBackgroundColor.
chrome_browser_view->contents_web_view()->SetBackgroundVisible(false);
@@ -519,8 +514,10 @@ void ChromeBrowserHostImpl::SetBrowser(Browser* browser) {
void ChromeBrowserHostImpl::WindowDestroyed() {
CEF_REQUIRE_UIT();
if (auto view = chrome_browser_view()) {
view->Destroyed();
if (browser_ && is_views_hosted_) {
auto chrome_browser_view =
static_cast<ChromeBrowserView*>(browser_->window());
chrome_browser_view->Destroyed();
}
platform_delegate_->CloseHostWindow();
@@ -535,7 +532,6 @@ bool ChromeBrowserHostImpl::WillBeDestroyed() const {
void ChromeBrowserHostImpl::DestroyBrowser() {
CEF_REQUIRE_UIT();
browser_ = nullptr;
weak_ptr_factory_.InvalidateWeakPtrs();
OnBeforeClose();
OnBrowserDestroyed();

View File

@@ -11,11 +11,8 @@
#include "libcef/browser/browser_host_base.h"
#include "libcef/browser/chrome/browser_delegate.h"
#include "base/memory/weak_ptr.h"
class Browser;
class ChromeBrowserDelegate;
class ChromeBrowserView;
// CefBrowser implementation for the chrome runtime. Method calls are delegated
// to the chrome Browser object or the WebContents as appropriate. See the
@@ -117,15 +114,6 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase {
CefRefPtr<CefExtension> GetExtension() override;
bool IsBackgroundHost() override;
Browser* browser() const { return browser_; }
// Return the CEF specialization of BrowserView.
ChromeBrowserView* chrome_browser_view() const;
base::WeakPtr<ChromeBrowserHostImpl> GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
protected:
bool Navigate(const content::OpenURLParams& params) override;
@@ -169,8 +157,6 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase {
Browser* browser_ = nullptr;
CefWindowHandle host_window_handle_ = kNullWindowHandle;
base::WeakPtrFactory<ChromeBrowserHostImpl> weak_ptr_factory_{this};
};
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_HOST_IMPL_H_

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