Add support for updating the AppCache using the network URL loader

Desktop / Chromium - Anantanarayanan Iyengar [chromium.org] - 8 August 2017 23:32 EDT

This patch adds the implementation for the methods of the AppCacheUpdateJob::UpdateURLLoaderRequest class added in the last iteration.

Following changes: 1. Bring back the helper classes from mojo for facilitating copying between a mojo buffer and net. These classes are MojoToNetPendingBuffer and MojoToNetIOBuffer.

2. The UpdateRequestBase::Read function does not take an IOBuffer anymore. Instead the subclasses (URLRequest and URLLoader) pass the IOBuffer to AppCacheUpdateJob::URLFetcher::OnReadCompleted()

3. AppCacheUpdateJob::URLFetcher does not maintain an IOBuffer anymore. The buffers are maintained by the request subclasses.

4. The AppCacheUpdateJob::UpdateURLRequest::Read implicitly invokes the fetchers OnReadCompleted() function if the read is synchronously completed. It always returns ERR_IO_PENDING though.

5. The AppCacheServiceImpl class now saves away the URLLoaderFactoryGetter class. This enables the updater based on URLLoader to retrieve the network service from there.

BUG=715632 TEST=Verified by manual testing on the w3schools AppCache test page and http://webdbg.com/test/appcache/ The entries get setup correctly and the page loads in offline

Change-Id: Ic7c42471589aff33c68de9af6bafd0c881e5b4db Reviewed-on: https://chromium-review.googlesource.com/599359

25dba32 Add support for updating the AppCache using the network URL loader.
content/browser/appcache/appcache_service_impl.h | 18 +++
content/browser/appcache/appcache_update_job.cc | 4 +-
.../appcache/appcache_update_request_base.cc | 52 ++++++-
.../appcache/appcache_update_request_base.h | 27 ++--
.../appcache/appcache_update_url_fetcher.cc | 62 ++++----
.../browser/appcache/appcache_update_url_fetcher.h | 5 +-
.../appcache/appcache_update_url_loader_request.cc | 169 ++++++++++++++++-----
.../appcache/appcache_update_url_loader_request.h | 62 +++++++-
.../appcache/appcache_update_url_request.cc | 68 +++------
.../browser/appcache/appcache_update_url_request.h | 13 +-
content/browser/storage_partition_impl.cc | 3 +
content/common/net_adapters.cc | 47 ++++++
content/common/net_adapters.h | 61 ++++++++
13 files changed, 432 insertions(+), 159 deletions(-)

Upstream: git.chromium.org


  • Share