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

Unified Diff: Source/core/fetch/RawResource.h

Issue 1170503003: Remove resource type-specific fetching logic from ResourceFetcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null-check Document::loader() before calling startPreload() Created 5 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 | « Source/core/fetch/LinkFetchResource.cpp ('k') | Source/core/fetch/RawResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/RawResource.h
diff --git a/Source/core/fetch/RawResource.h b/Source/core/fetch/RawResource.h
index f354a5cb6add5103fb2633bb9cdbde17079ed429..62da51c48cc38a0e8b08402e099750bb5c5d69b3 100644
--- a/Source/core/fetch/RawResource.h
+++ b/Source/core/fetch/RawResource.h
@@ -30,12 +30,23 @@
#include "wtf/PassOwnPtr.h"
namespace blink {
+class FetchRequest;
class RawResourceClient;
+class ResourceFetcher;
+class SubstituteData;
class CORE_EXPORT RawResource final : public Resource {
public:
typedef RawResourceClient ClientType;
+ static ResourcePtr<Resource> fetchSynchronously(FetchRequest&, ResourceFetcher*);
+ static ResourcePtr<RawResource> fetch(FetchRequest&, ResourceFetcher*);
+ static ResourcePtr<RawResource> fetchMainResource(FetchRequest&, ResourceFetcher*, const SubstituteData&);
+ static ResourcePtr<RawResource> fetchImport(FetchRequest&, ResourceFetcher*);
+ static ResourcePtr<RawResource> fetchMedia(FetchRequest&, ResourceFetcher*);
+ static ResourcePtr<RawResource> fetchTextTrack(FetchRequest&, ResourceFetcher*);
+
+ // Exposed for testing
RawResource(const ResourceRequest&, Type);
// FIXME: AssociatedURLLoader shouldn't be a DocumentThreadableLoader and therefore shouldn't
@@ -46,6 +57,18 @@ public:
bool canReuse(const ResourceRequest&) const override;
private:
+ class RawResourceFactory : public ResourceFactory {
+ public:
+ RawResourceFactory(Resource::Type type)
+ : ResourceFactory(type) { }
+
+ Resource* create(const ResourceRequest& request, const String& charset) const override
+ {
+ return new RawResource(request, m_type);
+ }
+ };
+ static void preCacheSubstituteDataForMainResource(const FetchRequest&, ResourceFetcher*, const SubstituteData&);
+
void didAddClient(ResourceClient*) override;
void appendData(const char*, unsigned) override;
« no previous file with comments | « Source/core/fetch/LinkFetchResource.cpp ('k') | Source/core/fetch/RawResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698