Chromium Code Reviews| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 PassRefPtr<SerializedScriptValue>, | 195 PassRefPtr<SerializedScriptValue>, |
| 196 HistoryScrollRestorationType, | 196 HistoryScrollRestorationType, |
| 197 FrameLoadType, | 197 FrameLoadType, |
| 198 Document*); | 198 Document*); |
| 199 | 199 |
| 200 HistoryItem* currentItem() const { return m_currentItem.get(); } | 200 HistoryItem* currentItem() const { return m_currentItem.get(); } |
| 201 void saveScrollState(); | 201 void saveScrollState(); |
| 202 | 202 |
| 203 void restoreScrollPositionAndViewState(); | 203 void restoreScrollPositionAndViewState(); |
| 204 | 204 |
| 205 bool shouldContinueForNavigationPolicy(const ResourceRequest&, | 205 NavigationPolicy shouldContinueForNavigationPolicy( |
|
clamy
2017/03/02 14:37:18
Maybe add a comment about which NavigationPolicy s
Nate Chapin
2017/03/02 19:39:18
Done.
| |
| 206 const SubstituteData&, | 206 const ResourceRequest&, |
| 207 DocumentLoader*, | 207 const SubstituteData&, |
| 208 ContentSecurityPolicyDisposition, | 208 DocumentLoader*, |
| 209 NavigationType, | 209 ContentSecurityPolicyDisposition, |
| 210 NavigationPolicy, | 210 NavigationType, |
| 211 FrameLoadType, | 211 NavigationPolicy, |
| 212 bool isClientRedirect, | 212 FrameLoadType, |
| 213 HTMLFormElement*); | 213 bool isClientRedirect, |
| 214 HTMLFormElement*); | |
| 214 | 215 |
| 215 // PlzNavigate: Navigations handled by the client are treated as | 216 // PlzNavigate: Navigations handled by the client are treated as |
| 216 // provisional navigations. | 217 // provisional navigations. |
|
clamy
2017/03/02 14:37:18
nit: I think the comment should be updated. Maybe
Nate Chapin
2017/03/02 19:39:18
Done.
| |
| 217 bool hasProvisionalNavigation() const { | 218 bool hasProvisionalNavigation() const { return provisionalDocumentLoader(); } |
| 218 return provisionalDocumentLoader() || m_isNavigationHandledByClient; | |
| 219 } | |
| 220 | |
| 221 void clearNavigationHandledByClient(); | |
| 222 | 219 |
| 223 DECLARE_TRACE(); | 220 DECLARE_TRACE(); |
| 224 | 221 |
| 225 static void setReferrerForFrameRequest(FrameLoadRequest&); | 222 static void setReferrerForFrameRequest(FrameLoadRequest&); |
| 226 | 223 |
| 227 private: | 224 private: |
| 228 void checkTimerFired(TimerBase*); | 225 void checkTimerFired(TimerBase*); |
| 229 | 226 |
| 230 bool prepareRequestForThisFrame(FrameLoadRequest&); | 227 bool prepareRequestForThisFrame(FrameLoadRequest&); |
| 231 FrameLoadType determineFrameLoadType(const FrameLoadRequest&); | 228 FrameLoadType determineFrameLoadType(const FrameLoadRequest&); |
| 232 | 229 |
| 233 SubstituteData defaultSubstituteDataForURL(const KURL&); | 230 SubstituteData defaultSubstituteDataForURL(const KURL&); |
| 234 | 231 |
| 235 bool shouldPerformFragmentNavigation(bool isFormSubmission, | 232 bool shouldPerformFragmentNavigation(bool isFormSubmission, |
| 236 const String& httpMethod, | 233 const String& httpMethod, |
| 237 FrameLoadType, | 234 FrameLoadType, |
| 238 const KURL&); | 235 const KURL&); |
| 239 void processFragment(const KURL&, FrameLoadType, LoadStartType); | 236 void processFragment(const KURL&, FrameLoadType, LoadStartType); |
| 240 | 237 |
| 241 bool checkLoadCanStart(FrameLoadRequest&, | 238 NavigationPolicy checkLoadCanStart(FrameLoadRequest&, |
| 242 FrameLoadType, | 239 FrameLoadType, |
| 243 NavigationPolicy, | 240 NavigationPolicy, |
| 244 NavigationType); | 241 NavigationType); |
| 245 void startLoad(FrameLoadRequest&, FrameLoadType, NavigationPolicy); | 242 void startLoad(FrameLoadRequest&, FrameLoadType, NavigationPolicy); |
| 246 | 243 |
| 247 enum class HistoryNavigationType { DifferentDocument, Fragment, HistoryApi }; | 244 enum class HistoryNavigationType { DifferentDocument, Fragment, HistoryApi }; |
| 248 void setHistoryItemStateForCommit(FrameLoadType, | 245 void setHistoryItemStateForCommit(FrameLoadType, |
| 249 HistoryCommitType, | 246 HistoryCommitType, |
| 250 HistoryNavigationType); | 247 HistoryNavigationType); |
| 251 | 248 |
| 252 void loadInSameDocument(const KURL&, | 249 void loadInSameDocument(const KURL&, |
| 253 PassRefPtr<SerializedScriptValue> stateObject, | 250 PassRefPtr<SerializedScriptValue> stateObject, |
| 254 FrameLoadType, | 251 FrameLoadType, |
| 255 HistoryLoadType, | 252 HistoryLoadType, |
| 256 ClientRedirectPolicy, | 253 ClientRedirectPolicy, |
| 257 Document*); | 254 Document*); |
| 258 void restoreScrollPositionAndViewStateForLoadType(FrameLoadType); | 255 void restoreScrollPositionAndViewStateForLoadType(FrameLoadType); |
| 259 | 256 |
| 260 void scheduleCheckCompleted(); | 257 void scheduleCheckCompleted(); |
| 261 | 258 |
| 262 void detachDocumentLoader(Member<DocumentLoader>&); | 259 void detachDocumentLoader(Member<DocumentLoader>&); |
| 263 | 260 |
| 264 void upgradeInsecureRequest(ResourceRequest&, Document*) const; | 261 void upgradeInsecureRequest(ResourceRequest&, Document*) const; |
| 265 | 262 |
| 266 std::unique_ptr<TracedValue> toTracedValue() const; | 263 std::unique_ptr<TracedValue> toTracedValue() const; |
| 267 void takeObjectSnapshot() const; | 264 void takeObjectSnapshot() const; |
| 268 | 265 |
| 269 DocumentLoader* createDocumentLoader(const ResourceRequest&, | 266 DocumentLoader* createDocumentLoader(const ResourceRequest&, |
| 270 const FrameLoadRequest&, | 267 const FrameLoadRequest&, |
| 271 FrameLoadType, | 268 FrameLoadType, |
| 272 NavigationType); | 269 NavigationType); |
| 273 | 270 |
| 274 void setNavigationHandledByClient(); | |
| 275 | |
| 276 Member<LocalFrame> m_frame; | 271 Member<LocalFrame> m_frame; |
| 277 AtomicString m_requiredCSP; | 272 AtomicString m_requiredCSP; |
| 278 | 273 |
| 279 // FIXME: These should be std::unique_ptr<T> to reduce build times and | 274 // FIXME: These should be std::unique_ptr<T> to reduce build times and |
| 280 // simplify header dependencies unless performance testing proves otherwise. | 275 // simplify header dependencies unless performance testing proves otherwise. |
| 281 // Some of these could be lazily created for memory savings on devices. | 276 // Some of these could be lazily created for memory savings on devices. |
| 282 mutable FrameLoaderStateMachine m_stateMachine; | 277 mutable FrameLoaderStateMachine m_stateMachine; |
| 283 | 278 |
| 284 Member<ProgressTracker> m_progressTracker; | 279 Member<ProgressTracker> m_progressTracker; |
| 285 | 280 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 Member<DeferredHistoryLoad> m_deferredHistoryLoad; | 321 Member<DeferredHistoryLoad> m_deferredHistoryLoad; |
| 327 | 322 |
| 328 bool m_inStopAllLoaders; | 323 bool m_inStopAllLoaders; |
| 329 | 324 |
| 330 TaskRunnerTimer<FrameLoader> m_checkTimer; | 325 TaskRunnerTimer<FrameLoader> m_checkTimer; |
| 331 | 326 |
| 332 SandboxFlags m_forcedSandboxFlags; | 327 SandboxFlags m_forcedSandboxFlags; |
| 333 | 328 |
| 334 bool m_dispatchingDidClearWindowObjectInMainWorld; | 329 bool m_dispatchingDidClearWindowObjectInMainWorld; |
| 335 bool m_protectProvisionalLoader; | 330 bool m_protectProvisionalLoader; |
| 336 bool m_isNavigationHandledByClient; | |
| 337 }; | 331 }; |
| 338 | 332 |
| 339 } // namespace blink | 333 } // namespace blink |
| 340 | 334 |
| 341 #endif // FrameLoader_h | 335 #endif // FrameLoader_h |
| OLD | NEW |