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