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

Unified Diff: Source/core/loader/FrameLoader.h

Issue 1156473002: Refactor FrameLoader loading interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed issue with inital history navigation in child frames Created 5 years, 7 months 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: Source/core/loader/FrameLoader.h
diff --git a/Source/core/loader/FrameLoader.h b/Source/core/loader/FrameLoader.h
index 1cabfeb76d65cfc24a2fda9f914fd112d90a5c9c..e195ba24d020e0f319aed0d283433e9b2f637d07 100644
--- a/Source/core/loader/FrameLoader.h
+++ b/Source/core/loader/FrameLoader.h
@@ -66,7 +66,11 @@ class CORE_EXPORT FrameLoader final {
WTF_MAKE_NONCOPYABLE(FrameLoader);
DISALLOW_ALLOCATION();
public:
- static ResourceRequest requestFromHistoryItem(HistoryItem*, ResourceRequestCachePolicy);
+ static ResourceRequest resourceRequestFromHistoryItem(HistoryItem*, ResourceRequestCachePolicy);
+ static ResourceRequest resourceRequestForReload(HistoryItem*, const LocalFrame&, FrameLoadType,
Nate Chapin 2015/05/27 16:54:34 I'm not sure I like this as a static method, given
clamy 2015/05/29 14:41:50 Switched to a non-static function.
+ const KURL& overrideURL = KURL(), ClientRedirectPolicy = NotClientRedirect);
+ static FrameLoadRequest frameRequestForReload(
+ const ResourceRequest&, ClientRedirectPolicy = NotClientRedirect);
FrameLoader(LocalFrame*);
~FrameLoader();
@@ -75,12 +79,12 @@ public:
ProgressTracker& progress() const { return *m_progressTracker; }
- // These functions start a load. All eventually call into startLoad() or loadInSameDocument().
- void load(const FrameLoadRequest&); // The entry point for non-reload, non-history loads.
- void reload(ReloadPolicy, const KURL& overrideURL = KURL(), ClientRedirectPolicy = NotClientRedirect);
- void loadHistoryItem(HistoryItem*, FrameLoadType = FrameLoadTypeBackForward,
- HistoryLoadType = HistoryDifferentDocumentLoad,
- ResourceRequestCachePolicy = UseProtocolCachePolicy); // The entry point for all back/forward loads
+ // Starts a load. It will eventually call startLoad() or
+ // loadInSameDocument(). For history navigations or reloads, an appropriate
+ // FrameLoadType should be given. Otherwise, FrameLoadTypeStandard should be
+ // used (and the final FrameLoadType will be computed). For history
+ // navigations, a history item should also be provided.
+ void load(const FrameLoadRequest&, FrameLoadType = FrameLoadTypeStandard, HistoryItem* = nullptr);
static void reportLocalLoadFailed(LocalFrame*, const String& url);
@@ -224,25 +228,26 @@ private:
struct DeferredHistoryLoad {
DISALLOW_ALLOCATION();
public:
- DeferredHistoryLoad(HistoryItem* item, HistoryLoadType type, ResourceRequestCachePolicy cachePolicy)
- : m_item(item)
- , m_type(type)
- , m_cachePolicy(cachePolicy)
+ DeferredHistoryLoad(ResourceRequest request, HistoryItem* item, FrameLoadType loadType)
+ : m_request(request)
+ , m_item(item)
+ , m_loadType(loadType)
+ , m_isValid(true)
{
}
- DeferredHistoryLoad() { }
-
- bool isValid() { return m_item; }
+ DeferredHistoryLoad() : m_isValid(false) { }
DEFINE_INLINE_TRACE()
{
- visitor->trace(m_item);
}
+ bool isValid() { return m_isValid; }
+
+ ResourceRequest m_request;
RefPtrWillBeMember<HistoryItem> m_item;
- HistoryLoadType m_type;
- ResourceRequestCachePolicy m_cachePolicy;
+ FrameLoadType m_loadType;
+ bool m_isValid;
};
DeferredHistoryLoad m_deferredHistoryLoad;

Powered by Google App Engine
This is Rietveld 408576698