| OLD | NEW |
| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 class FrameLoader { | 75 class FrameLoader { |
| 76 WTF_MAKE_NONCOPYABLE(FrameLoader); | 76 WTF_MAKE_NONCOPYABLE(FrameLoader); |
| 77 public: | 77 public: |
| 78 FrameLoader(Frame*, FrameLoaderClient*); | 78 FrameLoader(Frame*, FrameLoaderClient*); |
| 79 ~FrameLoader(); | 79 ~FrameLoader(); |
| 80 | 80 |
| 81 void init(); | 81 void init(); |
| 82 | 82 |
| 83 Frame* frame() const { return m_frame; } | 83 Frame* frame() const { return m_frame; } |
| 84 | 84 |
| 85 HistoryController* history() const { return &m_history; } | |
| 86 | |
| 87 MixedContentChecker* mixedContentChecker() const { return &m_mixedContentChe
cker; } | 85 MixedContentChecker* mixedContentChecker() const { return &m_mixedContentChe
cker; } |
| 88 | 86 |
| 89 void prepareForHistoryNavigation(); | |
| 90 | |
| 91 // These functions start a load. All eventually call into loadWithNavigation
Action() or loadInSameDocument(). | 87 // These functions start a load. All eventually call into loadWithNavigation
Action() or loadInSameDocument(). |
| 92 void load(const FrameLoadRequest&); // The entry point for non-reload, non-h
istory loads. | 88 void load(const FrameLoadRequest&); // The entry point for non-reload, non-h
istory loads. |
| 93 void reload(ReloadPolicy = NormalReload, const KURL& overrideURL = KURL(), c
onst String& overrideEncoding = String()); | 89 void reload(ReloadPolicy = NormalReload, const KURL& overrideURL = KURL(), c
onst String& overrideEncoding = String()); |
| 94 void loadHistoryItem(HistoryItem*); // The entry point for all back/forward
loads | 90 void loadHistoryItem(HistoryItem*, HistoryLoadType = HistoryDifferentDocumen
tLoad); // The entry point for all back/forward loads |
| 95 | 91 |
| 96 static void reportLocalLoadFailed(Frame*, const String& url); | 92 static void reportLocalLoadFailed(Frame*, const String& url); |
| 97 | 93 |
| 98 // FIXME: These are all functions which stop loads. We have too many. | 94 // FIXME: These are all functions which stop loads. We have too many. |
| 99 // Warning: stopAllLoaders can and will detach the Frame out from under you.
All callers need to either protect the Frame | 95 // Warning: stopAllLoaders can and will detach the Frame out from under you.
All callers need to either protect the Frame |
| 100 // or guarantee they won't in any way access the Frame after stopAllLoaders
returns. | 96 // or guarantee they won't in any way access the Frame after stopAllLoaders
returns. |
| 101 void stopAllLoaders(); | 97 void stopAllLoaders(); |
| 102 void stopLoading(); | 98 void stopLoading(); |
| 103 bool closeURL(); | 99 bool closeURL(); |
| 104 // FIXME: clear() is trying to do too many things. We should break it down i
nto smaller functions. | 100 // FIXME: clear() is trying to do too many things. We should break it down i
nto smaller functions. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 127 FrameState state() const { return m_state; } | 123 FrameState state() const { return m_state; } |
| 128 FetchContext& fetchContext() const { return *m_fetchContext; } | 124 FetchContext& fetchContext() const { return *m_fetchContext; } |
| 129 | 125 |
| 130 const ResourceRequest& originalRequest() const; | 126 const ResourceRequest& originalRequest() const; |
| 131 void receivedMainResourceError(const ResourceError&); | 127 void receivedMainResourceError(const ResourceError&); |
| 132 | 128 |
| 133 bool isLoadingMainFrame() const; | 129 bool isLoadingMainFrame() const; |
| 134 | 130 |
| 135 bool subframeIsLoading() const; | 131 bool subframeIsLoading() const; |
| 136 | 132 |
| 133 bool shouldTreatURLAsSameAsCurrent(const KURL&) const; |
| 137 bool shouldTreatURLAsSrcdocDocument(const KURL&) const; | 134 bool shouldTreatURLAsSrcdocDocument(const KURL&) const; |
| 138 | 135 |
| 139 FrameLoadType loadType() const; | 136 FrameLoadType loadType() const; |
| 140 void setLoadType(FrameLoadType loadType) { m_loadType = loadType; } | 137 void setLoadType(FrameLoadType loadType) { m_loadType = loadType; } |
| 141 | 138 |
| 142 CachePolicy subresourceCachePolicy() const; | 139 CachePolicy subresourceCachePolicy() const; |
| 143 | 140 |
| 144 void didFirstLayout(); | 141 void didFirstLayout(); |
| 145 | 142 |
| 146 void checkLoadComplete(DocumentLoader*); | 143 void checkLoadComplete(DocumentLoader*); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 199 |
| 203 bool allowPlugins(ReasonForCallingAllowPlugins); | 200 bool allowPlugins(ReasonForCallingAllowPlugins); |
| 204 | 201 |
| 205 enum UpdateBackForwardListPolicy { | 202 enum UpdateBackForwardListPolicy { |
| 206 UpdateBackForwardList, | 203 UpdateBackForwardList, |
| 207 DoNotUpdateBackForwardList | 204 DoNotUpdateBackForwardList |
| 208 }; | 205 }; |
| 209 void updateForSameDocumentNavigation(const KURL&, SameDocumentNavigationSour
ce, PassRefPtr<SerializedScriptValue>, UpdateBackForwardListPolicy); | 206 void updateForSameDocumentNavigation(const KURL&, SameDocumentNavigationSour
ce, PassRefPtr<SerializedScriptValue>, UpdateBackForwardListPolicy); |
| 210 | 207 |
| 211 private: | 208 private: |
| 209 HistoryController* history() const; |
| 210 |
| 212 bool allChildrenAreComplete() const; // immediate children, not all descenda
nts | 211 bool allChildrenAreComplete() const; // immediate children, not all descenda
nts |
| 213 | 212 |
| 214 void completed(); | 213 void completed(); |
| 215 | 214 |
| 216 void checkTimerFired(Timer<FrameLoader>*); | 215 void checkTimerFired(Timer<FrameLoader>*); |
| 217 void didAccessInitialDocumentTimerFired(Timer<FrameLoader>*); | 216 void didAccessInitialDocumentTimerFired(Timer<FrameLoader>*); |
| 218 | 217 |
| 219 void insertDummyHistoryItem(); | |
| 220 | |
| 221 bool prepareRequestForThisFrame(FrameLoadRequest&); | 218 bool prepareRequestForThisFrame(FrameLoadRequest&); |
| 222 void setReferrerForFrameRequest(ResourceRequest&, ShouldSendReferrer); | 219 void setReferrerForFrameRequest(ResourceRequest&, ShouldSendReferrer); |
| 223 FrameLoadType determineFrameLoadType(const FrameLoadRequest&); | 220 FrameLoadType determineFrameLoadType(const FrameLoadRequest&); |
| 224 bool isScriptTriggeredFormSubmissionInChildFrame(const FrameLoadRequest&) co
nst; | 221 bool isScriptTriggeredFormSubmissionInChildFrame(const FrameLoadRequest&) co
nst; |
| 225 | 222 |
| 226 SubstituteData defaultSubstituteDataForURL(const KURL&); | 223 SubstituteData defaultSubstituteDataForURL(const KURL&); |
| 227 | 224 |
| 228 void checkNavigationPolicyAndContinueFragmentScroll(const NavigationAction&,
bool isNewNavigation, ClientRedirectPolicy); | 225 void checkNavigationPolicyAndContinueFragmentScroll(const NavigationAction&,
bool isNewNavigation, ClientRedirectPolicy); |
| 229 | 226 |
| 230 bool shouldPerformFragmentNavigation(bool isFormSubmission, const String& ht
tpMethod, FrameLoadType, const KURL&); | 227 bool shouldPerformFragmentNavigation(bool isFormSubmission, const String& ht
tpMethod, FrameLoadType, const KURL&); |
| 231 void scrollToFragmentWithParentBoundary(const KURL&); | 228 void scrollToFragmentWithParentBoundary(const KURL&); |
| 232 | 229 |
| 233 void checkLoadCompleteForThisFrame(); | 230 void checkLoadCompleteForThisFrame(); |
| 234 | 231 |
| 235 void closeOldDataSources(); | 232 void closeOldDataSources(); |
| 236 | 233 |
| 237 // Calls continueLoadAfterNavigationPolicy | 234 // Calls continueLoadAfterNavigationPolicy |
| 238 void loadWithNavigationAction(const NavigationAction&, FrameLoadType, PassRe
fPtr<FormState>, | 235 void loadWithNavigationAction(const NavigationAction&, FrameLoadType, PassRe
fPtr<FormState>, |
| 239 const SubstituteData&, ClientRedirectPolicy = NotClientRedirect, const S
tring& overrideEncoding = String()); | 236 const SubstituteData&, ClientRedirectPolicy = NotClientRedirect, const S
tring& overrideEncoding = String()); |
| 240 | 237 |
| 241 void detachChildren(); | 238 void detachChildren(); |
| 242 void closeAndRemoveChild(Frame*); | 239 void closeAndRemoveChild(Frame*); |
| 243 | 240 |
| 244 void loadInSameDocument(const KURL&, PassRefPtr<SerializedScriptValue> state
Object, bool isNewNavigation, ClientRedirectPolicy); | 241 void loadInSameDocument(const KURL&, PassRefPtr<SerializedScriptValue> state
Object, bool isNewNavigation, ClientRedirectPolicy); |
| 245 | 242 |
| 246 void scheduleCheckCompleted(); | 243 void scheduleCheckCompleted(); |
| 247 void startCheckCompleteTimer(); | 244 void startCheckCompleteTimer(); |
| 248 | 245 |
| 249 bool shouldTreatURLAsSameAsCurrent(const KURL&) const; | |
| 250 | |
| 251 Frame* m_frame; | 246 Frame* m_frame; |
| 252 FrameLoaderClient* m_client; | 247 FrameLoaderClient* m_client; |
| 253 | 248 |
| 254 // FIXME: These should be OwnPtr<T> to reduce build times and simplify | 249 // FIXME: These should be OwnPtr<T> to reduce build times and simplify |
| 255 // header dependencies unless performance testing proves otherwise. | 250 // header dependencies unless performance testing proves otherwise. |
| 256 // Some of these could be lazily created for memory savings on devices. | 251 // Some of these could be lazily created for memory savings on devices. |
| 257 mutable HistoryController m_history; | |
| 258 mutable FrameLoaderStateMachine m_stateMachine; | 252 mutable FrameLoaderStateMachine m_stateMachine; |
| 259 mutable MixedContentChecker m_mixedContentChecker; | 253 mutable MixedContentChecker m_mixedContentChecker; |
| 260 | 254 |
| 261 class FrameProgressTracker; | 255 class FrameProgressTracker; |
| 262 OwnPtr<FrameProgressTracker> m_progressTracker; | 256 OwnPtr<FrameProgressTracker> m_progressTracker; |
| 263 | 257 |
| 264 FrameState m_state; | 258 FrameState m_state; |
| 265 FrameLoadType m_loadType; | 259 FrameLoadType m_loadType; |
| 266 | 260 |
| 267 // Document loaders for the three phases of frame loading. Note that while | 261 // Document loaders for the three phases of frame loading. Note that while |
| (...skipping 20 matching lines...) Expand all Loading... |
| 288 | 282 |
| 289 bool m_didAccessInitialDocument; | 283 bool m_didAccessInitialDocument; |
| 290 Timer<FrameLoader> m_didAccessInitialDocumentTimer; | 284 Timer<FrameLoader> m_didAccessInitialDocumentTimer; |
| 291 | 285 |
| 292 SandboxFlags m_forcedSandboxFlags; | 286 SandboxFlags m_forcedSandboxFlags; |
| 293 }; | 287 }; |
| 294 | 288 |
| 295 } // namespace WebCore | 289 } // namespace WebCore |
| 296 | 290 |
| 297 #endif // FrameLoader_h | 291 #endif // FrameLoader_h |
| OLD | NEW |