Skip to content

Commit 9db72f1

Browse files
committed
Add RequestContext xml doc (copied from IRequestContext)
1 parent bbc6e45 commit 9db72f1

File tree

1 file changed

+146
-78
lines changed

1 file changed

+146
-78
lines changed

CefSharp.Core/RequestContext.h

Lines changed: 146 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ namespace CefSharp
8181
_disposed = true;
8282
}
8383

84+
/// <summary>
85+
/// Returns true if this object is pointing to the same context object.
86+
/// </summary>
87+
/// <param name="context">context to compare</param>
88+
/// <returns>Returns true if the same</returns>
8489
virtual bool IsSame(IRequestContext^ context)
8590
{
8691
ThrowIfDisposed();
@@ -90,6 +95,11 @@ namespace CefSharp
9095
return _requestContext->IsSame(requestContext);
9196
}
9297

98+
/// <summary>
99+
/// Returns true if this object is sharing the same storage as the specified context.
100+
/// </summary>
101+
/// <param name="context">context to compare</param>
102+
/// <returns>Returns true if same storage</returns>
93103
virtual bool IsSharingWith(IRequestContext^ context)
94104
{
95105
ThrowIfDisposed();
@@ -99,6 +109,15 @@ namespace CefSharp
99109
return _requestContext->IsSharingWith(requestContext);
100110
}
101111

112+
/// <summary>
113+
/// Returns the default cookie manager for this object. This will be the global
114+
/// cookie manager if this object is the global request context. Otherwise,
115+
/// this will be the default cookie manager used when this request context does
116+
/// not receive a value via IRequestContextHandler.GetCookieManager().
117+
/// </summary>
118+
/// <param name="callback">If callback is non-NULL it will be executed asnychronously on the CEF IO thread
119+
/// after the manager's storage has been initialized.</param>
120+
/// <returns>Returns the default cookie manager for this object</returns>
102121
virtual ICookieManager^ GetDefaultCookieManager(ICompletionCallback^ callback)
103122
{
104123
ThrowIfDisposed();
@@ -113,6 +132,11 @@ namespace CefSharp
113132
return nullptr;
114133
}
115134

135+
/// <summary>
136+
/// Returns true if this object is the global context. The global context is
137+
/// used by default when creating a browser or URL request with a NULL context
138+
/// argument.
139+
/// </summary>
116140
virtual property bool IsGlobal
117141
{
118142
bool get()
@@ -122,6 +146,20 @@ namespace CefSharp
122146
}
123147
}
124148

149+
/// <summary>
150+
/// Register a scheme handler factory for the specified schemeName and optional domainName.
151+
/// An empty domainName value for a standard scheme will cause the factory to match all domain
152+
/// names. The domainName value will be ignored for non-standard schemes. If schemeName is
153+
/// a built-in scheme and no handler is returned by factory then the built-in scheme handler
154+
/// factory will be called. If schemeName is a custom scheme then you must also implement the
155+
/// CefApp::OnRegisterCustomSchemes() method in all processes. This function may be called multiple
156+
/// times to change or remove the factory that matches the specified schemeName and optional
157+
/// domainName.
158+
/// </summary>
159+
/// <param name="schemeName">Scheme Name</param>
160+
/// <param name="domainName">Optional domain name</param>
161+
/// <param name="factory">Scheme handler factory</param>
162+
/// <returns>Returns false if an error occurs.</returns>
125163
virtual bool RegisterSchemeHandlerFactory(String^ schemeName, String^ domainName, ISchemeHandlerFactory^ factory)
126164
{
127165
ThrowIfDisposed();
@@ -130,18 +168,21 @@ namespace CefSharp
130168
return _requestContext->RegisterSchemeHandlerFactory(StringUtils::ToNative(schemeName), StringUtils::ToNative(domainName), wrapper);
131169
}
132170

171+
/// <summary>
172+
/// Clear all registered scheme handler factories.
173+
/// </summary>
174+
/// <returns>Returns false on error.</returns>
133175
virtual bool ClearSchemeHandlerFactories()
134176
{
135177
ThrowIfDisposed();
136178

137179
return _requestContext->ClearSchemeHandlerFactories();
138180
}
139181

140-
///
141-
// Returns the cache path for this object. If empty an "incognito mode"
142-
// in-memory cache is being used.
143-
///
144-
/*--cef()--*/
182+
/// <summary>
183+
/// Returns the cache path for this object. If empty an "incognito mode"
184+
/// in-memory cache is being used.
185+
/// </summary>
145186
virtual property String^ CachePath
146187
{
147188
String^ get()
@@ -152,56 +193,69 @@ namespace CefSharp
152193
}
153194
}
154195

