Skip to content

Commit e1ac768

Browse files
committed
Core - Update CefThreadIds enum
This is a breaking change Resolves #3597
1 parent 9943333 commit e1ac768

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

CefSharp/Enums/CefThreadIds.cs

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,40 @@ public enum CefThreadIds
1212
// BROWSER PROCESS THREADS -- Only available in the browser process.
1313

1414
/// <summary>
15-
/// The CEF UI thread in the browser. In CefSharp this is ALWAYS
16-
/// separate from the application's main thread (and thus the main
17-
/// WinForm UI thread).
15+
/// The CEF UI thread in the browser. In CefSharp this is by default
16+
/// different from your main applications UI Thread
17+
/// (e.g. WPF/WinForms UI Threads). Only when MultiThreadedMessageLoop
18+
/// is false will this be the same as your app UI Thread.
1819
/// </summary>
1920
TID_UI,
2021

2122
/// <summary>
22-
/// Used to interact with the database.
23+
/// Used for blocking tasks (e.g. file system access) where the user won't
24+
/// notice if the task takes an arbitrarily long time to complete. All tasks
25+
/// posted after <see cref="IBrowserProcessHandler.OnContextInitialized"/>
26+
/// and before Cef.Shutdown() are guaranteed to run.
2327
/// </summary>
24-
TID_DB,
28+
TID_FILE_BACKGROUND,
2529

2630
/// <summary>
27-
/// Used to interact with the file system.
31+
/// Used for blocking tasks (e.g. file system access) that affect UI or
32+
/// responsiveness of future user interactions. Do not use if an immediate
33+
/// response to a user interaction is expected. All tasks posted after
34+
/// <see cref="IBrowserProcessHandler.OnContextInitialized"/> and before Cef.Shutdown()
35+
/// are guaranteed to run.
36+
/// Examples:
37+
/// - Updating the UI to reflect progress on a long task.
38+
/// - Loading data that might be shown in the UI after a future user
39+
/// interaction.
2840
/// </summary>
29-
TID_FILE,
41+
TID_FILE_USER_VISIBLE,
3042

3143
/// <summary>
32-
/// Used for file system operations that block user interactions.
33-
/// Responsiveness of this thread affects users.
44+
/// Used for blocking tasks (e.g. file system access) that affect UI
45+
/// immediately after a user interaction. All tasks posted after
46+
/// <see cref="IBrowserProcessHandler.OnContextInitialized"/> and before Cef.Shutdown()
47+
/// are guaranteed to run.
48+
/// Example: Generating data shown in the UI immediately after a click.
3449
/// </summary>
3550
TID_FILE_USER_BLOCKING,
3651

@@ -40,19 +55,20 @@ public enum CefThreadIds
4055
TID_PROCESS_LAUNCHER,
4156

4257
/// <summary>
43-
/// Used to handle slow HTTP cache operations.
44-
/// </summary>
45-
TID_CACHE,
46-
47-
/// <summary>
48-
/// Used to process IPC and network messages.
58+
/// Used to process IPC and network messages. Do not perform blocking tasks on
59+
/// this thread. All tasks posted after <see cref="IBrowserProcessHandler.OnContextInitialized"/>
60+
/// and before Cef.Shutdown() are guaranteed to run.
4961
/// </summary>
5062
TID_IO,
5163

5264
// RENDER PROCESS THREADS -- Only available in the render process.
5365

5466
/// <summary>
5567
/// The main thread in the renderer. Used for all WebKit and V8 interaction.
68+
/// Tasks may be posted to this thread after
69+
/// CefRenderProcessHandler::OnWebKitInitialized but are not guaranteed to
70+
/// run before sub-process termination (sub-processes may be killed at any time
71+
/// without warning).
5672
/// </summary>
5773
TID_RENDERER,
5874
}

0 commit comments

Comments
 (0)