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

Issue 12090050: Revert 138962 (Closed)

Created:
7 years, 10 months ago by karen
Modified:
7 years, 10 months ago
Reviewers:
ap
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/1397/
Visibility:
Public.

Description

Revert 138962 > ResourceHandle::willLoadFromCache is evil > https://bugs.webkit.org/show_bug.cgi?id=106147 > > Reviewed by Brady Eidson. > > For back/forward navigations to a page that's a result of form submission, we may > never silently re-submit the form. So, we show a warning dialog when about to re-submit, > but try to load from cache if possible. > > This patch changes the logic so that we always try to fetch from cache, without > any preflighting. If cache load fails, we restart the load as a known re-submit. > > No behavior change expected, so no tests. > > * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::handleClick): > Added a FIXME. > > * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::startLoadingMainResource): > Amended a FIXME with some information about why this call may still be needed. > > * loader/FrameLoader.h: > * loader/FrameLoader.cpp: > (WebCore::FrameLoader::loadURLIntoChildFrame): Pass an explicit argument for unchanged caching behavior. > (WebCore::FrameLoader::reloadWithOverrideEncoding): Added a FIXME. This function > can silently re-submit a form. > (WebCore::FrameLoader::addExtraFieldsToMainResourceRequest): Added a FIXME about > an incorrect use of current load type. > (WebCore::FrameLoader::addExtraFieldsToRequest): Make sure that a correct caching > policy is used for subresources even if main resource was loaded from cache. We > didn't need that before because initial request had wrong extra fields due to a use > of m_loadType when it was first called. > Removed code to change caching policy for b/f navigations. This function does not > have enough context to decide what the policy should be. > (WebCore::FrameLoader::loadDifferentDocumentItem): Added an argument telling the > function whether it should attempt loading from cache. It should do that on first > attempt to navigate to a form submission result, but not if that failed. > Pass a correct loadType - m_loadType is one for _previous_ load. > Removed a special case for https - we've long stopped prohibiting caching of https > resources, and using a resource that's already cached should definitely be allowed. > (WebCore::FrameLoader::loadItem): Pass an explicit argument for unchanged caching behavior. > (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad): Added. > > * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::notifyFinished): > Removed a check for m_resource being null, because we were immediately dereferencing > it anyway. > Call retryAfterFailedCacheOnlyMainResourceLoad() to let FrameLoader restart the navigation. > > * platform/network/ResourceHandle.h: > * platform/network/blackberry/ResourceHandleBlackBerry.cpp: > * platform/network/cf/ResourceHandleCFNet.cpp: > * platform/network/chromium/ResourceHandle.cpp: > * platform/network/curl/ResourceHandleCurl.cpp: > * platform/network/mac/ResourceHandleMac.mm: > * platform/network/qt/ResourceHandleQt.cpp: > * platform/network/soup/ResourceHandleSoup.cpp: > * platform/network/win/ResourceHandleWin.cpp: > Removed willLoadFromCache() - the new logic is cross-platform. > > TBR=ap@apple.com Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=141118

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -68 lines) Patch
M Source/WebCore/html/HTMLAnchorElement.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/WebCore/loader/DocumentLoader.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/WebCore/loader/FrameLoader.h View 2 chunks +1 line, -8 lines 0 comments Download
M Source/WebCore/loader/FrameLoader.cpp View 10 chunks +24 lines, -50 lines 0 comments Download
M Source/WebCore/loader/MainResourceLoader.cpp View 1 chunk +1 line, -7 lines 0 comments Download
M Source/WebCore/platform/network/ResourceHandle.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/WebCore/platform/network/blackberry/ResourceHandleBlackBerry.cpp View 1 chunk +6 lines, -0 lines 0 comments Download
M Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp View 1 chunk +17 lines, -0 lines 0 comments Download
M Source/WebCore/platform/network/chromium/ResourceHandle.cpp View 1 chunk +16 lines, -0 lines 0 comments Download
M Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp View 1 chunk +6 lines, -0 lines 0 comments Download
M Source/WebCore/platform/network/mac/ResourceHandleMac.mm View 1 chunk +13 lines, -0 lines 0 comments Download
M Source/WebCore/platform/network/qt/ResourceHandleQt.cpp View 1 chunk +24 lines, -0 lines 0 comments Download
M Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp View 1 chunk +8 lines, -0 lines 0 comments Download
M Source/WebCore/platform/network/win/ResourceHandleWin.cpp View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
karen
7 years, 10 months ago (2013-01-29 16:52:23 UTC) #1
ap_apple.com
7 years, 10 months ago (2013-01-29 17:36:55 UTC) #2
What is that?

- WBR, Alexey Proskuryakov

29.01.2013, в 08:52, karen@chromium.org написал(а):

