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.
7 #include "core/fetch/LinkFetchResource.h"
9 #include "core/fetch/FetchRequest.h"
10 #include "core/fetch/ResourceFetcher.h"
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()