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

Side by Side 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: Rebase Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
4 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
5 * Copyright (C) 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2011 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 class SubstituteData; 59 class SubstituteData;
60 60
61 struct FrameLoadRequest; 61 struct FrameLoadRequest;
62 62
63 CORE_EXPORT bool isBackForwardLoadType(FrameLoadType); 63 CORE_EXPORT bool isBackForwardLoadType(FrameLoadType);
64 64
65 class CORE_EXPORT FrameLoader final { 65 class CORE_EXPORT FrameLoader final {
66 WTF_MAKE_NONCOPYABLE(FrameLoader); 66 WTF_MAKE_NONCOPYABLE(FrameLoader);
67 DISALLOW_ALLOCATION(); 67 DISALLOW_ALLOCATION();
68 public: 68 public:
69 static ResourceRequest requestFromHistoryItem(HistoryItem*, ResourceRequestC achePolicy); 69 static ResourceRequest resourceRequestFromHistoryItem(HistoryItem*, Resource RequestCachePolicy);
70 70
71 FrameLoader(LocalFrame*); 71 FrameLoader(LocalFrame*);
72 ~FrameLoader(); 72 ~FrameLoader();
73 73
74 void init(); 74 void init();
75 75
76 ResourceRequest resourceRequestForReload(FrameLoadType, const KURL& override URL = KURL(),
77 ClientRedirectPolicy = NotClientRedirect);
78
76 ProgressTracker& progress() const { return *m_progressTracker; } 79 ProgressTracker& progress() const { return *m_progressTracker; }
77 80
78 // These functions start a load. All eventually call into startLoad() or loa dInSameDocument(). 81 // Starts a load. It will eventually call startLoad() or
79 void load(const FrameLoadRequest&); // The entry point for non-reload, non-h istory loads. 82 // loadInSameDocument(). For history navigations or reloads, an appropriate
80 void reload(ReloadPolicy, const KURL& overrideURL = KURL(), ClientRedirectPo licy = NotClientRedirect); 83 // FrameLoadType should be given. Otherwise, FrameLoadTypeStandard should be
81 void loadHistoryItem(HistoryItem*, FrameLoadType = FrameLoadTypeBackForward, 84 // used (and the final FrameLoadType will be computed). For history
82 HistoryLoadType = HistoryDifferentDocumentLoad, 85 // navigations, a history item and a HistoryLoadType should also be provided .
83 ResourceRequestCachePolicy = UseProtocolCachePolicy); // The entry point for all back/forward loads 86 void load(const FrameLoadRequest&, FrameLoadType = FrameLoadTypeStandard,
87 HistoryItem* = nullptr, HistoryLoadType = HistoryDifferentDocumentLoad);
84 88
85 static void reportLocalLoadFailed(LocalFrame*, const String& url); 89 static void reportLocalLoadFailed(LocalFrame*, const String& url);
86 90
87 // Warning: stopAllLoaders can and will detach the LocalFrame out from under you. All callers need to either protect the LocalFrame 91 // Warning: stopAllLoaders can and will detach the LocalFrame out from under you. All callers need to either protect the LocalFrame
88 // or guarantee they won't in any way access the LocalFrame after stopAllLoa ders returns. 92 // or guarantee they won't in any way access the LocalFrame after stopAllLoa ders returns.
89 void stopAllLoaders(); 93 void stopAllLoaders();
90 94
91 // FIXME: clear() is trying to do too many things. We should break it down i nto smaller functions. 95 // FIXME: clear() is trying to do too many things. We should break it down i nto smaller functions.
92 void clear(); 96 void clear();
93 97
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // E.g. while a new request is in the "policy" state, the old document loade r may 222 // E.g. while a new request is in the "policy" state, the old document loade r may
219 // be consulted in particular as it makes sense to imply certain settings on the new loader. 223 // be consulted in particular as it makes sense to imply certain settings on the new loader.
220 RefPtr<DocumentLoader> m_documentLoader; 224 RefPtr<DocumentLoader> m_documentLoader;
221 RefPtr<DocumentLoader> m_provisionalDocumentLoader; 225 RefPtr<DocumentLoader> m_provisionalDocumentLoader;
222 RefPtr<DocumentLoader> m_policyDocumentLoader; 226 RefPtr<DocumentLoader> m_policyDocumentLoader;
223 227
224 RefPtrWillBeMember<HistoryItem> m_currentItem; 228 RefPtrWillBeMember<HistoryItem> m_currentItem;
225 RefPtrWillBeMember<HistoryItem> m_provisionalItem; 229 RefPtrWillBeMember<HistoryItem> m_provisionalItem;
226 230
227 struct DeferredHistoryLoad { 231 struct DeferredHistoryLoad {
228 DISALLOW_ALLOCATION(); 232 DISALLOW_COPY(DeferredHistoryLoad);
229 public: 233 public:
230 DeferredHistoryLoad(HistoryItem* item, HistoryLoadType type, ResourceReq uestCachePolicy cachePolicy) 234 DeferredHistoryLoad(ResourceRequest request, HistoryItem* item, FrameLoa dType loadType,
231 : m_item(item) 235 HistoryLoadType historyLoadType)
232 , m_type(type) 236 : m_request(request)
233 , m_cachePolicy(cachePolicy) 237 , m_item(item)
238 , m_loadType(loadType)
239 , m_historyLoadType(historyLoadType)
234 { 240 {
235 } 241 }
236 242
237 DeferredHistoryLoad() { } 243 DeferredHistoryLoad() { }
238 244
239 bool isValid() { return m_item; }
240
241 DEFINE_INLINE_TRACE() 245 DEFINE_INLINE_TRACE()
242 { 246 {
243 visitor->trace(m_item); 247 visitor->trace(m_item);
244 } 248 }
245 249
250 ResourceRequest m_request;
246 RefPtrWillBeMember<HistoryItem> m_item; 251 RefPtrWillBeMember<HistoryItem> m_item;
247 HistoryLoadType m_type; 252 FrameLoadType m_loadType;
248 ResourceRequestCachePolicy m_cachePolicy; 253 HistoryLoadType m_historyLoadType;
249 }; 254 };
250 255
251 DeferredHistoryLoad m_deferredHistoryLoad; 256 OwnPtr<DeferredHistoryLoad> m_deferredHistoryLoad;
252 257
253 bool m_inStopAllLoaders; 258 bool m_inStopAllLoaders;
254 259
255 Timer<FrameLoader> m_checkTimer; 260 Timer<FrameLoader> m_checkTimer;
256 261
257 bool m_didAccessInitialDocument; 262 bool m_didAccessInitialDocument;
258 Timer<FrameLoader> m_didAccessInitialDocumentTimer; 263 Timer<FrameLoader> m_didAccessInitialDocumentTimer;
259 264
260 SandboxFlags m_forcedSandboxFlags; 265 SandboxFlags m_forcedSandboxFlags;
261 266
262 bool m_dispatchingDidClearWindowObjectInMainWorld; 267 bool m_dispatchingDidClearWindowObjectInMainWorld;
263 }; 268 };
264 269
265 } // namespace blink 270 } // namespace blink
266 271
267 #endif // FrameLoader_h 272 #endif // FrameLoader_h
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorResourceContentLoader.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698