Chromium Code Reviews| OLD | NEW |
|---|---|
| 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, 2009, 2010, 2011 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 #endif | 142 #endif |
| 143 #if ENABLE(CSS_SHADERS) | 143 #if ENABLE(CSS_SHADERS) |
| 144 case CachedResource::ShaderResource: | 144 case CachedResource::ShaderResource: |
| 145 return ResourceLoadPriorityMedium; | 145 return ResourceLoadPriorityMedium; |
| 146 #endif | 146 #endif |
| 147 } | 147 } |
| 148 ASSERT_NOT_REACHED(); | 148 ASSERT_NOT_REACHED(); |
| 149 return ResourceLoadPriorityLow; | 149 return ResourceLoadPriorityLow; |
| 150 } | 150 } |
| 151 | 151 |
| 152 #if PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY) | 152 #if PLATFORM(CHROMIUM) |
|
eseidel
2013/04/06 01:36:47
We can remove these whole defines now, but we can
eae
2013/04/06 01:59:05
I'd rather do the PLATFORM(CHROMIUM) work in a sep
| |
| 153 static ResourceRequest::TargetType cachedResourceTypeToTargetType(CachedResource ::Type type) | 153 static ResourceRequest::TargetType cachedResourceTypeToTargetType(CachedResource ::Type type) |
| 154 { | 154 { |
| 155 switch (type) { | 155 switch (type) { |
| 156 case CachedResource::MainResource: | 156 case CachedResource::MainResource: |
| 157 return ResourceRequest::TargetIsMainFrame; | 157 return ResourceRequest::TargetIsMainFrame; |
| 158 case CachedResource::CSSStyleSheet: | 158 case CachedResource::CSSStyleSheet: |
| 159 #if ENABLE(XSLT) | 159 #if ENABLE(XSLT) |
| 160 case CachedResource::XSLStyleSheet: | 160 case CachedResource::XSLStyleSheet: |
| 161 #endif | 161 #endif |
| 162 return ResourceRequest::TargetIsStyleSheet; | 162 return ResourceRequest::TargetIsStyleSheet; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 | 301 |
| 302 FrameLoader* frameLoader = cachedResourceLoader->frame()->loader(); | 302 FrameLoader* frameLoader = cachedResourceLoader->frame()->loader(); |
| 303 if (options.securityCheck == DoSecurityCheck && (frameLoader->state() == Fra meStateProvisional || !frameLoader->activeDocumentLoader() || frameLoader->activ eDocumentLoader()->isStopping())) { | 303 if (options.securityCheck == DoSecurityCheck && (frameLoader->state() == Fra meStateProvisional || !frameLoader->activeDocumentLoader() || frameLoader->activ eDocumentLoader()->isStopping())) { |
| 304 failBeforeStarting(); | 304 failBeforeStarting(); |
| 305 return; | 305 return; |
| 306 } | 306 } |
| 307 | 307 |
| 308 m_options = options; | 308 m_options = options; |
| 309 m_loading = true; | 309 m_loading = true; |
| 310 | 310 |
| 311 #if PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY) | 311 #if PLATFORM(CHROMIUM) |
| 312 if (m_resourceRequest.targetType() == ResourceRequest::TargetIsUnspecified) | 312 if (m_resourceRequest.targetType() == ResourceRequest::TargetIsUnspecified) |
| 313 m_resourceRequest.setTargetType(cachedResourceTypeToTargetType(type())); | 313 m_resourceRequest.setTargetType(cachedResourceTypeToTargetType(type())); |
| 314 #endif | 314 #endif |
| 315 | 315 |
| 316 if (!accept().isEmpty()) | 316 if (!accept().isEmpty()) |
| 317 m_resourceRequest.setHTTPAccept(accept()); | 317 m_resourceRequest.setHTTPAccept(accept()); |
| 318 | 318 |
| 319 if (isCacheValidator()) { | 319 if (isCacheValidator()) { |
| 320 CachedResource* resourceToRevalidate = m_resourceToRevalidate; | 320 CachedResource* resourceToRevalidate = m_resourceToRevalidate; |
| 321 ASSERT(resourceToRevalidate->canUseCacheValidator()); | 321 ASSERT(resourceToRevalidate->canUseCacheValidator()); |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 972 // Because the disk cache is asynchronous and racey with regards to the data we might be asked to replace, | 972 // Because the disk cache is asynchronous and racey with regards to the data we might be asked to replace, |
| 973 // we need to verify that the new buffer has the same contents as our old bu ffer. | 973 // we need to verify that the new buffer has the same contents as our old bu ffer. |
| 974 if (m_data->size() != newBuffer->size() || memcmp(m_data->data(), newBuffer- >data(), m_data->size())) | 974 if (m_data->size() != newBuffer->size() || memcmp(m_data->data(), newBuffer- >data(), m_data->size())) |
| 975 return; | 975 return; |
| 976 | 976 |
| 977 m_data->tryReplaceSharedBufferContents(newBuffer.get()); | 977 m_data->tryReplaceSharedBufferContents(newBuffer.get()); |
| 978 } | 978 } |
| 979 #endif | 979 #endif |
| 980 | 980 |
| 981 } | 981 } |
| OLD | NEW |