| 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 | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 rights reserved. | 6 rights reserved. |
| 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 8 | 8 |
| 9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
| 10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
| 11 License as published by the Free Software Foundation; either | 11 License as published by the Free Software Foundation; either |
| 12 version 2 of the License, or (at your option) any later version. | 12 version 2 of the License, or (at your option) any later version. |
| 13 | 13 |
| 14 This library is distributed in the hope that it will be useful, | 14 This library is distributed in the hope that it will be useful, |
| 15 but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 Library General Public License for more details. | 17 Library General Public License for more details. |
| 18 | 18 |
| 19 You should have received a copy of the GNU Library General Public License | 19 You should have received a copy of the GNU Library General Public License |
| 20 along with this library; see the file COPYING.LIB. If not, write to | 20 along with this library; see the file COPYING.LIB. If not, write to |
| 21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 Boston, MA 02110-1301, USA. | 22 Boston, MA 02110-1301, USA. |
| 23 | 23 |
| 24 This class provides all functionality needed for loading images, style | 24 This class provides all functionality needed for loading images, style |
| 25 sheets and html pages from the web. It has a memory cache for these objects. | 25 sheets and html pages from the web. It has a memory cache for these objects. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "core/fetch/ResourceFetcher.h" | 28 #include "platform/loader/fetch/ResourceFetcher.h" |
| 29 | 29 |
| 30 #include "core/fetch/FetchContext.h" | |
| 31 #include "core/fetch/FetchInitiatorTypeNames.h" | |
| 32 #include "core/fetch/MemoryCache.h" | |
| 33 #include "core/fetch/ResourceLoader.h" | |
| 34 #include "core/fetch/ResourceLoadingLog.h" | |
| 35 #include "core/fetch/UniqueIdentifier.h" | |
| 36 #include "platform/Histogram.h" | 30 #include "platform/Histogram.h" |
| 37 #include "platform/RuntimeEnabledFeatures.h" | 31 #include "platform/RuntimeEnabledFeatures.h" |
| 38 #include "platform/instrumentation/tracing/TraceEvent.h" | 32 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 39 #include "platform/instrumentation/tracing/TracedValue.h" | 33 #include "platform/instrumentation/tracing/TracedValue.h" |
| 34 #include "platform/loader/fetch/FetchContext.h" |
| 35 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" |
| 36 #include "platform/loader/fetch/MemoryCache.h" |
| 37 #include "platform/loader/fetch/ResourceLoader.h" |
| 38 #include "platform/loader/fetch/ResourceLoadingLog.h" |
| 39 #include "platform/loader/fetch/UniqueIdentifier.h" |
| 40 #include "platform/mhtml/ArchiveResource.h" | 40 #include "platform/mhtml/ArchiveResource.h" |
| 41 #include "platform/mhtml/MHTMLArchive.h" | 41 #include "platform/mhtml/MHTMLArchive.h" |
| 42 #include "platform/network/NetworkInstrumentation.h" | 42 #include "platform/network/NetworkInstrumentation.h" |
| 43 #include "platform/network/NetworkUtils.h" | 43 #include "platform/network/NetworkUtils.h" |
| 44 #include "platform/network/ResourceTimingInfo.h" | 44 #include "platform/network/ResourceTimingInfo.h" |
| 45 #include "platform/weborigin/KnownPorts.h" | 45 #include "platform/weborigin/KnownPorts.h" |
| 46 #include "platform/weborigin/SecurityOrigin.h" | 46 #include "platform/weborigin/SecurityOrigin.h" |
| 47 #include "platform/weborigin/SecurityPolicy.h" | 47 #include "platform/weborigin/SecurityPolicy.h" |
| 48 #include "public/platform/Platform.h" | 48 #include "public/platform/Platform.h" |
| 49 #include "public/platform/WebCachePolicy.h" | 49 #include "public/platform/WebCachePolicy.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 ResourceFetcher::ResourceFetcher(FetchContext* newContext) | 248 ResourceFetcher::ResourceFetcher(FetchContext* newContext) |
| 249 : m_context(newContext), | 249 : m_context(newContext), |
| 250 m_archive(context().isMainFrame() ? nullptr : context().archive()), | 250 m_archive(context().isMainFrame() ? nullptr : context().archive()), |
| 251 m_resourceTimingReportTimer( | 251 m_resourceTimingReportTimer( |
| 252 this, | 252 this, |
| 253 &ResourceFetcher::resourceTimingReportTimerFired), | 253 &ResourceFetcher::resourceTimingReportTimerFired), |
| 254 m_autoLoadImages(true), | 254 m_autoLoadImages(true), |
| 255 m_imagesEnabled(true), | 255 m_imagesEnabled(true), |
| 256 m_allowStaleResources(false), | 256 m_allowStaleResources(false), |
| 257 m_imageFetched(false) { | 257 m_imageFetched(false) {} |
| 258 } | |
| 259 | 258 |
| 260 ResourceFetcher::~ResourceFetcher() {} | 259 ResourceFetcher::~ResourceFetcher() {} |
| 261 | 260 |
| 262 Resource* ResourceFetcher::cachedResource(const KURL& resourceURL) const { | 261 Resource* ResourceFetcher::cachedResource(const KURL& resourceURL) const { |
| 263 KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(resourceURL); | 262 KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(resourceURL); |
| 264 const WeakMember<Resource>& resource = m_documentResources.get(url); | 263 const WeakMember<Resource>& resource = m_documentResources.get(url); |
| 265 return resource.get(); | 264 return resource.get(); |
| 266 } | 265 } |
| 267 | 266 |
| 268 bool ResourceFetcher::isControlledByServiceWorker() const { | 267 bool ResourceFetcher::isControlledByServiceWorker() const { |
| (...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1502 visitor->trace(m_context); | 1501 visitor->trace(m_context); |
| 1503 visitor->trace(m_archive); | 1502 visitor->trace(m_archive); |
| 1504 visitor->trace(m_loaders); | 1503 visitor->trace(m_loaders); |
| 1505 visitor->trace(m_nonBlockingLoaders); | 1504 visitor->trace(m_nonBlockingLoaders); |
| 1506 visitor->trace(m_documentResources); | 1505 visitor->trace(m_documentResources); |
| 1507 visitor->trace(m_preloads); | 1506 visitor->trace(m_preloads); |
| 1508 visitor->trace(m_resourceTimingInfoMap); | 1507 visitor->trace(m_resourceTimingInfoMap); |
| 1509 } | 1508 } |
| 1510 | 1509 |
| 1511 } // namespace blink | 1510 } // namespace blink |
| OLD | NEW |