Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 1444413002: Revert of Simplify starting a navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698