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

Side by Side Diff: third_party/WebKit/Source/core/fetch/XSLStyleSheetResource.cpp

Issue 2072613002: Make ResourceLoadPriority calculation simpler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // difference between an XSL stylesheet and a CSS stylesheet, so it assumes 43 // difference between an XSL stylesheet and a CSS stylesheet, so it assumes
44 // stylesheets are all CSS unless they already have an Accept: header set. 44 // stylesheets are all CSS unless they already have an Accept: header set.
45 // Should we teach the browser process the difference? 45 // Should we teach the browser process the difference?
46 DEFINE_STATIC_LOCAL(const AtomicString, acceptXSLT, ("text/xml, application/ xml, application/xhtml+xml, text/xsl, application/rss+xml, application/atom+xml" )); 46 DEFINE_STATIC_LOCAL(const AtomicString, acceptXSLT, ("text/xml, application/ xml, application/xhtml+xml, text/xsl, application/rss+xml, application/atom+xml" ));
47 request.setHTTPAccept(acceptXSLT); 47 request.setHTTPAccept(acceptXSLT);
48 } 48 }
49 49
50 XSLStyleSheetResource* XSLStyleSheetResource::fetchSynchronously(FetchRequest& r equest, ResourceFetcher* fetcher) 50 XSLStyleSheetResource* XSLStyleSheetResource::fetchSynchronously(FetchRequest& r equest, ResourceFetcher* fetcher)
51 { 51 {
52 applyXSLRequestProperties(request.mutableResourceRequest()); 52 applyXSLRequestProperties(request.mutableResourceRequest());
53 request.mutableResourceRequest().setTimeoutInterval(10); 53 request.makeSynchronous();
54 ResourceLoaderOptions options(request.options());
55 options.synchronousPolicy = RequestSynchronously;
56 request.setOptions(options);
57 XSLStyleSheetResource* resource = toXSLStyleSheetResource(fetcher->requestRe source(request, XSLStyleSheetResourceFactory())); 54 XSLStyleSheetResource* resource = toXSLStyleSheetResource(fetcher->requestRe source(request, XSLStyleSheetResourceFactory()));
58 if (resource && resource->m_data) 55 if (resource && resource->m_data)
59 resource->m_sheet = resource->decodedText(); 56 resource->m_sheet = resource->decodedText();
60 return resource; 57 return resource;
61 } 58 }
62 59
63 XSLStyleSheetResource* XSLStyleSheetResource::fetch(FetchRequest& request, Resou rceFetcher* fetcher) 60 XSLStyleSheetResource* XSLStyleSheetResource::fetch(FetchRequest& request, Resou rceFetcher* fetcher)
64 { 61 {
65 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); 62 ASSERT(RuntimeEnabledFeatures::xsltEnabled());
66 applyXSLRequestProperties(request.mutableResourceRequest()); 63 applyXSLRequestProperties(request.mutableResourceRequest());
(...skipping 17 matching lines...) Expand all
84 { 81 {
85 if (m_data.get()) 82 if (m_data.get())
86 m_sheet = decodedText(); 83 m_sheet = decodedText();
87 84
88 ResourceClientWalker<StyleSheetResourceClient> w(clients()); 85 ResourceClientWalker<StyleSheetResourceClient> w(clients());
89 while (StyleSheetResourceClient* c = w.next()) 86 while (StyleSheetResourceClient* c = w.next())
90 c->setXSLStyleSheet(m_resourceRequest.url(), m_response.url(), m_sheet); 87 c->setXSLStyleSheet(m_resourceRequest.url(), m_response.url(), m_sheet);
91 } 88 }
92 89
93 } // namespace blink 90 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | third_party/WebKit/Source/core/html/LinkResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698