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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 if (type == Resource::Script) { | 156 if (type == Resource::Script) { |
| 157 if (FetchRequest::LazyLoad == request.defer()) | 157 if (FetchRequest::LazyLoad == request.defer()) |
| 158 priority = ResourceLoadPriorityLow; | 158 priority = ResourceLoadPriorityLow; |
| 159 else if (request.forPreload() && m_imageFetched) | 159 else if (request.forPreload() && m_imageFetched) |
| 160 priority = ResourceLoadPriorityMedium; | 160 priority = ResourceLoadPriorityMedium; |
| 161 } else if (FetchRequest::LazyLoad == request.defer()) { | 161 } else if (FetchRequest::LazyLoad == request.defer()) { |
| 162 // A deferred load of type Raw is a link rel=preload, which should be Lo w instead of VeryLow. | 162 // A deferred load of type Raw is a link rel=preload, which should be Lo w instead of VeryLow. |
| 163 priority = type == Resource::Raw ? ResourceLoadPriorityLow : ResourceLoa dPriorityVeryLow; | 163 priority = type == Resource::Raw ? ResourceLoadPriorityLow : ResourceLoa dPriorityVeryLow; |
| 164 } | 164 } |
| 165 | 165 |
| 166 priority = request.resourceRequest().computePriorityForInterventions(priorit y); | |
|
Nate Chapin
2016/08/22 19:47:03
This seems like overkill at first glance. Is there
shivanisha
2016/08/22 20:44:00
LazyLoad results in priority ResourceLoadPriorityL
Nate Chapin
2016/08/22 20:55:12
Ah, I forgot about the script-specific LazyLoad pr
shivanisha
2016/08/23 01:04:46
That's a good suggestion. Done.
| |
| 167 | |
| 166 // A manually set priority acts as a floor. This is used to ensure that sync hronous requests | 168 // A manually set priority acts as a floor. This is used to ensure that sync hronous requests |
| 167 // are always given the highest possible priority, as well as to ensure that there isn't priority | 169 // are always given the highest possible priority, as well as to ensure that there isn't priority |
| 168 // churn if images move in and out of the viewport, or is displayed more tha n once, both in and out | 170 // churn if images move in and out of the viewport, or is displayed more tha n once, both in and out |
| 169 // of the viewport. | 171 // of the viewport. |
| 170 return std::max(context().modifyPriorityForExperiments(priority), request.re sourceRequest().priority()); | 172 return std::max(context().modifyPriorityForExperiments(priority), request.re sourceRequest().priority()); |
| 171 } | 173 } |
| 172 | 174 |
| 173 static void populateResourceTiming(ResourceTimingInfo* info, Resource* resource) | 175 static void populateResourceTiming(ResourceTimingInfo* info, Resource* resource) |
| 174 { | 176 { |
| 175 info->setInitialRequest(resource->resourceRequest()); | 177 info->setInitialRequest(resource->resourceRequest()); |
| (...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1319 visitor->trace(m_context); | 1321 visitor->trace(m_context); |
| 1320 visitor->trace(m_archive); | 1322 visitor->trace(m_archive); |
| 1321 visitor->trace(m_loaders); | 1323 visitor->trace(m_loaders); |
| 1322 visitor->trace(m_nonBlockingLoaders); | 1324 visitor->trace(m_nonBlockingLoaders); |
| 1323 visitor->trace(m_documentResources); | 1325 visitor->trace(m_documentResources); |
| 1324 visitor->trace(m_preloads); | 1326 visitor->trace(m_preloads); |
| 1325 visitor->trace(m_resourceTimingInfoMap); | 1327 visitor->trace(m_resourceTimingInfoMap); |
| 1326 } | 1328 } |
| 1327 | 1329 |
| 1328 } // namespace blink | 1330 } // namespace blink |
| OLD | NEW |