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 12 matching lines...) Expand all Loading... |
23 This class provides all functionality needed for loading images, style sheet
s and html | 23 This class provides all functionality needed for loading images, style sheet
s and html |
24 pages from the web. It has a memory cache for these objects. | 24 pages from the web. It has a memory cache for these objects. |
25 */ | 25 */ |
26 | 26 |
27 #include "core/fetch/ResourceFetcher.h" | 27 #include "core/fetch/ResourceFetcher.h" |
28 | 28 |
29 #include "bindings/core/v8/V8DOMActivityLogger.h" | 29 #include "bindings/core/v8/V8DOMActivityLogger.h" |
30 #include "core/fetch/CrossOriginAccessControl.h" | 30 #include "core/fetch/CrossOriginAccessControl.h" |
31 #include "core/fetch/FetchContext.h" | 31 #include "core/fetch/FetchContext.h" |
32 #include "core/fetch/FetchInitiatorTypeNames.h" | 32 #include "core/fetch/FetchInitiatorTypeNames.h" |
| 33 #include "core/fetch/ImageResource.h" |
33 #include "core/fetch/MemoryCache.h" | 34 #include "core/fetch/MemoryCache.h" |
34 #include "core/fetch/ResourceLoader.h" | 35 #include "core/fetch/ResourceLoader.h" |
35 #include "core/fetch/ResourceLoaderSet.h" | 36 #include "core/fetch/ResourceLoaderSet.h" |
36 #include "core/fetch/UniqueIdentifier.h" | 37 #include "core/fetch/UniqueIdentifier.h" |
37 #include "platform/Logging.h" | 38 #include "platform/Logging.h" |
38 #include "platform/RuntimeEnabledFeatures.h" | 39 #include "platform/RuntimeEnabledFeatures.h" |
39 #include "platform/TraceEvent.h" | 40 #include "platform/TraceEvent.h" |
40 #include "platform/TracedValue.h" | 41 #include "platform/TracedValue.h" |
41 #include "platform/mhtml/ArchiveResource.h" | 42 #include "platform/mhtml/ArchiveResource.h" |
42 #include "platform/mhtml/ArchiveResourceCollection.h" | 43 #include "platform/mhtml/ArchiveResourceCollection.h" |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 ResourceLoadPriority resourceLoadPriority = loadPriority(Resource::Image
, FetchRequest(resource->resourceRequest(), FetchInitiatorInfo()), resourcePrior
ity.visibility); | 1053 ResourceLoadPriority resourceLoadPriority = loadPriority(Resource::Image
, FetchRequest(resource->resourceRequest(), FetchInitiatorInfo()), resourcePrior
ity.visibility); |
1053 if (resourceLoadPriority == resource->resourceRequest().priority()) | 1054 if (resourceLoadPriority == resource->resourceRequest().priority()) |
1054 continue; | 1055 continue; |
1055 | 1056 |
1056 resource->didChangePriority(resourceLoadPriority, resourcePriority.intra
PriorityValue); | 1057 resource->didChangePriority(resourceLoadPriority, resourcePriority.intra
PriorityValue); |
1057 TRACE_EVENT_ASYNC_STEP_INTO1("blink.net", "Resource", resource, "ChangeP
riority", "priority", resourceLoadPriority); | 1058 TRACE_EVENT_ASYNC_STEP_INTO1("blink.net", "Resource", resource, "ChangeP
riority", "priority", resourceLoadPriority); |
1058 context().dispatchDidChangeResourcePriority(resource->identifier(), reso
urceLoadPriority, resourcePriority.intraPriorityValue); | 1059 context().dispatchDidChangeResourcePriority(resource->identifier(), reso
urceLoadPriority, resourcePriority.intraPriorityValue); |
1059 } | 1060 } |
1060 } | 1061 } |
1061 | 1062 |
| 1063 void ResourceFetcher::reloadLoFiImages() |
| 1064 { |
| 1065 for (const auto& documentResource : m_documentResources) { |
| 1066 Resource* resource = documentResource.value.get(); |
| 1067 if (resource && resource->isImage()) { |
| 1068 ImageResource* imageResource = toImageResource(resource); |
| 1069 imageResource->reloadIfLoFi(this); |
| 1070 } |
| 1071 } |
| 1072 } |
| 1073 |
1062 #if PRELOAD_DEBUG | 1074 #if PRELOAD_DEBUG |
1063 void ResourceFetcher::printPreloadStats() | 1075 void ResourceFetcher::printPreloadStats() |
1064 { | 1076 { |
1065 if (!m_preloads) | 1077 if (!m_preloads) |
1066 return; | 1078 return; |
1067 | 1079 |
1068 unsigned scripts = 0; | 1080 unsigned scripts = 0; |
1069 unsigned scriptMisses = 0; | 1081 unsigned scriptMisses = 0; |
1070 unsigned stylesheets = 0; | 1082 unsigned stylesheets = 0; |
1071 unsigned stylesheetMisses = 0; | 1083 unsigned stylesheetMisses = 0; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 visitor->trace(m_loaders); | 1174 visitor->trace(m_loaders); |
1163 visitor->trace(m_nonBlockingLoaders); | 1175 visitor->trace(m_nonBlockingLoaders); |
1164 #if ENABLE(OILPAN) | 1176 #if ENABLE(OILPAN) |
1165 visitor->trace(m_documentResources); | 1177 visitor->trace(m_documentResources); |
1166 visitor->trace(m_preloads); | 1178 visitor->trace(m_preloads); |
1167 visitor->trace(m_resourceTimingInfoMap); | 1179 visitor->trace(m_resourceTimingInfoMap); |
1168 #endif | 1180 #endif |
1169 } | 1181 } |
1170 | 1182 |
1171 } | 1183 } |
OLD | NEW |