-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chromium NetworkService API Changes #2743
Comments
From a documentation clarifying point of view even if rootcachepath is set to a real path, CachePath can still be set empty for using in-memory cache. |
Thanks 👍 It's probably worth seeing if the
Which implies you have to set CefSettings.root_cache_path, which isn't the case, you can leave it blank and it will default to CefSettings.cache_path as per I've made some improvements in c0ebbb4 Hopefully it makes sense, feedback welcome. |
Experiencing a strange issue where
Not the expected behaviour, opened issue https://bitbucket.org/chromiumembedded/cef/issues/2687/cefframe-getidentifier-differs-between To allow This should be reverted when the
|
JavascriptCallback's are limited to only working in the main frame Frame ids aren't the same between processes, so makes it almost impossible to handle callbacks in sub frames https://bitbucket.org/chromiumembedded/cef/issues/2687/cefframe-getidentifier-differs-between cefsharp#2743 (comment) This should be reverted after the problem has been resolved.
JavascriptCallback's are limited to only working in the main frame Frame ids aren't the same between processes, so makes it almost impossible to handle callbacks in sub frames https://bitbucket.org/chromiumembedded/cef/issues/2687/cefframe-getidentifier-differs-between #2743 (comment) This should be reverted after the problem has been resolved.
The |
The network services requires that custom schemes be registered, previously we only registered them in render processes. Add SubProcessApp to handle scheme registration CefAppUnmanagedWrapper inherits SubProcessApp now #2743
|
Changes are complete, any bugs please open a new issue making sure to use the Bug Report Template |
For reference it's still possible to disable the This will only work with version |
…nges - MemoryStreamResponseFilter renamed to StreamResponseFilter - Stream is now passed into StreamResponseFilter constructor - ExampleResourceRequestHandler updated to reflect that it now represents a single resource request - ExampleResourceRequestHandler is now used for all requests from the CefSharpSchemeHandlerFactory.SchemeName custom scheme Issue #2743
…nges - MemoryStreamResponseFilter renamed to StreamResponseFilter - Stream is now passed into StreamResponseFilter constructor - ExampleResourceRequestHandler updated to reflect that it now represents a single resource request - ExampleResourceRequestHandler is now used for all requests from the CefSharpSchemeHandlerFactory.SchemeName custom scheme Issue #2743
The
|
Tried disabling the Network Service, as you mentioned, (due to a severe libcef crash: https://bitbucket.org/chromiumembedded/cef/issues/2795/crash-in-openinputstreamwrapper) but I cannot get custom schemes to work. Navigation aborts right away with an unknown custom schema error code. Probably expected, or not? (Most likely a cef issue, but still asking here) |
I had to put back the SchemeHandlerFactory when creating the CustomScheme (removed when upgraded to 75) and had to implement my own ResourceHandler because the CefSharp builtin ResourceHandler has deprecated the ReadResponse and ProcessRequest methods, and those seem to be used by the old network layer. |
Due to
Chromium
changesCEF
will be implementing some dramaticAPI
changes. Relevantupstream
issue is https://bitbucket.org/chromiumembedded/cef/issues/2622/implement-support-for-networkserviceChromium
is moving to aNetwork Service
, this means that network requests will be handled using a separate process, just like rendering, gpu acceleration, etc.Known behaviour changes:
newUrl
parameter inOnResourceRedirect
will no longer result in the method being called an additional time (likely a bug in the old implementation).OnResourceResponse
would previously cause a redirect. This behaviour is now deprecated because the NetworkService does not support this functionality when using default network loaders. Temporary support has been added in combination withIResourceHandler
usage only. - Other changes to the request object inOnResourceResponse
will now cause the request to be restarted. This means thatOnBeforeResourceLoad
, etc, will be called an additional time with the new request information.IResponse.MimeType
will now be empty for non-200 responses.IResourceRequestHandler
with the same callback behaviour as builtin schemes.disableDefaultHandling
to true inGetResourceRequestHandler
.Response.Error
value of ERR_UNKNOWN_URL_SCHEME.ISchemeHandlerFactory.Create
callback will now include cookie headers.CachePath
values must be relative to a newCefSettings.RootCachePath
value.ICookieManager
callbacks are now executed on theCEF UI
thread (previously theCEF IO
thread).IRequestHandler
to a newIResourceRequestHandler
interface which is returned via theIRequestHandler.GetResourceRequestHandler
method. If theIRequestHandler
declines to handle a resource it can optionally be handled by theIRequestContextHandler
, if any, associated with the loading context.OnProtocolExecution
callback has been moved fromIRequestHandler
toIResourceRequestHandler
and will be called if a custom scheme request is unhandled.IRequestHandler
andIResourceHandler
toIResourceRequestHandler
.IResourceHandler
that better match NetworkService execution sequence expectations. The old methods are now deprecated.IRequest
andIResponse
.or associated browser is destroyed. The OnResourceLoadComplete callback will
now also be called in this case for in-progress requests that have a handler.
IResourceHandler.Cancel
method will now always be called when resourcehandling is complete, irrespective of whether handling completed successfully.
OnBeforeClose
callback for theassociated browser (which may happen for in-progress requests that are aborted
on browser destruction) will now always have a non-nullptr
IBrowser
parameter.
IRequest
andIResponse
methods where it makessense (e.g. resetting default response state, or clearing a referrer value).
header) the redirect response must include the "Access-Control-Allow-Origin"
header, otherwise the request will be blocked.
the latest http draft. For historical reasons the draft also allows POST
requests to be converted to GETs when following 301/302 redirects. Most major
browsers do this and so shall we. When a request is converted to GET any POST
data should also be removed.
method and POST data.
API changes:
IResourceRequestHandler
ICookieAccessFilter
IRequestHandler.OnBeforeResourceLoad
moved toIResourceRequestHandler.OnBeforeResourceLoad
IRequestHandler.OnResourceRedirect
moved toIResourceRequestHandler.OnResourceRedirect
IRequestHandler.OnResourceResponse
moved toIResourceRequestHandler.OnResourceResponse
IRequestHandler.GetResourceResponseFilter
moved toIResourceRequestHandler.GetResourceResponseFilter
IRequestHandler.OnResourceLoadComplete
moved toIResourceRequestHandler.OnResourceLoadComplete
IRequestHandler.OnProtocolExecution
moved toIResourceRequestHandler.OnProtocolExecution
IRequestHandler.GetAuthCredentials
signature change,IFrame frame
replaced withstring originUrl
IDragHandler.OnDraggableRegionsChanged
now includes theIFrame
paramCookie Handling
ICookieAccessFilter
which is returned usingIResourceRequestHandler.GetCookieAccessFilter
IRequestHandler.CanGetCookie
IRequestHandler.CanSetCookie
IResourceHandler.CanGetCookie
IResourceHandler.CanSetCookie
ICookieManager.CreateManager
ICookieManager.GetBlockingManager
ICookieManager.SetStoragePath
IRequestContextHandler.GetCookieManager
IRequestContext.GetDefaultCookieManager
renamed toIRequestContext.GetCookieManager
ICookieManager.SetSupportedSchemes
has additionalbool includeDefaults
param.Request/Scheme Handling
The
IRequestHandler
interface has been rewritten as theCEF API
changedSeek
within a stream has been addedIRequestHandler
directly it's reccomended for most cases to inherit fromRequestHandler
and overrideProcessRequestAsync
. See https://github.com/cefsharp/CefSharp/blob/cefsharp/75/CefSharp.Example/CefSharpSchemeHandler.cs for an example.ResourceHandler Headers
IRequest
now has SetHeaderByName and GetHeaderByName which greatly simplifies header get/set.CefSharp Specific API Changes
IResourceHandler.ProcessRequestAsync
now returnsCefReturnValue
instead ofbool
.IResourceHandler.ProcessRequestAsync
is now called inIResourceHandler.Open
which is a new method, as the structure has changed.IResourceHandler.GetResponse
has been removedRequestHandler
(DefaultRequestHandler
exists as a class for now that's marked asObsolete
)RequestHandler
now implementsIRequestHandler
explicitly an exposesprotected virtual
methods to override, previously they were public.ISchemeRegistrar.AddCustomScheme
now takes a set ofSchemeOptions
flags to represent the different options instead of a bool for each param type. Brings the interface in line with theCEF API
.CefSharp.Legacy.LegacyResourceHandlerFactory
has been removed.The text was updated successfully, but these errors were encountered: