Skip to content

Commit f8fd2a6

Browse files
committed
Improve comments around CEF UI thread
1 parent 852e739 commit f8fd2a6

File tree

6 files changed

+36
-18
lines changed

6 files changed

+36
-18
lines changed

CefSharp.Core/Cef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace CefSharp
5151

5252
public:
5353
/// <summary>
54-
/// Called on the browser process UI thread immediately after the CEF context has been initialized.
54+
/// Called on the CEF UI thread immediately after the CEF context has been initialized.
5555
/// You can now access the Global RequestContext through Cef.GetGlobalRequestContext() - this is the
5656
/// first place you can set Preferences (e.g. proxy settings, spell check dictionaries).
5757
/// </summary>

CefSharp/IDialogHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace CefSharp
88
{
99
/// <summary>
10-
/// Implement this interface to handle dialog events. The methods of this class will be called on the browser process UI thread.
10+
/// Implement this interface to handle dialog events. The methods of this class will be called on the CEF UI thread.
1111
/// </summary>
1212
public interface IDialogHandler
1313
{

CefSharp/IGeolocationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace CefSharp
66
{
77
/// <summary>
88
/// Implement this interface to handle events related to geolocation permission requests.
9-
/// The methods of this class will be called on the browser process UI thread.
9+
/// The methods of this class will be called on the CEF UI thread.
1010
/// </summary>
1111
public interface IGeolocationHandler
1212
{

CefSharp/IPrintToPdfCallback.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace CefSharp
66
{
77
/// <summary>
88
/// Callback interface for <see cref="IBrowserHost.PrintToPDF"/>. The methods of this interface
9-
/// will be called on the browser process UI thread.
9+
/// will be called on the CEF UI thread.
1010
/// </summary>
1111
public interface IPrintToPdfCallback
1212
{

CefSharp/IRequestContext.cs

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,30 +71,40 @@ public interface IRequestContext : IDisposable
7171

7272
/// <summary>
7373
/// Tells all renderer processes associated with this context to throw away
74-
/// their plugin list cache. If |reload_pages| is true they will also reload
74+
/// their plugin list cache. If reloadPages is true they will also reload
7575
/// all pages with plugins. RequestContextHandler.OnBeforePluginLoad may
7676
/// be called to rebuild the plugin list cache.
7777
/// </summary>
7878
/// <param name="reloadPages">reload any pages with pluginst</param>
7979
void PurgePluginListCache(bool reloadPages);
8080

8181
/// <summary>
82-
/// Returns true if a preference with the specified |name| exists. This method
83-
/// must be called on the browser process UI thread.
82+
/// Returns true if a preference with the specified name exists. This method
83+
/// must be called on the CEF UI thread.
8484
/// </summary>
85-
/// <param name="name"></param>
86-
/// <returns></returns>
85+
/// <param name="name">name of preference</param>
86+
/// <returns>bool if the preference exists</returns>
87+
/// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
88+
/// Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
89+
/// executed on the CEF UI thread, so can be called directly.
90+
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
91+
/// application thread will be the CEF UI thread.</remarks>
8792
bool HasPreference(string name);
8893

8994
/// <summary>
90-
/// Returns the value for the preference with the specified |name|. Returns
95+
/// Returns the value for the preference with the specified name. Returns
9196
/// NULL if the preference does not exist. The returned object contains a copy
9297
/// of the underlying preference value and modifications to the returned object
9398
/// will not modify the underlying preference value. This method must be called
94-
/// on the browser process UI thread.
99+
/// on the CEF UI thread.
95100
/// </summary>
96-
/// <param name="name"></param>
97-
/// <returns></returns>
101+
/// <param name="name">preference name</param>
102+
/// <returns>Returns the value for the preference with the specified name</returns>
103+
/// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
104+
/// Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
105+
/// executed on the CEF UI thread, so can be called directly.
106+
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
107+
/// application thread will be the CEF UI thread.</remarks>
98108
object GetPreference(string name);
99109

100110
/// <summary>
@@ -112,25 +122,34 @@ public interface IRequestContext : IDisposable
112122
/// <summary>
113123
/// Returns true if the preference with the specified name can be modified
114124
/// using SetPreference. As one example preferences set via the command-line
115-
/// usually cannot be modified. This method must be called on the browser
116-
/// process UI thread.
125+
/// usually cannot be modified. This method must be called on the CEF UI thread.
117126
/// </summary>
118127
/// <param name="name">preference key</param>
119128
/// <returns>Returns true if the preference with the specified name can be modified
120129
/// using SetPreference</returns>
130+
/// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
131+
/// Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
132+
/// executed on the CEF UI thread, so can be called directly.
133+
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
134+
/// application thread will be the CEF UI thread.</remarks>
121135
bool CanSetPreference(string name);
122136

123137
/// <summary>
124138
/// Set the value associated with preference name. If value is null the
125139
/// preference will be restored to its default value. If setting the preference
126140
/// fails then error will be populated with a detailed description of the
127-
/// problem. This method must be called on the browser process UI thread.
141+
/// problem. This method must be called on the CEF UI thread.
128142
/// Preferences set via the command-line usually cannot be modified.
129143
/// </summary>
130144
/// <param name="name">preference key</param>
131145
/// <param name="value">preference value</param>
132146
/// <param name="error">out error</param>
133147
/// <returns>Returns true if the value is set successfully and false otherwise.</returns>
148+
/// /// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
149+
/// Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
150+
/// executed on the CEF UI thread, so can be called directly.
151+
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
152+
/// application thread will be the CEF UI thread.</remarks>
134153
bool SetPreference(string name, object value, out string error);
135154

136155
/// <summary>

CefSharp/IRequestHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,13 @@ bool OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame
145145
bool OnProtocolExecution(IWebBrowser browserControl, IBrowser browser, string url);
146146

147147
/// <summary>
148-
/// Called on the browser process UI thread when the render view associated
148+
/// Called on the CEF UI thread when the render view associated
149149
/// with browser is ready to receive/handle IPC messages in the render
150150
/// process.
151151
/// </summary>
152152
/// <param name="browserControl">The ChromiumWebBrowser control</param>
153153
/// <param name="browser">the browser object</param>
154154
void OnRenderViewReady(IWebBrowser browserControl, IBrowser browser);
155-
156155

157156
/// <summary>
158157
/// Called on the CEF IO thread when a resource response is received.

0 commit comments

Comments
 (0)