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

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

Issue 2982363002: Add support for fallback content for the frame. This includes main and subframes. (Closed)
Patch Set: Address review comments. Add the fallback function as a parameter to LoaderCallback 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_url_loader_job.h
diff --git a/content/browser/appcache/appcache_url_loader_job.h b/content/browser/appcache/appcache_url_loader_job.h
index 8cd759ed453ca085e109421826162b766f3a553f..2ac26ba2e97f347fdf9f488b9a9f2a63efd2c365 100644
--- a/content/browser/appcache/appcache_url_loader_job.h
+++ b/content/browser/appcache/appcache_url_loader_job.h
@@ -96,6 +96,10 @@ class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob,
main_resource_loader_callback_ = std::move(callback);
}
+ void set_main_resource_fallback_handler(ResponseFallback fallback_handler) {
+ main_resource_fallback_handler_ = std::move(fallback_handler);
+ }
+
// Subresource request load information is passed in the
// |subresource_load_info| parameter. This includes the request id, the
// client pointer, etc.
@@ -111,6 +115,13 @@ class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob,
sub_resource_handler_ = std::move(handler);
}
+ // Binds to the URLLoaderRequest instance passed in the |request| parameter.
+ // The URLLoaderClient instance is passed in the |client| parameter. This
+ // enables the client to receive notifications/data, etc for the ensuing
+ // URL load.
+ void BindRequest(mojom::URLLoaderClientPtr client,
+ mojom::URLLoaderRequest request);
+
protected:
// AppCacheJob::Create() creates this instance.
friend class AppCacheJob;
@@ -206,6 +217,10 @@ class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob,
// info when we receive it.
AppCacheURLLoaderRequest* appcache_request_;
+ // Contains the fallback response handler for the main resource, which is
+ // invoked by the client to request fallback responses.
+ ResponseFallback main_resource_fallback_handler_;
+
DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderJob);
};

Powered by Google App Engine
This is Rietveld 408576698