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/MHTMLArchive.h" | 43 #include "platform/mhtml/MHTMLArchive.h" |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 ResourceLoadPriority resourceLoadPriority = loadPriority(Resource::Image
, FetchRequest(resource->resourceRequest(), FetchInitiatorInfo()), resourcePrior
ity.visibility); | 1059 ResourceLoadPriority resourceLoadPriority = loadPriority(Resource::Image
, FetchRequest(resource->resourceRequest(), FetchInitiatorInfo()), resourcePrior
ity.visibility); |
1059 if (resourceLoadPriority == resource->resourceRequest().priority()) | 1060 if (resourceLoadPriority == resource->resourceRequest().priority()) |
1060 continue; | 1061 continue; |
1061 | 1062 |
1062 resource->didChangePriority(resourceLoadPriority, resourcePriority.intra
PriorityValue); | 1063 resource->didChangePriority(resourceLoadPriority, resourcePriority.intra
PriorityValue); |
1063 TRACE_EVENT_ASYNC_STEP_INTO1("blink.net", "Resource", resource, "ChangeP
riority", "priority", resourceLoadPriority); | 1064 TRACE_EVENT_ASYNC_STEP_INTO1("blink.net", "Resource", resource, "ChangeP
riority", "priority", resourceLoadPriority); |
1064 context().dispatchDidChangeResourcePriority(resource->identifier(), reso
urceLoadPriority, resourcePriority.intraPriorityValue); | 1065 context().dispatchDidChangeResourcePriority(resource->identifier(), reso
urceLoadPriority, resourcePriority.intraPriorityValue); |
1065 } | 1066 } |
1066 } | 1067 } |
1067 | 1068 |
| 1069 void ResourceFetcher::reloadLoFiImages() |
| 1070 { |
| 1071 for (const auto& documentResource : m_documentResources) { |
| 1072 Resource* resource = documentResource.value.get(); |
| 1073 if (resource && resource->isImage()) { |
| 1074 ImageResource* imageResource = toImageResource(resource); |
| 1075 imageResource->reloadIfLoFi(this); |
| 1076 } |
| 1077 } |
| 1078 } |
| 1079 |
1068 #if PRELOAD_DEBUG | 1080 #if PRELOAD_DEBUG |
1069 void ResourceFetcher::printPreloadStats() | 1081 void ResourceFetcher::printPreloadStats() |
1070 { | 1082 { |
1071 if (!m_preloads) | 1083 if (!m_preloads) |
1072 return; | 1084 return; |
1073 | 1085 |
1074 unsigned scripts = 0; | 1086 unsigned scripts = 0; |
1075 unsigned scriptMisses = 0; | 1087 unsigned scriptMisses = 0; |
1076 unsigned stylesheets = 0; | 1088 unsigned stylesheets = 0; |
1077 unsigned stylesheetMisses = 0; | 1089 unsigned stylesheetMisses = 0; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 visitor->trace(m_loaders); | 1180 visitor->trace(m_loaders); |
1169 visitor->trace(m_nonBlockingLoaders); | 1181 visitor->trace(m_nonBlockingLoaders); |
1170 #if ENABLE(OILPAN) | 1182 #if ENABLE(OILPAN) |
1171 visitor->trace(m_documentResources); | 1183 visitor->trace(m_documentResources); |
1172 visitor->trace(m_preloads); | 1184 visitor->trace(m_preloads); |
1173 visitor->trace(m_resourceTimingInfoMap); | 1185 visitor->trace(m_resourceTimingInfoMap); |
1174 #endif | 1186 #endif |
1175 } | 1187 } |
1176 | 1188 |
1177 } // namespace blink | 1189 } // namespace blink |
OLD | NEW |