155-
///
156-
// Tells all renderer processes associated with this context to throw away
157-
// their plugin list cache. If |reload_pages| is true they will also reload
158-
// all pages with plugins. CefRequestContextHandler::OnBeforePluginLoad may
159-
// be called to rebuild the plugin list cache.
160-
///
161-
/*--cef()--*/
196+
/// <summary>
197+
/// Tells all renderer processes associated with this context to throw away
198+
/// their plugin list cache. If reloadPages is true they will also reload
199+
/// all pages with plugins. RequestContextHandler.OnBeforePluginLoad may
200+
/// be called to rebuild the plugin list cache.
201+
/// </summary>
202+
/// <param name="reloadPages">reload any pages with pluginst</param>
162203
virtual void PurgePluginListCache(bool reloadPages)
163204
{
164205
ThrowIfDisposed();
165206

166207
_requestContext->PurgePluginListCache(reloadPages);
167208
}
168209

169-
///
170-
// Returns true if a preference with the specified |name| exists. This method
171-
// must be called on the browser process UI thread.
172-
///
173-
/*--cef()--*/
210+
/// <summary>
211+
/// Returns true if a preference with the specified name exists. This method
212+
/// must be called on the CEF UI thread.
213+
/// </summary>
214+
/// <param name="name">name of preference</param>
215+
/// <returns>bool if the preference exists</returns>
216+
/// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
217+
/// Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
218+
/// executed on the CEF UI thread, so can be called directly.
219+
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
220+
/// application thread will be the CEF UI thread.</remarks>
174221
virtual bool HasPreference(String^ name)
175222
{
176223
ThrowIfDisposed();
177224

178225
return _requestContext->HasPreference(StringUtils::ToNative(name));
179226
}
180227

181-
///
182-
// Returns the value for the preference with the specified |name|. Returns
183-
// NULL if the preference does not exist. The returned object contains a copy
184-
// of the underlying preference value and modifications to the returned object
185-
// will not modify the underlying preference value. This method must be called
186-
// on the browser process UI thread.
187-
///
188-
/*--cef()--*/
228+
/// <summary>
229+
/// Returns the value for the preference with the specified name. Returns
230+
/// NULL if the preference does not exist. The returned object contains a copy
231+
/// of the underlying preference value and modifications to the returned object
232+
/// will not modify the underlying preference value. This method must be called
233+
/// on the CEF UI thread.
234+
/// </summary>
235+
/// <param name="name">preference name</param>
236+
/// <returns>Returns the value for the preference with the specified name</returns>
237+
/// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
238+
/// Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
239+
/// executed on the CEF UI thread, so can be called directly.
240+
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
241+
/// application thread will be the CEF UI thread.</remarks>
189242
virtual Object^ GetPreference(String^ name)
190243
{
191244
ThrowIfDisposed();
192245

193246
return TypeConversion::FromNative(_requestContext->GetPreference(StringUtils::ToNative(name)));
194247
}
195248

196-
///
197-
// Returns all preferences as a dictionary. If |include_defaults| is true then
198-
// preferences currently at their default value will be included. The returned
199-
// object contains a copy of the underlying preference values and
200-
// modifications to the returned object will not modify the underlying
201-
// preference values. This method must be called on the browser process UI
202-
// thread.
203-
///
204-
/*--cef()--*/
249+
/// <summary>
250+
/// Returns all preferences as a dictionary. The returned
251+
/// object contains a copy of the underlying preference values and
252+
/// modifications to the returned object will not modify the underlying
253+
/// preference values. This method must be called on the browser process UI
254+
/// thread.
255+
/// </summary>
256+
/// <param name="includeDefaults">If true then
257+
/// preferences currently at their default value will be included.</param>
258+
/// <returns>Preferences (dictionary can have sub dictionaries)</returns>
205259
virtual IDictionary<String^, Object^>^ GetAllPreferences(bool includeDefaults)
206260
{
207261
ThrowIfDisposed();
@@ -211,29 +265,42 @@ namespace CefSharp
211265
return TypeConversion::FromNative(preferences);
212266
}
213267

214-
///
215-
// Returns true if the preference with the specified |name| can be modified
216-
// using SetPreference. As one example preferences set via the command-line
217-
// usually cannot be modified. This method must be called on the browser
218-
// process UI thread.
219-
///
220-
/*--cef()--*/
268+
/// <summary>
269+
/// Returns true if the preference with the specified name can be modified
270+
/// using SetPreference. As one example preferences set via the command-line
271+
/// usually cannot be modified. This method must be called on the CEF UI thread.
272+
/// </summary>
273+
/// <param name="name">preference key</param>
274+
/// <returns>Returns true if the preference with the specified name can be modified
275+
/// using SetPreference</returns>
276+
/// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
277+
/// Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
278+
/// executed on the CEF UI thread, so can be called directly.
279+
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
280+
/// application thread will be the CEF UI thread.</remarks>
221281
virtual bool CanSetPreference(String^ name)
222282
{
223283
ThrowIfDisposed();
224284

225285
return _requestContext->CanSetPreference(StringUtils::ToNative(name));
226286
}
227287

