Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: Source/core/loader/FrameLoader.cpp

Issue 145493005: Keep frames to navigate alive in HistoryController::goToEntry() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: improved as suggested in review Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 m_provisionalItem = item; 1408 m_provisionalItem = item;
1409 if (historyLoadType == HistorySameDocumentLoad) { 1409 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); 1410 loadInSameDocument(item->url(), item->stateObject(), DoNotUpdateBackForw ardList, NotClientRedirect);
1414 restoreScrollPositionAndViewState(ForcedRestoreForSameDocumentHistoryNav igation); 1411 restoreScrollPositionAndViewState(ForcedRestoreForSameDocumentHistoryNav igation);
1415 return; 1412 return;
1416 } 1413 }
1417 1414
1418 RefPtr<FormData> formData = item->formData(); 1415 RefPtr<FormData> formData = item->formData();
1419 ResourceRequest request(item->url()); 1416 ResourceRequest request(item->url());
1420 request.setHTTPReferrer(item->referrer()); 1417 request.setHTTPReferrer(item->referrer());
1421 request.setCachePolicy(cachePolicy); 1418 request.setCachePolicy(cachePolicy);
1422 if (formData) { 1419 if (formData) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 { 1460 {
1464 SandboxFlags flags = m_forcedSandboxFlags; 1461 SandboxFlags flags = m_forcedSandboxFlags;
1465 if (Frame* parentFrame = m_frame->tree().parent()) 1462 if (Frame* parentFrame = m_frame->tree().parent())
1466 flags |= parentFrame->document()->sandboxFlags(); 1463 flags |= parentFrame->document()->sandboxFlags();
1467 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) 1464 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement())
1468 flags |= ownerElement->sandboxFlags(); 1465 flags |= ownerElement->sandboxFlags();
1469 return flags; 1466 return flags;
1470 } 1467 }
1471 1468
1472 } // namespace WebCore 1469 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698