diff --git a/api/cefpython.md b/api/cefpython.md index dd868d00..e68d0231 100644 --- a/api/cefpython.md +++ b/api/cefpython.md @@ -239,11 +239,12 @@ Post a task for execution on the thread associated with this task runner. Execut List of threads in the Browser process: * cef.TID_UI: The main thread in the browser. This will be the same as the main application thread if cefpython.Initialize() is called with a ApplicationSettings.multi_threaded_message_loop value of false. Do not perform blocking tasks on this thread. All tasks posted after CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() are guaranteed to run. This thread will outlive all other CEF threads. -* cef.TID_DB: Used to interact with the database. -* cef.TID_FILE: Used for blocking tasks (e.g. file system access) where the user won't notice if the task takes an arbitrarily long time to complete. All tasks posted after CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() are guaranteed to run. +* cef.TID_FILE (alias cef.TID_FILE_BACKGROUND): Used for blocking tasks (e.g. file system access) where the user won't notice if the task takes an arbitrarily long time to complete. All tasks posted after CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() are guaranteed to run. +* cef.TID_FILE_USER_VISIBLE: Used for blocking tasks (e.g. file system access) that affect UI or responsiveness of future user interactions. Do not use if an immediate response to a user interaction is expected. All tasks posted after CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() are guaranteed to run. Examples: + - Updating the UI to reflect progress on a long task. + - Loading data that might be shown in the UI after a future user + interaction. * cef.TID_FILE_USER_BLOCKING: Used for blocking tasks (e.g. file system access) that affect UI immediately after a user interaction. All tasks posted after CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() are guaranteed to run. Example: Generating data shown in the UI immediately after a click. -* cef.TID_PROCESS_LAUNCHER: Used to launch and terminate browser processes. -* cef.TID_CACHE: Used to handle slow HTTP cache operations. * cef.TID_IO: Used to process IPC and network messages. Do not perform blocking tasks on this thread. All tasks posted after CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() are guaranteed to run. List of threads in the Renderer process: diff --git a/docs/Migration-guide.md b/docs/Migration-guide.md index c83d702f..2361a8ff 100644 --- a/docs/Migration-guide.md +++ b/docs/Migration-guide.md @@ -42,6 +42,7 @@ Table of contents: * [v66+ RequestHandler.OnBeforeBrowse has a new param 'user_gesture'](#v66-requesthandleronbeforebrowse-has-a-new-param-user_gesture) * [v66+ Window transparency changes](#v66-window-transparency-changes) * [v66+ BrowserSettings.javascript_open_windows_disallowed option was removed](#v66-browsersettingsjavascript_open_windows_disallowed-option-was-removed) +* [v66+ Threads removed: TID_DB, TID_PROCESS_LAUNCHER, TID_CACHE](#v66-threads-removed-tid_db-tid_process_launcher-tid_cache) @@ -351,3 +352,12 @@ only on Linux (got it working on Fedora with just a change in window setting). The BrowserSettings.`javascript_open_windows_disallowed` option was removed (setting it will do nothing). + +## v66+ Threads removed: TID_DB, TID_PROCESS_LAUNCHER, TID_CACHE + +These threads and their corresponding constants in the cefpython module +were removed: TID_DB, TID_PROCESS_LAUNCHER, TID_CACHE. + +New threads were added, see cefpython.[PostTask](../api/cefpython.md#posttask) +description for a complete list of threads. + diff --git a/src/cef_v59..v66_changes.txt b/src/cef_v59..v66_changes.txt index f9a1d58f..8a5cf161 100644 --- a/src/cef_v59..v66_changes.txt +++ b/src/cef_v59..v66_changes.txt @@ -46,10 +46,11 @@ internal/cef_types.h - + cef_settings_t: - + javascript_open_windows option removed (keep a dummy for BC) - + update Migration Guide -- cef_thread_id_t: - - TID_DB removed (update Migration Guide) - - TID_PROCESS_LAUNCHER removed (update Migration Guide) - - TID_CACHE removed (update Migration Guide) +- + cef_thread_id_t: + - + TID_DB removed (update Migration Guide) + - + TID_PROCESS_LAUNCHER removed (update Migration Guide) + - + TID_CACHE removed (update Migration Guide) + - + Added threads: TID_FILE_BACKGROUND, TID_FILE_USER_VISIBLE NEW FEATURES diff --git a/src/extern/cef/cef_types.pxd b/src/extern/cef/cef_types.pxd index f242cee7..2ce54c0f 100644 --- a/src/extern/cef/cef_types.pxd +++ b/src/extern/cef/cef_types.pxd @@ -122,11 +122,10 @@ cdef extern from "include/internal/cef_types.h": ctypedef enum cef_thread_id_t: TID_UI, - TID_DB, + TID_FILE_BACKGROUND TID_FILE, + TID_FILE_USER_VISIBLE TID_FILE_USER_BLOCKING, - TID_PROCESS_LAUNCHER, - TID_CACHE, TID_IO, TID_RENDERER diff --git a/src/task.pyx b/src/task.pyx index 2af14983..c8d7e1a6 100644 --- a/src/task.pyx +++ b/src/task.pyx @@ -12,7 +12,7 @@ def PostTask(int thread, object func, *args): # Validate threadId. if thread not in g_browserProcessThreads: - raise Exception("PoastTask failed: requires a browser process thread") + raise Exception("PostTask failed: requires a browser process thread") # Validate func. if not IsFunctionOrMethod(type(func)): @@ -39,7 +39,7 @@ def PostDelayedTask(int thread, int delay_ms, object func, *args): # Validate threadId. if thread not in g_browserProcessThreads: - raise Exception("PoastTask failed: requires a browser process thread") + raise Exception("PostTask failed: requires a browser process thread") # Validate func. if not IsFunctionOrMethod(type(func)): diff --git a/src/utils.pyx b/src/utils.pyx index e253e9f7..2832d730 100644 --- a/src/utils.pyx +++ b/src/utils.pyx @@ -8,20 +8,19 @@ include "cefpython.pyx" cimport cef_types TID_UI = cef_types.TID_UI -TID_DB = cef_types.TID_DB +TID_FILE_BACKGROUND = cef_types.TID_FILE_BACKGROUND TID_FILE = cef_types.TID_FILE +TID_FILE_USER_VISIBLE = cef_types.TID_FILE_USER_VISIBLE TID_FILE_USER_BLOCKING = cef_types.TID_FILE_USER_BLOCKING -TID_PROCESS_LAUNCHER = cef_types.TID_PROCESS_LAUNCHER -TID_CACHE = cef_types.TID_CACHE TID_IO = cef_types.TID_IO TID_RENDERER = cef_types.TID_RENDERER g_browserProcessThreads = [ TID_UI, - TID_DB, + TID_FILE_BACKGROUND, TID_FILE, + TID_FILE_USER_VISIBLE TID_FILE_USER_BLOCKING, - TID_CACHE, TID_IO, ]