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

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

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)
Patch Set: Address review comments 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
« no previous file with comments | « content/browser/appcache/appcache_job.cc ('k') | content/browser/appcache/appcache_request_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b0ed05fc1095b97b1dd1b57866e3fa65b3996e36 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,11 @@ class URLRequest;
namespace content {
class AppCacheJob;
+class AppCacheNavigationHandleCore;
class AppCacheRequest;
class AppCacheRequestHandlerTest;
class AppCacheURLRequestJob;
+struct ResourceRequest;
// 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 +42,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 +73,11 @@ class CONTENT_EXPORT AppCacheRequestHandler
type == RESOURCE_TYPE_SHARED_WORKER;
}
+ static std::unique_ptr<AppCacheRequestHandler>
+ InitializeForNavigationNetworkService(
+ const ResourceRequest& request,
+ AppCacheNavigationHandleCore* appcache_handle_core);
+
private:
friend class AppCacheHost;
@@ -135,6 +144,11 @@ class CONTENT_EXPORT AppCacheRequestHandler
// AppCacheHost::Observer override
void OnCacheSelectionComplete(AppCacheHost* host) override;
+ // URLLoaderRequestHandler override
+ void MaybeCreateLoader(const ResourceRequest& resource_request,
+ ResourceContext* resource_context,
+ LoaderCallback callback) override;
+
// Data members -----------------------------------------------
// What host we're servicing a request for.
@@ -195,6 +209,13 @@ 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 handled 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 handled via
+ // the AppCache, we delete the job.
+ std::unique_ptr<AppCacheJob> navigation_request_job_;
+
friend class content::AppCacheRequestHandlerTest;
DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler);
};
« no previous file with comments | « content/browser/appcache/appcache_job.cc ('k') | content/browser/appcache/appcache_request_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698