> Reviewers: ap_apple.com,
> 
> Description:
> Revert 138962
>>         ResourceHandle::willLoadFromCache is evil
>>         https://bugs.webkit.org/show_bug.cgi?id=106147
> 
>>         Reviewed by Brady Eidson.
> 
>>         For back/forward navigations to a page that's a result of form
> submission, we may
>>         never silently re-submit the form. So, we show a warning dialog when
> about to re-submit,
>>         but try to load from cache if possible.
> 
>>         This patch changes the logic so that we always try to fetch from
> cache, without
>>         any preflighting. If cache load fails, we restart the load as a
known
> re-submit.
> 
>>         No behavior change expected, so no tests.
> 
>>         * html/HTMLAnchorElement.cpp:
> (WebCore::HTMLAnchorElement::handleClick):
>>         Added a FIXME.
> 
>>         * loader/DocumentLoader.cpp:
> (WebCore::DocumentLoader::startLoadingMainResource):
>>         Amended a FIXME with some information about why this call may still
be
> needed.
> 
>>         * loader/FrameLoader.h:
>>         * loader/FrameLoader.cpp:
>>         (WebCore::FrameLoader::loadURLIntoChildFrame): Pass an explicit
> argument for unchanged caching behavior.
>>         (WebCore::FrameLoader::reloadWithOverrideEncoding): Added a FIXME.
> This function
>>         can silently re-submit a form.
>>         (WebCore::FrameLoader::addExtraFieldsToMainResourceRequest): Added a
> FIXME about
>>         an incorrect use of current load type.
>>         (WebCore::FrameLoader::addExtraFieldsToRequest): Make sure that a
> correct caching
>>         policy is used for subresources even if main resource was loaded
from
> cache. We
>>         didn't need that before because initial request had wrong extra
fields
> due to a use
>>         of m_loadType when it was first called.
>>         Removed code to change caching policy for b/f navigations. This
> function does not
>>         have enough context to decide what the policy should be.
>>         (WebCore::FrameLoader::loadDifferentDocumentItem): Added an argument
> telling the
>>         function whether it should attempt loading from cache. It should do
> that on first
>>         attempt to navigate to a form submission result, but not if that
> failed.
>>         Pass a correct loadType - m_loadType is one for _previous_ load.
>>         Removed a special case for https - we've long stopped prohibiting
> caching of https
>>         resources, and using a resource that's already cached should
> definitely be allowed.
>>         (WebCore::FrameLoader::loadItem): Pass an explicit argument for
> unchanged caching behavior.
>>         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
> Added.
> 
>>         * loader/MainResourceLoader.cpp:
> (WebCore::MainResourceLoader::notifyFinished):
>>         Removed a check for m_resource being null, because we were
immediately
> dereferencing
>>         it anyway.
>>         Call retryAfterFailedCacheOnlyMainResourceLoad() to let FrameLoader
> restart the navigation.
> 
>>         * platform/network/ResourceHandle.h:
>>         * platform/network/blackberry/ResourceHandleBlackBerry.cpp:
>>         * platform/network/cf/ResourceHandleCFNet.cpp:
>>         * platform/network/chromium/ResourceHandle.cpp:
>>         * platform/network/curl/ResourceHandleCurl.cpp:
>>         * platform/network/mac/ResourceHandleMac.mm:
>>         * platform/network/qt/ResourceHandleQt.cpp:
>>         * platform/network/soup/ResourceHandleSoup.cpp:
>>         * platform/network/win/ResourceHandleWin.cpp:
>>         Removed willLoadFromCache() - the new logic is cross-platform.
> 
> 
> 
> TBR=ap@apple.com
> 
> Please review this at https://codereview.chromium.org/12090050/
> 
> SVN Base: http://svn.webkit.org/repository/webkit/branches/chromium/1397/
> 
> Affected files:
>  M     Source/WebCore/html/HTMLAnchorElement.cpp
>  M     Source/WebCore/loader/DocumentLoader.cpp
>  M     Source/WebCore/loader/FrameLoader.h
>  M     Source/WebCore/loader/FrameLoader.cpp
>  M     Source/WebCore/loader/MainResourceLoader.cpp
>  M     Source/WebCore/platform/network/ResourceHandle.h
>  M    
Source/WebCore/platform/network/blackberry/ResourceHandleBlackBerry.cpp
>  M     Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
>  M     Source/WebCore/platform/network/chromium/ResourceHandle.cpp
>  M     Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp
>  M     Source/WebCore/platform/network/mac/ResourceHandleMac.mm
>  M     Source/WebCore/platform/network/qt/ResourceHandleQt.cpp
>  M     Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
>  M     Source/WebCore/platform/network/win/ResourceHandleWin.cpp
> 
> 

Powered by Google App Engine
This is Rietveld 408576698