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

Unified Diff: Source/core/fetch/Resource.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/RawResource.cpp ('k') | Source/core/fetch/ResourceFetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/Resource.h
diff --git a/Source/core/fetch/Resource.h b/Source/core/fetch/Resource.h
index 58340fd9b3733b006e2141bfbccce67610c7ac88..85465bd19c3a0b4a2dc6fa6c90cb3e45db24b5ec 100644
--- a/Source/core/fetch/Resource.h
+++ b/Source/core/fetch/Resource.h
@@ -85,6 +85,7 @@ public:
DecodeError
};
+ // Exposed for testing.
Resource(const ResourceRequest&, Type);
#if ENABLE(OILPAN)
virtual ~Resource();
@@ -104,6 +105,7 @@ public:
virtual String encoding() const { return String(); }
virtual void appendData(const char*, unsigned);
virtual void error(Resource::Status);
+ virtual void setCORSFailed() { }
void setNeedsSynchronousCacheHit(bool needsSynchronousCacheHit) { m_needsSynchronousCacheHit = needsSynchronousCacheHit; }
@@ -416,6 +418,17 @@ private:
static unsigned s_instanceCount;
};
+class ResourceFactory {
+public:
+ virtual Resource* create(const ResourceRequest&, const String&) const = 0;
+ Resource::Type type() const { return m_type; }
+
+protected:
+ ResourceFactory(Resource::Type type) : m_type(type) { }
+
+ Resource::Type m_type;
+};
+
#if !LOG_DISABLED
// Intended to be used in LOG statements.
const char* ResourceTypeName(Resource::Type);
« no previous file with comments | « Source/core/fetch/RawResource.cpp ('k') | Source/core/fetch/ResourceFetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698