OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 #include "core/css/CSSStyleSheet.h" | 35 #include "core/css/CSSStyleSheet.h" |
36 #include "core/css/resolver/StyleResolver.h" | 36 #include "core/css/resolver/StyleResolver.h" |
37 #include "core/dom/ContainerNode.h" | 37 #include "core/dom/ContainerNode.h" |
38 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
39 #include "core/html/LinkRelAttribute.h" | 39 #include "core/html/LinkRelAttribute.h" |
40 #include "core/loader/Prerenderer.h" | 40 #include "core/loader/Prerenderer.h" |
41 #include "core/loader/cache/CachedCSSStyleSheet.h" | 41 #include "core/loader/cache/CachedCSSStyleSheet.h" |
42 #include "core/loader/cache/CachedResourceLoader.h" | 42 #include "core/loader/cache/CachedResourceLoader.h" |
43 #include "core/loader/cache/CachedResourceRequest.h" | 43 #include "core/loader/cache/CachedResourceRequest.h" |
| 44 #include "core/loader/cache/CachedResourceRequestInitiators.h" |
44 #include "core/page/Frame.h" | 45 #include "core/page/Frame.h" |
45 #include "core/page/FrameView.h" | 46 #include "core/page/FrameView.h" |
46 #include "core/page/Settings.h" | 47 #include "core/page/Settings.h" |
47 #include "core/platform/PrerenderHandle.h" | 48 #include "core/platform/PrerenderHandle.h" |
48 #include "core/platform/network/DNS.h" | 49 #include "core/platform/network/DNS.h" |
49 | 50 |
50 namespace WebCore { | 51 namespace WebCore { |
51 | 52 |
52 LinkLoader::LinkLoader(LinkLoaderClient* client) | 53 LinkLoader::LinkLoader(LinkLoaderClient* client) |
53 : m_client(client) | 54 : m_client(client) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (!m_client->shouldLoadLink()) | 124 if (!m_client->shouldLoadLink()) |
124 return false; | 125 return false; |
125 ResourceLoadPriority priority = ResourceLoadPriorityUnresolved; | 126 ResourceLoadPriority priority = ResourceLoadPriorityUnresolved; |
126 CachedResource::Type type = CachedResource::LinkPrefetch; | 127 CachedResource::Type type = CachedResource::LinkPrefetch; |
127 // We only make one request to the cachedresourcelodaer if multiple rel
types are | 128 // We only make one request to the cachedresourcelodaer if multiple rel
types are |
128 // specified, | 129 // specified, |
129 if (relAttribute.isLinkSubresource()) { | 130 if (relAttribute.isLinkSubresource()) { |
130 priority = ResourceLoadPriorityLow; | 131 priority = ResourceLoadPriorityLow; |
131 type = CachedResource::LinkSubresource; | 132 type = CachedResource::LinkSubresource; |
132 } | 133 } |
133 CachedResourceRequest linkRequest(ResourceRequest(document->completeURL(
href)), priority); | 134 CachedResourceRequest linkRequest(ResourceRequest(document->completeURL(
href)), cachedResourceRequestInitiators().link, priority); |
134 | 135 |
135 if (m_cachedLinkResource) { | 136 if (m_cachedLinkResource) { |
136 m_cachedLinkResource->removeClient(this); | 137 m_cachedLinkResource->removeClient(this); |
137 m_cachedLinkResource = 0; | 138 m_cachedLinkResource = 0; |
138 } | 139 } |
139 m_cachedLinkResource = document->cachedResourceLoader()->requestLinkReso
urce(type, linkRequest); | 140 m_cachedLinkResource = document->cachedResourceLoader()->requestLinkReso
urce(type, linkRequest); |
140 if (m_cachedLinkResource) | 141 if (m_cachedLinkResource) |
141 m_cachedLinkResource->addClient(this); | 142 m_cachedLinkResource->addClient(this); |
142 } | 143 } |
143 | 144 |
(...skipping 16 matching lines...) Expand all Loading... |
160 // Only prerenders need treatment here; other links either use the CachedRes
ource interface, or are notionally | 161 // Only prerenders need treatment here; other links either use the CachedRes
ource interface, or are notionally |
161 // atomic (dns prefetch). | 162 // atomic (dns prefetch). |
162 if (m_prerenderHandle) { | 163 if (m_prerenderHandle) { |
163 m_prerenderHandle->cancel(); | 164 m_prerenderHandle->cancel(); |
164 m_prerenderHandle->removeClient(); | 165 m_prerenderHandle->removeClient(); |
165 m_prerenderHandle.clear(); | 166 m_prerenderHandle.clear(); |
166 } | 167 } |
167 } | 168 } |
168 | 169 |
169 } | 170 } |
OLD | NEW |