Skip to content

Commit b1769a5

Browse files
committed
Remove threads: TID_DB, TID_CACHE, TID_PROCESS_LAUNCHER and add new (cztomczak#403)
1 parent 37fecd8 commit b1769a5

File tree

6 files changed

+28
-18
lines changed

6 files changed

+28
-18
lines changed

api/cefpython.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,12 @@ Post a task for execution on the thread associated with this task runner. Execut
239239

240240
List of threads in the Browser process:
241241
* 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.
242-
* cef.TID_DB: Used to interact with the database.
243-
* 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.
242+
* 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.
243+
* 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:
244+
- Updating the UI to reflect progress on a long task.
245+
- Loading data that might be shown in the UI after a future user
246+
interaction.
244247
* 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.
245-
* cef.TID_PROCESS_LAUNCHER: Used to launch and terminate browser processes.
246-
* cef.TID_CACHE: Used to handle slow HTTP cache operations.
247248
* 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.
248249

249250
List of threads in the Renderer process:

docs/Migration-guide.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Table of contents:
4242
* [v66+ RequestHandler.OnBeforeBrowse has a new param 'user_gesture'](#v66-requesthandleronbeforebrowse-has-a-new-param-user_gesture)
4343
* [v66+ Window transparency changes](#v66-window-transparency-changes)
4444
* [v66+ BrowserSettings.javascript_open_windows_disallowed option was removed](#v66-browsersettingsjavascript_open_windows_disallowed-option-was-removed)
45+
* [v66+ Threads removed: TID_DB, TID_PROCESS_LAUNCHER, TID_CACHE](#v66-threads-removed-tid_db-tid_process_launcher-tid_cache)
4546

4647

4748

@@ -351,3 +352,12 @@ only on Linux (got it working on Fedora with just a change in window setting).
351352
The BrowserSettings.`javascript_open_windows_disallowed` option was removed
352353
(setting it will do nothing).
353354

355+
356+
## v66+ Threads removed: TID_DB, TID_PROCESS_LAUNCHER, TID_CACHE
357+
358+
These threads and their corresponding constants in the cefpython module
359+
were removed: TID_DB, TID_PROCESS_LAUNCHER, TID_CACHE.
360+
361+
New threads were added, see cefpython.[PostTask](../api/cefpython.md#posttask)
362+
description for a complete list of threads.
363+

src/cef_v59..v66_changes.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ internal/cef_types.h
4646
- + cef_settings_t:
4747
- + javascript_open_windows option removed (keep a dummy for BC)
4848
- + update Migration Guide
49-
- cef_thread_id_t:
50-
- TID_DB removed (update Migration Guide)
51-
- TID_PROCESS_LAUNCHER removed (update Migration Guide)
52-
- TID_CACHE removed (update Migration Guide)
49+
- + cef_thread_id_t:
50+
- + TID_DB removed (update Migration Guide)
51+
- + TID_PROCESS_LAUNCHER removed (update Migration Guide)
52+
- + TID_CACHE removed (update Migration Guide)
53+
- + Added threads: TID_FILE_BACKGROUND, TID_FILE_USER_VISIBLE
5354

5455

5556
NEW FEATURES

src/extern/cef/cef_types.pxd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,10 @@ cdef extern from "include/internal/cef_types.h":
122122

123123
ctypedef enum cef_thread_id_t:
124124
TID_UI,
125-
TID_DB,
125+
TID_FILE_BACKGROUND
126126
TID_FILE,
127+
TID_FILE_USER_VISIBLE
127128
TID_FILE_USER_BLOCKING,
128-
TID_PROCESS_LAUNCHER,
129-
TID_CACHE,
130129
TID_IO,
131130
TID_RENDERER
132131

src/task.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def PostTask(int thread, object func, *args):
1212

1313
# Validate threadId.
1414
if thread not in g_browserProcessThreads:
15-
raise Exception("PoastTask failed: requires a browser process thread")
15+
raise Exception("PostTask failed: requires a browser process thread")
1616

1717
# Validate func.
1818
if not IsFunctionOrMethod(type(func)):
@@ -39,7 +39,7 @@ def PostDelayedTask(int thread, int delay_ms, object func, *args):
3939

4040
# Validate threadId.
4141
if thread not in g_browserProcessThreads:
42-
raise Exception("PoastTask failed: requires a browser process thread")
42+
raise Exception("PostTask failed: requires a browser process thread")
4343

4444
# Validate func.
4545
if not IsFunctionOrMethod(type(func)):

src/utils.pyx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@ include "cefpython.pyx"
88
cimport cef_types
99

1010
TID_UI = cef_types.TID_UI
11-
TID_DB = cef_types.TID_DB
11+
TID_FILE_BACKGROUND = cef_types.TID_FILE_BACKGROUND
1212
TID_FILE = cef_types.TID_FILE
13+
TID_FILE_USER_VISIBLE = cef_types.TID_FILE_USER_VISIBLE
1314
TID_FILE_USER_BLOCKING = cef_types.TID_FILE_USER_BLOCKING
14-
TID_PROCESS_LAUNCHER = cef_types.TID_PROCESS_LAUNCHER
15-
TID_CACHE = cef_types.TID_CACHE
1615
TID_IO = cef_types.TID_IO
1716
TID_RENDERER = cef_types.TID_RENDERER
1817

1918
g_browserProcessThreads = [
2019
TID_UI,
21-
TID_DB,
20+
TID_FILE_BACKGROUND,
2221
TID_FILE,
22+
TID_FILE_USER_VISIBLE
2323
TID_FILE_USER_BLOCKING,
24-
TID_CACHE,
2524
TID_IO,
2625
]
2726

0 commit comments

Comments
 (0)