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

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

Issue 123133006: Expose a cachePolicy parameter to loadHistoryItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 } 1457 }
1458 } 1458 }
1459 ASSERT(frame != m_frame); 1459 ASSERT(frame != m_frame);
1460 } 1460 }
1461 1461
1462 if (!activeDocument->canNavigate(frame)) 1462 if (!activeDocument->canNavigate(frame))
1463 return 0; 1463 return 0;
1464 return frame; 1464 return frame;
1465 } 1465 }
1466 1466
1467 void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoad Type) 1467 void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoad Type, ResourceRequestCachePolicy cachePolicy)
1468 { 1468 {
1469 saveDocumentAndScrollState(); 1469 saveDocumentAndScrollState();
1470 m_currentItem = item; 1470 m_currentItem = item;
1471 if (historyLoadType == HistorySameDocumentLoad) { 1471 if (historyLoadType == HistorySameDocumentLoad) {
1472 loadInSameDocument(item->url(), item->stateObject(), false, NotClientRed irect); 1472 loadInSameDocument(item->url(), item->stateObject(), false, NotClientRed irect);
1473 restoreScrollPositionAndViewState(ForcedRestoreForSameDocumentHistoryNav igation); 1473 restoreScrollPositionAndViewState(ForcedRestoreForSameDocumentHistoryNav igation);
1474 return; 1474 return;
1475 } 1475 }
1476 1476
1477 RefPtr<FormData> formData = item->formData(); 1477 RefPtr<FormData> formData = item->formData();
1478 ResourceRequest request(item->url()); 1478 ResourceRequest request(item->url());
1479 request.setHTTPReferrer(item->referrer()); 1479 request.setHTTPReferrer(item->referrer());
1480 request.setCachePolicy(cachePolicy);
1480 if (formData) { 1481 if (formData) {
1481 request.setHTTPMethod("POST"); 1482 request.setHTTPMethod("POST");
1482 request.setHTTPBody(formData); 1483 request.setHTTPBody(formData);
1483 request.setHTTPContentType(item->formContentType()); 1484 request.setHTTPContentType(item->formContentType());
1484 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString (item->referrer()); 1485 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString (item->referrer());
1485 addHTTPOriginIfNeeded(request, securityOrigin->toString()); 1486 addHTTPOriginIfNeeded(request, securityOrigin->toString());
1486 } 1487 }
1487 1488
1488 loadWithNavigationAction(NavigationAction(request, FrameLoadTypeBackForward, formData), FrameLoadTypeBackForward, 0, SubstituteData()); 1489 loadWithNavigationAction(NavigationAction(request, FrameLoadTypeBackForward, formData), FrameLoadTypeBackForward, 0, SubstituteData());
1489 } 1490 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 { 1522 {
1522 SandboxFlags flags = m_forcedSandboxFlags; 1523 SandboxFlags flags = m_forcedSandboxFlags;
1523 if (Frame* parentFrame = m_frame->tree().parent()) 1524 if (Frame* parentFrame = m_frame->tree().parent())
1524 flags |= parentFrame->document()->sandboxFlags(); 1525 flags |= parentFrame->document()->sandboxFlags();
1525 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) 1526 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement())
1526 flags |= ownerElement->sandboxFlags(); 1527 flags |= ownerElement->sandboxFlags();
1527 return flags; 1528 return flags;
1528 } 1529 }
1529 1530
1530 } // namespace WebCore 1531 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698