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 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 ASSERT(frame != m_frame); | 1398 ASSERT(frame != m_frame); |
1399 } | 1399 } |
1400 | 1400 |
1401 if (!activeDocument->canNavigate(frame)) | 1401 if (!activeDocument->canNavigate(frame)) |
1402 return 0; | 1402 return 0; |
1403 return frame; | 1403 return frame; |
1404 } | 1404 } |
1405 | 1405 |
1406 void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoad
Type, ResourceRequestCachePolicy cachePolicy) | 1406 void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoad
Type, ResourceRequestCachePolicy cachePolicy) |
1407 { | 1407 { |
| 1408 // The frame may have been detached by a pageshow/popstate event handler. |
| 1409 if (!m_client) |
| 1410 return; |
| 1411 |
1408 m_provisionalItem = item; | 1412 m_provisionalItem = item; |
1409 if (historyLoadType == HistorySameDocumentLoad) { | 1413 if (historyLoadType == HistorySameDocumentLoad) { |
1410 // loadInSameDocument() might (indirectly) dispatch events, which could
lead to the frame being | |
1411 // detached, so protect it. | |
1412 RefPtr<Frame> protect(m_frame); | |
1413 loadInSameDocument(item->url(), item->stateObject(), DoNotUpdateBackForw
ardList, NotClientRedirect); | 1414 loadInSameDocument(item->url(), item->stateObject(), DoNotUpdateBackForw
ardList, NotClientRedirect); |
1414 restoreScrollPositionAndViewState(ForcedRestoreForSameDocumentHistoryNav
igation); | 1415 restoreScrollPositionAndViewState(ForcedRestoreForSameDocumentHistoryNav
igation); |
1415 return; | 1416 return; |
1416 } | 1417 } |
1417 | 1418 |
1418 RefPtr<FormData> formData = item->formData(); | 1419 RefPtr<FormData> formData = item->formData(); |
1419 ResourceRequest request(item->url()); | 1420 ResourceRequest request(item->url()); |
1420 request.setHTTPReferrer(item->referrer()); | 1421 request.setHTTPReferrer(item->referrer()); |
1421 request.setCachePolicy(cachePolicy); | 1422 request.setCachePolicy(cachePolicy); |
1422 if (formData) { | 1423 if (formData) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 { | 1464 { |
1464 SandboxFlags flags = m_forcedSandboxFlags; | 1465 SandboxFlags flags = m_forcedSandboxFlags; |
1465 if (Frame* parentFrame = m_frame->tree().parent()) | 1466 if (Frame* parentFrame = m_frame->tree().parent()) |
1466 flags |= parentFrame->document()->sandboxFlags(); | 1467 flags |= parentFrame->document()->sandboxFlags(); |
1467 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) | 1468 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) |
1468 flags |= ownerElement->sandboxFlags(); | 1469 flags |= ownerElement->sandboxFlags(); |
1469 return flags; | 1470 return flags; |
1470 } | 1471 } |
1471 | 1472 |
1472 } // namespace WebCore | 1473 } // namespace WebCore |
OLD | NEW |