Skip to content

Commit 0fb3c50

Browse files
craigfowleramaitland
authored andcommitted
Update docs for IResourceRequestHandlerFactory (#3998)
I have just discovered that when HasHandlers returns false, the GetResourceRequestHandler method is never executed. Presumably this is an optimisation which happens inside of Chromium, as I can see that the HasHandlers property value goes all way back to the C++ native project. I was about to suggest removing this optimisation because it'd be trivial to optimise and return early inside the default factory impl in C# world. If it goes all the way down to Chromium then that's less easy and so the next best thing would be to document it.
1 parent 1663b19 commit 0fb3c50

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CefSharp/IResourceRequestHandlerFactory.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ public interface IResourceRequestHandlerFactory
1616
/// <summary>
1717
/// Are there any <see cref="ResourceHandler"/>'s registered?
1818
/// </summary>
19+
/// <remarks>
20+
/// <para>
21+
/// Implementors must return <see langword="true"/> from this method if the factory is to be used.
22+
/// The <see cref="GetResourceRequestHandler"/> method will not be executed if this property returns
23+
/// <see langword="false"/>, presumably as an optimisation.
24+
/// </para>
25+
/// </remarks>
1926
bool HasHandlers { get; }
2027

2128
/// <summary>

0 commit comments

Comments
 (0)