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

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: Address review comments Created 3 years, 5 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..7a319b1a211d37f3fcebd59f71e4d481ad21c83b 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,6 +14,7 @@
namespace content {
+class AppCacheHost;
class AppCacheJob;
class AppCacheServiceImpl;
class URLLoaderFactoryGetter;
@@ -25,10 +27,15 @@ 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.
- // Returns a URLLoaderFactoryPtr instance which controls the lifetime of the
- // factory.
- static mojom::URLLoaderFactoryPtr CreateURLLoaderFactory(
- URLLoaderFactoryGetter* factory_getter);
+ // 2. The |host| parameter contains the appcache host instance. This is used
+ // create the AppCacheRequestHandler instances for handling subresource
+ // requests.
+ // Returns the AppCacheSubresourceURLFactory instance. The URLLoaderFactoryPtr
+ // is returned in the |loader_factory| parameter.
+ static AppCacheSubresourceURLFactory* CreateURLLoaderFactory(
+ URLLoaderFactoryGetter* factory_getter,
+ base::WeakPtr<AppCacheHost> host,
+ mojom::URLLoaderFactoryPtr* loader_factory);
// mojom::URLLoaderFactory implementation.
void CreateLoaderAndStart(
@@ -47,7 +54,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 +66,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);
};

Powered by Google App Engine
This is Rietveld 408576698