Index: content/browser/appcache/appcache_url_loader_job.h |
diff --git a/content/browser/appcache/appcache_url_loader_job.h b/content/browser/appcache/appcache_url_loader_job.h |
index 8d16a2473b036237f6b4f4a31786a4ae3c9524a3..69e88bd5eb481e2ad827514c09f470e1455d6935 100644 |
--- a/content/browser/appcache/appcache_url_loader_job.h |
+++ b/content/browser/appcache/appcache_url_loader_job.h |
@@ -12,12 +12,14 @@ |
#include "base/time/time.h" |
#include "content/browser/appcache/appcache_entry.h" |
#include "content/browser/appcache/appcache_job.h" |
+#include "content/browser/appcache/appcache_request_handler.h" |
#include "content/browser/appcache/appcache_response.h" |
#include "content/browser/appcache/appcache_storage.h" |
#include "content/browser/loader/url_loader_request_handler.h" |
#include "content/common/content_export.h" |
#include "content/common/resource_request.h" |
#include "content/common/url_loader.mojom.h" |
+#include "mojo/public/cpp/bindings/associated_binding.h" |
#include "mojo/public/cpp/bindings/binding.h" |
#include "mojo/public/cpp/system/data_pipe.h" |
@@ -25,6 +27,8 @@ namespace content { |
class AppCacheRequest; |
class NetToMojoPendingBuffer; |
+class URLLoaderFactoryGetter; |
+struct SubresourceLoadInfo; |
// AppCacheJob wrapper for a mojom::URLLoader implementation which returns |
// responses stored in the AppCache. |
@@ -58,6 +62,18 @@ class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob, |
loader_callback_ = std::move(callback); |
} |
+ // Subresource request load information is passed in the |
+ // |subresource_load_info| parameter. This includes the request id, the |
+ // client pointer, etc. |
+ // |handler| points to the AppCacheRequestHandler instance handling this |
+ // request. The job controls the lifetime of the handler. |
+ // |default_url_loader| is used to retrieve the network loader for requests |
+ // intended to be sent to the network. |
+ void SetSubresourceLoadInfo( |
+ std::unique_ptr<SubresourceLoadInfo> subresource_load_info, |
+ AppCacheRequestHandler* handler, |
+ URLLoaderFactoryGetter* default_url_loader); |
+ |
protected: |
// AppCacheJob::Create() creates this instance. |
friend class AppCacheJob; |
@@ -126,6 +142,27 @@ class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob, |
// the request can be serviced via the AppCache. |
LoaderCallback loader_callback_; |
+ // We own the AppCacheRequestHandler instance for subresource requests. |
+ std::unique_ptr<AppCacheRequestHandler> handler_; |
+ |
+ scoped_refptr<URLLoaderFactoryGetter> default_url_loader_factory_getter_; |
+ |
+ // Holds subresource url loader information. |
+ std::unique_ptr<SubresourceLoadInfo> subresource_load_info_; |
+ |
+ // Timing information for the most recent request. Its start times are |
+ // populated in DeliverAppCachedResponse(). |
+ net::LoadTimingInfo load_timing_info_; |
+ |
+ // Used for subresource requests which go to the network. |
+ mojom::URLLoaderAssociatedPtr network_loader_request_; |
+ |
+ // Binds the subresource URLLoaderClient with us. We can use the regular |
+ // binding_ member above when we remove the need for the associated requests |
+ // issue with URLLoaderFactory. |
+ std::unique_ptr<mojo::AssociatedBinding<mojom::URLLoader>> |
+ associated_binding_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderJob); |
}; |