| Index: third_party/WebKit/Source/core/fetch/Resource.cpp
|
| diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| index 9271ff3424ae4c4d85ef0c0b2bd035d2808f6228..ae8596a6848fabf45abb3ee3456d3df9393c6e35 100644
|
| --- a/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| @@ -29,7 +29,7 @@
|
| #include "core/fetch/MemoryCache.h"
|
| #include "core/fetch/ResourceClient.h"
|
| #include "core/fetch/ResourceClientWalker.h"
|
| -#include "core/fetch/ResourceLoader.h"
|
| +#include "core/fetch/ResourceFetcher.h"
|
| #include "core/inspector/InstanceCounters.h"
|
| #include "platform/Histogram.h"
|
| #include "platform/RuntimeEnabledFeatures.h"
|
| @@ -322,7 +322,7 @@ Resource::~Resource()
|
|
|
| DEFINE_TRACE(Resource)
|
| {
|
| - visitor->trace(m_loader);
|
| + visitor->trace(m_fetcher);
|
| visitor->trace(m_cacheHandler);
|
| visitor->trace(m_clients);
|
| visitor->trace(m_clientsAwaitingCallback);
|
| @@ -330,11 +330,11 @@ DEFINE_TRACE(Resource)
|
| MemoryCoordinatorClient::trace(visitor);
|
| }
|
|
|
| -void Resource::setLoader(ResourceLoader* loader)
|
| +void Resource::setFetcher(ResourceFetcher* fetcher)
|
| {
|
| - RELEASE_ASSERT(!m_loader);
|
| + RELEASE_ASSERT(!isLoading());
|
| ASSERT(stillNeedsLoad());
|
| - m_loader = loader;
|
| + m_fetcher = fetcher;
|
| m_status = Pending;
|
| }
|
|
|
| @@ -407,7 +407,7 @@ void Resource::error(const ResourceError& error)
|
| setStatus(LoadError);
|
| ASSERT(errorOccurred());
|
| m_data.clear();
|
| - m_loader = nullptr;
|
| + m_fetcher = nullptr;
|
| checkNotify();
|
| }
|
|
|
| @@ -417,7 +417,7 @@ void Resource::finish(double loadFinishTime)
|
| m_loadFinishTime = loadFinishTime;
|
| if (!errorOccurred())
|
| m_status = Cached;
|
| - m_loader = nullptr;
|
| + m_fetcher = nullptr;
|
| checkNotify();
|
| }
|
|
|
| @@ -548,11 +548,9 @@ void Resource::willFollowRedirect(ResourceRequest& newRequest, const ResourceRes
|
| m_redirectChain.append(RedirectPair(newRequest, redirectResponse));
|
| }
|
|
|
| -void Resource::setResponse(const ResourceResponse& response)
|
| +void Resource::initializeServiceWorkerCachedMetadataHandler(SecurityOrigin* origin)
|
| {
|
| - m_response = response;
|
| - if (m_response.wasFetchedViaServiceWorker())
|
| - m_cacheHandler = ServiceWorkerResponseCachedMetadataHandler::create(this, m_fetcherSecurityOrigin.get());
|
| + m_cacheHandler = ServiceWorkerResponseCachedMetadataHandler::create(this, origin);
|
| }
|
|
|
| void Resource::responseReceived(const ResourceResponse& response, std::unique_ptr<WebDataConsumerHandle>)
|
| @@ -607,10 +605,10 @@ String Resource::reasonNotDeletable() const
|
| }
|
| builder.append(')');
|
| }
|
| - if (m_loader) {
|
| + if (isLoading()) {
|
| if (!builder.isEmpty())
|
| builder.append(' ');
|
| - builder.append("m_loader");
|
| + builder.append("isLoading()");
|
| }
|
| if (m_preloadCount) {
|
| if (!builder.isEmpty())
|
| @@ -741,7 +739,7 @@ void Resource::didRemoveClientOrObserver()
|
|
|
| void Resource::allClientsAndObserversRemoved()
|
| {
|
| - if (!m_loader)
|
| + if (!isLoading())
|
| return;
|
| if (m_type == Raw)
|
| cancelTimerFired(&m_cancelTimer);
|
| @@ -752,8 +750,8 @@ void Resource::allClientsAndObserversRemoved()
|
| void Resource::cancelTimerFired(TimerBase* timer)
|
| {
|
| ASSERT_UNUSED(timer, timer == &m_cancelTimer);
|
| - if (!hasClientsOrObservers() && m_loader)
|
| - m_loader->cancel();
|
| + if (!hasClientsOrObservers() && m_fetcher)
|
| + m_fetcher->cancelResourceLoad(this);
|
| }
|
|
|
| void Resource::setDecodedSize(size_t decodedSize)
|
| @@ -981,8 +979,6 @@ size_t Resource::calculateOverheadSize() const
|
| void Resource::didChangePriority(ResourceLoadPriority loadPriority, int intraPriorityValue)
|
| {
|
| m_resourceRequest.setPriority(loadPriority, intraPriorityValue);
|
| - if (m_loader)
|
| - m_loader->didChangePriority(loadPriority, intraPriorityValue);
|
| }
|
|
|
| static const char* initatorTypeNameToString(const AtomicString& initiatorTypeName)
|
|
|