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

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceLoader.h

Issue 2533683002: Move the code in ResourceFetcher handling calls from WebURLLoaderImpl to ResourceLoader (Closed)
Patch Set: Fix test Created 4 years 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: third_party/WebKit/Source/core/fetch/ResourceLoader.h
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoader.h b/third_party/WebKit/Source/core/fetch/ResourceLoader.h
index ff45ab1131a09453599fdb9c6214d02c541db6cb..b836a4693f80a1129631b31ce32a8356b4e6967e 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceLoader.h
+++ b/third_party/WebKit/Source/core/fetch/ResourceLoader.h
@@ -39,10 +39,15 @@
namespace blink {
+class FetchContext;
class Resource;
class ResourceError;
class ResourceFetcher;
+// A ResourceLoader is created for each Resource by the ResourceFetcher when it
+// needs to load the specified resource. A ResourceLoader creates a
+// WebURLLoader and loads the resource using it. Any per-load logic should be
+// implemented in this class basically.
class CORE_EXPORT ResourceLoader final
: public GarbageCollectedFinalized<ResourceLoader>,
protected WebURLLoaderClient {
@@ -51,16 +56,7 @@ class CORE_EXPORT ResourceLoader final
~ResourceLoader() override;
DECLARE_TRACE();
- void start(const ResourceRequest&,
- WebTaskRunner* loadingTaskRunner,
- bool defersLoading);
-
- // This method is currently only used for service worker fallback request and
- // cache-aware loading, other users should be careful not to break
- // ResourceLoader state.
- void restart(const ResourceRequest&,
- WebTaskRunner* loadingTaskRunner,
- bool defersLoading);
+ void start(const ResourceRequest&);
void cancel();
@@ -105,14 +101,23 @@ class CORE_EXPORT ResourceLoader final
void didFail(const WebURLError&,
int64_t encodedDataLength,
int64_t encodedBodyLength) override;
+ void handleError(const ResourceError&);
void didFinishLoadingFirstPartInMultipart();
- void didFail(const ResourceError&);
private:
// Assumes ResourceFetcher and Resource are non-null.
ResourceLoader(ResourceFetcher*, Resource*);
+ // This method is currently only used for service worker fallback request and
+ // cache-aware loading, other users should be careful not to break
+ // ResourceLoader state.
+ void restart(const ResourceRequest&);
+
+ FetchContext& context() const;
+ ResourceRequestBlockedReason canAccessResponse(Resource*,
+ const ResourceResponse&) const;
+
void cancelForRedirectAccessCheckError(const KURL&,
ResourceRequestBlockedReason);
void requestSynchronously(const ResourceRequest&);
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp ('k') | third_party/WebKit/Source/core/fetch/ResourceLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698