Index: content/browser/appcache/appcache_subresource_url_factory.h |
diff --git a/content/browser/appcache/appcache_subresource_url_factory.h b/content/browser/appcache/appcache_subresource_url_factory.h |
index f55afc472f0c375a4f2e6edb4e4c03d63b98ea09..6f0ad013eee689da2bd0fe803975b3c61ac8500d 100644 |
--- a/content/browser/appcache/appcache_subresource_url_factory.h |
+++ b/content/browser/appcache/appcache_subresource_url_factory.h |
@@ -6,6 +6,7 @@ |
#define CONTENT_BROWSER_APPCACHE_APPCACHE_SUBRESOURCE_URL_FACTORY_H_ |
#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
#include "content/common/url_loader_factory.mojom.h" |
#include "mojo/public/cpp/bindings/binding.h" |
#include "net/traffic_annotation/network_traffic_annotation.h" |
@@ -13,10 +14,26 @@ |
namespace content { |
+class AppCacheHost; |
class AppCacheJob; |
class AppCacheServiceImpl; |
class URLLoaderFactoryGetter; |
+// Holds information about the subresource load request like the routing id, |
+// request id, the client pointer, etc. |
+struct SubresourceLoadInfo { |
jam
2017/06/30 01:31:15
nit: why is this in this header if it's not refere
ananta
2017/06/30 01:39:06
It is populated in the factory cc file. I thought
ananta
2017/06/30 01:53:42
I moved it to the appcache_url_loader_job.h/.cc fi
|
+ SubresourceLoadInfo(); |
+ ~SubresourceLoadInfo(); |
+ |
+ mojom::URLLoaderAssociatedRequest url_loader_request; |
+ int32_t routing_id; |
+ int32_t request_id; |
+ uint32_t options; |
+ ResourceRequest request; |
+ mojom::URLLoaderClientPtr client; |
+ net::MutableNetworkTrafficAnnotationTag traffic_annotation; |
+}; |
+ |
// Implements the URLLoaderFactory mojom for AppCache subresource requests. |
class AppCacheSubresourceURLFactory : public mojom::URLLoaderFactory { |
public: |
@@ -25,10 +42,16 @@ class AppCacheSubresourceURLFactory : public mojom::URLLoaderFactory { |
// Factory function to create an instance of the factory. |
// 1. The |factory_getter| parameter is used to query the network service |
// to pass network requests to. |
+ // 2. The |frame_tree_node_id| parameter contains the FrameTreeNodeId for the |
+ // frame. |
+ // Returns the AppCacheSubresourceURLFactory instance. The URLLoaderFactoryPtr |
+ // is returned in the |loader_factory| parameter. |
// Returns a URLLoaderFactoryPtr instance which controls the lifetime of the |
// factory. |
- static mojom::URLLoaderFactoryPtr CreateURLLoaderFactory( |
- URLLoaderFactoryGetter* factory_getter); |
+ static AppCacheSubresourceURLFactory* CreateURLLoaderFactory( |
+ URLLoaderFactoryGetter* factory_getter, |
+ base::WeakPtr<AppCacheHost> host, |
+ mojom::URLLoaderFactoryPtr* loader_factory); |
// mojom::URLLoaderFactory implementation. |
void CreateLoaderAndStart( |
@@ -47,7 +70,8 @@ class AppCacheSubresourceURLFactory : public mojom::URLLoaderFactory { |
private: |
AppCacheSubresourceURLFactory(mojom::URLLoaderFactoryRequest request, |
- URLLoaderFactoryGetter* factory_getter); |
+ URLLoaderFactoryGetter* factory_getter, |
+ base::WeakPtr<AppCacheHost> host); |
void OnConnectionError(); |
@@ -58,6 +82,8 @@ class AppCacheSubresourceURLFactory : public mojom::URLLoaderFactory { |
// the network service. |
scoped_refptr<URLLoaderFactoryGetter> default_url_loader_factory_getter_; |
+ base::WeakPtr<AppCacheHost> appcache_host_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AppCacheSubresourceURLFactory); |
}; |