| 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. | 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 4 * (http://www.torchmobile.com/) | 4 * (http://www.torchmobile.com/) |
| 5 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
| 6 * Copyright (C) 2011 Google Inc. All rights reserved. | 6 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return m_provisionalDocumentLoader.get(); | 122 return m_provisionalDocumentLoader.get(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void loadFailed(DocumentLoader*, const ResourceError&); | 125 void loadFailed(DocumentLoader*, const ResourceError&); |
| 126 | 126 |
| 127 bool isLoadingMainFrame() const; | 127 bool isLoadingMainFrame() const; |
| 128 | 128 |
| 129 bool shouldTreatURLAsSameAsCurrent(const KURL&) const; | 129 bool shouldTreatURLAsSameAsCurrent(const KURL&) const; |
| 130 bool shouldTreatURLAsSrcdocDocument(const KURL&) const; | 130 bool shouldTreatURLAsSrcdocDocument(const KURL&) const; |
| 131 | 131 |
| 132 FrameLoadType loadType() const; | |
| 133 void setLoadType(FrameLoadType loadType) { m_loadType = loadType; } | |
| 134 | |
| 135 FrameLoaderClient* client() const; | 132 FrameLoaderClient* client() const; |
| 136 | 133 |
| 137 void setDefersLoading(bool); | 134 void setDefersLoading(bool); |
| 138 | 135 |
| 139 void didExplicitOpen(); | 136 void didExplicitOpen(); |
| 140 | 137 |
| 141 // Callbacks from DocumentWriter | 138 // Callbacks from DocumentWriter |
| 142 void didInstallNewDocument(bool dispatchWindowObjectAvailable); | 139 void didInstallNewDocument(bool dispatchWindowObjectAvailable); |
| 143 | 140 |
| 144 void didBeginDocument(); | 141 void didBeginDocument(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 void saveScrollState(); | 200 void saveScrollState(); |
| 204 | 201 |
| 205 void restoreScrollPositionAndViewState(); | 202 void restoreScrollPositionAndViewState(); |
| 206 | 203 |
| 207 bool shouldContinueForNavigationPolicy(const ResourceRequest&, | 204 bool shouldContinueForNavigationPolicy(const ResourceRequest&, |
| 208 const SubstituteData&, | 205 const SubstituteData&, |
| 209 DocumentLoader*, | 206 DocumentLoader*, |
| 210 ContentSecurityPolicyDisposition, | 207 ContentSecurityPolicyDisposition, |
| 211 NavigationType, | 208 NavigationType, |
| 212 NavigationPolicy, | 209 NavigationPolicy, |
| 213 bool shouldReplaceCurrentEntry, | 210 FrameLoadType, |
| 214 bool isClientRedirect, | 211 bool isClientRedirect, |
| 215 HTMLFormElement*); | 212 HTMLFormElement*); |
| 216 | 213 |
| 217 // PlzNavigate: Navigations handled by the client are treated as | 214 // PlzNavigate: Navigations handled by the client are treated as |
| 218 // provisional navigations. | 215 // provisional navigations. |
| 219 bool hasProvisionalNavigation() const { | 216 bool hasProvisionalNavigation() const { |
| 220 return provisionalDocumentLoader() || m_isNavigationHandledByClient; | 217 return provisionalDocumentLoader() || m_isNavigationHandledByClient; |
| 221 } | 218 } |
| 222 | 219 |
| 223 void clearNavigationHandledByClient() { | 220 void clearNavigationHandledByClient() { |
| 224 m_isNavigationHandledByClient = false; | 221 m_isNavigationHandledByClient = false; |
| 225 } | 222 } |
| 226 | 223 |
| 227 DECLARE_TRACE(); | 224 DECLARE_TRACE(); |
| 228 | 225 |
| 229 static void setReferrerForFrameRequest(FrameLoadRequest&); | 226 static void setReferrerForFrameRequest(FrameLoadRequest&); |
| 230 | 227 |
| 231 private: | 228 private: |
| 232 void checkTimerFired(TimerBase*); | 229 void checkTimerFired(TimerBase*); |
| 233 | 230 |
| 234 bool prepareRequestForThisFrame(FrameLoadRequest&); | 231 bool prepareRequestForThisFrame(FrameLoadRequest&); |
| 235 FrameLoadType determineFrameLoadType(const FrameLoadRequest&); | 232 FrameLoadType determineFrameLoadType(const FrameLoadRequest&); |
| 236 | 233 |
| 237 SubstituteData defaultSubstituteDataForURL(const KURL&); | 234 SubstituteData defaultSubstituteDataForURL(const KURL&); |
| 238 | 235 |
| 239 bool shouldPerformFragmentNavigation(bool isFormSubmission, | 236 bool shouldPerformFragmentNavigation(bool isFormSubmission, |
| 240 const String& httpMethod, | 237 const String& httpMethod, |
| 241 FrameLoadType, | 238 FrameLoadType, |
| 242 const KURL&); | 239 const KURL&); |
| 243 void processFragment(const KURL&, LoadStartType); | 240 void processFragment(const KURL&, FrameLoadType, LoadStartType); |
| 244 | 241 |
| 245 bool checkLoadCanStart(FrameLoadRequest&, | 242 bool checkLoadCanStart(FrameLoadRequest&, |
| 246 FrameLoadType, | 243 FrameLoadType, |
| 247 NavigationPolicy, | 244 NavigationPolicy, |
| 248 NavigationType); | 245 NavigationType); |
| 249 void startLoad(FrameLoadRequest&, FrameLoadType, NavigationPolicy); | 246 void startLoad(FrameLoadRequest&, FrameLoadType, NavigationPolicy); |
| 250 | 247 |
| 251 enum class HistoryNavigationType { DifferentDocument, Fragment, HistoryApi }; | 248 enum class HistoryNavigationType { DifferentDocument, Fragment, HistoryApi }; |
| 252 void setHistoryItemStateForCommit(FrameLoadType, | 249 void setHistoryItemStateForCommit(FrameLoadType, |
| 253 HistoryCommitType, | 250 HistoryCommitType, |
| 254 HistoryNavigationType); | 251 HistoryNavigationType); |
| 255 | 252 |
| 256 void loadInSameDocument(const KURL&, | 253 void loadInSameDocument(const KURL&, |
| 257 PassRefPtr<SerializedScriptValue> stateObject, | 254 PassRefPtr<SerializedScriptValue> stateObject, |
| 258 FrameLoadType, | 255 FrameLoadType, |
| 259 HistoryLoadType, | 256 HistoryLoadType, |
| 260 ClientRedirectPolicy, | 257 ClientRedirectPolicy, |
| 261 Document*); | 258 Document*); |
| 259 void restoreScrollPositionAndViewStateForLoadType(FrameLoadType); |
| 262 | 260 |
| 263 void scheduleCheckCompleted(); | 261 void scheduleCheckCompleted(); |
| 264 | 262 |
| 265 void detachDocumentLoader(Member<DocumentLoader>&); | 263 void detachDocumentLoader(Member<DocumentLoader>&); |
| 266 | 264 |
| 267 void upgradeInsecureRequest(ResourceRequest&, Document*) const; | 265 void upgradeInsecureRequest(ResourceRequest&, Document*) const; |
| 268 | 266 |
| 269 std::unique_ptr<TracedValue> toTracedValue() const; | 267 std::unique_ptr<TracedValue> toTracedValue() const; |
| 270 void takeObjectSnapshot() const; | 268 void takeObjectSnapshot() const; |
| 271 | 269 |
| 272 Member<LocalFrame> m_frame; | 270 Member<LocalFrame> m_frame; |
| 273 AtomicString m_requiredCSP; | 271 AtomicString m_requiredCSP; |
| 274 | 272 |
| 275 // FIXME: These should be std::unique_ptr<T> to reduce build times and | 273 // FIXME: These should be std::unique_ptr<T> to reduce build times and |
| 276 // simplify header dependencies unless performance testing proves otherwise. | 274 // simplify header dependencies unless performance testing proves otherwise. |
| 277 // Some of these could be lazily created for memory savings on devices. | 275 // Some of these could be lazily created for memory savings on devices. |
| 278 mutable FrameLoaderStateMachine m_stateMachine; | 276 mutable FrameLoaderStateMachine m_stateMachine; |
| 279 | 277 |
| 280 Member<ProgressTracker> m_progressTracker; | 278 Member<ProgressTracker> m_progressTracker; |
| 281 | 279 |
| 282 FrameLoadType m_loadType; | |
| 283 | |
| 284 // Document loaders for the three phases of frame loading. Note that while a | 280 // Document loaders for the three phases of frame loading. Note that while a |
| 285 // new request is being loaded, the old document loader may still be | 281 // new request is being loaded, the old document loader may still be |
| 286 // referenced. E.g. while a new request is in the "policy" state, the old | 282 // referenced. E.g. while a new request is in the "policy" state, the old |
| 287 // document loader may be consulted in particular as it makes sense to imply | 283 // document loader may be consulted in particular as it makes sense to imply |
| 288 // certain settings on the new loader. | 284 // certain settings on the new loader. |
| 289 Member<DocumentLoader> m_documentLoader; | 285 Member<DocumentLoader> m_documentLoader; |
| 290 Member<DocumentLoader> m_provisionalDocumentLoader; | 286 Member<DocumentLoader> m_provisionalDocumentLoader; |
| 291 | 287 |
| 292 Member<HistoryItem> m_currentItem; | 288 Member<HistoryItem> m_currentItem; |
| 293 Member<HistoryItem> m_provisionalItem; | 289 Member<HistoryItem> m_provisionalItem; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 SandboxFlags m_forcedSandboxFlags; | 326 SandboxFlags m_forcedSandboxFlags; |
| 331 | 327 |
| 332 bool m_dispatchingDidClearWindowObjectInMainWorld; | 328 bool m_dispatchingDidClearWindowObjectInMainWorld; |
| 333 bool m_protectProvisionalLoader; | 329 bool m_protectProvisionalLoader; |
| 334 bool m_isNavigationHandledByClient; | 330 bool m_isNavigationHandledByClient; |
| 335 }; | 331 }; |
| 336 | 332 |
| 337 } // namespace blink | 333 } // namespace blink |
| 338 | 334 |
| 339 #endif // FrameLoader_h | 335 #endif // FrameLoader_h |
| OLD | NEW |