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

Unified Diff: Source/core/fetch/LinkFetchResource.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/ImageResourceTest.cpp ('k') | Source/core/fetch/LinkFetchResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/LinkFetchResource.h
diff --git a/Source/core/fetch/LinkFetchResource.h b/Source/core/fetch/LinkFetchResource.h
new file mode 100644
index 0000000000000000000000000000000000000000..15e5b175d7b6cea39fe620b73604532fdbac5788
--- /dev/null
+++ b/Source/core/fetch/LinkFetchResource.h
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+#ifndef LinkFetchResource_h
+#define LinkFetchResource_h
+
+#include "core/fetch/Resource.h"
+#include "core/fetch/ResourceClient.h"
+#include "core/fetch/ResourcePtr.h"
+
+namespace blink {
+
+class FetchRequest;
+class ResourceFetcher;
+
+class LinkFetchResource final : public Resource {
+public:
+ typedef ResourceClient ClientType;
+
+ static ResourcePtr<Resource> fetch(Resource::Type, FetchRequest&, ResourceFetcher*);
+ virtual ~LinkFetchResource();
+
+private:
+ class LinkResourceFactory : public ResourceFactory {
+ public:
+ LinkResourceFactory(Resource::Type type)
+ : ResourceFactory(type) { }
+
+ Resource* create(const ResourceRequest& request, const String& charset) const override
+ {
+ return new LinkFetchResource(request, type());
+ }
+ };
+ LinkFetchResource(const ResourceRequest&, Type);
+};
+
+}
+
+#endif // LinkFetchResource_h
« no previous file with comments | « Source/core/fetch/ImageResourceTest.cpp ('k') | Source/core/fetch/LinkFetchResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698