Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Unified Diff: content/browser/appcache/appcache_subresource_url_factory.h

Issue 2956373002: Add support for subresource request loads in AppCache for the network service. (Closed)
Patch Set: Use the precreated AppCacheHost from the AppCacheNavigationHandleCore instance. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « content/browser/appcache/appcache_request_handler.cc ('k') | content/browser/appcache/appcache_subresource_url_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698