Skip to content

Commit 750dbcd

Browse files
committed
RequestContext - Improve CEF UI thread xml doc
1 parent 904ae0c commit 750dbcd

File tree

2 files changed

+21
-190
lines changed

2 files changed

+21
-190
lines changed

CefSharp.Core/RequestContext.cpp

Lines changed: 0 additions & 189 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ using namespace System::Runtime::InteropServices;
3131

3232
namespace CefSharp
3333
{
34-
/// <summary>
35-
/// Returns true if this object is pointing to the same context object.
36-
/// </summary>
37-
/// <param name="context">context to compare</param>
38-
/// <returns>Returns true if the same</returns>
3934
bool RequestContext::IsSame(IRequestContext^ context)
4035
{
4136
ThrowIfDisposed();
@@ -45,11 +40,6 @@ namespace CefSharp
4540
return _requestContext->IsSame(requestContext);
4641
}
4742

48-
/// <summary>
49-
/// Returns true if this object is sharing the same storage as the specified context.
50-
/// </summary>
51-
/// <param name="context">context to compare</param>
52-
/// <returns>Returns true if same storage</returns>
5343
bool RequestContext::IsSharingWith(IRequestContext^ context)
5444
{
5545
ThrowIfDisposed();
@@ -59,15 +49,6 @@ namespace CefSharp
5949
return _requestContext->IsSharingWith(requestContext);
6050
}
6151

62-
/// <summary>
63-
/// Returns the default cookie manager for this object. This will be the global
64-
/// cookie manager if this object is the global request context. Otherwise,
65-
/// this will be the default cookie manager used when this request context does
66-
/// not receive a value via IRequestContextHandler.GetCookieManager().
67-
/// </summary>
68-
/// <param name="callback">If callback is non-NULL it will be executed asnychronously on the CEF IO thread
69-
/// after the manager's storage has been initialized.</param>
70-
/// <returns>Returns the default cookie manager for this object</returns>
7152
ICookieManager^ RequestContext::GetDefaultCookieManager(ICompletionCallback^ callback)
7253
{
7354
ThrowIfDisposed();
@@ -82,20 +63,6 @@ namespace CefSharp
8263
return nullptr;
8364
}
8465

85-
/// <summary>
86-
/// Register a scheme handler factory for the specified schemeName and optional domainName.
87-
/// An empty domainName value for a standard scheme will cause the factory to match all domain
88-
/// names. The domainName value will be ignored for non-standard schemes. If schemeName is
89-
/// a built-in scheme and no handler is returned by factory then the built-in scheme handler
90-
/// factory will be called. If schemeName is a custom scheme then you must also implement the
91-
/// CefApp::OnRegisterCustomSchemes() method in all processes. This function may be called multiple
92-
/// times to change or remove the factory that matches the specified schemeName and optional
93-
/// domainName.
94-
/// </summary>
95-
/// <param name="schemeName">Scheme Name</param>
96-
/// <param name="domainName">Optional domain name</param>
97-
/// <param name="factory">Scheme handler factory</param>
98-
/// <returns>Returns false if an error occurs.</returns>
9966
bool RequestContext::RegisterSchemeHandlerFactory(String^ schemeName, String^ domainName, ISchemeHandlerFactory^ factory)
10067
{
10168
ThrowIfDisposed();
@@ -104,80 +71,34 @@ namespace CefSharp
10471
return _requestContext->RegisterSchemeHandlerFactory(StringUtils::ToNative(schemeName), StringUtils::ToNative(domainName), wrapper);
10572
}
10673

107-
/// <summary>
108-
/// Clear all registered scheme handler factories.
109-
/// </summary>
110-
/// <returns>Returns false on error.</returns>
11174
bool RequestContext::ClearSchemeHandlerFactories()
11275
{
11376
ThrowIfDisposed();
11477

11578
return _requestContext->ClearSchemeHandlerFactories();
11679
}
11780

118-
/// <summary>
119-
/// Tells all renderer processes associated with this context to throw away
120-
/// their plugin list cache. If reloadPages is true they will also reload
121-
/// all pages with plugins. RequestContextHandler.OnBeforePluginLoad may
122-
/// be called to rebuild the plugin list cache.
123-
/// </summary>
124-
/// <param name="reloadPages">reload any pages with pluginst</param>
12581
void RequestContext::PurgePluginListCache(bool reloadPages)
12682
{
12783
ThrowIfDisposed();
12884

12985
_requestContext->PurgePluginListCache(reloadPages);
13086
}
13187

132-
/// <summary>
133-
/// Returns true if a preference with the specified name exists. This method
134-
/// must be called on the CEF UI thread.
135-
/// </summary>
136-
/// <param name="name">name of preference</param>
137-
/// <returns>bool if the preference exists</returns>
138-
/// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
139-
/// <see cref="IBrowserProcessHandler.OnContextInitialized"/> and ChromiumWebBrowser.IsBrowserInitializedChanged are both
140-
/// executed on the CEF UI thread, so can be called directly.
141-
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
142-
/// application thread will be the CEF UI thread.</remarks>
14388
bool RequestContext::HasPreference(String^ name)
14489
{
14590
ThrowIfDisposed();
14691

14792
return _requestContext->HasPreference(StringUtils::ToNative(name));
14893
}
14994

150-
/// <summary>
151-
/// Returns the value for the preference with the specified name. Returns
152-
/// NULL if the preference does not exist. The returned object contains a copy
153-
/// of the underlying preference value and modifications to the returned object
154-
/// will not modify the underlying preference value. This method must be called
155-
/// on the CEF UI thread.
156-
/// </summary>
157-
/// <param name="name">preference name</param>
158-
/// <returns>Returns the value for the preference with the specified name</returns>
159-
/// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
160-
/// <see cref="IBrowserProcessHandler.OnContextInitialized"/> and ChromiumWebBrowser.IsBrowserInitializedChanged are both
161-
/// executed on the CEF UI thread, so can be called directly.
162-
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
163-
/// application thread will be the CEF UI thread.</remarks>
16495
Object^ RequestContext::GetPreference(String^ name)
16596
{
16697
ThrowIfDisposed();
16798

16899
return TypeConversion::FromNative(_requestContext->GetPreference(StringUtils::ToNative(name)));
169100
}
170101

171-
/// <summary>
172-
/// Returns all preferences as a dictionary. The returned
173-
/// object contains a copy of the underlying preference values and
174-
/// modifications to the returned object will not modify the underlying
175-
/// preference values. This method must be called on the browser process UI
176-
/// thread.
177-
/// </summary>
178-
/// <param name="includeDefaults">If true then
179-
/// preferences currently at their default value will be included.</param>
180-
/// <returns>Preferences (dictionary can have sub dictionaries)</returns>
181102
IDictionary<String^, Object^>^ RequestContext::GetAllPreferences(bool includeDefaults)
182103
{
183104
ThrowIfDisposed();
@@ -187,42 +108,13 @@ namespace CefSharp
187108
return TypeConversion::FromNative(preferences);
188109
}
189110

190-
/// <summary>
191-
/// Returns true if the preference with the specified name can be modified
192-
/// using SetPreference. As one example preferences set via the command-line
193-
/// usually cannot be modified. This method must be called on the CEF UI thread.
194-
/// </summary>
195-
/// <param name="name">preference key</param>
196-
/// <returns>Returns true if the preference with the specified name can be modified
197-
/// using SetPreference</returns>
198-
/// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
199-
/// <see cref="IBrowserProcessHandler.OnContextInitialized"/> and ChromiumWebBrowser.IsBrowserInitializedChanged are both
200-
/// executed on the CEF UI thread, so can be called directly.
201-
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
202-
/// application thread will be the CEF UI thread.</remarks>
203111
bool RequestContext::CanSetPreference(String^ name)
204112
{
205113
ThrowIfDisposed();
206114

207115
return _requestContext->CanSetPreference(StringUtils::ToNative(name));
208116
}
209117

210-
/// <summary>
211-
/// Set the value associated with preference name. If value is null the
212-
/// preference will be restored to its default value. If setting the preference
213-
/// fails then error will be populated with a detailed description of the
214-
/// problem. This method must be called on the CEF UI thread.
215-
/// Preferences set via the command-line usually cannot be modified.
216-
/// </summary>
217-
/// <param name="name">preference key</param>
218-
/// <param name="value">preference value</param>
219-
/// <param name="error">out error</param>
220-
/// <returns>Returns true if the value is set successfully and false otherwise.</returns>
221-
/// /// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
222-
/// <see cref="IBrowserProcessHandler.OnContextInitialized"/> and ChromiumWebBrowser.IsBrowserInitializedChanged are both
223-
/// executed on the CEF UI thread, so can be called directly.
224-
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
225-
/// application thread will be the CEF UI thread.</remarks>
226118
bool RequestContext::SetPreference(String^ name, Object^ value, [Out] String^ %error)
227119
{
228120
ThrowIfDisposed();
@@ -236,14 +128,6 @@ namespace CefSharp
236128
return success;
237129
}
238130

239-
/// <summary>
240-
/// Clears all certificate exceptions that were added as part of handling
241-
/// <see cref="IRequestHandler.OnCertificateError"/>. If you call this it is
242-
/// recommended that you also call <see cref="IRequestContext.CloseAllConnections"/> or you risk not
243-
/// being prompted again for server certificates if you reconnect quickly.
244-
/// </summary>
245-
/// <param name="callback">If is non-NULL it will be executed on the CEF UI thread after
246-
/// completion. This param is optional</param>
247131
void RequestContext::ClearCertificateExceptions(ICompletionCallback^ callback)
248132
{
249133
ThrowIfDisposed();
@@ -253,13 +137,6 @@ namespace CefSharp
253137
_requestContext->ClearCertificateExceptions(wrapper);
254138
}
255139

256-
/// <summary>
257-
/// Clears all active and idle connections that Chromium currently has.
258-
/// This is only recommended if you have released all other CEF objects but
259-
/// don't yet want to call Cef.Shutdown().
260-
/// </summary>
261-
/// <param name="callback">If is non-NULL it will be executed on the CEF UI thread after
262-
/// completion. This param is optional</param>
263140
void RequestContext::CloseAllConnections(ICompletionCallback^ callback)
264141
{
265142
ThrowIfDisposed();
@@ -269,11 +146,6 @@ namespace CefSharp
269146
_requestContext->CloseAllConnections(wrapper);
270147
}
271148

272-
/// <summary>
273-
/// Attempts to resolve origin to a list of associated IP addresses.
274-
/// </summary>
275-
/// <param name="origin">host name to resolve</param>
276-
/// <returns>A task that represents the Resoolve Host operation. The value of the TResult parameter contains ResolveCallbackResult.</returns>
277149
Task<ResolveCallbackResult>^ RequestContext::ResolveHostAsync(Uri^ origin)
278150
{
279151
ThrowIfDisposed();
@@ -287,15 +159,6 @@ namespace CefSharp
287159
return callback->Task;
288160
}
289161

290-
/// <summary>
291-
/// Attempts to resolve origin to a list of associated IP addresses using
292-
/// cached data. This method must be called on the CEF IO thread. Use
293-
/// Cef.IOThreadTaskFactory to execute on that thread.
294-
/// </summary>
295-
/// <param name="origin">host name to resolve</param>
296-
/// <param name="resolvedIpAddresses">list of resolved IP
297-
/// addresses or empty list if no cached data is available.</param>
298-
/// <returns> Returns <see cref="CefErrorCode.None"/> on success</returns>
299162
CefErrorCode RequestContext::ResolveHostCached(Uri^ origin, [Out] IList<String^>^ %resolvedIpAddresses)
300163
{
301164
ThrowIfDisposed();
@@ -309,24 +172,13 @@ namespace CefSharp
309172
return (CefErrorCode)errorCode;
310173
}
311174

312-
/// <summary>
313-
/// Returns true if this context was used to load the extension identified by extensionId. Other contexts sharing the same storage will also have access to the extension (see HasExtension).
314-
/// This method must be called on the CEF UI thread.
315-
/// </summary>
316-
/// <returns>Returns true if this context was used to load the extension identified by extensionId</returns>
317175
bool RequestContext::DidLoadExtension(String^ extensionId)
318176
{
319177
ThrowIfDisposed();
320178

321179
return _requestContext->DidLoadExtension(StringUtils::ToNative(extensionId));
322180
}
323181

324-
/// <summary>
325-
/// Returns the extension matching extensionId or null if no matching extension is accessible in this context (see HasExtension).
326-
/// This method must be called on the CEF UI thread.
327-
/// </summary>
328-
/// <param name="extensionId">extension Id</param>
329-
/// <returns>Returns the extension matching extensionId or null if no matching extension is accessible in this context</returns>
330182
IExtension^ RequestContext::GetExtension(String^ extensionId)
331183
{
332184
ThrowIfDisposed();
@@ -341,13 +193,6 @@ namespace CefSharp
341193
return nullptr;
342194
}
343195

344-
/// <summary>
345-
/// Retrieve the list of all extensions that this context has access to (see HasExtension).
346-
/// <see cref="extensionIds"/> will be populated with the list of extension ID values.
347-
/// This method must be called on the CEF UI thread.
348-
/// </summary>
349-
/// <param name="extensionIds">output a list of extensions Ids</param>
350-
/// <returns>returns true on success otherwise false</returns>
351196
bool RequestContext::GetExtensions([Out] IList<String^>^ %extensionIds)
352197
{
353198
ThrowIfDisposed();
@@ -361,47 +206,13 @@ namespace CefSharp
361206
return success;
362207
}
363208

364-
/// <summary>
365-
/// Returns true if this context has access to the extension identified by extensionId.
366-
/// This may not be the context that was used to load the extension (see DidLoadExtension).
367-
/// This method must be called on the CEF UI thread.
368-
/// </summary>
369-
/// <param name="extensionId">extension id</param>
370-
/// <returns>Returns true if this context has access to the extension identified by extensionId</returns>
371209
bool RequestContext::HasExtension(String^ extensionId)
372210
{
373211
ThrowIfDisposed();
374212

375213
return _requestContext->HasExtension(StringUtils::ToNative(extensionId));
376214
}
377215

378-
/// <summary>
379-
/// Load an extension. If extension resources will be read from disk using the default load implementation then rootDirectoy
380-
/// should be the absolute path to the extension resources directory and manifestJson should be null.
381-
/// If extension resources will be provided by the client (e.g. via IRequestHandler and/or IExtensionHandler) then rootDirectory
382-
/// should be a path component unique to the extension (if not absolute this will be internally prefixed with the PK_DIR_RESOURCES path)
383-
/// and manifestJson should contain the contents that would otherwise be read from the "manifest.json" file on disk.
384-
/// The loaded extension will be accessible in all contexts sharing the same storage (HasExtension returns true).
385-
/// However, only the context on which this method was called is considered the loader (DidLoadExtension returns true) and only the
386-
/// loader will receive IRequestContextHandler callbacks for the extension. <see cref="IExtensionHandler.OnExtensionLoaded"/> will be
387-
/// called on load success or <see cref="IExtensionHandler.OnExtensionLoadFailed"/> will be called on load failure.
388-
/// If the extension specifies a background script via the "background" manifest key then <see cref="IExtensionHandler.OnBeforeBackgroundBrowser"/>
389-
/// will be called to create the background browser. See that method for additional information about background scripts.
390-
/// For visible extension views the client application should evaluate the manifest to determine the correct extension URL to load and then pass
391-
/// that URL to the IBrowserHost.CreateBrowser* function after the extension has loaded. For example, the client can look for the "browser_action"
392-
/// manifest key as documented at https://developer.chrome.com/extensions/browserAction. Extension URLs take the form "chrome-extension:///".
393-
/// Browsers that host extensions differ from normal browsers as follows: - Can access chrome.* JavaScript APIs if allowed by the manifest.
394-
/// Visit chrome://extensions-support for the list of extension APIs currently supported by CEF. - Main frame navigation to non-extension
395-
/// content is blocked.
396-
/// - Pinch-zooming is disabled.
397-
/// - <see cref="IBrowserHost.GetExtension"/> returns the hosted extension.
398-
/// - CefBrowserHost::IsBackgroundHost returns true for background hosts. See https://developer.chrome.com/extensions for extension implementation and usage documentation.
399-
/// </summary>
400-
/// <param name="rootDirectory">If extension resources will be read from disk using the default load implementation then rootDirectoy
401-
/// should be the absolute path to the extension resources directory and manifestJson should be null</param>
402-
/// <param name="manifestJson">If extension resources will be provided by the client then rootDirectory should be a path component unique to the extension
403-
/// and manifestJson should contain the contents that would otherwise be read from the manifest.json file on disk</param>
404-
/// <param name="handler">handle events related to browser extensions</param>
405216
void RequestContext::LoadExtension(String^ rootDirectory, String^ manifestJson, IExtensionHandler^ handler)
406217
{
407218
ThrowIfDisposed();

0 commit comments

Comments
 (0)