228-
///
229-
// Set the |value| associated with preference |name|. Returns true if the
230-
// value is set successfully and false otherwise. If |value| is NULL the
231-
// preference will be restored to its default value. If setting the preference
232-
// fails then |error| will be populated with a detailed description of the
233-
// problem. This method must be called on the browser process UI thread.
234-
// Preferences set via the command-line usually cannot be modified.
235-
///
236-
/*--cef(optional_param=value)--*/
288+
/// <summary>
289+
/// Set the value associated with preference name. If value is null the
290+
/// preference will be restored to its default value. If setting the preference
291+
/// fails then error will be populated with a detailed description of the
292+
/// problem. This method must be called on the CEF UI thread.
293+
/// Preferences set via the command-line usually cannot be modified.
294+
/// </summary>
295+
/// <param name="name">preference key</param>
296+
/// <param name="value">preference value</param>
297+
/// <param name="error">out error</param>
298+
/// <returns>Returns true if the value is set successfully and false otherwise.</returns>
299+
/// /// <remarks>Use Cef.UIThreadTaskFactory to execute this method if required,
300+
/// Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
301+
/// executed on the CEF UI thread, so can be called directly.
302+
/// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
303+
/// application thread will be the CEF UI thread.</remarks>
237304
virtual bool SetPreference(String^ name, Object^ value, [Out] String^ %error)
238305
{
239306
ThrowIfDisposed();
@@ -247,15 +314,14 @@ namespace CefSharp
247314
return success;
248315
}
249316

250-
///
251-
// Clears all certificate exceptions that were added as part of handling
252-
// CefRequestHandler::OnCertificateError(). If you call this it is
253-
// recommended that you also call CloseAllConnections() or you risk not
254-
// being prompted again for server certificates if you reconnect quickly.
255-
// If |callback| is non-NULL it will be executed on the UI thread after
256-
// completion.
257-
///
258-
/*--cef(optional_param=callback)--*/
317+
/// <summary>
318+
/// Clears all certificate exceptions that were added as part of handling
319+
/// <see cref="IRequestHandler.OnCertificateError"/>. If you call this it is
320+
/// recommended that you also call <see cref="IRequestContext.CloseAllConnections"/> or you risk not
321+
/// being prompted again for server certificates if you reconnect quickly.
322+
/// </summary>
323+
/// <param name="callback">If is non-NULL it will be executed on the CEF UI thread after
324+
/// completion. This param is optional</param>
259325
virtual void ClearCertificateExceptions(ICompletionCallback^ callback)
260326
{
261327
ThrowIfDisposed();
@@ -265,13 +331,13 @@ namespace CefSharp
265331
_requestContext->ClearCertificateExceptions(wrapper);
266332
}
267333

268-
///
269-
// Clears all active and idle connections that Chromium currently has.
270-
// This is only recommended if you have released all other CEF objects but
271-
// don't yet want to call CefShutdown(). If |callback| is non-NULL it will be
272-
// executed on the UI thread after completion.
273-
///
274-
/*--cef(optional_param=callback)--*/
334+
/// <summary>
335+
/// Clears all active and idle connections that Chromium currently has.
336+
/// This is only recommended if you have released all other CEF objects but
337+
/// don't yet want to call Cef.Shutdown().
338+
/// </summary>
339+
/// <param name="callback">If is non-NULL it will be executed on the CEF UI thread after
340+
/// completion. This param is optional</param>
275341
virtual void CloseAllConnections(ICompletionCallback^ callback)
276342
{
277343
ThrowIfDisposed();
@@ -281,11 +347,11 @@ namespace CefSharp
281347
_requestContext->CloseAllConnections(wrapper);
282348
}
283349

284-
///
285-
// Attempts to resolve |origin| to a list of associated IP addresses.
286-
// |callback| will be executed on the UI thread after completion.
287-
///
288-
/*--cef()--*/
350+
/// <summary>
351+
/// Attempts to resolve origin to a list of associated IP addresses.
352+
/// </summary>
353+
/// <param name="origin">host name to resolve</param>
354+
/// <return>A task that represents the Resoolve Host operation. The value of the TResult parameter contains ResolveCallbackResult.</return>
289355
virtual Task<ResolveCallbackResult>^ ResolveHostAsync(Uri^ origin)
290356
{
291357
ThrowIfDisposed();
@@ -299,13 +365,15 @@ namespace CefSharp
299365
return callback->Task;
300366
}
301367

302-
///
303-
// Attempts to resolve |origin| to a list of associated IP addresses using
304-
// cached data. |resolved_ips| will be populated with the list of resolved IP
305-
// addresses or empty if no cached data is available. Returns ERR_NONE on
306-
// success. This method must be called on the browser process IO thread.
307-
///
308-
/*--cef(default_retval=ERR_FAILED)--*/
368+
/// <summary>
369+
/// Attempts to resolve origin to a list of associated IP addresses using
370+
/// cached data. This method must be called on the CEF IO thread. Use
371+
/// Cef.IOThreadTaskFactory to execute on that thread.
372+
/// </summary>
373+
/// <param name="origin">host name to resolve</param>
374+
/// <param name="resolvedIpAddresses">list of resolved IP
375+
/// addresses or empty list if no cached data is available.</param>
376+
/// <returns> Returns <see cref="CefErrorCode.None"/> on success</returns>
309377
virtual CefErrorCode ResolveHostCached(Uri^ origin, [Out] IList<String^>^ %resolvedIpAddresses)
310378
{
311379
ThrowIfDisposed();

0 commit comments

Comments
 (0)