Add support for subresource request loads in AppCache for the network service.
This patch builds on the earlier patch where we passed the URLLoaderFactory for AppCache to the renderer process. The renderer invokes CreateLoaderAndStart which comes to the AppCache factory. We then instantiate the AppCacheRequestHandler instance here and call into it to handle the request. The handler creates the AppCacheURLLoaderJob and passes itself to the job. The job controls the lifetime of the handler. The AppCacheSubresourceURLFactory class is passed the precreated AppCache host during init. We save maintain this as a weak reference in the class to protect against the case where the host dies while we are processing the call from the renderer. Added support to get a weak pointer in the AppCacheHost class. The AppCacheRequestHandler saves away the host as a weak reference during InitializeForNavigationNetworkService() and passes to the factory in MaybeCreateSubresourceFactory() The other changes are to pass the information from CreateLoaderAndStart() to the AppCacheRequestHandler class and from there to the job. A bug was fixed in the AppCacheURLLoaderJob where we weren't terminating the write correctly causing the renderer to not consider the load as complete. With this change normal subresource loads will work. Fallback support is not added yet and will happen in a followup. BUG=715632 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2956373002 Cr-Commit-Position: refs/heads/master@{#485834}
Showing
Please register or sign in to comment