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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/fetch/LinkFetchResource.h ('k') | Source/core/fetch/RawResource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5
6 #include "config.h"
7 #include "core/fetch/LinkFetchResource.h"
8
9 #include "core/fetch/FetchRequest.h"
10 #include "core/fetch/ResourceFetcher.h"
11
12 namespace blink {
13
14 ResourcePtr<Resource> LinkFetchResource::fetch(Resource::Type type, FetchRequest & request, ResourceFetcher* fetcher)
15 {
16 // TODO(yoav): Enforce a LinkPreload context here, once we know we're adding one - https://github.com/whatwg/fetch/issues/36
17 ASSERT(type == LinkPrefetch || type == LinkSubresource || type == LinkPreloa d);
18 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone );
19 fetcher->determineRequestContext(request.mutableResourceRequest(), type);
20 return fetcher->requestResource(request, LinkResourceFactory(type));
21 }
22
23 LinkFetchResource::LinkFetchResource(const ResourceRequest& request, Type type)
24 : Resource(request, type)
25 {
26 }
27
28 LinkFetchResource::~LinkFetchResource()
29 {
30 }
31
32 }
OLDNEW
« 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