Chromium Code Reviews| Index: third_party/WebKit/Source/core/fetch/ResourceLoader.cpp |
| diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp |
| index 048e1018c6cec0784fa2077e199aeb2a61249805..fa897fcbdbcb6dd71a8ed6df259f50525b8206a2 100644 |
| --- a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp |
| +++ b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp |
| @@ -92,18 +92,21 @@ void ResourceLoader::releaseResources() |
| m_fetcher.clear(); |
| } |
| -void ResourceLoader::start(ResourceRequest& request) |
| +void ResourceLoader::start(ResourceRequest& request, WebTaskRunner* loadingTaskRunner, bool defersLoading) |
| { |
| ASSERT(!m_loader); |
| - |
| - m_fetcher->willStartLoadingResource(m_resource.get(), this, request); |
| RELEASE_ASSERT(m_state == ConnectionStateNew); |
| m_state = ConnectionStateStarted; |
| + if (m_resource->options().synchronousPolicy == RequestSynchronously && defersLoading) { |
|
Yoav Weiss
2016/04/20 08:52:08
Does that constitute a behavior change? I may be r
Nate Chapin
2016/05/18 23:56:04
No behavior change. I moved this from requestSynch
|
| + cancel(); |
| + return; |
| + } |
| + |
| m_loader = adoptPtr(Platform::current()->createURLLoader()); |
| - m_loader->setDefersLoading(m_fetcher->defersLoading()); |
| + m_loader->setDefersLoading(defersLoading); |
| ASSERT(m_loader); |
| - m_loader->setLoadingTaskRunner(m_fetcher->loadingTaskRunner()); |
| + m_loader->setLoadingTaskRunner(loadingTaskRunner); |
| if (m_resource->options().synchronousPolicy == RequestSynchronously) |
| requestSynchronously(request); |
| @@ -376,11 +379,6 @@ void ResourceLoader::requestSynchronously(ResourceRequest& request) |
| // Synchronous requests should always be max priority, lest they hang the renderer. |
| request.setPriority(ResourceLoadPriorityHighest); |
| - if (m_fetcher->defersLoading()) { |
| - cancel(); |
| - return; |
| - } |
| - |
| WrappedResourceRequest requestIn(request); |
| WebURLResponse responseOut; |
| responseOut.initialize(); |