| 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 de290b6cc35a6645888f99249d5ea2ed02d9bfd0..aade7d714ec9492a3d1384bb3df6da8705d75448 100644
|
| --- a/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| @@ -175,8 +175,13 @@
|
| if (m_resourceRequest.url().protocolIsInHTTPFamily())
|
| m_cacheHandler = CacheHandler::create(this);
|
|
|
| - if (!accept().isEmpty())
|
| - m_resourceRequest.setHTTPAccept(accept());
|
| + if (!m_resourceRequest.url().hasFragmentIdentifier())
|
| + return;
|
| + KURL urlForCache = MemoryCache::removeFragmentIdentifierIfNeeded(m_resourceRequest.url());
|
| + if (urlForCache.hasFragmentIdentifier())
|
| + return;
|
| + m_fragmentIdentifierForRequest = m_resourceRequest.url().fragmentIdentifier();
|
| + m_resourceRequest.setURL(urlForCache);
|
| }
|
|
|
| Resource::~Resource()
|
| @@ -208,23 +213,28 @@
|
| {
|
| m_options = options;
|
| m_loading = true;
|
| +
|
| + ResourceRequest request(m_revalidatingRequest.isNull() ? m_resourceRequest : m_revalidatingRequest);
|
| + if (!accept().isEmpty())
|
| + request.setHTTPAccept(accept());
|
| +
|
| + // FIXME: It's unfortunate that the cache layer and below get to know anything about fragment identifiers.
|
| + // We should look into removing the expectation of that knowledge from the platform network stacks.
|
| + if (!m_fragmentIdentifierForRequest.isNull()) {
|
| + KURL url = request.url();
|
| + url.setFragmentIdentifier(m_fragmentIdentifierForRequest);
|
| + request.setURL(url);
|
| + m_fragmentIdentifierForRequest = String();
|
| + }
|
| m_status = Pending;
|
| -
|
| if (m_loader) {
|
| ASSERT(m_revalidatingRequest.isNull());
|
| RELEASE_ASSERT(m_options.synchronousPolicy == RequestSynchronously);
|
| m_loader->changeToSynchronous();
|
| return;
|
| }
|
| -
|
| - ResourceRequest& request(m_revalidatingRequest.isNull() ? m_resourceRequest : m_revalidatingRequest);
|
| - ResourceRequest requestCopy(m_revalidatingRequest.isNull() ? m_resourceRequest : m_revalidatingRequest);
|
| - m_loader = ResourceLoader::create(fetcher, this, requestCopy, options);
|
| + m_loader = ResourceLoader::create(fetcher, this, request, options);
|
| m_loader->start();
|
| -
|
| - // Headers might have been modified during load start. Copy them over so long as the url didn't change.
|
| - if (request.url() == requestCopy.url())
|
| - request = requestCopy;
|
| }
|
|
|
| void Resource::checkNotify()
|
|
|