Chromium Code Reviews| Index: Source/core/loader/DocumentLoader.cpp |
| diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp |
| index 7feb915f6c3620b29fcc53db9137eea4292bbbe2..9bec94aa898efa81910204ea28b74fe9d23be5ee 100644 |
| --- a/Source/core/loader/DocumentLoader.cpp |
| +++ b/Source/core/loader/DocumentLoader.cpp |
| @@ -157,25 +157,6 @@ bool DocumentLoader::isURLValidForNewHistoryEntry() const |
| return !originalRequest().url().isEmpty() || !unreachableURL().isEmpty(); |
| } |
| -void DocumentLoader::setRequest(const ResourceRequest& req) |
| -{ |
| - // Replacing an unreachable URL with alternate content looks like a server-side |
| - // redirect at this point, but we can replace a committed dataSource. |
| - bool handlingUnreachableURL = false; |
| - |
| - handlingUnreachableURL = m_substituteData.isValid() && !m_substituteData.failingURL().isEmpty(); |
| - |
| - if (handlingUnreachableURL) |
| - m_committed = false; |
| - |
| - // We should never be getting a redirect callback after the data |
| - // source is committed, except in the unreachable URL case. It |
| - // would be a WebFoundation bug if it sent a redirect callback after commit. |
| - ASSERT(!m_committed); |
|
Nate Chapin
2014/01/06 21:13:22
This ASSERT and resetting of m_committed are not v
|
| - |
| - m_request = req; |
| -} |
| - |
| void DocumentLoader::setMainDocumentError(const ResourceError& error) |
| { |
| m_mainDocumentError = error; |
| @@ -326,11 +307,7 @@ bool DocumentLoader::isRedirectAfterPost(const ResourceRequest& newRequest, cons |
| bool DocumentLoader::shouldContinueForNavigationPolicy(const ResourceRequest& request, PolicyCheckLoadType policyCheckLoadType) |
| { |
| // Don't ask if we are loading an empty URL. |
| - if (request.url().isEmpty()) |
| - return true; |
| - |
| - // We are always willing to show alternate content for unreachable URLs. |
| - if (m_substituteData.isValid() && !m_substituteData.failingURL().isEmpty()) |
| + if (request.url().isEmpty() || m_substituteData.isValid()) |
| return true; |
| // If we're loading content into a subframe, check against the parent's Content Security Policy |
| @@ -406,7 +383,7 @@ void DocumentLoader::willSendRequest(ResourceRequest& newRequest, const Resource |
| } |
| } |
| - setRequest(newRequest); |
| + m_request = newRequest; |
| if (redirectResponse.isNull()) |
| return; |
| @@ -788,7 +765,7 @@ void DocumentLoader::startLoadingMainResource() |
| FetchRequest cachedResourceRequest(request, FetchInitiatorTypeNames::document, mainResourceLoadOptions); |
| m_mainResource = m_fetcher->fetchMainResource(cachedResourceRequest, m_substituteData); |
| if (!m_mainResource) { |
| - setRequest(ResourceRequest()); |
| + m_request = ResourceRequest(); |
| // If the load was aborted by clearing m_request, it's possible the ApplicationCacheHost |
| // is now in a state where starting an empty load will be inconsistent. Replace it with |
| // a new ApplicationCacheHost. |
| @@ -805,7 +782,7 @@ void DocumentLoader::startLoadingMainResource() |
| // the fragment identifier, so add that back in. |
| if (equalIgnoringFragmentIdentifier(m_request.url(), request.url())) |
| request.setURL(m_request.url()); |
| - setRequest(request); |
| + m_request = request; |
| } |
| void DocumentLoader::cancelMainResourceLoad(const ResourceError& resourceError) |
| @@ -819,12 +796,6 @@ void DocumentLoader::cancelMainResourceLoad(const ResourceError& resourceError) |
| mainReceivedError(error); |
| } |
| -DocumentWriter* DocumentLoader::beginWriting(const AtomicString& mimeType, const AtomicString& encoding, const KURL& url) |
| -{ |
| - m_writer = createWriterFor(m_frame, 0, url, mimeType, encoding, false, true); |
| - return m_writer.get(); |
| -} |
| - |
| void DocumentLoader::endWriting(DocumentWriter* writer) |
| { |
| ASSERT_UNUSED(writer, m_writer == writer); |