Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cefpython123 #669

Merged
merged 33 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
523362f
py3 update for automate-git.py and automate.py
Jan 28, 2024
5a5df95
--disable-syntax-validation option at gclient has been removed from u…
Jan 28, 2024
41e0b97
Add support for Python 3.8 and Upgrade Cython (#594)
gmjosack Feb 14, 2021
92a6c69
update spotify prebuilt cef url
Jan 28, 2024
e8a5dc7
fix
Jan 29, 2024
f49ab60
add support for cef 123 version
May 11, 2024
24abdc3
Fix CefListValue "int index" params (#461).
cztomczak Jan 14, 2020
5309afe
getting partical fix from https://github.com/cztomczak/cefpython/comm…
May 12, 2024
0a6a22d
getting partical fix (part 2) from https://github.com/cztomczak/cefpy…
May 12, 2024
daacb75
undo previous unittest change (partly)
May 12, 2024
748f104
Fix V8ContextHandler.OnContextCreated and OnContextReleased (#484).
cztomczak Jan 17, 2020
cd70070
add python311 support
May 12, 2024
e67aa83
undo previous accidental change to common.py
May 12, 2024
2c8819c
update misc place for py311 support
May 12, 2024
af864f0
better handle MainMessageLoopExternalPump, remove some previouis test…
May 19, 2024
cffcf93
add mainframe validation at javascript_bindings.pyx
May 25, 2024
b7aa32c
undo unexpected change to src/compile_time_constatns.pxi
linesight Feb 10, 2025
ffbfdad
not use obsolete base/cef_ptr_util.h
linesight Feb 10, 2025
b3d38bc
add back cef_mac.h and cef_linux.h
linesight Feb 11, 2025
615af96
address pull request feedback
linesight Feb 11, 2025
52edcd8
restore previous language_level line at cython_setup.py
linesight Feb 11, 2025
720782b
remove obsolete stuff
linesight Feb 11, 2025
44fda11
Merge branch 'master' into cefpython123
linesight Feb 13, 2025
3550c40
delete previously commented code
linesight Feb 15, 2025
c68cb2e
address pull request feedback
linesight Feb 15, 2025
cf1778b
delete previously commented code
linesight Feb 15, 2025
541f136
update osr_test.py to respect current event data type
linesight Feb 15, 2025
c4c0806
delete OnPluginCrashed; add initial implementation of CanSendCookie a…
linesight Feb 16, 2025
8286fb1
add back upstream cef 6312 branch's cef_types_linux.h and cef_types_m…
linesight Feb 17, 2025
099f5a1
remove commented SendProcessMessage from cef_browser.pxd
linesight Feb 17, 2025
eddbce1
one more place to use str type for uniqueFrameId
linesight Feb 17, 2025
db1d3ac
bring back SendFocusEvent in browser.pyx for backward compatibility
linesight Feb 17, 2025
1585ccf
replace ondomread.py example using example.com, as google.com website…
linesight Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/common/cefpython_public_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#include "../../build/build_cefpython/cefpython_py37_fixed.h"
#elif PY_MINOR_VERSION == 8
#include "../../build/build_cefpython/cefpython_py38_fixed.h"
#elif PY_MINOR_VERSION == 9
#include "../../build/build_cefpython/cefpython_py39_fixed.h"
#elif PY_MINOR_VERSION == 10
#include "../../build/build_cefpython/cefpython_py310_fixed.h"
#endif // PY_MINOR_VERSION
#endif // PY_MAJOR_VERSION

Expand Down
4 changes: 0 additions & 4 deletions src/compile_time_constants.pxi
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This file was generated by setup.py

# Type this command to ignore changes to this file:
# git update-index --assume-unchanged src/compile_time_constants.pxi

DEF UNAME_SYSNAME = "Windows"
DEF PY_MAJOR_VERSION = 3
1 change: 1 addition & 0 deletions src/extern/cef/cef_request.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ cdef extern from "include/cef_request.h":
# noinspection PyUnresolvedReferences
ctypedef cef_postdataelement_type_t ElementType

@staticmethod
cdef CefRefPtr[CefPostDataElement] CefPostDataElement_Create \
"CefPostDataElement::Create"()
cdef cppclass CefPostDataElement:
Expand Down
4 changes: 3 additions & 1 deletion src/extern/cef/cef_values.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ from libcpp.vector cimport vector
from cef_types cimport cef_value_type_t

cdef extern from "include/cef_values.h":
@staticmethod
cdef CefRefPtr[CefBinaryValue] CefBinaryValue_Create \
"CefBinaryValue::Create"(const void* data, size_t data_size)

Expand All @@ -31,7 +32,8 @@ cdef extern from "include/cef_values.h":
CefRefPtr[CefBinaryValue] Copy()
size_t GetSize()
size_t GetData(void* buffer_, size_t buffer_size, size_t data_offset)


@staticmethod
cdef CefRefPtr[CefDictionaryValue] CefDictionaryValue_Create \
"CefDictionaryValue::Create"()

Expand Down
12 changes: 6 additions & 6 deletions src/version/cef_version_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
#ifndef CEF_INCLUDE_CEF_VERSION_H_
#define CEF_INCLUDE_CEF_VERSION_H_

#define CEF_VERSION "3.3359.1774.gd49d25f"
#define CEF_VERSION "120.2.7+g4bc6a59+chromium-120.0.6099.234"
#define CEF_VERSION_MAJOR 3
#define CEF_COMMIT_NUMBER 1774
#define CEF_COMMIT_HASH "d49d25f881b68f418e243e12801cbbb7caebb563"
#define CEF_COMMIT_NUMBER 6099
#define CEF_COMMIT_HASH "4bc6a5995a1aaa0bd39c87dc87a10c713a3d1553"
#define COPYRIGHT_YEAR 2018

#define CHROME_VERSION_MAJOR 66
#define CHROME_VERSION_MAJOR 120
#define CHROME_VERSION_MINOR 0
#define CHROME_VERSION_BUILD 3359
#define CHROME_VERSION_PATCH 181
#define CHROME_VERSION_BUILD 6099
#define CHROME_VERSION_PATCH 234

#define DO_MAKE_STRING(p) #p
#define MAKE_STRING(p) DO_MAKE_STRING(p)
Expand Down
45 changes: 27 additions & 18 deletions tools/automate-git.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,12 @@ def check_pattern_matches(output_file=None):
dest='armbuild',
default=False,
help='Create an ARM build.')
parser.add_option(
'--with-pgo-profiles',
action='store_true',
dest='withpgoprofiles',
default=False,
help='Download PGO profiles for the build.')

# Test-related options.
parser.add_option(
Expand Down Expand Up @@ -1401,25 +1407,28 @@ def check_pattern_matches(output_file=None):
# Exclude unnecessary directories. Intentionally written without newlines.
gclient_spec = \
"solutions = [{"+\
"u'managed': False,"+\
"u'name': u'src', "+\
"u'url': u'" + chromium_url + "', "+\
"u'custom_deps': {"+\
"u'build': None, "+\
"u'build/scripts/command_wrapper/bin': None, "+\
"u'build/scripts/gsd_generate_index': None, "+\
"u'build/scripts/private/data/reliability': None, "+\
"u'build/scripts/tools/deps2git': None, "+\
"u'build/third_party/lighttpd': None, "+\
"u'commit-queue': None, "+\
"u'depot_tools': None, "+\
"u'src/chrome_frame/tools/test/reference_build/chrome': None, "+\
"u'src/chrome/tools/test/reference_build/chrome_linux': None, "+\
"u'src/chrome/tools/test/reference_build/chrome_mac': None, "+\
"u'src/chrome/tools/test/reference_build/chrome_win': None, "+\
"'managed': False,"+\
"'name': 'src', "+\
"'url': '" + chromium_url + "', "+\
"'custom_vars': {"+\
"'checkout_pgo_profiles': " + ('True' if options.withpgoprofiles else 'False') + ", "+\
"}, "+\
"'custom_deps': {"+\
"'build': None, "+\
"'build/scripts/command_wrapper/bin': None, "+\
"'build/scripts/gsd_generate_index': None, "+\
"'build/scripts/private/data/reliability': None, "+\
"'build/scripts/tools/deps2git': None, "+\
"'build/third_party/lighttpd': None, "+\
"'commit-queue': None, "+\
"'depot_tools': None, "+\
"'src/chrome_frame/tools/test/reference_build/chrome': None, "+\
"'src/chrome/tools/test/reference_build/chrome_linux': None, "+\
"'src/chrome/tools/test/reference_build/chrome_mac': None, "+\
"'src/chrome/tools/test/reference_build/chrome_win': None, "+\
"}, "+\
"u'deps_file': u'" + deps_file + "', "+\
"u'safesync_url': u''"+\
"'deps_file': '" + deps_file + "', "+\
"'safesync_url': ''"+\
"}]"

msg('Writing file: %s' % gclient_file)
Expand Down
6 changes: 4 additions & 2 deletions tools/automate.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def setup_options(docopt_args):
# --gyp-msvs-version
if not Options.gyp_msvs_version:
if int(Options.cef_branch) >= 2704:
Options.gyp_msvs_version = "2015"
Options.gyp_msvs_version = "2022"
else:
Options.gyp_msvs_version = "2013"

Expand Down Expand Up @@ -870,6 +870,7 @@ def get_available_python_compilers():
("2008", VS2008_VCVARS),
("2010", VS2010_VCVARS),
("2015", VS2015_VCVARS),
("2022", VS2015_VCVARS),
])
ret_compilers = OrderedDict()
for msvs in all_python_compilers:
Expand Down Expand Up @@ -980,7 +981,7 @@ def run_automate_git():
"""
Example automate-git.py command:
C:\chromium>call python automate-git.py --download-dir=./test/
--branch=2526 --no-debug-build --verbose-build
--branch=2526 --no-debug-build --verbose-build --with-pgo-profiles
Run ninja build manually:
cd chromium/src
ninja -v -j2 -Cout\Release cefclient
Expand All @@ -1006,6 +1007,7 @@ def run_automate_git():
if Options.force_chromium_update:
args.append("--force-update")
args.append("--no-distrib-archive")
args.append("--with-pgo-profiles")
if platform.system() == "Linux":
# Building cefclient target isn't supported on Linux when
# using sysroot (cef/#1916). However building cefclient
Expand Down
1 change: 1 addition & 0 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ def build_cefpython_module():
enable_line_tracing=enable_line_tracing))
if FAST_FLAG:
command += " --fast"
print('cython:', command)
ret = subprocess.call(command, shell=True)

# if DEBUG_FLAG:
Expand Down
2 changes: 1 addition & 1 deletion tools/build_cpp_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def build_cefpython_app_library():


def build_subprocess_executable():
print("[buil_cpp_projects.py] Build executable: subprocess")
print("[build_cpp_projects.py] Build executable: subprocess")
compiler = get_compiler(static=True)
sources = get_sources(SUBPROCESS_DIR,
exclude_names=["print_handler_gtk.cpp"])
Expand Down
10 changes: 5 additions & 5 deletions tools/build_distrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
ALLOW_PARTIAL = False

# Python versions
SUPPORTED_PYTHON_VERSIONS = [(2, 7), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8)]
SUPPORTED_PYTHON_VERSIONS = [(2, 7), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3, 10)]

# Python search paths. It will use first Python found for specific version.
# Supports replacement of one environment variable in path eg.: %ENV_KEY%.
Expand Down Expand Up @@ -273,7 +273,7 @@ def search_for_pythons(search_arch):
.format(executable=python))
sys.exit(1)
version_str = subprocess.check_output([python, "-c",
version_code])
version_code]).decode()
version_str = version_str.strip()
match = re.search("^\((\d+), (\d+), (\d+)\)$", version_str)
assert match, version_str
Expand All @@ -284,7 +284,7 @@ def search_for_pythons(search_arch):
version_tuple3 = (int(major), int(minor), int(micro))
arch_code = ("import platform;"
"print(str(platform.architecture()[0]));")
arch = subprocess.check_output([python, "-c", arch_code])
arch = subprocess.check_output([python, "-c", arch_code]).decode()
arch = arch.strip()
if version_tuple2 in SUPPORTED_PYTHON_VERSIONS \
and arch == search_arch:
Expand Down Expand Up @@ -376,8 +376,8 @@ def uninstall_cefpython3_packages(pythons):
command = ("\"{python}\" -m pip show cefpython3"
.format(python=python["executable"]))
try:
output = subprocess.check_output(command, shell=True)
except subprocess.CalledProcessError, exc:
output = subprocess.check_output(command, shell=True).decode()
except subprocess.CalledProcessError as exc:
# pip show returns error code when package is not installed
output = exc.output
if not len(output.strip()):
Expand Down
14 changes: 9 additions & 5 deletions tools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
CEF_POSTFIX2 = "unknown" # Upstream CEF binaries postfix

if OS_POSTFIX == "win":
OS_POSTFIX2 = "win32" if ARCH32 else "win64"
OS_POSTFIX2 = "windows32" if ARCH32 else "windows64"
CEF_POSTFIX2 = "windows32" if ARCH32 else "windows64"
elif OS_POSTFIX == "mac":
OS_POSTFIX2 = "mac32" if ARCH32 else "mac64"
Expand Down Expand Up @@ -219,8 +219,7 @@

VS_PLATFORM_ARG = "x86" if ARCH32 else "amd64"

VS2015_VCVARS = ("C:\\Program Files (x86)\\Microsoft Visual Studio 14.0"
"\\VC\\vcvarsall.bat")
VS2015_VCVARS = (r"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat")

VS2013_VCVARS = ("C:\\Program Files (x86)\\Microsoft Visual Studio 12.0"
"\\VC\\vcvarsall.bat")
Expand Down Expand Up @@ -270,7 +269,8 @@ def get_python_include_path():
# 3) ~/.pyenv/versions/3.4.6/include/python2.7m
# 4) /usr/include/python2.7
base_dir = os.path.dirname(sys.executable)
try_dirs = ["{base_dir}/include",
try_dirs = [r"C:\Users\opopp\AppData\Local\Programs\Python\Python310\include",
"{base_dir}/include",
"{base_dir}/../include/python{ver}",
"{base_dir}/../include/python{ver}*",
("{base_dir}/../Frameworks/Python.framework/Versions/{ver}"
Expand Down Expand Up @@ -451,7 +451,7 @@ def get_cefpython_version():


def get_version_from_file(header_file):
with open(header_file, "rU") as fp:
with open(header_file, "r") as fp:
contents = fp.read() # no need to decode() as "rU" specified
ret = dict()
matches = re.findall(r'^#define (\w+) "?([^\s"]+)"?', contents,
Expand All @@ -475,6 +475,10 @@ def get_msvs_for_python(vs_prefix=False):
return "VS2015" if vs_prefix else "2015"
elif sys.version_info[:2] == (3, 8):
return "VS2015" if vs_prefix else "2015"
elif sys.version_info[:2] == (3, 9):
return "VS2015" if vs_prefix else "2015"
elif sys.version_info[:2] == (3, 10):
return "VS2015" if vs_prefix else "2022"
else:
print("ERROR: This version of Python is not supported")
sys.exit(1)
Expand Down
2 changes: 2 additions & 0 deletions tools/cython_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,15 @@ def get_winsdk_lib():
if WINDOWS:
if ARCH32:
winsdk_libs = [
r"C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10",
r"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib",
r"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0\\Lib",
# Visual Studio 2008 installation
r"C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Lib",
]
elif ARCH64:
winsdk_libs = [
r"C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10",
r"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib\\x64",
r"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0\\Lib\\x64",
# Visual Studio 2008 installation
Expand Down
2 changes: 1 addition & 1 deletion tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Cython == 0.29.21
Cython == 0.29.37
docopt >= 0.6.2
setuptools
wheel
Expand Down