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

Unified Diff: Source/core/fetch/LinkFetchResource.cpp

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.h ('k') | Source/core/fetch/RawResource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/LinkFetchResource.cpp
diff --git a/Source/core/fetch/LinkFetchResource.cpp b/Source/core/fetch/LinkFetchResource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b47985aebcdd8a3d4e4b6ca7ead890321a292be0
--- /dev/null
+++ b/Source/core/fetch/LinkFetchResource.cpp
@@ -0,0 +1,32 @@
+// 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.
+
+
+#include "config.h"
+#include "core/fetch/LinkFetchResource.h"
+
+#include "core/fetch/FetchRequest.h"
+#include "core/fetch/ResourceFetcher.h"
+
+namespace blink {
+
+ResourcePtr<Resource> LinkFetchResource::fetch(Resource::Type type, FetchRequest& request, ResourceFetcher* fetcher)
+{
+ // TODO(yoav): Enforce a LinkPreload context here, once we know we're adding one - https://github.com/whatwg/fetch/issues/36
+ ASSERT(type == LinkPrefetch || type == LinkSubresource || type == LinkPreload);
+ ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone);
+ fetcher->determineRequestContext(request.mutableResourceRequest(), type);
+ return fetcher->requestResource(request, LinkResourceFactory(type));
+}
+
+LinkFetchResource::LinkFetchResource(const ResourceRequest& request, Type type)
+ : Resource(request, type)
+{
+}
+
+LinkFetchResource::~LinkFetchResource()
+{
+}
+
+}
« no previous file with comments | « Source/core/fetch/LinkFetchResource.h ('k') | Source/core/fetch/RawResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698