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

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

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)
Patch Set: Another attempt at fixing redness 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_request_handler.h
diff --git a/content/browser/appcache/appcache_request_handler.h b/content/browser/appcache/appcache_request_handler.h
index 3b7e16736d50b3198620f2e4367daa3bce0686e3..70ba472503523c1293ed3342cc66eb852ee80b81 100644
--- a/content/browser/appcache/appcache_request_handler.h
+++ b/content/browser/appcache/appcache_request_handler.h
@@ -16,6 +16,7 @@
#include "content/browser/appcache/appcache_entry.h"
#include "content/browser/appcache/appcache_host.h"
#include "content/browser/appcache/appcache_service_impl.h"
+#include "content/browser/loader/url_loader_request_handler.h"
#include "content/common/content_export.h"
#include "content/public/common/resource_type.h"
@@ -26,9 +27,12 @@ class URLRequest;
namespace content {
class AppCacheJob;
+class AppCacheNavigationHandleCore;
class AppCacheRequest;
class AppCacheRequestHandlerTest;
class AppCacheURLRequestJob;
+struct ResourceRequest;
+class URLLoaderFactoryGetter;
// An instance is created for each net::URLRequest. The instance survives all
// http transactions involved in the processing of its net::URLRequest, and is
@@ -39,7 +43,8 @@ class CONTENT_EXPORT AppCacheRequestHandler
: public base::SupportsUserData::Data,
public AppCacheHost::Observer,
public AppCacheServiceImpl::Observer,
- public AppCacheStorage::Delegate {
+ public AppCacheStorage::Delegate,
+ public URLLoaderRequestHandler {
public:
~AppCacheRequestHandler() override;
@@ -69,6 +74,12 @@ class CONTENT_EXPORT AppCacheRequestHandler
type == RESOURCE_TYPE_SHARED_WORKER;
}
+ static std::unique_ptr<AppCacheRequestHandler>
+ InitializeForNavigationNetworkService(
+ const ResourceRequest& request,
+ AppCacheNavigationHandleCore* appcache_handle_core,
+ URLLoaderFactoryGetter* url_loader_factory_getter);
kinuko 2017/06/06 08:07:30 Yeah thanks for making this look similar to SW cas
ananta 2017/06/06 20:49:15 +1
+
private:
friend class AppCacheHost;
@@ -135,6 +146,11 @@ class CONTENT_EXPORT AppCacheRequestHandler
// AppCacheHost::Observer override
void OnCacheSelectionComplete(AppCacheHost* host) override;
+ // URLLoaderRequestHandler override
+ void MaybeCreateLoaderFactory(const ResourceRequest& resource_request,
+ ResourceContext* resource_context,
+ LoaderFactoryCallback callback) override;
+
// Data members -----------------------------------------------
// What host we're servicing a request for.
@@ -195,6 +211,22 @@ class CONTENT_EXPORT AppCacheRequestHandler
std::unique_ptr<AppCacheRequest> request_;
+ // In the network service world we are queried via the URLLoaderRequestHandler
+ // interface to see if the navigation request can be serviced via the
+ // AppCache. We hold onto the AppCache job created here until the client
+ // binds to it (Serviced via AppCache). If the request cannot be serviced via
+ // the AppCache, we delete the job.
+ std::unique_ptr<AppCacheJob> navigation_request_job_;
+
+ // The Callback to be invoked in the network service land to indicate if
+ // the request can be serviced via the AppCache.
+ LoaderFactoryCallback loader_factory_callback_;
+
+ // In network service world used to to get the default network service.
+ scoped_refptr<URLLoaderFactoryGetter> url_loader_factory_getter_;
+
+ mojom::URLLoaderFactoryPtr appcache_factory_;
+
friend class content::AppCacheRequestHandlerTest;
DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler);
};

Powered by Google App Engine
This is Rietveld 408576698