Get main frame and subframe AppCache loads to work.

The latest iteration of this patch now has AppCache working for the main frame and
subframe. Subresource loads will be addressed in a later patchset. With this change
the w3schools.com AppCache sample here https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_html_manifest
works.

This has been integrated with kinuko's patch, i.e. we implement the URLLoaderRequestHandler interface to
validate if the request can be serviced via the AppCache.

The URLLoaderFactory for AppCache is now instantiated as needed.

Changes in this patch include the following:
1. The AppCacheRequestHandler class now implements the URLLoaderRequestHandler interface. The handler then initializes
   the AppCacheURLLoader job which allows us to determine if the request would be serviced via the AppCache. If yes
   we return the URLLoaderFactory for the AppCache in the callback or pass null to the callback.

2. We call the AppCacheRequestHandler::InitializeForNavigationNetworkService() function from
   NavigationURLLoaderNetworkService::URLLoaderRequestController::Start() for AppCache.

3. Use the AppCacheResponseReader and AppCacheResponseInfo classes in AppCacheURLLoaderJob to read data from the AppCache.
   The job invokes methods on the URLLoaderClient when it reads the response/data, etc.
   The data from the AppCache is written to a mojo data pipe and passed to the client.

4. I reverted portions of the previous change to the AppCacheURLLoaderRequest class, which was to hold on to a
   unique_ptr for the ResourceRequest. We now hold on to a copy of the request. The CreateLoaderAndStart() method on the factory gives us a
   copy of the request.

5. Moved some of the methods like IsWaiting/IsDeliveringAppCacheResponse/IsDeliveringNetworkResponse/IsDeliveringErrorResponse/IsCacheEntryNotFound to the
   AppCacheJob base class as these implementations could be shared between the URLRequest and URLLoader versions of the subclasses. I also moved the
   member variables used by these methods to the base class.

6. Add WeakPtrFactory to the AppCacheStorage class and provide a getter to return a weak pointer reference to the instance.

BUG=715632

Review-Url: https://codereview.chromium.org/2902653002
Cr-Commit-Position: refs/heads/master@{#478459}
21 files changed