Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / core / fetch / LinkFetchResource.cpp
blobb47985aebcdd8a3d4e4b6ca7ead890321a292be0
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.
6 #include "config.h"
7 #include "core/fetch/LinkFetchResource.h"
9 #include "core/fetch/FetchRequest.h"
10 #include "core/fetch/ResourceFetcher.h"
12 namespace blink {
14 ResourcePtr<Resource> LinkFetchResource::fetch(Resource::Type type, FetchRequest& request, ResourceFetcher* fetcher)
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 == LinkPreload);
18 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone);
19 fetcher->determineRequestContext(request.mutableResourceRequest(), type);
20 return fetcher->requestResource(request, LinkResourceFactory(type));
23 LinkFetchResource::LinkFetchResource(const ResourceRequest& request, Type type)
24 : Resource(request, type)
28 LinkFetchResource::~LinkFetchResource()