ScriptResource* ScriptResource::fetch(FetchRequest& request, ResourceFetcher* fetcher) { DCHECK_EQ(request.resourceRequest().frameType(), WebURLRequest::FrameTypeNone); request.mutableResourceRequest().setRequestContext( WebURLRequest::RequestContextScript); ScriptResource* resource = toScriptResource( fetcher->requestResource(request, ScriptResourceFactory())); if (resource && !request.integrityMetadata().isEmpty()) resource->setIntegrityMetadata(request.integrityMetadata()); return resource; }
ResourcePtr<ScriptResource> ScriptResource::fetch(FetchRequest& request, ResourceFetcher* fetcher) { ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone); request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestContextScript); return toScriptResource(fetcher->requestResource(request, ScriptResourceFactory())); }