| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
| 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
| 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
| 8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 9 * | 9 * |
| 10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 m_currentItem->setURL(m_documentLoader->urlForHistory()); | 278 m_currentItem->setURL(m_documentLoader->urlForHistory()); |
| 279 m_currentItem->setDocumentState(m_frame->document()->formElementsState()); | 279 m_currentItem->setDocumentState(m_frame->document()->formElementsState()); |
| 280 m_currentItem->setTarget(m_frame->tree().uniqueName()); | 280 m_currentItem->setTarget(m_frame->tree().uniqueName()); |
| 281 if (isPushOrReplaceState) | 281 if (isPushOrReplaceState) |
| 282 m_currentItem->setStateObject(stateObject); | 282 m_currentItem->setStateObject(stateObject); |
| 283 m_currentItem->setReferrer(Referrer(m_documentLoader->request().httpReferrer
(), m_documentLoader->request().referrerPolicy())); | 283 m_currentItem->setReferrer(Referrer(m_documentLoader->request().httpReferrer
(), m_documentLoader->request().referrerPolicy())); |
| 284 m_currentItem->setFormInfoFromRequest(isPushOrReplaceState ? ResourceRequest
() : m_documentLoader->request()); | 284 m_currentItem->setFormInfoFromRequest(isPushOrReplaceState ? ResourceRequest
() : m_documentLoader->request()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 static HistoryCommitType loadTypeToCommitType(FrameLoadType type, bool isValidHi
storyURL) | 287 static HistoryCommitType loadTypeToCommitType(FrameLoadType type) |
| 288 { | 288 { |
| 289 switch (type) { | 289 switch (type) { |
| 290 case FrameLoadTypeStandard: | 290 case FrameLoadTypeStandard: |
| 291 return isValidHistoryURL ? StandardCommit : HistoryInertCommit; | 291 return StandardCommit; |
| 292 case FrameLoadTypeInitialInChildFrame: | 292 case FrameLoadTypeInitialInChildFrame: |
| 293 return InitialCommitInChildFrame; | 293 return InitialCommitInChildFrame; |
| 294 case FrameLoadTypeBackForward: | 294 case FrameLoadTypeBackForward: |
| 295 return BackForwardCommit; | 295 return BackForwardCommit; |
| 296 default: | 296 default: |
| 297 break; | 297 break; |
| 298 } | 298 } |
| 299 return HistoryInertCommit; | 299 return HistoryInertCommit; |
| 300 } | 300 } |
| 301 | 301 |
| 302 void FrameLoader::receivedFirstData() | 302 void FrameLoader::receivedFirstData() |
| 303 { | 303 { |
| 304 if (m_stateMachine.creatingInitialEmptyDocument()) | 304 if (m_stateMachine.creatingInitialEmptyDocument()) |
| 305 return; | 305 return; |
| 306 | 306 |
| 307 bool isValidHistoryURL = !m_documentLoader->urlForHistory().isEmpty() && (!o
pener() || m_currentItem || !m_documentLoader->originalRequest().url().isEmpty()
); | 307 HistoryCommitType historyCommitType = loadTypeToCommitType(m_loadType); |
| 308 HistoryCommitType historyCommitType = loadTypeToCommitType(m_loadType, isVal
idHistoryURL); | 308 if (historyCommitType == StandardCommit && (m_documentLoader->urlForHistory(
).isEmpty() || (opener() && !m_currentItem && m_documentLoader->originalRequest(
).url().isEmpty()))) |
| 309 historyCommitType = HistoryInertCommit; |
| 310 else if (historyCommitType == InitialCommitInChildFrame && MixedContentCheck
er::isMixedContent(m_frame->tree().top()->document()->securityOrigin(), m_docume
ntLoader->url())) |
| 311 historyCommitType = HistoryInertCommit; |
| 309 setHistoryItemStateForCommit(historyCommitType); | 312 setHistoryItemStateForCommit(historyCommitType); |
| 310 | 313 |
| 311 if (!m_stateMachine.committedMultipleRealLoads() && m_loadType == FrameLoadT
ypeStandard) | 314 if (!m_stateMachine.committedMultipleRealLoads() && m_loadType == FrameLoadT
ypeStandard) |
| 312 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedMultipleRealL
oads); | 315 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedMultipleRealL
oads); |
| 313 | 316 |
| 314 m_client->dispatchDidCommitLoad(m_frame, m_currentItem.get(), historyCommitT
ype); | 317 m_client->dispatchDidCommitLoad(m_frame, m_currentItem.get(), historyCommitT
ype); |
| 315 | 318 |
| 316 InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get()); | 319 InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get()); |
| 317 m_frame->page()->didCommitLoad(m_frame); | 320 m_frame->page()->didCommitLoad(m_frame); |
| 318 dispatchDidClearDocumentOfWindowObject(); | 321 dispatchDidClearDocumentOfWindowObject(); |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 { | 1433 { |
| 1431 SandboxFlags flags = m_forcedSandboxFlags; | 1434 SandboxFlags flags = m_forcedSandboxFlags; |
| 1432 if (LocalFrame* parentFrame = m_frame->tree().parent()) | 1435 if (LocalFrame* parentFrame = m_frame->tree().parent()) |
| 1433 flags |= parentFrame->document()->sandboxFlags(); | 1436 flags |= parentFrame->document()->sandboxFlags(); |
| 1434 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) | 1437 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) |
| 1435 flags |= ownerElement->sandboxFlags(); | 1438 flags |= ownerElement->sandboxFlags(); |
| 1436 return flags; | 1439 return flags; |
| 1437 } | 1440 } |
| 1438 | 1441 |
| 1439 } // namespace WebCore | 1442 } // namespace WebCore |
| OLD | NEW |