Index: content/browser/appcache/appcache_url_loader_factory.h |
diff --git a/content/browser/appcache/appcache_url_loader_factory.h b/content/browser/appcache/appcache_url_loader_factory.h |
index f61539519e6d22a0e698a3da521428d5ca104fe7..65e7ca55df7935a2abfbc1a7ca6d998f5250ecab 100644 |
--- a/content/browser/appcache/appcache_url_loader_factory.h |
+++ b/content/browser/appcache/appcache_url_loader_factory.h |
@@ -11,7 +11,9 @@ |
#include "url/gurl.h" |
namespace content { |
-class ChromeAppCacheService; |
+ |
+class AppCacheJob; |
+class AppCacheServiceImpl; |
class URLLoaderFactoryGetter; |
// Implements the URLLoaderFactory mojom for AppCache requests. |
@@ -20,13 +22,12 @@ class AppCacheURLLoaderFactory : public mojom::URLLoaderFactory { |
~AppCacheURLLoaderFactory() override; |
// Factory function to create an instance of the factory. |
- // The |appcache_service| parameter is used to query the underlying |
- // AppCacheStorage instance to check if we can service requests from the |
- // AppCache. We pass unhandled requests to the network service retrieved from |
- // the |factory_getter|. |
+ // 1. The |factory_getter| parameter is used to query the network service |
+ // to pass network requests to. |
+ // 2. The |url_loader_job| is valid only for navigation requests. |
static void CreateURLLoaderFactory(mojom::URLLoaderFactoryRequest request, |
- ChromeAppCacheService* appcache_service, |
- URLLoaderFactoryGetter* factory_getter); |
+ URLLoaderFactoryGetter* factory_getter, |
+ AppCacheJob* url_loader_job); |
// mojom::URLLoaderFactory implementation. |
void CreateLoaderAndStart( |
@@ -42,17 +43,17 @@ class AppCacheURLLoaderFactory : public mojom::URLLoaderFactory { |
SyncLoadCallback callback) override; |
private: |
- AppCacheURLLoaderFactory(ChromeAppCacheService* appcache_service, |
- URLLoaderFactoryGetter* factory_getter); |
- |
- // Used to query AppCacheStorage to see if a request can be served out of the |
- /// AppCache. |
- scoped_refptr<ChromeAppCacheService> appcache_service_; |
+ AppCacheURLLoaderFactory(URLLoaderFactoryGetter* factory_getter, |
+ AppCacheJob* url_loader_job); |
// Used to retrieve the network service factory to pass unhandled requests to |
// the network service. |
scoped_refptr<URLLoaderFactoryGetter> factory_getter_; |
+ // Only set for navigation requests. We release ownership when the client |
+ // binds to us. |
+ std::unique_ptr<AppCacheJob> url_loader_job_; |
+ |
mojo::StrongBindingSet<mojom::URLLoaderFactory> loader_factory_bindings_; |
DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderFactory); |